feat: 添加上工程支持

This commit is contained in:
zhu-mengmeng 2025-07-19 14:06:39 +08:00
parent ef77566b1d
commit 976080683f
3 changed files with 8 additions and 1 deletions

Binary file not shown.

View File

@ -2,7 +2,7 @@ from pymodbus.client import ModbusTcpClient
import time import time
client = ModbusTcpClient('localhost', port=5020) client = ModbusTcpClient('localhost', port=5020)
client.connect() client.connect()
client.write_registers(address=11, values=[2922]) client.write_registers(address=11, values=[3922])
# client.write_registers(address=3, values=[0]) # client.write_registers(address=3, values=[0])
# time.sleep(2) # time.sleep(2)
# client.write_registers(address=0, values=[0]) # client.write_registers(address=0, values=[0])

View File

@ -919,6 +919,7 @@ class MainWindow(MainWindowUI):
if response.get("status", False): if response.get("status", False):
gc_info = response.get("data", {}) gc_info = response.get("data", {})
self._current_gc_qd = gc_info.get("qd",0) self._current_gc_qd = gc_info.get("qd",0)
self._current_gc_sc_gch = gc_info.get("sc_gch", "") # 保存sc_gch字段
# 先获取当前 info_table 已有的数据 # 先获取当前 info_table 已有的数据
order_info = {} order_info = {}
for field_name, label in self.info_values.items(): for field_name, label in self.info_values.items():
@ -2232,6 +2233,12 @@ class MainWindow(MainWindowUI):
info['jt'] = "" # 默认值 info['jt'] = "" # 默认值
else: else:
info['jt'] = "" # 默认值 info['jt'] = "" # 默认值
# 添加sc_gch信息
if hasattr(self, '_current_gc_sc_gch') and self._current_gc_sc_gch:
info['sc_gch'] = self._current_gc_sc_gch
else:
info['sc_gch'] = "" # 默认值
# 获取本机IP地址 # 获取本机IP地址
# import socket # import socket
# try: # try: