From cbf51065b77f938cc51ee58cb100018b6b7710f2 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 27 Feb 2023 15:29:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E9=94=AE=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E8=A1=A5=E5=81=BF=E5=80=BC=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=98=BE=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_machine_connect/models/ftp_client.py | 5 ++++- sf_machine_connect/views/ftp_button.xml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sf_machine_connect/models/ftp_client.py b/sf_machine_connect/models/ftp_client.py index 6b084b21..3c1d90e3 100644 --- a/sf_machine_connect/models/ftp_client.py +++ b/sf_machine_connect/models/ftp_client.py @@ -246,7 +246,6 @@ class WorkCenterBarcode(models.Model): print(temp_dict) temp = py2opcua.Py2opcua() temp.write(temp_dict) - self.button_compensation_state = True except Exception as e: _logger.info("=====================================", e) raise UserError('补偿值获取失败,或机床未连接,请检查') @@ -271,6 +270,10 @@ class WorkCenterBarcode(models.Model): # _logger.info("=====================================", e) # raise UserError('程序删除失败,请重试') # host="192.168.2.158", port=8080, username="MITSUBISHI", password="CNC" + try: + self.compensation() + except Exception: + raise UserError("补偿值写入执行超时,请检查机床状态或者写入状态") sequence_collect = [] host = self.workcenter_id.machine_tool_id.ftp_host port = self.workcenter_id.machine_tool_id.ftp_port diff --git a/sf_machine_connect/views/ftp_button.xml b/sf_machine_connect/views/ftp_button.xml index 6e20e0d0..f102dc00 100644 --- a/sf_machine_connect/views/ftp_button.xml +++ b/sf_machine_connect/views/ftp_button.xml @@ -19,7 +19,9 @@ -