@@ -164,7 +164,7 @@ def switch_version_action(self):
164164 def switch_vtx_callback (self , event ):
165165 self .vtx_index_select = self .target_combobox .current ()
166166 self .vtx_name_select = self .target_combobox ['value' ][self .vtx_index_select ]
167- if self .vtx_index_select != 0 :
167+ if self .vtx_index_select != 0 and self . vtx_index_select <= len ( Download . vtx_id_list ) :
168168 ch341 .vtx_id = Download .vtx_id_list [self .vtx_name_select ]
169169 self .reset_fw_state ()
170170
@@ -175,7 +175,8 @@ def switch_target_action(self):
175175 def load_firmware_online_callback (event ):
176176 global my_gui
177177 if my_gui .vtx_index_select != 0 and my_gui .ver_index_select != 0 :
178- Download .downloadLink = Download .firmware_link_list [my_gui .ver_name_select ][my_gui .vtx_name_select ]
178+ Download .downloadLink = Download .firmware_link_list [
179+ my_gui .ver_name_select ][my_gui .vtx_name_select ]
179180 Download .localTemp = "./Data/Temp/fw.zip"
180181 Download .downloadCommand = 2
181182 my_gui .downloadCommand = 2
@@ -371,7 +372,7 @@ def update_connection_state(self):
371372 if vtx_id_list [i ] == ch341 .vtx_id :
372373 # print()
373374 # print("Current vtx is", i)
374- for j in range (0 , len (vtx_id_list ) + 1 ):
375+ for j in range (0 , len (Download . vtx_name_list [ self . ver_index_select ]) ):
375376 if self .target_combobox ['value' ][j ] == i :
376377 self .target_combobox .current (j )
377378 self .vtx_name_select = i
0 commit comments