1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/usr/bin/env python3
- from sensors.acousticSensor import AcousticSensor
- from sensors.calibration import CalibrationStateMashine
- 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_calibration_state = CalibrationStateMashine()
- ac_sensor = AcousticSensor(conf, ac_calibration_state)
- try:
- ac_sensor.start()
- root = tk.Tk()
- root.title("Tracking System")
- root.attributes('-fullscreen', conf['gui']['fullscreen'] == "yes")
- view = MainWindow(root, ac_sensor, ac_calibration_state, conf)
- 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()
- main()
|