修改字段名称,为一键下发增加异常捕获

This commit is contained in:
mgw
2023-01-31 10:27:57 +08:00
parent 4e57c76c63
commit 51c89f5c6b

View File

@@ -185,7 +185,7 @@ class Machine_ftp(models.Model):
y_compensation_node = fields.Char('y补偿值节点')
# 数采配置相关
machine_ip = fields.Char('机床IP')
machine_signed = fields.Char('刷新间隔')
machine_signed = fields.Char('机床刷新间隔')
machine_status = fields.Char('机床在线状态')
machine_time_on = fields.Char('机床总在线时长')
machine_tool_num = fields.Char('机床当前刀具')
@@ -318,6 +318,7 @@ class WorkCenterBarcode(models.Model):
print(host, port, username, pwd, remote_path)
ftp = ftp_operate.FtpController(host, port, username, pwd)
# ftp.delAllfile('C://Users//马广威//Desktop//ftp')
try:
for item in self.cnc_ids:
a = item.cnc_id
print(a.display_name)
@@ -338,9 +339,9 @@ class WorkCenterBarcode(models.Model):
_logger.info("=====================11================")
ftp.upload_file(remotepath=file_path_remote, localpath=file_path_local)
# _logger.info("=====================22================")
# except Exception as e:
# _logger.info("=====================================", e)
# raise UserError('NC下发执行超时, 请检查下发状态')
except Exception as e:
_logger.info("=====================================", e)
raise UserError('NC下发执行超时, 请检查下发状态')
# 下发都执行完毕后按钮标志位变为true
self.button_up_all_state = True