diff --git a/pycrocart/Connection.py b/pycrocart/Connection.py new file mode 100644 index 0000000000000000000000000000000000000000..047d8996ac5a15205e6284728e799907bfc26212 --- /dev/null +++ b/pycrocart/Connection.py @@ -0,0 +1,28 @@ +from PyQt5.QtWidgets import QPushButton, QGridLayout, QWidget, QHBoxLayout, QComboBox + + +class Connection(QWidget): + + def __init__(self): + + super().__init__() + + self.dropdown = QComboBox(self) + self.dropdown.addItem("radio://45/") + self.dropdown.addItem("radio://100/") + self.dropdown.setFixedWidth(150) + + self.connect = QPushButton("Connect", self) + self.connect.setFixedWidth(100) + + self.scan = QPushButton("Scan", self) + self.scan.setFixedWidth(100) + + button_layout = QHBoxLayout() + button_layout.addWidget(self.dropdown) + button_layout.addWidget(self.connect) + button_layout.addWidget(self.scan) + button_layout.addStretch(1) + + self.show() + diff --git a/pycrocart/PyCroCart.py b/pycrocart/PyCroCart.py index 49e40fd723d2822222b60089502efc1f7e95cb0b..7f2e93b31ab8a326a2bfd7792aed2677413ac269 100644 --- a/pycrocart/PyCroCart.py +++ b/pycrocart/PyCroCart.py @@ -8,7 +8,7 @@ groundstation and launches the gui. """ import sys -from PyQt5.QtWidgets import QApplication, QMainWindow, QTabWidget +from PyQt5.QtWidgets import QApplication, QMainWindow, QTabWidget, QHBoxLayout, QVBoxLayout import uCartCommander from CrazyflieProtoConnection import CrazyflieProtoConnection from ControlTab import ControlTab @@ -32,6 +32,24 @@ class PyCroCart(QMainWindow): def __init__(self, cf: CrazyflieProtoConnection, setpoint_handler: SetpointHandler): super().__init__() + + self.dropdown = QComboBox(self) + self.dropdown.addItem("radio://45/") + self.dropdown.addItem("radio://100/") + self.dropdown.setFixedWidth(150) + + self.connect = QPushButton("Connect", self) + self.connect.setFixedWidth(100) + + self.scan = QPushButton("Scan", self) + self.scan.setFixedWidth(100) + + button_layout = QHBoxLayout() + button_layout.addWidget(self.dropdown) + button_layout.addWidget(self.connect) + button_layout.addWidget(self.scan) + button_layout.addStretch(1) + self.joystick_reader = JoystickReader() @@ -51,7 +69,14 @@ class PyCroCart(QMainWindow): self.tabs.addTab(self.tab3, "Parameter Window") self.tabs.addTab(self.tab4, "Logging Window") - self.setCentralWidget(self.tabs) + main_layout = QHBoxLayout() + main_layout.addLayout(button_layout) + main_layout.addWidget(self.tabs) + + widget = QWidget() + widget.setLayout(main_layout) + + self.setCentralWidget(widget) # self.show() @@ -61,7 +86,7 @@ if __name__ == '__main__': app = QApplication(sys.argv) cf1 = CrazyflieProtoConnection() - uri = 'radio://0/20/2M/E7E7E7E7E7' + uri = 'radio://0/60/2M/E7E7E7E7E7' cf1.connect(uri) cf1.scf.cf.commander = uCartCommander.Commander(cf1.scf.cf) diff --git a/pycrocart/__pycache__/Connection.cpython-38.pyc b/pycrocart/__pycache__/Connection.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cfdf9220d7d50dc91d7759fcdb8eb0223ae48920 Binary files /dev/null and b/pycrocart/__pycache__/Connection.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/ControlTab.cpython-38.pyc b/pycrocart/__pycache__/ControlTab.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ff85ea30bd593f7b7f648ffeef7e77a3e66624e7 Binary files /dev/null and b/pycrocart/__pycache__/ControlTab.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/ControlWindow.cpython-38.pyc b/pycrocart/__pycache__/ControlWindow.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a13f4cbd67a651b27a601507796af84af13c5a45 Binary files /dev/null and b/pycrocart/__pycache__/ControlWindow.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/CrazyflieProtoConnection.cpython-38.pyc b/pycrocart/__pycache__/CrazyflieProtoConnection.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f38730a95ea1aa9f3f02fd3eeb0a143d6dd0542c Binary files /dev/null and b/pycrocart/__pycache__/CrazyflieProtoConnection.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/GamepadWizard.cpython-38.pyc b/pycrocart/__pycache__/GamepadWizard.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ccac5c9628e41c9568c243f6316ab7a736dfdbdb Binary files /dev/null and b/pycrocart/__pycache__/GamepadWizard.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/GamepadWizardTab.cpython-38.pyc b/pycrocart/__pycache__/GamepadWizardTab.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ebd1d7c9809a01f8266a41de3eb90644f371f55 Binary files /dev/null and b/pycrocart/__pycache__/GamepadWizardTab.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/LoggingConfigTab.cpython-38.pyc b/pycrocart/__pycache__/LoggingConfigTab.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81747ac14163086f6cdc1f498b789ebf067bed24 Binary files /dev/null and b/pycrocart/__pycache__/LoggingConfigTab.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/LoggingConfigWindow.cpython-38.pyc b/pycrocart/__pycache__/LoggingConfigWindow.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e4d2fc1d5ea0f536ae4109c22dd1807e3a0f9525 Binary files /dev/null and b/pycrocart/__pycache__/LoggingConfigWindow.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/LoggingSelectionMenu.cpython-38.pyc b/pycrocart/__pycache__/LoggingSelectionMenu.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e5e3ebc84dce8c3c0f669210bd8ab484074d6fa Binary files /dev/null and b/pycrocart/__pycache__/LoggingSelectionMenu.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/ParameterTab.cpython-38.pyc b/pycrocart/__pycache__/ParameterTab.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86b18dfceee4a1c742ef06719dffcbf9c7083646 Binary files /dev/null and b/pycrocart/__pycache__/ParameterTab.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/ParameterWindow.cpython-38.pyc b/pycrocart/__pycache__/ParameterWindow.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f221f45a6ce0b13891ab30c98b8ea94e2255fd8 Binary files /dev/null and b/pycrocart/__pycache__/ParameterWindow.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/PlottingWindow.cpython-38.pyc b/pycrocart/__pycache__/PlottingWindow.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b18238ad6a376e9e328a04312607b321666975d Binary files /dev/null and b/pycrocart/__pycache__/PlottingWindow.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/PyLine.cpython-38.pyc b/pycrocart/__pycache__/PyLine.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47064fb5bf7b3b20575ca19bf1c6ce1e4ed2843f Binary files /dev/null and b/pycrocart/__pycache__/PyLine.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/SetpointHandler.cpython-38.pyc b/pycrocart/__pycache__/SetpointHandler.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..145d67410bccb129d9e6e616fc8a967e0c87b7f4 Binary files /dev/null and b/pycrocart/__pycache__/SetpointHandler.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/SetpointMenu.cpython-38.pyc b/pycrocart/__pycache__/SetpointMenu.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..618ed884b9ac957d8f2be7d6d293c6ad9f9d8e21 Binary files /dev/null and b/pycrocart/__pycache__/SetpointMenu.cpython-38.pyc differ diff --git a/pycrocart/__pycache__/uCartCommander.cpython-38.pyc b/pycrocart/__pycache__/uCartCommander.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c02a45944831533fcf0cd01bac697baadc30a149 Binary files /dev/null and b/pycrocart/__pycache__/uCartCommander.cpython-38.pyc differ