1234567891011121314151617181920212223242526272829303132333435363738394041 |
- from sensors.acousticSensor import AcousticSensor
- from sensors.calibration import CalibrationStateMashine
- from gui.mainWindow import MainWindow
- import queue
- 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()
- ac_queue = queue.Queue()
- ac_calibration_state = CalibrationStateMashine(log_handler)
- ac_sensor = AcousticSensor(conf, ac_queue, ac_calibration_state)
- try:
- ac_sensor.start()
- root = tk.Tk()
- root.title("Tracking System")
- root.attributes('-fullscreen', True)
- view = MainWindow(root, ac_sensor, ac_queue, 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()
|