1212from ui .frame_firmware_flash import FrameFirmwareFlash
1313from ui .frame_search_device import FrameSearchDevice
1414from ui .frame_console import FrameConsole
15+ from ui .frame_plugins import FramePlugIns
1516from esptool_plugin .esptool_command_runner import CommandRunner
1617from serial_plugin .serial_command_runner import SerialCommandRunner
1718from config .device_configuration import BAUDRATE_OPTIONS , DEFAULT_URL , CONFIGURED_DEVICES
@@ -64,12 +65,17 @@ def __init__(self):
6465 self .information .chip_info_btn .configure (command = lambda : self ._esptool_command ("chip_id" ))
6566 self .information .memory_info_btn .configure (command = lambda : self ._esptool_command ("flash_id" ))
6667 self .information .mac_info_btn .configure (command = lambda : self ._esptool_command ("read_mac" ))
68+ self .information .mac_info_btn .pack_forget ()
6769 self .information .flash_status_btn .configure (command = lambda : self ._esptool_command ("read_flash_status" ))
6870 self .information .flash_status_btn .pack_forget ()
69- self .information .mp_version_btn .configure (command = self ._get_version )
70- self .information .mp_version_btn .pack_forget ()
71- self .information .mp_structure_btn .configure (command = self ._get_structure )
72- self .information .mp_structure_btn .pack_forget ()
71+
72+ # PlugIns
73+ self .plugins = FramePlugIns (self )
74+ self .plugins .label .configure (font = FONT_CATEGORY )
75+ self .plugins .mp_version_btn .configure (command = self ._get_version )
76+ self .plugins .mp_version_btn .pack_forget ()
77+ self .plugins .mp_structure_btn .configure (command = self ._get_structure )
78+ self .plugins .mp_structure_btn .pack_forget ()
7379
7480 # Erase Device
7581 self .erase_device = FrameEraseDevice (self )
@@ -148,9 +154,10 @@ def toggle_expert_mode(self) -> None:
148154 if self .flash_firmware .expert_mode .get ():
149155 debug ('Expert mode enabled' )
150156 self .__expert_mode = True
157+ self .information .mac_info_btn .pack (padx = 10 , pady = 5 )
151158 self .information .flash_status_btn .pack (padx = 10 , pady = 5 )
152- self .information .mp_version_btn .pack (padx = 10 , pady = 5 )
153- self .information .mp_structure_btn .pack (padx = 10 , pady = 5 )
159+ self .plugins .mp_version_btn .pack (padx = 10 , pady = 5 )
160+ self .plugins .mp_structure_btn .pack (padx = 10 , pady = 5 )
154161 self .flash_firmware .flash_mode_label .grid (row = 5 , column = 0 , padx = 10 , pady = 5 , sticky = "w" )
155162 self .flash_firmware .flash_mode_option .grid (row = 5 , column = 1 , padx = 10 , pady = 5 , sticky = "w" )
156163 self .flash_firmware .flash_mode_info .grid (row = 5 , column = 3 , columnspan = 3 , padx = 10 , pady = 5 , sticky = "w" )
@@ -166,9 +173,10 @@ def toggle_expert_mode(self) -> None:
166173 else :
167174 debug ('Expert mode disabled' )
168175 self .__expert_mode = False
176+ self .information .mac_info_btn .pack_forget ()
169177 self .information .flash_status_btn .pack_forget ()
170- self .information .mp_version_btn .pack_forget ()
171- self .information .mp_structure_btn .pack_forget ()
178+ self .plugins .mp_version_btn .pack_forget ()
179+ self .plugins .mp_structure_btn .pack_forget ()
172180 self .flash_firmware .flash_mode_label .grid_remove ()
173181 self .flash_firmware .flash_mode_option .grid_remove ()
174182 self .flash_firmware .flash_mode_info .grid_remove ()
@@ -221,8 +229,8 @@ def _disable_buttons(self) -> None:
221229 self .information .memory_info_btn .configure (state = 'disabled' )
222230 self .information .mac_info_btn .configure (state = 'disabled' )
223231 self .information .flash_status_btn .configure (state = 'disabled' )
224- self .information .mp_version_btn .configure (state = 'disabled' )
225- self .information .mp_structure_btn .configure (state = 'disabled' )
232+ self .plugins .mp_version_btn .configure (state = 'disabled' )
233+ self .plugins .mp_structure_btn .configure (state = 'disabled' )
226234 self .erase_device .erase_btn .configure (state = 'disabled' )
227235 self .flash_firmware .flash_btn .configure (state = 'disabled' )
228236
@@ -236,8 +244,8 @@ def _enable_buttons(self) -> None:
236244 self .information .memory_info_btn .configure (state = 'normal' )
237245 self .information .mac_info_btn .configure (state = 'normal' )
238246 self .information .flash_status_btn .configure (state = 'normal' )
239- self .information .mp_version_btn .configure (state = 'normal' )
240- self .information .mp_structure_btn .configure (state = 'normal' )
247+ self .plugins .mp_version_btn .configure (state = 'normal' )
248+ self .plugins .mp_structure_btn .configure (state = 'normal' )
241249 self .erase_device .erase_btn .configure (state = 'normal' )
242250 self .flash_firmware .flash_btn .configure (state = 'normal' )
243251
0 commit comments