mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-31 01:09:33 +00:00
Fix server import
This commit is contained in:
BIN
server/icons/test.png
Normal file
BIN
server/icons/test.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
@@ -1,3 +1,5 @@
|
||||
import os
|
||||
import sys
|
||||
import pickle
|
||||
import logging
|
||||
from ast import literal_eval
|
||||
@@ -10,14 +12,12 @@ from PyQt5.QtGui import QCursor, QKeySequence
|
||||
from PyQt5.QtWidgets import QAbstractItemView, QTreeView, QMenu, QAction, QMessageBox, QInputDialog, QFileDialog, \
|
||||
QShortcut
|
||||
|
||||
import config_editor
|
||||
import modules.ui.config_editor as config_editor
|
||||
|
||||
import sys
|
||||
import os, inspect # Add parent dir to PATH to import messaging_lib
|
||||
|
||||
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
||||
parent_dir = os.path.dirname(current_dir)
|
||||
sys.path.insert(0, parent_dir)
|
||||
# Add parent dir to PATH to import messaging_lib and config_lib
|
||||
current_dir = (os.path.dirname(os.path.realpath(__file__)))
|
||||
lib_dir = os.path.realpath(os.path.join(current_dir, '../../lib'))
|
||||
sys.path.insert(0, lib_dir)
|
||||
|
||||
import config
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ from PyQt5.QtGui import QCursor
|
||||
from PyQt5.QtWidgets import QTableView, QMessageBox, QMenu, QAction, QWidgetAction, QListWidget, \
|
||||
QAbstractItemView, QListWidgetItem, QVBoxLayout, QHBoxLayout, QPushButton, QInputDialog, QLineEdit, QApplication
|
||||
|
||||
from config_editor_models import ConfigDialog
|
||||
import copter_table_models as table
|
||||
from modules.config_editor_models import ConfigDialog
|
||||
import modules.copter_table_models as table
|
||||
|
||||
|
||||
def save_preset(config, current, header_dict):
|
||||
|
||||
@@ -38,7 +38,7 @@ ConfigOption = collections.namedtuple("ConfigOption", ["section", "option", "val
|
||||
|
||||
|
||||
class Server(messaging.Singleton):
|
||||
def __init__(self, server_id=None, config_path="../config/server.ini"):
|
||||
def __init__(self, config_path="../config/server.ini", server_id=None):
|
||||
self.id = server_id if server_id else str(random.randint(0, 9999)).zfill(4)
|
||||
self.time_started = 0
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ class Ui_MainWindow(object):
|
||||
self.reboot_fcu.setText(_translate("MainWindow", "Reboot FCU"))
|
||||
self.calibrate_gyro.setText(_translate("MainWindow", "Calibrate gyro"))
|
||||
self.calibrate_level.setText(_translate("MainWindow", "Calibrate level"))
|
||||
self.menuOptions.setTitle(_translate("MainWindow", "server"))
|
||||
self.menuOptions.setTitle(_translate("MainWindow", "Server"))
|
||||
self.menuMusic_2.setTitle(_translate("MainWindow", "Music"))
|
||||
self.menuTable.setTitle(_translate("MainWindow", "Table"))
|
||||
self.menuDrone_2.setTitle(_translate("MainWindow", "Selected drones"))
|
||||
|
||||
@@ -2,7 +2,7 @@ from PyQt5.QtCore import pyqtSlot
|
||||
from PyQt5.QtGui import QKeySequence
|
||||
from PyQt5 import QtWidgets
|
||||
|
||||
import visual_land
|
||||
import modules.ui.visual_land as visual_land
|
||||
import math
|
||||
import logging
|
||||
import sys
|
||||
|
||||
@@ -8,30 +8,33 @@ import asyncio
|
||||
import platform
|
||||
import itertools
|
||||
import subprocess
|
||||
from functools import partial, wraps
|
||||
|
||||
from functools import partial, wraps
|
||||
from quamash import QEventLoop
|
||||
|
||||
# Import server routines
|
||||
from modules.server_core import Server, Client, now
|
||||
|
||||
# Import modules from lib, that was added to PATH on the previous step
|
||||
import messaging
|
||||
import config as cfg
|
||||
from lib import b_partial
|
||||
|
||||
# Import PyQt5 related functions
|
||||
from PyQt5 import QtWidgets, QtMultimedia, QtCore
|
||||
from PyQt5.QtGui import QPixmap, QIcon
|
||||
from PyQt5.QtCore import Qt, pyqtSlot, QUrl
|
||||
|
||||
from PyQt5.QtWidgets import QFileDialog, QMessageBox, QApplication, QInputDialog, QLineEdit, QStatusBar, \
|
||||
QSplashScreen, QProgressBar
|
||||
from quamash import QEventLoop
|
||||
|
||||
# Importing gui form
|
||||
from server_gui import Ui_MainWindow
|
||||
# Import gui form
|
||||
from modules.ui.server_gui import Ui_MainWindow
|
||||
|
||||
from core_server import Server, Client, now
|
||||
|
||||
import messaging_lib as messaging
|
||||
import config as cfg
|
||||
|
||||
import copter_table_models as table
|
||||
from copter_table import CopterTableWidget, HeaderEditDialog
|
||||
from visual_land_dialog import VisualLandDialog
|
||||
from config_editor_models import ConfigDialog
|
||||
|
||||
from lib import b_partial
|
||||
# Import gui logic
|
||||
import modules.copter_table_models as table
|
||||
from modules.copter_table import CopterTableWidget, HeaderEditDialog
|
||||
from modules.visual_land_dialog import VisualLandDialog
|
||||
from modules.config_editor_models import ConfigDialog
|
||||
|
||||
startup_cwd = os.getcwd()
|
||||
|
||||
@@ -683,7 +686,7 @@ if __name__ == "__main__":
|
||||
|
||||
# app.exec_()
|
||||
with loop:
|
||||
server = ServerQt()
|
||||
server = ServerQt(config_path="config/server.ini")
|
||||
window = MainWindow(server)
|
||||
|
||||
Client.on_first_connect = window.new_client_connected
|
||||
|
||||
Reference in New Issue
Block a user