From: kyz Date: Sun, 24 Mar 2024 06:01:46 +0000 (+0800) Subject: V2.2 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=30b776b81d581f6179cce55ca5fa3e898422fed8;p=yn%2Fweldingcontroller.git V2.2 1.焊接电流按正负10A判断, 范围内认为焊接未开始,LCD显示电流为0 2.固件下载工具功能优化 --- diff --git a/tools_v2/test.py b/tools_v2/test.py index 95e49f8..ff11d20 100644 --- a/tools_v2/test.py +++ b/tools_v2/test.py @@ -53,6 +53,7 @@ class App( QDialog, ui_welding.Ui_Dialog ): self.btn_connect_devinfo.released.connect( lambda:self.on_btn_connect(1)) self.btn_connect_curr.released.connect( lambda:self.on_btn_connect(2)) #self.btn_download.released.connect( lambda:self.on_btn_connect(3)) + self.btn_connect_update.released.connect( lambda:self.on_btn_connect(3)) ###self.cbx_debug.release #self.cbx_debug.stateChanged.connect( lambda:self.on_cbx_debug() ) @@ -246,6 +247,13 @@ class App( QDialog, ui_welding.Ui_Dialog ): pass def on_btn_connect( self, id ): print( 'on btn connect', self.connected, id ) + if id==3: + #read fw ver + if self.connected == 0: + if self.ser_open(): + self.tx_cmd( 0x0000 ) #读取版本 + self.ser_close() + return if self.connected == 0: if self.ser_open(): if self.tx_cmd( 0x0022, struct.pack( '>L', id )): @@ -335,6 +343,8 @@ class App( QDialog, ui_welding.Ui_Dialog ): print( 'flag', flag ) self.label_fw_ver.setText( "%s V%d.%d"%( "APP"if flag == 0x41 else "BOOT", v_major, v_minor) ) self.lineEdit_uuid.setText( "%08X-%08X-%08X"%( id0, id1, id2 )) + self.label_fw_ver_2.setText( "%s V%d.%d"%( "APP"if flag == 0x41 else "BOOT", v_major, v_minor) ) + self.lineEdit_uuid_2.setText( "%08X-%08X-%08X"%( id0, id1, id2 )) elif cmd == 0x0024 and len(data)>=10000: #焊接电流原始信息实时上报 self.curr_raw_x = [] self.curr_raw_y = [] @@ -496,7 +506,7 @@ class App( QDialog, ui_welding.Ui_Dialog ): log_str = '' + str + '' else: log_str = '' + str + '' - #self.update_log.append( log_str ) + self.update_log.append( log_str ) if __name__ == "__main__": app = QApplication(sys.argv) # 创建一个QApplication,也就是你要开发的软件app diff --git a/tools_v2/test.ui b/tools_v2/test.ui index 4612d15..94e5fd3 100644 --- a/tools_v2/test.ui +++ b/tools_v2/test.ui @@ -189,7 +189,7 @@ - 1 + 2 @@ -614,7 +614,7 @@ 10 - 10 + 100 591 591 @@ -768,6 +768,90 @@ + + + + 20 + 30 + 71 + 61 + + + + 连接 + + + false + + + + + + 100 + 30 + 501 + 61 + + + + GroupBox + + + + + 20 + 21 + 41 + 31 + + + + 版本: + + + + + + 70 + 20 + 61 + 31 + + + + V1.0 + + + + + + 150 + 20 + 41 + 31 + + + + UUID: + + + + + + 190 + 20 + 301 + 31 + + + + 00000000-00000000-00000000 + + + true + + + diff --git a/user/user.h b/user/user.h index a60ed21..2d966d1 100644 --- a/user/user.h +++ b/user/user.h @@ -26,7 +26,7 @@ //-------------------- #define APP_VER_MAJOR 2 -#define APP_VER_MINOR 1 +#define APP_VER_MINOR 2 #define VREF 2.5f diff --git a/user/user_ui.c b/user/user_ui.c index 633f7a2..a85facd 100644 --- a/user/user_ui.c +++ b/user/user_ui.c @@ -356,9 +356,9 @@ void user_ui_task( void* unused ) }else{ //500毫秒刷新 ui int16_t curr_x10 = g_dev.welding_current*10; - if( curr_x10 < 45 && curr_x10 > -45 ){ //改为按+-4.5A内显示0 + if( curr_x10 < 100 && curr_x10 > -100 ){ //改为按+-10.0A内显示0 //传感器采样,未接负载显示 -0.5 到 -2 左右波动, - //+3A 到 -3A在屏上暂时按 0A显示 避免影响用户体验 + //+10A 到 -10A在屏上暂时按 0A显示 避免影响用户体验 curr_x10 = 0; } reg_values[0] = (uint16_t)curr_x10; diff --git a/user/user_valve_ctrl.c b/user/user_valve_ctrl.c index b984220..4a3fc59 100644 --- a/user/user_valve_ctrl.c +++ b/user/user_valve_ctrl.c @@ -504,7 +504,7 @@ void user_valve_ctrl_task( void* unused ) }else{ valve_bypass( 0 ); //旁路电磁阀关闭 //检查焊接电流,判断是否开始焊接 - if( welding_current < 5.0f ){ + if( welding_current < 10.0f ){ //焊接电流大于10A 认为开始焊接,小于10A认为焊接停止。 //未开始焊接 //按比例阀开度设置电流, 最小0.7v 最大1.0v, 按开度百分比计算电流