V1.1
This commit is contained in:
Binary file not shown.
+6
-1
@@ -11,4 +11,9 @@
|
|||||||
|
|
||||||
Sunny V1.0 - 05/07/2023
|
Sunny V1.0 - 05/07/2023
|
||||||
|
|
||||||
- Initial release
|
- Initial release
|
||||||
|
|
||||||
|
Sunny V1.1 - 25/07/2023
|
||||||
|
|
||||||
|
- Variables are now read in through a Configuration.ini
|
||||||
|
- Customisable thresholds
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
[GENERAL]
|
||||||
|
ControlConfigDirectory = \\0.0.0.0\ExecutorShare\Working\Tennis\TennisBallTrackControl\TennisBallTrackControl1\ControlConfig.json
|
||||||
|
CourtName = CHANGE ME
|
||||||
|
|
||||||
|
[THRESHOLDS]
|
||||||
|
Thresh1 = 0.0
|
||||||
|
Thresh2 = 0.1
|
||||||
|
Thresh3 = 0.3
|
||||||
|
Thresh4 = 0.6
|
||||||
|
Thresh5 = 0.9
|
||||||
|
Thresh6 = 1.0
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
@@ -19,28 +19,46 @@ from datetime import datetime
|
|||||||
|
|
||||||
|
|
||||||
from tkinter import *
|
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)
|
if folder_selected == "\\\\0.0.0.0\\ExecutorShare\Working\Tennis\TennisBallTrackControl\TennisBallTrackControl1\ControlConfig.json":
|
||||||
#Builder.load_file('update_label.kv')
|
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)
|
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 = Tk()
|
||||||
root.withdraw()
|
root.withdraw()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#f = open(r"C:\Users\William\Documents\University\BeepDetails.log", "r")
|
|
||||||
|
|
||||||
Builder.load_string("""
|
Builder.load_string("""
|
||||||
<MySec>:
|
<MySec>:
|
||||||
rgba: (1,.2,.2,.2)
|
rgba: (1,.2,.2,.2)
|
||||||
@@ -175,11 +193,9 @@ class MySec(BoxLayout):
|
|||||||
|
|
||||||
class MyApp(App):
|
class MyApp(App):
|
||||||
def build(self):
|
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)
|
Clock.schedule_interval(lambda dt: self.update_time(), 5)
|
||||||
|
|
||||||
return MySec()
|
return MySec()
|
||||||
@@ -215,14 +231,14 @@ class MyApp(App):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if Average == 0.0:
|
if Average == Thresh1:
|
||||||
XNeg = str(XNeg)
|
XNeg = str(XNeg)
|
||||||
XPos = str(XPos)
|
XPos = str(XPos)
|
||||||
self.root.Negative = XNeg
|
self.root.Negative = XNeg
|
||||||
self.root.Positive = XPos
|
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)
|
XNeg = str(XNeg)
|
||||||
XPos = str(XPos)
|
XPos = str(XPos)
|
||||||
self.root.Negative = XNeg
|
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)
|
XNeg = str(XNeg)
|
||||||
XPos = str(XPos)
|
XPos = str(XPos)
|
||||||
self.root.Negative = XNeg
|
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)
|
XNeg = str(XNeg)
|
||||||
XPos = str(XPos)
|
XPos = str(XPos)
|
||||||
self.root.Negative = XNeg
|
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)
|
XNeg = str(XNeg)
|
||||||
XPos = str(XPos)
|
XPos = str(XPos)
|
||||||
self.root.Negative = XNeg
|
self.root.Negative = XNeg
|
||||||
@@ -259,7 +275,7 @@ class MyApp(App):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
elif Average > 0.9:
|
elif Average >= Thresh6:
|
||||||
XNeg = str(XNeg)
|
XNeg = str(XNeg)
|
||||||
XPos = str(XPos)
|
XPos = str(XPos)
|
||||||
self.root.Negative = XNeg
|
self.root.Negative = XNeg
|
||||||
|
|||||||
Reference in New Issue
Block a user