12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #!/usr/bin/env python3
- from sensors.acousticSensor import AcousticSensor
- from sensors.opticalSensor import OpticalSensor
- from gui.mainWindow import MainWindow
- import configparser
- import tkinter as tk
- import traceback
- import logHandler
- conf = configparser.ConfigParser()
- conf.read('config.ini')
- def main():
- log_handler = logHandler.get_log_handler(int(conf['gui']['log_lines']))
- ac_sensor = AcousticSensor(conf)
- opt_sensor = OpticalSensor(conf)
- try:
- ac_sensor.start()
- opt_sensor.start()
- root = tk.Tk()
- root.title("Tracking System")
- root.attributes('-fullscreen', conf['gui']['fullscreen'] == "yes")
- view = MainWindow(root, conf, ac_sensor, opt_sensor)
- view.pack(side="top", fill="both", expand=True)
- view.update()
- root.mainloop()
- except KeyboardInterrupt:
- print("stop")
- except Exception as e:
- print("Error: ",e)
- traceback.print_exc()
- finally:
- ac_sensor.stop()
- opt_sensor.stop()
- main()
|