runner_traffic.py 521 B

123456789101112131415161718192021222324252627
  1. '''
  2. Created on 18 Aug 2014
  3. @author: Raphael
  4. '''
  5. import Tkinter as tk
  6. import traffic
  7. from python_runtime.libs.ui import ui
  8. from python_runtime.statecharts_core import Event
  9. FIXED_UPDATE_TIME = 20 #ms
  10. def update(controller,window):
  11. controller.update(FIXED_UPDATE_TIME/1000.0)
  12. window.after(FIXED_UPDATE_TIME,update,controller,window)
  13. if __name__ == '__main__':
  14. ui.window = tk.Tk()
  15. controller = traffic.Controller()
  16. controller.start()
  17. update(controller,ui.window)
  18. ui.window.mainloop()