node.py 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. import sys
  2. from PyQt5.QtCore import Qt
  3. from PyQt5.QtWidgets import QApplication
  4. import mytool.db_helper.db_operation as spmng
  5. import mytool.json_helper.parse_json as parse_json
  6. import main_window_XmSgj
  7. import main_window_GyBhhy
  8. if __name__ == '__main__':
  9. app = QApplication(sys.argv)
  10. desktop = QApplication.desktop()
  11. config = parse_json.parse_json_with_comments('./config.json')
  12. # 数据库配置
  13. db_config = config['db_config']
  14. # 显示配置
  15. show_config = config['show_config']
  16. task_type = 0
  17. if show_config['task_type'] == 'park':
  18. task_type = 1
  19. elif show_config['task_type'] == 'pick':
  20. task_type = 2
  21. if config['project_name'] == 'xm_sgj':
  22. window = main_window_XmSgj.MainWindow(task_type,show_config,db_config)
  23. elif config['project_name'] == 'gy_bhhy':
  24. window = main_window_GyBhhy.MainWindow(show_config['display_number'],show_config['unit'],show_config['unit_list'][show_config['unit']],task_type,show_config['font_size'],db_config)
  25. screen_count = desktop.screenCount()
  26. if screen_count > 1:
  27. screen = desktop.screen(1)
  28. window.move(screen.geometry().x(), screen.geometry().y())
  29. window.setGeometry(desktop.screenGeometry(1))
  30. window.showMaximized()
  31. sys.exit(app.exec_())