|
@@ -3,12 +3,14 @@ from tkinter.ttk import Progressbar
|
|
import pyglet
|
|
import pyglet
|
|
|
|
|
|
class CalibrationPopUp(tk.Frame):
|
|
class CalibrationPopUp(tk.Frame):
|
|
- def __init__(self, root, calibration_state):
|
|
|
|
|
|
+ def __init__(self, root, calibration_state, conf):
|
|
self.root = root
|
|
self.root = root
|
|
self.font = pyglet.font.add_file("gui/SourceSansPro-Semibold.otf")
|
|
self.font = pyglet.font.add_file("gui/SourceSansPro-Semibold.otf")
|
|
self.calibration_state = calibration_state
|
|
self.calibration_state = calibration_state
|
|
tk.Frame.__init__(self, root)
|
|
tk.Frame.__init__(self, root)
|
|
self.pendingClose = False
|
|
self.pendingClose = False
|
|
|
|
+ self.conf = conf
|
|
|
|
+
|
|
|
|
|
|
self.instruction = tk.Label(self,text="Start Calibration", anchor="c",font=("SourceSansPro-Semibold", 18))
|
|
self.instruction = tk.Label(self,text="Start Calibration", anchor="c",font=("SourceSansPro-Semibold", 18))
|
|
self.instruction.pack(side="top", fill="both", expand=True)
|
|
self.instruction.pack(side="top", fill="both", expand=True)
|
|
@@ -26,9 +28,11 @@ class CalibrationPopUp(tk.Frame):
|
|
self.cs['value'] = self.calibration_state.progress
|
|
self.cs['value'] = self.calibration_state.progress
|
|
# read state from state machine
|
|
# read state from state machine
|
|
if self.calibration_state.get_state() == self.calibration_state.WAITING_POS_1:
|
|
if self.calibration_state.get_state() == self.calibration_state.WAITING_POS_1:
|
|
- self.instruction["text"] = "Move gondola to left at calibration_y_offset!"
|
|
|
|
|
|
+ text = "Move gondola to [" + self.conf["ac_sensor"]["calibration_x_offset"] + " , " + self.conf["ac_sensor"]["calibration_y_offset_1"] + "]!"
|
|
|
|
+ self.instruction["text"] = text
|
|
elif self.calibration_state.get_state() == self.calibration_state.WAITING_POS_2:
|
|
elif self.calibration_state.get_state() == self.calibration_state.WAITING_POS_2:
|
|
- self.instruction["text"] = "Move gondola to right at calibration_y_offset!"
|
|
|
|
|
|
+ text = "Move gondola to [" + self.conf["ac_sensor"]["calibration_x_offset"] + " , " + self.conf["ac_sensor"]["calibration_y_offset_2"] + "]!"
|
|
|
|
+ self.instruction["text"] = text
|
|
elif self.calibration_state.get_state() == self.calibration_state.CALIBRATION_DONE:
|
|
elif self.calibration_state.get_state() == self.calibration_state.CALIBRATION_DONE:
|
|
self.instruction["text"] = "Calibration Done!"
|
|
self.instruction["text"] = "Calibration Done!"
|
|
if not self.pendingClose:
|
|
if not self.pendingClose:
|