Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging mode sub menu #79

Merged
merged 1 commit into from
Oct 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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