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
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()
<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">
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 );
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 )
{
int32_t is_dev_locked( void )
{
return (g_dev.cfg.remote_locked || g_dev.offline_locked)?1:0;
-}
\ No newline at end of file
+}
}
-//int32_t lcd_init_h3( void );
+extern int32_t lcd_init_h3( void );
void user_ui_h3_task( void* unused )
{
ui_ev_t ev;
{
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;