From a31cd877f219f32f35486e0fc7f0217150c20820 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Tue, 25 Oct 2022 01:21:20 -0500 Subject: [PATCH] Disable debug mode for demo, add status text --- config.yml | 2 +- panel.py | 17 +++++++++++++++-- setup.py | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index a2ba196..62fb355 100644 --- a/config.yml +++ b/config.yml @@ -1,5 +1,5 @@ core: - autostart: true + autostart: false clockspeed: 20 interval: 10 level: 3 diff --git a/panel.py b/panel.py index 9e269e3..e32904e 100644 --- a/panel.py +++ b/panel.py @@ -40,7 +40,7 @@ class OtherFrame(wx.Frame): Class used for creating frames other than the main one """ def __init__(self): - wx.Frame.__init__(self, None, -1, 'Server Panel', size=(1000, 700)) + wx.Frame.__init__(self, None, -1, 'Server Panel', size=(1000, 620)) panel = ServerPanel(self) self.SetIcon(wx.Icon(find_data_file("icon.ico"), wx.BITMAP_TYPE_ICO)) @@ -154,6 +154,12 @@ class ServerPanel(wx.Panel): #tb.AddTool(wx.ID_ANY, '',wx.Bitmap(find_data_file("WXPython_30x30.png")),) #tb.AddTool(wx.ID_ANY, '',wx.Bitmap(find_data_file("settings_30x30.png"))) #tb.Realize() + if settings["running"] == True: + txt = "Status: Running (" + str(settings["config"]["core"]["level"]) + ")" + else: + txt = "Status: Not running" + + self.statustext = wx.StaticText(self, label=txt) # pos=(20,20)) #self.main_sizer.Add(tb) #main_sizer.SetBackgroundColour((44, 51, 51)) # self.pnl1.SetBackgroundColour(wx.BLACK) @@ -174,6 +180,7 @@ class ServerPanel(wx.Panel): secondary_frame_button.Bind(wx.EVT_BUTTON, self.on_window) # wx.BORDER(stop_button, wx.BORDER_NONE) stop_button.Bind(wx.EVT_BUTTON, self.on_stop) + self.main_sizer.Add(self.statustext, 0, wx.CENTER | wx.ALL | 100, 5) self.main_sizer.Add(start_button, 0, wx.CENTER | wx.ALL | 100, 5) self.main_sizer.Add(stop_button, 0, wx.CENTER | wx.ALL | 100, 5) self.main_sizer.Add(secondary_frame_button, 0, wx.CENTER | wx.ALL | 100, 5) @@ -185,7 +192,12 @@ class ServerPanel(wx.Panel): def updatedata(self): global settings - + if settings["running"] == True: + txt = "Status: Running (" + str(settings["config"]["core"]["level"]) + ")" + else: + txt = "Status: Not running" + + if settings["newdata"] == True: settings["newdata"] = False else: @@ -220,6 +232,7 @@ class ServerPanel(wx.Panel): #fprint(i, j, TEST_FILE.iloc[i, j]) #self.SetSizer(self.main_sizer) + self.statustext.SetLabel(txt) wx.CallLater(1000, self.updatedata) def on_start(self, event): diff --git a/setup.py b/setup.py index 963a4e7..d33e010 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import sys from cx_Freeze import setup, Executable debug = True -#debug = not debug +debug = not debug # Dependencies are automatically detected, but it might need fine tuning. # "packages": ["os"] is used as example only build_exe_options = {"packages": ["os"], "excludes": ["tkinter"], "include_msvcr": True, "include_files": ["icon.png", "config.yml", "keyfile-admin.pem", "WXPython.png", "WXPython_30x30.png", "settings.png", "settings_30x30.png", "icon.ico"], "optimize": 1}