Disable debug mode for demo, add status text

formac 1666679076
Cole Deck 2 years ago
parent ba0e84ee95
commit a31cd877f2

@ -1,5 +1,5 @@
core: core:
autostart: true autostart: false
clockspeed: 20 clockspeed: 20
interval: 10 interval: 10
level: 3 level: 3

@ -40,7 +40,7 @@ class OtherFrame(wx.Frame):
Class used for creating frames other than the main one Class used for creating frames other than the main one
""" """
def __init__(self): 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) panel = ServerPanel(self)
self.SetIcon(wx.Icon(find_data_file("icon.ico"), wx.BITMAP_TYPE_ICO)) 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("WXPython_30x30.png")),)
#tb.AddTool(wx.ID_ANY, '',wx.Bitmap(find_data_file("settings_30x30.png"))) #tb.AddTool(wx.ID_ANY, '',wx.Bitmap(find_data_file("settings_30x30.png")))
#tb.Realize() #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) #self.main_sizer.Add(tb)
#main_sizer.SetBackgroundColour((44, 51, 51)) #main_sizer.SetBackgroundColour((44, 51, 51))
# self.pnl1.SetBackgroundColour(wx.BLACK) # self.pnl1.SetBackgroundColour(wx.BLACK)
@ -174,6 +180,7 @@ class ServerPanel(wx.Panel):
secondary_frame_button.Bind(wx.EVT_BUTTON, self.on_window) secondary_frame_button.Bind(wx.EVT_BUTTON, self.on_window)
# wx.BORDER(stop_button, wx.BORDER_NONE) # wx.BORDER(stop_button, wx.BORDER_NONE)
stop_button.Bind(wx.EVT_BUTTON, self.on_stop) 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(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(stop_button, 0, wx.CENTER | wx.ALL | 100, 5)
self.main_sizer.Add(secondary_frame_button, 0, wx.CENTER | wx.ALL | 100, 5) self.main_sizer.Add(secondary_frame_button, 0, wx.CENTER | wx.ALL | 100, 5)
@ -185,6 +192,11 @@ class ServerPanel(wx.Panel):
def updatedata(self): def updatedata(self):
global settings global settings
if settings["running"] == True:
txt = "Status: Running (" + str(settings["config"]["core"]["level"]) + ")"
else:
txt = "Status: Not running"
if settings["newdata"] == True: if settings["newdata"] == True:
settings["newdata"] = False settings["newdata"] = False
@ -220,6 +232,7 @@ class ServerPanel(wx.Panel):
#fprint(i, j, TEST_FILE.iloc[i, j]) #fprint(i, j, TEST_FILE.iloc[i, j])
#self.SetSizer(self.main_sizer) #self.SetSizer(self.main_sizer)
self.statustext.SetLabel(txt)
wx.CallLater(1000, self.updatedata) wx.CallLater(1000, self.updatedata)
def on_start(self, event): def on_start(self, event):

@ -2,7 +2,7 @@ import sys
from cx_Freeze import setup, Executable from cx_Freeze import setup, Executable
debug = True debug = True
#debug = not debug debug = not debug
# Dependencies are automatically detected, but it might need fine tuning. # Dependencies are automatically detected, but it might need fine tuning.
# "packages": ["os"] is used as example only # "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} 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}

Loading…
Cancel
Save