测试工具优化
authorkyz <kongyuzhong@google.com>
Mon, 24 Jun 2024 01:00:35 +0000 (09:00 +0800)
committerkyz <kongyuzhong@google.com>
Mon, 24 Jun 2024 01:41:53 +0000 (09:41 +0800)
tools_v2/test.py
tools_v2/test.ui
user/user_ota.c
user/user_report.c
user/user_ui_h3.c
user/user_valve_ctrl.c

index 856c9ed8f8f289b76f9836e6f83b98ed8da1e740..5805897644cefa39016f29cda0be20ccb295f3b8 100644 (file)
@@ -191,10 +191,6 @@ class App( QDialog, ui_welding.Ui_Dialog ):
             method = factor = prev = comp = coeff = bypass_save = bypass = 0x7FFFFFFF
             if item == "method" :
                 method = 0 if action == "tig" else  1 if action=="mig" else 2
-                #test lcd passthourh
-                self.tx_cmd( cmd = 0x00C4, data=struct.pack( '>HBBHH', 0x5AA5, 3+2, 0x82, 0x5008, 1 if method==0 else 0 ), wait=False )
-                time.sleep(1.0)
-
             elif item == "factor":
                 factor = int(self.label_factor.text())
                 factor += 1 if action == "add" else  -1 if action == "sub" else 0
@@ -211,14 +207,13 @@ class App( QDialog, ui_welding.Ui_Dialog ):
 
     def on_btn_mk_ota_img(self):
         file , check = QFileDialog.getOpenFileName(None, u"选择固件", "", "image (*hex *bin)")
-        print("select fw file:{}, check:{}".format( file, check) )
-        img_name, img_data = mk_ota_image.mk_ota_img( file )
-        if len( img_name) and len(img_data):
-            save_name, check = QFileDialog.getSaveFileName(None, u"保存OTA文件", img_name, "ota image ( *bin)")
-            print( "save as {}, check:{}".format( save_name, check))
-            with open( save_name, "wb" ) as ota_fd:
-                print( "save file:%s len:%d/%08X Bytes"%( save_name, len(img_data), len( img_data)))
-                ota_fd.write( img_data )
+        if os.path.exists( file ):
+            img_name, img_data = mk_ota_image.mk_ota_img( file )
+            if len( img_name) and len(img_data):
+                save_name, check = QFileDialog.getSaveFileName(None, u"保存OTA文件", img_name, "ota image ( *bin)")
+                if len( save_name ):
+                    with open( save_name, "wb" ) as ota_fd:
+                        ota_fd.write( img_data )
 
     def on_btn_alarm_read( self ):
         self.on_btn_gas_read()
index 7b340ccdae34265de140aa290bad5f752b89cda0..7fce658e253175963c014be6957df51da61de724 100644 (file)
        <rect>
         <x>100</x>
         <y>30</y>
-        <width>501</width>
+        <width>391</width>
         <height>61</height>
        </rect>
       </property>
         <rect>
          <x>70</x>
          <y>20</y>
-         <width>61</width>
+         <width>71</width>
          <height>31</height>
         </rect>
        </property>
       <widget class="QLabel" name="label_8">
        <property name="geometry">
         <rect>
-         <x>150</x>
+         <x>160</x>
          <y>20</y>
-         <width>41</width>
+         <width>31</width>
          <height>31</height>
         </rect>
        </property>
         <rect>
          <x>190</x>
          <y>20</y>
-         <width>301</width>
+         <width>191</width>
          <height>31</height>
         </rect>
        </property>
        </property>
       </widget>
      </widget>
-     <widget class="QPushButton" name="btn_mk_ota_img">
-      <property name="geometry">
-       <rect>
-        <x>10</x>
-        <y>560</y>
-        <width>121</width>
-        <height>41</height>
-       </rect>
-      </property>
-      <property name="text">
-       <string>创建ota升级文件</string>
-      </property>
-      <property name="autoDefault">
-       <bool>false</bool>
-      </property>
-     </widget>
      <widget class="QGroupBox" name="groupBox_24">
       <property name="geometry">
        <rect>
         <x>10</x>
-        <y>600</y>
+        <y>550</y>
         <width>591</width>
-        <height>201</height>
+        <height>151</height>
        </rect>
       </property>
       <property name="title">
         <rect>
          <x>10</x>
          <y>20</y>
-         <width>511</width>
-         <height>171</height>
+         <width>501</width>
+         <height>121</height>
         </rect>
        </property>
       </widget>
         <rect>
          <x>520</x>
          <y>20</y>
-         <width>71</width>
+         <width>61</width>
          <height>61</height>
         </rect>
        </property>
         <rect>
          <x>520</x>
          <y>80</y>
-         <width>71</width>
-         <height>51</height>
+         <width>61</width>
+         <height>61</height>
         </rect>
        </property>
        <property name="text">
        </property>
       </widget>
      </widget>
+     <widget class="QPushButton" name="btn_mk_ota_img">
+      <property name="geometry">
+       <rect>
+        <x>500</x>
+        <y>30</y>
+        <width>101</width>
+        <height>61</height>
+       </rect>
+      </property>
+      <property name="text">
+       <string>创建OTA升级文件</string>
+      </property>
+      <property name="autoDefault">
+       <bool>false</bool>
+      </property>
+     </widget>
     </widget>
     <widget class="QWidget" name="tab_4">
      <attribute name="title">
index 0c332839eca728101aed1b07b4a4b0deba7c415c..f9ce375a42f3b8bad1bec3b0f4a869bb549aa0ce 100644 (file)
@@ -16,6 +16,7 @@ Connection:keep-alive\r\n\r\n"
 
 extern int32_t wifi_ota_requst( char *host, uint16_t port, char *req );
 extern int32_t eth_ota_requst( char *host, uint16_t port, char *req );
+extern int32_t cat1_ota_requst( char *host, uint16_t port, char *req );
 
 extern void wifi_ota_close( void );
 extern uint16_t user_sflash_crc( uint32_t addr, uint32_t sz );
index 64fed7ca01accd73e0edabb7153bd9282c1136da..ddaa31d6668721232c837e0df2ce7b795a9d9adb 100644 (file)
@@ -225,6 +225,7 @@ char * devinfo_report_str( void )
 extern int32_t wifi_tcp_tx( uint8_t conn_id, uint8_t *data, uint32_t sz );
 extern int32_t wifi_ota_start( char * url, char *ver );
 extern int32_t eth_ota_start( char * url, char *ver );
+extern int32_t cat1_ota_start( char * url, char *ver );
 
 char * lock_resp_str( void )
 {
@@ -430,4 +431,4 @@ int32_t is_iot_connected( void )
 int32_t is_dev_locked( void )
 {
        return (g_dev.cfg.remote_locked || g_dev.offline_locked)?1:0;
-}
\ No newline at end of file
+}
index c7609b7f28cc337a3c6943738b761383b83855be..4d2791d8c8105183247b4ab9394bee3117f9aca8 100644 (file)
@@ -251,7 +251,7 @@ void ui_evt_handle( ui_ev_t *ev )
 }
 
 
-//int32_t lcd_init_h3( void );
+extern int32_t lcd_init_h3( void );
 void user_ui_h3_task( void* unused )
 {
     ui_ev_t ev;
index 9e8d3baf1e2b5684cfa1a11805c60f8298550d5c..d5e4efadcb0acc9a90c4694bfbbb5d01073e1c22 100644 (file)
@@ -408,11 +408,11 @@ void user_valve_ctrl_task( void* unused )
 {
     uint32_t last_tick;
     float welding_current;
-    uint32_t bypass = 0;
+//    uint32_t bypass = 0;
     uint32_t tem_alarm_start_tick=0;
     uint32_t tem_restore_tick=0;
     uint32_t  tem_err_state = 0;
-    float valve_curr;
+//    float valve_curr;
     double target_flowspeed;
 
     uint32_t tem_state_last = 0;