Popup.py 1.3 KB

123456789101112131415161718192021222324252627282930
  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, calibration_state):
  7. self.root = root
  8. self.calibration_state = calibration_state
  9. tk.Frame.__init__(self, root)
  10. self.killed = False
  11. self.instruction = tk.Label(self,text="Start Calibration", anchor="c",font=("Courier",18))
  12. self.instruction.pack(side="top", fill="both", expand=True)
  13. button = tk.Button(self,text="OK", command=self.calibration_state.next_state_gui, anchor="c",height=1,width=5)
  14. button.pack(side="top", fill="both", expand=True)
  15. self.cs = tk.Label(self,text=self.calibration_state.state_clearname(), anchor="c")
  16. self.cs.pack(side="top", fill="both", expand=True)
  17. def update(self):
  18. self.cs["text"] = self.calibration_state.state_clearname()
  19. if self.calibration_state.get_state() == self.calibration_state.WAITING_POS_1:
  20. self.instruction["text"] = "Move gondola to far left corner!"
  21. elif self.calibration_state.get_state() == self.calibration_state.WAITING_POS_2:
  22. self.instruction["text"] = "Move gondola to far right corner!"
  23. elif self.calibration_state.get_state() == self.calibration_state.CALIBRATION_DONE:
  24. self.instruction["text"] = "Calibration Done!"
  25. else:
  26. self.instruction["text"] = "Processing..."