From: kyz Date: Mon, 24 Jun 2024 01:00:35 +0000 (+0800) Subject: 测试工具优化 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=87826d5774c671eaf847d3e95bdc08d39f168d26;p=yn%2Fweldingcontroller.git 测试工具优化 --- diff --git a/tools_v2/test.py b/tools_v2/test.py index 856c9ed..5805897 100644 --- a/tools_v2/test.py +++ b/tools_v2/test.py @@ -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() diff --git a/tools_v2/test.ui b/tools_v2/test.ui index 7b340cc..7fce658 100644 --- a/tools_v2/test.ui +++ b/tools_v2/test.ui @@ -784,7 +784,7 @@ 100 30 - 501 + 391 61 @@ -809,7 +809,7 @@ 70 20 - 61 + 71 31 @@ -820,9 +820,9 @@ - 150 + 160 20 - 41 + 31 31 @@ -835,7 +835,7 @@ 190 20 - 301 + 191 31 @@ -847,29 +847,13 @@ - - - - 10 - 560 - 121 - 41 - - - - 创建ota升级文件 - - - false - - 10 - 600 + 550 591 - 201 + 151 @@ -880,8 +864,8 @@ 10 20 - 511 - 171 + 501 + 121 @@ -890,7 +874,7 @@ 520 20 - 71 + 61 61 @@ -903,8 +887,8 @@ 520 80 - 71 - 51 + 61 + 61 @@ -912,6 +896,22 @@ + + + + 500 + 30 + 101 + 61 + + + + 创建OTA升级文件 + + + false + + diff --git a/user/user_ota.c b/user/user_ota.c index 0c33283..f9ce375 100644 --- a/user/user_ota.c +++ b/user/user_ota.c @@ -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 ); diff --git a/user/user_report.c b/user/user_report.c index 64fed7c..ddaa31d 100644 --- a/user/user_report.c +++ b/user/user_report.c @@ -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 +} diff --git a/user/user_ui_h3.c b/user/user_ui_h3.c index c7609b7..4d2791d 100644 --- a/user/user_ui_h3.c +++ b/user/user_ui_h3.c @@ -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; diff --git a/user/user_valve_ctrl.c b/user/user_valve_ctrl.c index 9e8d3ba..d5e4efa 100644 --- a/user/user_valve_ctrl.c +++ b/user/user_valve_ctrl.c @@ -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;