配置所有可采集数据

This commit is contained in:
mgw
2023-03-24 21:40:10 +08:00
parent 1505c56513
commit a742018956
4 changed files with 81 additions and 18 deletions

View File

@@ -138,16 +138,49 @@ class Machine_ftp(models.Model):
machine_ip = fields.Char('机床IP')
machine_signed = fields.Char('机床刷新间隔')
machine_status = fields.Char('机床在线状态')
machine_time_on = fields.Char('机床总在线时长')
machine_tool_num = fields.Char('机床当前刀具')
machine_program = fields.Char('机床当前程序')
machine_cnc_type = fields.Char('机床CNC型号')
machine_axis_count = fields.Char('机床轴总数')
machine_run_status = fields.Char('机床运行状态')
machine_run_time = fields.Char('机床总运行时长')
machine_cut_time = fields.Char('机床总切削时长')
machine_cut_status = fields.Char('机床切削状态')
machine_emg_status = fields.Char('机床急停状态')
machine_mode = fields.Char('机床操作模式')
machine_spindle_speed = fields.Char('机床主轴转速')
machine_cut_status = fields.Char('机床当前切削状态')
machine_mode = fields.Char('机床当前操作模式')
machine_spindle_load = fields.Char('机床主轴负载')
machine_x_mach = fields.Char('机床X轴机械坐标')
machine_x_abs_mach = fields.Char('机床X轴当前位置')
machine_x_rel_mach = fields.Char('机床X轴相对工件坐标')
machine_x_dis_mach = fields.Char('机床X轴目标距离')
machine_x_axis_load = fields.Char('机床X轴伺服轴负载')
machine_y_mach = fields.Char('机床Y轴机械坐标')
machine_y_abs_mach = fields.Char('机床Y轴当前位置')
machine_y_rel_mach = fields.Char('机床Y轴相对工件坐标')
machine_y_dis_mach = fields.Char('机床Y轴目标距离')
machine_y_axis_load = fields.Char('机床Y轴伺服轴负载')
machine_z_mach = fields.Char('机床Z轴机械坐标')
machine_z_abs_mach = fields.Char('机床Z轴当前位置')
machine_z_rel_mach = fields.Char('机床Z轴相对工件坐标')
machine_z_dis_mach = fields.Char('机床Z轴目标距离')
machine_z_axis_load = fields.Char('机床Z轴伺服轴负载')
machine_tool_num = fields.Char('机床当前刀位号')
machine_program = fields.Char('机床主程序名称')
machine_current_prg = fields.Char('机床当前执行指令')
machine_prg_seq = fields.Char('机床当前执行语句号')
machine_spindle_speed_set = fields.Char('机床设定主轴速度')
machine_act_spindle_speed = fields.Char('机床实际主轴转速')
machine_feed_speed_set = fields.Char('机床设定进给速度')
machine_act_feed_speed = fields.Char('机床实际进给速度')
machine_spindle_feed = fields.Char('机床主轴倍率')
machine_feed_rate = fields.Char('机床进给倍率')
machine_rapid_feed = fields.Char('机床快速移动倍率')
machine_run_time = fields.Char('机床运行时间')
machine_cut_time = fields.Char('机床切削时间')
machine_keep_alive_time = fields.Char('机床上电时间')
machine_circle_time = fields.Char('机床循环时间')
machine_product_counts = fields.Char('机床加工件数')
machine_system_date = fields.Char('机床系统日期')
machine_system_time = fields.Char('机床系统时间')
machine_alarm_msg = fields.Char('机床系统报警')
# 刀位配置
tool_num1 = fields.Char('刀位1')
tool_num2 = fields.Char('刀位2')
@@ -222,6 +255,7 @@ class WorkCenterBarcode(models.Model):
"""
_inherit = "mrp.workorder"
# barcode = fields.Binary(string='条码', default='UP-ALL')
compensation_value_x = fields.Float(string='X轴补偿值')
compensation_value_y = fields.Float(string='Y轴补偿值')
button_compensation_state = fields.Boolean(string='是否已经补偿', readonly=True)
@@ -470,6 +504,7 @@ class DeliveryRecord(models.Model):
扫码托盘码可查到制造订单,由制造订单查工单
"""
_name = "delivery.record"
_description = "Delivery Record"
delivery_type = fields.Char(string='下发方式', readonly=True)
delivery_time = fields.Char(string='下发时间', readonly=True)

View File

@@ -1,5 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_up_select_wizard,up.select.wizard,model_up_select_wizard,base.group_user,1,1,1,1
access_delivery_record,delivery.record,model_delivery_record,base.group_user,1,1,1,1
access_mrp_workorder,mrp.workorder,model_mrp_workorder,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_up_select_wizard up.select.wizard model_up_select_wizard base.group_user 1 1 1 1
2 access_delivery_record access_up_select_wizard delivery.record up.select.wizard model_delivery_record model_up_select_wizard base.group_user 1 1 1 1
3 access_mrp_workorder access_delivery_record mrp.workorder delivery.record model_mrp_workorder model_delivery_record base.group_user 1 1 1 1

View File

@@ -146,16 +146,47 @@
<field name="machine_ip"/>
<field name="machine_signed"/>
<field name="machine_status"/>
<field name="machine_time_on"/>
<field name="machine_cnc_type"/>
<field name="machine_axis_count"/>
<field name="machine_run_status"/>
<field name="machine_emg_status"/>
<field name="machine_cut_status"/>
<field name="machine_mode"/>
<field name="machine_spindle_load"/>
<field name="machine_x_mach"/>
<field name="machine_x_abs_mach"/>
<field name="machine_x_rel_mach"/>
<field name="machine_x_dis_mach"/>
<field name="machine_x_axis_load"/>
<field name="machine_y_mach"/>
<field name="machine_y_abs_mach"/>
<field name="machine_y_rel_mach"/>
<field name="machine_y_dis_mach"/>
<field name="machine_y_axis_load"/>
<field name="machine_z_mach"/>
<field name="machine_z_abs_mach"/>
<field name="machine_z_rel_mach"/>
<field name="machine_z_dis_mach"/>
<field name="machine_z_axis_load"/>
<field name="machine_tool_num"/>
<field name="machine_program"/>
<field name="machine_run_status"/>
<field name="machine_current_prg"/>
<field name="machine_prg_seq"/>
<field name="machine_spindle_speed_set"/>
<field name="machine_act_spindle_speed"/>
<field name="machine_feed_speed_set"/>
<field name="machine_act_feed_speed"/>
<field name="machine_spindle_feed"/>
<field name="machine_feed_rate"/>
<field name="machine_rapid_feed"/>
<field name="machine_run_time"/>
<field name="machine_cut_time"/>
<field name="machine_cut_status"/>
<field name="machine_emg_status"/>
<field name="machine_mode"/>
<field name="machine_spindle_speed"/>
<field name="machine_keep_alive_time"/>
<field name="machine_circle_time"/>
<field name="machine_product_counts"/>
<field name="machine_system_date"/>
<field name="machine_system_time"/>
<field name="machine_alarm_msg"/>
</group>
</group>

View File

@@ -18,13 +18,13 @@ _logger = logging.getLogger(__name__)
class UpSelectWizard(models.TransientModel):
_name = 'up.select.wizard'
_description = 'Up Select Wizard'
workorder_id = fields.Many2one('mrp.workorder', string='工单', readonly=True)
workcenter_id = fields.Many2one('mrp.workcenter', string='工作中心', related='workorder_id.workcenter_id',
readonly=True)
program_ids = fields.Many2many('sf.cnc.processing', string='程序列表')
def confirm_up(self):
# 合并下发前删除机床上的全部程序
try:
@@ -106,4 +106,3 @@ class UpSelectWizard(models.TransientModel):
item.button_state = False
_logger.info("=====================================", e)
raise UserError('NC下发执行超时, 请检查下发状态')