From c69f13da0979ef33701ec135aa59184ea2276883 Mon Sep 17 00:00:00 2001 From: kyz Date: Tue, 23 Dec 2025 10:38:54 +0800 Subject: [PATCH] =?utf8?q?tools=20=E5=A2=9E=E5=8A=A0=E6=9C=80=E5=B0=8F?= =?utf8?q?=E7=84=8A=E6=8E=A5=E6=B5=81=E9=87=8F=E5=8F=82=E6=95=B0=E8=AF=BB?= =?utf8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools_v3/main.py | 10 +++- tools_v3/parameter.ui | 125 +++++++++++++++++++++++++++--------------- 2 files changed, 90 insertions(+), 45 deletions(-) diff --git a/tools_v3/main.py b/tools_v3/main.py index bf3cb3e..dfab25d 100644 --- a/tools_v3/main.py +++ b/tools_v3/main.py @@ -524,12 +524,14 @@ class page_parameter( QWidget, ui_parameter.Ui_Form): self.gas_coefficient = [ (u'氩气(1000)',1000), (u'二氧化碳(570)', 570), (u'混合气(910)',910) ] self.crc16 = crcmod.mkCrcFun(0x18005, rev=True, initCrc=0xFFFF, xorOut=0x0000) self.btn_parameter_read.released.connect( self.on_btn_parameter_read ) + self.btn_flow_min.released.connect( self.on_btn_flow_min_write ) + def on_rx_ser_msg( self, msg ): msg_type, msg_data = msg if msg_type == "received": self.on_rx_pkt( msg_data ) def on_btn_parameter_read( self ): - cmds=[ 0x00B6,0x00B8,0x00BA, 0x00BC, 0x00BE, 0x00C0, 0x00C2] + cmds=[ 0x00B6,0x00B8,0x00BA, 0x00BC, 0x00BE, 0x00C0, 0x00C2, 0x00C5 ] for cmd in cmds: self.tx_cmd( cmd = cmd, wait=False ) time.sleep(0.05) @@ -544,6 +546,8 @@ class page_parameter( QWidget, ui_parameter.Ui_Form): QApplication.processEvents() retry -=1 return self.wait_resp[2] + def on_btn_flow_min_write( self ): + self.tx_cmd( cmd = 0x00C6, data=struct.pack( ">H", int( 10*float(self.lineEdit_flow_min.text() ) ) ) ) def on_btn_alarm_read( self ): self.on_btn_gas_read() def on_btn_alarm_write( self ): @@ -679,6 +683,8 @@ class page_parameter( QWidget, ui_parameter.Ui_Form): elif cmd == 0x00C2 and len(data)>=4: #读取参数2 t = struct.unpack( ">L", data[:4])[0] self.label_rtc.setText( time.strftime( "%Y/%m/%d-%H:%M:%S", time.localtime( t ) ) ) + elif cmd == 0x00C5 and len(data)>=2: #最小焊接流量读取 + self.lineEdit_flow_min.setText( str( struct.unpack( '>H', data )[0]/10 ) ) #if cmd == self.wait_resp[0]: # self.wait_resp = ( cmd, True, data[0] ) # print( "recv resp", self.wait_resp ) @@ -688,7 +694,7 @@ class App( QDialog, ui_main.Ui_Dialog ): def __init__( self ): super().__init__() self.setupUi(self) - self.setWindowTitle( u"焊接控制器调试工具 V2.0" ) + self.setWindowTitle( u"焊接控制器调试工具 V2.1" ) try: # PyInstaller创建的临时文件夹,存储于_MEIPASS中 base_path = sys._MEIPASS diff --git a/tools_v3/parameter.ui b/tools_v3/parameter.ui index 4c5f287..206fa2d 100644 --- a/tools_v3/parameter.ui +++ b/tools_v3/parameter.ui @@ -7,7 +7,7 @@ 0 0 700 - 656 + 655 @@ -681,7 +681,67 @@ - + + + + + 330 + 70 + + + + RTC时间 + + + + + + + 0 + 40 + + + + 同步PC时间 + + + + + + + + 0 + 30 + + + + + Arial + 12 + + + + 2024/5/1-08:00:00 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + @@ -746,63 +806,42 @@ - - - - - 330 - 70 - - + + - RTC时间 + 焊接流量最低值 - - - - - - 0 - 40 - + + + + + 最低流量(L/min) + + + + - 同步PC时间 + 0 + + + false - - + + 0 - 30 + 40 - - - Arial - 12 - - - 2024/5/1-08:00:00 + 写入 - - - - Qt::Horizontal - - - - 40 - 20 - - - - -- 2.34.1