fixed logging filename
This commit is contained in:
parent
231862f06b
commit
b60b053aed
2 changed files with 18 additions and 6 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
/build
|
/build
|
||||||
/dist
|
/dist
|
||||||
OutGaugeInterpreter.spec
|
OutGaugeInterpreter.spec
|
||||||
|
*.csv
|
||||||
|
|
@ -49,6 +49,16 @@ carData = 0
|
||||||
csvOut = False
|
csvOut = False
|
||||||
|
|
||||||
#Functions <-------------------------------------------------------------------------------------------
|
#Functions <-------------------------------------------------------------------------------------------
|
||||||
|
def checkBoxChange():
|
||||||
|
if tkLoggingEnabled.get()==True:
|
||||||
|
loggingLocationEntry.config(state='normal')
|
||||||
|
loggingLocationText.set(value= "./"+ tkGametype.get()+"_"+str(int(time.time()))+".csv")
|
||||||
|
loggingLocationEntry.insert(0,loggingLocationText.get())
|
||||||
|
else:
|
||||||
|
loggingLocationText.set(value="")
|
||||||
|
loggingLocationEntry.delete(0,tkinter.END)
|
||||||
|
loggingLocationEntry.config(state='disabled')
|
||||||
|
|
||||||
def csvWriteOut(firstRun,carData,csvFile):
|
def csvWriteOut(firstRun,carData,csvFile):
|
||||||
if firstRun == True:
|
if firstRun == True:
|
||||||
out=""
|
out=""
|
||||||
|
|
@ -79,7 +89,7 @@ def runningThread():
|
||||||
csvOut = tkLoggingEnabled.get()
|
csvOut = tkLoggingEnabled.get()
|
||||||
|
|
||||||
if csvOut == True:
|
if csvOut == True:
|
||||||
csvFile = open(gameType.value+"_"+str(int(time.time()))+'.csv',"a")
|
csvFile = open(loggingLocationText.get(),"a")
|
||||||
|
|
||||||
gameType= tkGametype.get()
|
gameType= tkGametype.get()
|
||||||
|
|
||||||
|
|
@ -166,16 +176,17 @@ tkinter.Label(gameSelectFrame,textvariable=gameSelectText)
|
||||||
gameSelectLOptions= [GameType.BEAMNG,GameType.FORZA]
|
gameSelectLOptions= [GameType.BEAMNG,GameType.FORZA]
|
||||||
##gameSelectRadioButtons
|
##gameSelectRadioButtons
|
||||||
##space after text is so the buttons are the same size
|
##space after text is so the buttons are the same size
|
||||||
tkinter.Radiobutton(gameSelectFrame,text="BeamNG ",variable=tkGametype,value=GameType.BEAMNG.value).pack(anchor="w")
|
tkinter.Radiobutton(gameSelectFrame,text="BeamNG ",variable=tkGametype,value=GameType.BEAMNG.value,command=checkBoxChange).pack(anchor="w")
|
||||||
tkinter.Radiobutton(gameSelectFrame,text="Forza ",variable=tkGametype,value=GameType.FORZA.value).pack(anchor="w")
|
tkinter.Radiobutton(gameSelectFrame,text="Forza ",variable=tkGametype,value=GameType.FORZA.value,command=checkBoxChange).pack(anchor="w")
|
||||||
loggingFrameGui= tkinter.ttk.Frame(firstFrameGui,padding=5,relief="groove",borderwidth=2)
|
loggingFrameGui= tkinter.ttk.Frame(firstFrameGui,padding=5,relief="groove",borderwidth=2)
|
||||||
loggingFrameGui.pack(anchor="nw")
|
loggingFrameGui.pack(anchor="nw")
|
||||||
tkLoggingEnabled=tkinter.BooleanVar()
|
tkLoggingEnabled=tkinter.BooleanVar()
|
||||||
tkLoggingEnabled.set(False)
|
tkLoggingEnabled.set(False)
|
||||||
tkinter.Checkbutton(loggingFrameGui,text="Enable Logging",variable=tkLoggingEnabled,onvalue=True,offvalue=False).pack(side="top")
|
tkinter.Checkbutton(loggingFrameGui,text="Enable Logging",variable=tkLoggingEnabled,onvalue=True,offvalue=False,command=checkBoxChange).pack(side="top")
|
||||||
loggingLocationText = tkinter.StringVar(value= "./")
|
loggingLocationText = tkinter.StringVar(value="")
|
||||||
loggingLocationEntry = tkinter.Entry(loggingFrameGui)
|
loggingLocationEntry = tkinter.Entry(loggingFrameGui)
|
||||||
loggingLocationEntry.insert(0,loggingLocationText.get())
|
loggingLocationEntry.insert(0,loggingLocationText.get())
|
||||||
|
loggingLocationEntry.config(state='disabled')
|
||||||
loggingLocationEntry.pack(side="bottom")
|
loggingLocationEntry.pack(side="bottom")
|
||||||
startStopButton= tkinter.Button(bottomBarFrameGui,text= "start",command= startStopButtonFunc)
|
startStopButton= tkinter.Button(bottomBarFrameGui,text= "start",command= startStopButtonFunc)
|
||||||
startStopButton.pack(side="right",fill="x")
|
startStopButton.pack(side="right",fill="x")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue