diff --git a/OutGaugeInterpreter.py b/OutGaugeInterpreter.py index 0f77c74..9f0898a 100644 --- a/OutGaugeInterpreter.py +++ b/OutGaugeInterpreter.py @@ -15,16 +15,6 @@ from GAME_METHODS import * if not(sys.version_info[0] == 3 and sys.version_info[1] == 11): raise Exception("code must be run in python verion 3.11.\ninput struct for network needs to be changed per python version.") -##GUI init -rootFrameGui= tkinter.Tk() -rootFrameGui.title("Car speed to arduino") -rootFrameGui.geometry("400x200") - -# theme: https://github.com/rdbende/Azure-ttk-theme -rootFrameGui.tk.call("source","azure.tcl") ##import theme -rootFrameGui.tk.call("set_theme","dark") ##set theme to dark - -firstFrameGui=tkinter.ttk.Frame(rootFrameGui,padding=10) ##system init @@ -73,6 +63,30 @@ else: print("OS detection failed setting serial port to 'COM5'\n") SERIAL_PORT = 'COM5' + ##GUI init +rootFrameGui= tkinter.Tk() +rootFrameGui.title("Car speed to arduino") +rootFrameGui.geometry("400x200") + +# theme: https://github.com/rdbende/Azure-ttk-theme +rootFrameGui.tk.call("source","azure.tcl") ##import theme +rootFrameGui.tk.call("set_theme","dark") ##set theme to dark + +firstFrameGui=tkinter.ttk.Frame(rootFrameGui,padding=10) +firstFrameGui.pack() +serialFrameGui = tkinter.ttk.Frame(firstFrameGui,padding=10) +serialFrameGui.pack(side="left") +serialLableText =tkinter.StringVar() +serialLableText.set("Serial Port") +serialLable = tkinter.Label(serialFrameGui,textvariable=serialLableText) +serialLable.pack(side="top") +serialEntry=tkinter.Entry(serialFrameGui) +serialEntry.insert(0,SERIAL_PORT) +serialEntry.pack(side="left") +gameSelectFrame= tkinter.ttk.Frame(firstFrameGui,padding=10) +gameSelectFrame.pack(side="right") + + #select game while gameSelected == False: gameNo = input("1:BEAMNG\n2:FORZA\n\n7:Toggle CSV out ("+str(csvOut)+")\n9:SET SERIAL PORT ("+SERIAL_PORT+")\n")