Przeglądaj źródła

added calibration dialog

w.mueller 4 lat temu
rodzic
commit
d0e0ceeea1
1 zmienionych plików z 10 dodań i 3 usunięć
  1. 10 3
      raspberry-pi/gui/mainWindow.py

+ 10 - 3
raspberry-pi/gui/mainWindow.py

@@ -1,4 +1,5 @@
 import tkinter as tk
+import tkinter.messagebox
 import time
 import queue
 
@@ -22,8 +23,6 @@ class MainWindow(tk.Frame):
     l.pack(side="top", fill="both", expand=True)
     calibrate_button = tk.Button(self.controls,text="calibrate",command=self.calibrate)
     calibrate_button.pack(side="top")
-    calibrate_button_next = tk.Button(self.controls,text="calibrate_next",command=self.calibration_state.next_state)
-    calibrate_button_next.pack(side="top")
 
     self.csString = tk.StringVar()
     cs = tk.Label(self.controls, textvariable=self.csString, anchor="c")
@@ -36,9 +35,17 @@ class MainWindow(tk.Frame):
 
   def calibrate(self):
     self.calibration_state.reset_state()
+    tkinter.messagebox.showinfo(title="Calibrate", message="Move gondola to far left corner!")
     self.calibration_state.next_state()
     self.down_queue.put("calibrate")
-
+    while self.calibration_state.return_state() != 3:
+      time.sleep(1)
+    tkinter.messagebox.showinfo(title="Calibrate", message="Move gondola to far rigth corner!")
+    self.calibration_state.next_state()
+    while self.calibration_state.return_state() != 7:
+      time.sleep(1)
+    tkinter.messagebox.showinfo(title="Calibrate",message="Calibration Done!") #display new calibration values?
+    
 if __name__ == "__main__":
   root = tk.Tk()
   up_queue = queue.Queue()