Skip to content

Commit

Permalink
Add logging mode sub menu (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorHowell authored Oct 23, 2022
1 parent 5f737e8 commit b2580aa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions VW_Flash_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,18 @@ def create_menu(self):
self.Bind(
event=wx.EVT_MENU, handler=self.on_stop_logger, source=logger_stop_menu_item
)

logging_modes = ["22", "3E", "HSL"]
logging_modes_menu = wx.Menu()
for mode in logging_modes:
radio_item = logging_modes_menu.AppendRadioItem(wx.ID_ANY, mode, "Logging Mode: "+mode)
radio_item.Check(self.panel.options.get('logmode', "22") == mode)

self.Bind(
wx.EVT_MENU, lambda evt, temp=mode: self.on_select_logging_mode(evt, temp), source=radio_item
)

logger_menu.AppendSubMenu(logging_modes_menu, "&Logging Mode", "Select Logging Mode")
menu_bar.Append(logger_menu, "&Logger")

self.SetMenuBar(menu_bar)
Expand All @@ -757,6 +769,10 @@ def on_open_folder(self, event):
self.panel.update_bin_listing()
dlg.Destroy()

def on_select_logging_mode(self, event, mode):
self.panel.options["logmode"] = mode
write_config(self.panel.options)

def on_select_scanble(self, event):
self.panel.options["scanble"] = event.IsChecked()
write_config(self.panel.options)
Expand Down

0 comments on commit b2580aa

Please sign in to comment.