import sys
sys.path.append("..")

from PyQt5.QtWidgets import QApplication
import mytool.json_helper.parse_json as parse_json
from window_controller.main_window import MainWindow

if __name__ == '__main__':
    # 读取文件
    config = parse_json.parse_json_with_comments('./config.json')
    # 数据库配置
    db_config = config['db_config']
    # 车库配置配置
    parking_config = config['parking_config']
    # rabbitmq配置
    mq_config = config['mq_config']
    passwd = parking_config['passwd']


    app = QApplication(sys.argv)
    mainWindow = MainWindow(parking_config, mq_config,db_config)
    mainWindow.showMaximized()
    mainWindow.plate_full_image_label.setMaximumSize(mainWindow.plate_full_image_label.size())
    mainWindow.plate_clip_image_label.setMaximumSize(mainWindow.plate_clip_image_label.size())

    sys.exit(app.exec_())
