pending dev
This commit is contained in:
		| @@ -216,7 +216,7 @@ class HmiRequest(object): | ||||
|                 # self.c_xs.connect(('192.168.84.129', 6666)) | ||||
|                 self.c_xs.setblocking(False) | ||||
|  | ||||
|                 self.w2t("Connection success", 0, 0, 'green', tab_name=self.tab_name) | ||||
|                 # self.w2t("Connection success", 0, 0, 'green', tab_name=self.tab_name) | ||||
|                 with open(f"{current_path}/../../assets/templates/heartbeat", "w", encoding='utf-8') as f_hb: | ||||
|                     f_hb.write('1') | ||||
|                 md = ModbusRequest(self.w2t, self.tab_name) | ||||
| @@ -226,7 +226,7 @@ class HmiRequest(object): | ||||
|                 md.write_probe(False) | ||||
|                 md.write_axis(1) | ||||
|             except Exception as Err: | ||||
|                 self.w2t("Connection failed...", 0, 0, 'red', tab_name=self.tab_name) | ||||
|                 # self.w2t("Connection failed...", 0, 0, 'red', tab_name=self.tab_name) | ||||
|                 with open(f"{current_path}/../../assets/templates/heartbeat", "w", encoding='utf-8') as f_hb: | ||||
|                     f_hb.write('0') | ||||
|  | ||||
| @@ -268,7 +268,8 @@ class HmiRequest(object): | ||||
|             with open(f"{current_path}/../../assets/templates/heartbeat", "w", encoding='utf-8') as f_hb: | ||||
|                 f_hb.write(_flag) | ||||
|                 if _flag == '0': | ||||
|                     self.w2t(f"{_id} 心跳丢失,连接失败,重新连接中...", 0, 7, 'red', tab_name=self.tab_name) | ||||
|                     # self.w2t(f"{_id} 心跳丢失,连接失败,重新连接中...", 0, 7, 'red', tab_name=self.tab_name) | ||||
|                     self.w2t(f"", 0, 7, 'red', tab_name=self.tab_name) | ||||
|             sleep(1.5) | ||||
|             # with open(f"{current_path}/../../assets/templates/c_msg.log", "w", encoding='utf-8') as f: | ||||
|             #     for msg in self.c_msg: | ||||
| @@ -619,7 +620,8 @@ class HmiRequest(object): | ||||
|                 self.c.send(self.package(cmd)) | ||||
|                 sleep(0.5) | ||||
|             except Exception as Err: | ||||
|                 self.w2t(f"{cmd}\n请求发送失败...{Err}", 0, 0, 'red', tab_name=self.tab_name) | ||||
|                 # self.w2t(f"{cmd}\n请求发送失败...{Err}", 0, 0, 'red', tab_name=self.tab_name) | ||||
|                 self.w2t(f"", 0, 0, 'red', tab_name=self.tab_name) | ||||
|  | ||||
|             return req['id'] | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user