V1.1
This commit is contained in:
@@ -19,28 +19,46 @@ from datetime import datetime
|
||||
|
||||
|
||||
from tkinter import *
|
||||
import configparser
|
||||
|
||||
folder_selected = filedialog.askopenfilename()
|
||||
|
||||
print(folder_selected)
|
||||
#Configuration loading
|
||||
config = configparser.ConfigParser()
|
||||
config.read("Configuration.ini")
|
||||
|
||||
Court_name = simpledialog.askstring(title="Court Name",prompt="What Court is this?\t\t\t")
|
||||
# Accessing variables from the 'GENERAL' section
|
||||
folder_selected = str(config['GENERAL']['ControlConfigDirectory'])
|
||||
Court_name = str(config['GENERAL']['CourtName'])
|
||||
|
||||
print(Court_name)
|
||||
#Builder.load_file('update_label.kv')
|
||||
if folder_selected == "\\\\0.0.0.0\\ExecutorShare\Working\Tennis\TennisBallTrackControl\TennisBallTrackControl1\ControlConfig.json":
|
||||
print(chr(27) + "[2J")
|
||||
print("##################################################")
|
||||
print("You have not changed the default Configuration.ini")
|
||||
print("Please change the IP")
|
||||
print("##################################################")
|
||||
input()
|
||||
exit()
|
||||
|
||||
|
||||
print("Control Config Directory: " + folder_selected)
|
||||
print("Court Name: " + Court_name)
|
||||
|
||||
filePath = (folder_selected)
|
||||
|
||||
print(filePath)
|
||||
# Accessing variables from the 'THRESHOLDS' section
|
||||
Thresh1 = float(config['THRESHOLDS']['Thresh1'])
|
||||
Thresh2 = float(config['THRESHOLDS']['Thresh2'])
|
||||
Thresh3 = float(config['THRESHOLDS']['Thresh3'])
|
||||
Thresh4 = float(config['THRESHOLDS']['Thresh4'])
|
||||
Thresh5 = float(config['THRESHOLDS']['Thresh5'])
|
||||
Thresh6 = float(config['THRESHOLDS']['Thresh6'])
|
||||
|
||||
|
||||
|
||||
root = Tk()
|
||||
root.withdraw()
|
||||
|
||||
|
||||
|
||||
#f = open(r"C:\Users\William\Documents\University\BeepDetails.log", "r")
|
||||
|
||||
Builder.load_string("""
|
||||
<MySec>:
|
||||
rgba: (1,.2,.2,.2)
|
||||
@@ -175,11 +193,9 @@ class MySec(BoxLayout):
|
||||
|
||||
class MyApp(App):
|
||||
def build(self):
|
||||
self.title = 'Sunny V1.0'
|
||||
self.title = 'Sunny V1.1'
|
||||
|
||||
|
||||
|
||||
#register_topmost(Window, 'Sunny V1.0')
|
||||
Clock.schedule_interval(lambda dt: self.update_time(), 5)
|
||||
|
||||
return MySec()
|
||||
@@ -215,14 +231,14 @@ class MyApp(App):
|
||||
|
||||
|
||||
|
||||
if Average == 0.0:
|
||||
if Average == Thresh1:
|
||||
XNeg = str(XNeg)
|
||||
XPos = str(XPos)
|
||||
self.root.Negative = XNeg
|
||||
self.root.Positive = XPos
|
||||
self.root.rgba = [0/255, 10/255, 10/255, 1.0]
|
||||
self.root.rgba = [0/255, 10/255, 10/255, 1.0]
|
||||
|
||||
elif Average <= 0.1:
|
||||
elif Average <= Thresh2:
|
||||
XNeg = str(XNeg)
|
||||
XPos = str(XPos)
|
||||
self.root.Negative = XNeg
|
||||
@@ -231,7 +247,7 @@ class MyApp(App):
|
||||
|
||||
|
||||
|
||||
elif ((Average > 0.1) and (Average <= 0.3)):
|
||||
elif ((Average > Thresh2) and (Average <= Thresh3)):
|
||||
XNeg = str(XNeg)
|
||||
XPos = str(XPos)
|
||||
self.root.Negative = XNeg
|
||||
@@ -240,7 +256,7 @@ class MyApp(App):
|
||||
|
||||
|
||||
|
||||
elif ((Average > 0.3) and (Average <= 0.6)):
|
||||
elif ((Average > Thresh3) and (Average <= Thresh4)):
|
||||
XNeg = str(XNeg)
|
||||
XPos = str(XPos)
|
||||
self.root.Negative = XNeg
|
||||
@@ -249,7 +265,7 @@ class MyApp(App):
|
||||
|
||||
|
||||
|
||||
elif ((Average > 0.6) and (Average <= 0.9)):
|
||||
elif ((Average > Thresh4) and (Average <= Thresh5)):
|
||||
XNeg = str(XNeg)
|
||||
XPos = str(XPos)
|
||||
self.root.Negative = XNeg
|
||||
@@ -259,7 +275,7 @@ class MyApp(App):
|
||||
|
||||
|
||||
|
||||
elif Average > 0.9:
|
||||
elif Average >= Thresh6:
|
||||
XNeg = str(XNeg)
|
||||
XPos = str(XPos)
|
||||
self.root.Negative = XNeg
|
||||
|
||||
Reference in New Issue
Block a user