tools 增加最小焊接流量参数读写 tools_v3
authorkyz <kongyuzhong@google.com>
Tue, 23 Dec 2025 02:38:54 +0000 (10:38 +0800)
committerkyz <kongyuzhong@google.com>
Tue, 23 Dec 2025 02:38:54 +0000 (10:38 +0800)
tools_v3/main.py
tools_v3/parameter.ui

index bf3cb3e56d87ac2b36385749052830268af21e75..dfab25d8b81b0ffc17864eecbec8f5551679ef38 100644 (file)
@@ -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
index 4c5f287e47b6d6ecd909c5ded3af905e031f3151..206fa2dfbd57f6ea136fe535855c83fcd26e787a 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>700</width>
-    <height>656</height>
+    <height>655</height>
    </rect>
   </property>
   <property name="minimumSize">
      </layout>
     </widget>
    </item>
-   <item row="6" column="0" rowspan="2">
+   <item row="7" column="1" colspan="2">
+    <widget class="QGroupBox" name="groupBox_19">
+     <property name="minimumSize">
+      <size>
+       <width>330</width>
+       <height>70</height>
+      </size>
+     </property>
+     <property name="title">
+      <string>RTC时间</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_5">
+      <item row="0" column="3">
+       <widget class="QPushButton" name="btn_rtc_write">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>40</height>
+         </size>
+        </property>
+        <property name="text">
+         <string>同步PC时间</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QLabel" name="label_rtc">
+        <property name="minimumSize">
+         <size>
+          <width>0</width>
+          <height>30</height>
+         </size>
+        </property>
+        <property name="font">
+         <font>
+          <family>Arial</family>
+          <pointsize>12</pointsize>
+         </font>
+        </property>
+        <property name="text">
+         <string>2024/5/1-08:00:00</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="2">
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="6" column="0">
     <widget class="QGroupBox" name="groupBox_18">
      <property name="minimumSize">
       <size>
      </layout>
     </widget>
    </item>
-   <item row="7" column="1" colspan="2">
-    <widget class="QGroupBox" name="groupBox_19">
-     <property name="minimumSize">
-      <size>
-       <width>330</width>
-       <height>70</height>
-      </size>
-     </property>
+   <item row="7" column="0">
+    <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>RTC时间</string>
+      <string>焊接流量最低值</string>
      </property>
-     <layout class="QGridLayout" name="gridLayout_5">
-      <item row="0" column="3">
-       <widget class="QPushButton" name="btn_rtc_write">
-        <property name="minimumSize">
-         <size>
-          <width>0</width>
-          <height>40</height>
-         </size>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <widget class="QLabel" name="label_37">
+        <property name="text">
+         <string>最低流量(L/min)</string>
         </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QLineEdit" name="lineEdit_flow_min">
         <property name="text">
-         <string>同步PC时间</string>
+         <string>0</string>
+        </property>
+        <property name="readOnly">
+         <bool>false</bool>
         </property>
        </widget>
       </item>
-      <item row="0" column="1">
-       <widget class="QLabel" name="label_rtc">
+      <item>
+       <widget class="QPushButton" name="btn_flow_min">
         <property name="minimumSize">
          <size>
           <width>0</width>
-          <height>30</height>
+          <height>40</height>
          </size>
         </property>
-        <property name="font">
-         <font>
-          <family>Arial</family>
-          <pointsize>12</pointsize>
-         </font>
-        </property>
         <property name="text">
-         <string>2024/5/1-08:00:00</string>
+         <string>写入</string>
         </property>
        </widget>
       </item>
-      <item row="0" column="2">
-       <spacer name="horizontalSpacer">
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>40</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
      </layout>
     </widget>
    </item>