Popup.py 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. import tkinter as tk
  2. import tkinter.messagebox
  3. import time
  4. import queue
  5. class CalibrationPopUp(tk.Frame):
  6. def __init__(self, root, up_queue, down_queue,calibration_state):
  7. self.root = root
  8. self.calibration_state = calibration_state
  9. self.down_queue = down_queue
  10. self.up_queue = up_queue
  11. tk.Frame.__init__(self, root)
  12. self.csString = tk.StringVar()
  13. self.instruction_string = tk.StringVar()
  14. self.instruction_string.set("start Calibration!")
  15. self.csString.set(self.calibration_state.state_clearname())
  16. cs = tk.Label(self,textvariable=self.csString, anchor="c")
  17. cs.pack(side="top", fill="both", expand=True)
  18. dummy = tk.Label(self,text="dummy im a dummy", anchor="c")
  19. dummy.pack(side="top", fill="both", expand=True)
  20. instruction = tk.Label(self,textvariable=self.instruction_string, anchor="c")
  21. instruction.pack(side="top", fill="both", expand=True)
  22. button = tk.Button(self,text="OK", command=self.calibration_state.next_state_gui, anchor="c")
  23. button.pack(side="top", fill="both", expand=True)
  24. def update(self):
  25. self.csString.set(self.calibration_state.state_clearname())
  26. if self.calibration_state.get_state() == self.calibration_state.WAITING_POS_1:
  27. self.instruction_string.set("Move gondola to far left corner!")
  28. if self.calibration_state.get_state() == self.calibration_state.WAITING_POS_2:
  29. self.instruction_string.set("Move gondole to far right corner!")