diff --git a/groundStation/gui/MicroCART/MicroCART.files b/groundStation/gui/MicroCART/MicroCART.files index b4d086dd0b798f2b1e94602a836172f8e25a851e..0ce8141d43852df971238ce1de596c4f643e6bfb 100644 --- a/groundStation/gui/MicroCART/MicroCART.files +++ b/groundStation/gui/MicroCART/MicroCART.files @@ -5,6 +5,8 @@ controlworker.cpp controlworker.h crazyflieworker.cpp crazyflieworker.h +gamepadmonitor.cpp +gamepadmonitor.h gridlines.gif main.cpp mainwindow.cpp diff --git a/groundStation/gui/MicroCART/MicroCART.pro b/groundStation/gui/MicroCART/MicroCART.pro index 3548b01aab3ffb98b73ad450bf45eb0744e4683c..d38edbeee72bb9f4e95a72c0dd93931435e438cb 100644 --- a/groundStation/gui/MicroCART/MicroCART.pro +++ b/groundStation/gui/MicroCART/MicroCART.pro @@ -4,7 +4,7 @@ # #------------------------------------------------- -QT += core gui +QT += core gui gamepad greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport @@ -23,7 +23,8 @@ SOURCES += main.cpp\ qFlightInstruments.cpp\ qcustomplot.cpp\ crazyflieworker.cpp\ - setpoint.cpp + setpoint.cpp\ + gamepadmonitor.cpp HEADERS += mainwindow.h \ trackerworker.h \ @@ -34,7 +35,8 @@ HEADERS += mainwindow.h \ qFlightInstruments.h\ qcustomplot.h\ crazyflieworker.h\ - setpoint.h + setpoint.h\ + gamepadmonitor.h FORMS += mainwindow.ui diff --git a/groundStation/gui/MicroCART/crazyflieworker.cpp b/groundStation/gui/MicroCART/crazyflieworker.cpp index 17629e40b7ab43ce6a6ec45980ac66e0a7f3605b..8894c2c63b265fc749ec2f122a7d885abef96f52 100644 --- a/groundStation/gui/MicroCART/crazyflieworker.cpp +++ b/groundStation/gui/MicroCART/crazyflieworker.cpp @@ -59,12 +59,12 @@ void CrazyflieWorker::setCurrAttSetpoint(float roll, float pitch, float yaw, flo currAttitudeSetpoint.throttle = throttle; } -void CrazyflieWorker::setCurrAttRateSetpoint(float rollRate, float pitchRate, float yawRate, float throttleRate) +void CrazyflieWorker::setCurrAttRateSetpoint(float rollRate, float pitchRate, float yawRate, float throttle) { currAttitudeRateSetpoint.roll = rollRate; currAttitudeRateSetpoint.pitch = pitchRate; currAttitudeRateSetpoint.yaw = yawRate; - currAttitudeRateSetpoint.throttle = throttleRate; + currAttitudeRateSetpoint.throttle = throttle; } @@ -72,7 +72,7 @@ void CrazyflieWorker::sendAttRateSetpoint() { struct frontend_override_data data; data.enable = 2; //attitude rate - data.time = 0.2; //hold setpoint for 0.2 seconds TODO + data.time = 0.2; //hold setpoint for 0.2 seconds TODO check if this amount of time is good? data.throttle = currAttitudeRateSetpoint.throttle; data.roll = currAttitudeRateSetpoint.roll; data.pitch = currAttitudeRateSetpoint.pitch; @@ -269,4 +269,4 @@ void CrazyflieWorker::getGroupEntries(int box, QString gName) { entryList.append(cur); } emit(gotGroupEntries(box, entryList)); -} \ No newline at end of file +} diff --git a/groundStation/gui/MicroCART/gamepadmonitor.cpp b/groundStation/gui/MicroCART/gamepadmonitor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..09f936fc56062f8b9f92e4c24f58974d87256312 --- /dev/null +++ b/groundStation/gui/MicroCART/gamepadmonitor.cpp @@ -0,0 +1,81 @@ +#include "gamepadmonitor.h" +#include <QDebug> + +GamepadMonitor::GamepadMonitor(QObject *parent) : QObject(parent) +{ + m_gamepadManager = QGamepadManager::instance(); + + rollScale = 20; //-20 to 20 deg/s + pitchScale = 20; + yawScale = 30; + thrustScale = 30000; //0 to 60,000 thrust + + connect(m_gamepadManager, SIGNAL(gamepadConnected(int)), this, SLOT(gamepadConnectedHandler(int))); + connect(m_gamepadManager, SIGNAL(gamepadDisconnected(int)), this, SLOT(gamepadDisconnectedHandler(int))); + + auto gamepads = m_gamepadManager->connectedGamepads(); + if (gamepads.isEmpty()) { + // Did not find any connected gamepads creating default gamepad; + m_gamepad = new QGamepad(); + return; + } + + m_gamepad = new QGamepad(*gamepads.begin(), this); + qInfo() << "gamepad is connected, deviceId = " << m_gamepad->deviceId(); +} + +void GamepadMonitor::gamepadConnectedHandler(int deviceId){ + emit(gamepadConnected()); + qInfo() << "gamepad is connected, deviceId = " << deviceId; + m_gamepad = new QGamepad(deviceId, this); +} + +void GamepadMonitor::gamepadDisconnectedHandler(int deviceId){ + emit(gamepadDisconnected()); + qInfo() << "gamepad disconnected"; +} + +bool GamepadMonitor::isGamepadConnected(){ + return m_gamepad->isConnected(); +} + +void GamepadMonitor::resetConfig(){ + qInfo() << "gamepad config reset"; + m_gamepadManager->resetConfiguration(m_gamepad->deviceId()); +} + +void GamepadMonitor::configureAxis(QString axisName){ + if(axisName == "roll"){ + m_gamepadManager->configureAxis(m_gamepad->deviceId(), QGamepadManager::AxisRightX); + qInfo() << "roll configured"; + }else if(axisName == "yaw"){ + m_gamepadManager->configureAxis(m_gamepad->deviceId(), QGamepadManager::AxisLeftX); + qInfo() << "yaw configured"; + }else if(axisName == "pitch"){ + m_gamepadManager->configureAxis(m_gamepad->deviceId(), QGamepadManager::AxisRightY); + qInfo() << "pitch configured"; + }else if(axisName == "thrust"){ + m_gamepadManager->configureAxis(m_gamepad->deviceId(), QGamepadManager::AxisLeftY); + qInfo() << "thrust configured"; + } +} + +float GamepadMonitor::getRoll(){ + return (float) m_gamepad->axisRightX() * rollScale; +} + +float GamepadMonitor::getYaw(){ + return (float) m_gamepad->axisLeftX() * yawScale; +} + +float GamepadMonitor::getPitch(){ + return (float) m_gamepad->axisRightY() * pitchScale; +} + +float GamepadMonitor::getThrust(){ + return (float) (m_gamepad->axisLeftY() + 1) * thrustScale; +} + +GamepadMonitor::~GamepadMonitor(){ + +} diff --git a/groundStation/gui/MicroCART/gamepadmonitor.h b/groundStation/gui/MicroCART/gamepadmonitor.h new file mode 100644 index 0000000000000000000000000000000000000000..5b3ef05cd76daef5ce874c70d814876876aaa3fc --- /dev/null +++ b/groundStation/gui/MicroCART/gamepadmonitor.h @@ -0,0 +1,42 @@ +#ifndef GAMEPADMONITOR_H +#define GAMEPADMONITOR_H + +#include <QObject> +#include <QtGamepad/QGamepad> + + +class GamepadMonitor : public QObject +{ + Q_OBJECT +public: + explicit GamepadMonitor(QObject *parent = nullptr); + ~GamepadMonitor(); + + bool isGamepadConnected(); + + float getRoll(); + float getYaw(); + float getPitch(); + float getThrust(); + void configureAxis(QString axisName); + void resetConfig(); + + +private: + QGamepad *m_gamepad; + QGamepadManager *m_gamepadManager; + + float rollScale; + float pitchScale; + float yawScale; + float thrustScale; + +signals: + void gamepadConnected(); + void gamepadDisconnected(); +public slots: + void gamepadConnectedHandler(int deviceId); + void gamepadDisconnectedHandler(int deviceId); +}; + +#endif // GAMEPADMONITOR_H diff --git a/groundStation/gui/MicroCART/mainwindow.cpp b/groundStation/gui/MicroCART/mainwindow.cpp index 50d2226d83527453d409ae1d0be12b2f17eb3291..4a1bca851d180bdc271a9a694e877b664ca6e2fb 100644 --- a/groundStation/gui/MicroCART/mainwindow.cpp +++ b/groundStation/gui/MicroCART/mainwindow.cpp @@ -10,6 +10,7 @@ #include <QProcessEnvironment> #include <QPixmap> #include <QProcess> +#include <QDebug> #include "trackerworker.h" #include "controlworker.h" @@ -32,6 +33,7 @@ MainWindow::MainWindow(QWidget *parent) : workerStartTimer(new QTimer(this)), backendProcess(new QProcess(this)), matlabProcess(new QProcess(this)), + pollGamepadTimer(new QTimer(this)), connectedWorkers(0) { ui->setupUi(this); @@ -94,7 +96,7 @@ MainWindow::MainWindow(QWidget *parent) : /* Create another work for the crazyflie communication */ QThread * cfThread = new QThread(this); - CrazyflieWorker * crazyflieWorker = new CrazyflieWorker(); + crazyflieWorker = new CrazyflieWorker(); crazyflieWorker->moveToThread(cfThread); /* connect signals for crazyflie worker */ @@ -168,6 +170,22 @@ MainWindow::MainWindow(QWidget *parent) : // connect(ui->pbSendSetpoint, SIGNAL (clicked()), this, SLOT (sendSetpoints())); // connect(ui->setpointList, SIGNAL (doubleClicked(QModelIndex)), this, SLOT (sendSelectedSetpoint())); + /* start gamepad monitor */ + + gamepadMonitor = new GamepadMonitor(); + if(gamepadMonitor->isGamepadConnected()){ + onGamepadConnect(); + }else{ + onGamepadDisconnect(); + } + + connect(gamepadMonitor, SIGNAL(gamepadDisconnected()), this, SLOT(onGamepadDisconnect())); + connect(gamepadMonitor, SIGNAL(gamepadConnected()), this, SLOT(onGamepadConnect())); + connect(ui->pb_configRoll, SIGNAL(clicked()), this, SLOT(on_pb_configRoll_clicked())); + connect(pollGamepadTimer, SIGNAL(timeout()), this, SLOT(updateGamepad())); + pollGamepadTimer->start(50); + + /* Populate scripts list */ QDir scriptsDir("scripts/"); QStringList scripts = scriptsDir.entryList(); @@ -721,3 +739,94 @@ void MainWindow::on_yawSetpoint_returnPressed() // blockDefs[BLOCK_CONSTANT]->param_names[0], // ui->yawSetpoint->text().toFloat())); } + +void MainWindow::on_tActual_sliderMoved(int position) +{ + QToolTip::showText(QCursor::pos(), QString::number(position), nullptr); + +} + +void MainWindow::on_tActual_2_sliderMoved(int position) +{ + QToolTip::showText(QCursor::pos(), QString::number(position), nullptr); +} + + +/******** Gamepad handlers ********/ + +void MainWindow::onGamepadDisconnect(){ + crazyflieWorker->setCurrAttRateSetpoint(0,0,0,0); + ui->rRateActual->setText("0"); + ui->pRateActual->setText("0"); + ui->yRateActual->setText("0"); + ui->tActual_2->setValue(0); + + ui->noGamepadWarning->show(); + ui->rbGamepadControl->setEnabled(false); + ui->pb_configPitch->setEnabled(false); + ui->pb_configRoll->setEnabled(false); + ui->pb_configYaw->setEnabled(false); + ui->pb_configThrust->setEnabled(false); + ui->pb_resetConfig->setEnabled(false); + ui->rbManualSetpoint->setChecked(true); +} + +void MainWindow::onGamepadConnect(){ + ui->noGamepadWarning->hide(); + ui->rbGamepadControl->setEnabled(true); + ui->pb_configPitch->setEnabled(true); + ui->pb_configRoll->setEnabled(true); + ui->pb_configYaw->setEnabled(true); + ui->pb_configThrust->setEnabled(true); + ui->pb_resetConfig->setEnabled(true); +} + +void MainWindow::updateGamepad(){ + if(ui->tabWidget->currentWidget() == ui->Gamepad){ + //on gamepad tab + ui->rollVizBar->setValue((int) gamepadMonitor->getRoll()); + ui->yawVizBar->setValue((int) gamepadMonitor->getYaw()); + ui->pitchVizBar->setValue((int) gamepadMonitor->getPitch()); + ui->thrustVizBar->setValue((int) gamepadMonitor->getThrust()); + }else if(ui->tabWidget->currentWidget() == ui->navigation){ + if(ui->rbGamepadControl->isChecked()){ + float roll = gamepadMonitor->getRoll(); + float pitch = gamepadMonitor->getPitch(); + float yaw = gamepadMonitor->getYaw(); + float thrust = gamepadMonitor->getThrust(); + + crazyflieWorker->setCurrAttRateSetpoint(roll, pitch, yaw, thrust); + ui->rRateActual->setText(QString::number(roll)); + ui->pRateActual->setText(QString::number(pitch)); + ui->yRateActual->setText(QString::number(yaw)); + ui->tActual_2->setValue((int) thrust); + } + } +} + +void MainWindow::on_pb_resetConfig_clicked() +{ + gamepadMonitor->resetConfig(); +} + +void MainWindow::on_pb_configRoll_clicked() +{ + gamepadMonitor->configureAxis("roll"); +} + +void MainWindow::on_pb_configYaw_clicked() +{ + gamepadMonitor->configureAxis("yaw"); +} + +void MainWindow::on_pb_configPitch_clicked() +{ + gamepadMonitor->configureAxis("pitch"); +} + +void MainWindow::on_pb_configThrust_clicked() +{ + gamepadMonitor->configureAxis("thrust"); +} + + diff --git a/groundStation/gui/MicroCART/mainwindow.h b/groundStation/gui/MicroCART/mainwindow.h index a79eea75188bb23878240fa81e999f2a6818f921..f6c074042d6343557d60475beef06947c3c1d922 100644 --- a/groundStation/gui/MicroCART/mainwindow.h +++ b/groundStation/gui/MicroCART/mainwindow.h @@ -6,6 +6,9 @@ #include <QStandardItemModel> #include <QGraphicsScene> #include "quaditem.h" +#include "gamepadmonitor.h" +#include "crazyflieworker.h" + namespace Ui { class MainWindow; @@ -106,6 +109,23 @@ private slots: void getEntryBoxChange(int index); void getEntryBoxChange2(int index); + void onGamepadDisconnect(); + void onGamepadConnect(); + void on_pb_configRoll_clicked(); + void updateGamepad(); + + void on_pb_resetConfig_clicked(); + + void on_pb_configYaw_clicked(); + + void on_pb_configThrust_clicked(); + + void on_pb_configPitch_clicked(); + + void on_tActual_sliderMoved(int position); + + void on_tActual_2_sliderMoved(int position); + private: Ui::MainWindow *ui; QStandardItemModel * setpointList; @@ -115,9 +135,12 @@ private: float sp_z; QTimer * trackerTimer; QTimer * workerStartTimer; + QTimer *pollGamepadTimer; QProcess * backendProcess; QProcess * matlabProcess; int connectedWorkers; + GamepadMonitor *gamepadMonitor; + CrazyflieWorker *crazyflieWorker; }; #endif // MAINWINDOW_H diff --git a/groundStation/gui/MicroCART/mainwindow.ui b/groundStation/gui/MicroCART/mainwindow.ui index 6a96b514f672d891b4b1dc8622b15b44c7de973e..e5442fad09d75dd442d6e4ad10c26c9a5a1d7877 100644 --- a/groundStation/gui/MicroCART/mainwindow.ui +++ b/groundStation/gui/MicroCART/mainwindow.ui @@ -18,7 +18,7 @@ <item> <widget class="QTabWidget" name="tabWidget"> <property name="currentIndex"> - <number>1</number> + <number>2</number> </property> <widget class="QWidget" name="backend"> <attribute name="title"> @@ -326,10 +326,215 @@ </property> </widget> </widget> - <widget class="QWidget" name="controller"> + <widget class="QWidget" name="Gamepad"> <attribute name="title"> - <string>Controller</string> + <string>Gamepad</string> </attribute> + <widget class="QPushButton" name="pb_configRoll"> + <property name="geometry"> + <rect> + <x>720</x> + <y>130</y> + <width>141</width> + <height>25</height> + </rect> + </property> + <property name="text"> + <string>Configure Roll</string> + </property> + </widget> + <widget class="QSlider" name="rollVizBar"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>710</x> + <y>160</y> + <width>160</width> + <height>16</height> + </rect> + </property> + <property name="minimum"> + <number>-20</number> + </property> + <property name="maximum"> + <number>20</number> + </property> + <property name="value"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + <widget class="QPushButton" name="pb_resetConfig"> + <property name="geometry"> + <rect> + <x>440</x> + <y>90</y> + <width>191</width> + <height>25</height> + </rect> + </property> + <property name="text"> + <string>Reset Configuration</string> + </property> + </widget> + <widget class="QPushButton" name="pb_configYaw"> + <property name="geometry"> + <rect> + <x>160</x> + <y>140</y> + <width>141</width> + <height>25</height> + </rect> + </property> + <property name="text"> + <string>Configure Yaw</string> + </property> + </widget> + <widget class="QSlider" name="yawVizBar"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>150</x> + <y>170</y> + <width>160</width> + <height>16</height> + </rect> + </property> + <property name="minimum"> + <number>-30</number> + </property> + <property name="maximum"> + <number>30</number> + </property> + <property name="value"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + </widget> + <widget class="QSlider" name="thrustVizBar"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>220</x> + <y>190</y> + <width>16</width> + <height>160</height> + </rect> + </property> + <property name="maximum"> + <number>60000</number> + </property> + <property name="value"> + <number>50</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + <widget class="QSlider" name="pitchVizBar"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="geometry"> + <rect> + <x>780</x> + <y>180</y> + <width>16</width> + <height>160</height> + </rect> + </property> + <property name="minimum"> + <number>-20</number> + </property> + <property name="maximum"> + <number>20</number> + </property> + <property name="value"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + <widget class="QPushButton" name="pb_configThrust"> + <property name="geometry"> + <rect> + <x>250</x> + <y>260</y> + <width>141</width> + <height>25</height> + </rect> + </property> + <property name="text"> + <string>Configure Thrust</string> + </property> + </widget> + <widget class="QPushButton" name="pb_configPitch"> + <property name="geometry"> + <rect> + <x>810</x> + <y>250</y> + <width>141</width> + <height>25</height> + </rect> + </property> + <property name="text"> + <string>Configure Pitch</string> + </property> + </widget> + <widget class="QLabel" name="noGamepadWarning"> + <property name="geometry"> + <rect> + <x>360</x> + <y>10</y> + <width>381</width> + <height>61</height> + </rect> + </property> + <property name="font"> + <font> + <pointsize>20</pointsize> + </font> + </property> + <property name="text"> + <string>No Gamepad Detected</string> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + <widget class="QLabel" name="label_6"> + <property name="geometry"> + <rect> + <x>450</x> + <y>130</y> + <width>181</width> + <height>91</height> + </rect> + </property> + <property name="text"> + <string>Select the input to bind then move the joystick that will control that input</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> </widget> <widget class="QWidget" name="plots"> <attribute name="title"> @@ -345,6 +550,26 @@ <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> <layout class="QVBoxLayout" name="verticalLayout_4"> + <item> + <widget class="QRadioButton" name="rbManualSetpoint"> + <property name="text"> + <string>Manual Setpoint</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="rbGamepadControl"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="text"> + <string>Gamepad Control</string> + </property> + </widget> + </item> <item> <widget class="QLabel" name="label_1"> <property name="sizePolicy"> @@ -356,6 +581,9 @@ <property name="text"> <string>Send Position</string> </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> </widget> </item> <item> @@ -381,6 +609,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>0</string> + </property> </widget> </item> <item row="1" column="0"> @@ -401,6 +632,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>0</string> + </property> </widget> </item> <item row="2" column="0"> @@ -421,6 +655,50 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>0</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="tLabel"> + <property name="text"> + <string>Thrust</string> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QSlider" name="tActual"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>140</width> + <height>0</height> + </size> + </property> + <property name="toolTipDuration"> + <number>-1</number> + </property> + <property name="maximum"> + <number>60000</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval"> + <number>30000</number> + </property> </widget> </item> </layout> @@ -450,6 +728,9 @@ <property name="text"> <string>Send Rate</string> </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> </widget> </item> <item> @@ -475,6 +756,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>0</string> + </property> </widget> </item> <item row="1" column="0"> @@ -495,6 +779,9 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>0</string> + </property> </widget> </item> <item row="2" column="0"> @@ -515,51 +802,20 @@ <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>0</string> + </property> </widget> </item> - </layout> - </item> - <item> - <widget class="QPushButton" name="pbActualToSetpoint"> - <property name="text"> - <string>Send</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Send Thrust</string> - </property> - </widget> - </item> - <item> - <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="thrustLabel"> + <item row="3" column="0"> + <widget class="QLabel" name="tRateLabel"> <property name="text"> <string>Thrust</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="thrustActual"> + <item row="3" column="1"> + <widget class="QSlider" name="tActual_2"> <property name="enabled"> <bool>false</bool> </property> @@ -569,59 +825,30 @@ <verstretch>0</verstretch> </sizepolicy> </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QPushButton" name="sendThrustButton"> - <property name="text"> - <string>To Waypoint</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Send Thrust</string> - </property> - </widget> - </item> - <item> - <layout class="QFormLayout" name="formLayout"> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::ExpandingFieldsGrow</enum> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="thrustLabel"> - <property name="text"> - <string>Thrust</string> + <property name="minimumSize"> + <size> + <width>140</width> + <height>0</height> + </size> </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="thrustActual"> - <property name="enabled"> - <bool>false</bool> + <property name="maximum"> + <number>60000</number> </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::TicksBelow</enum> + </property> + <property name="tickInterval"> + <number>30000</number> </property> </widget> </item> </layout> </item> <item> - <widget class="QPushButton" name="sendThrustButton"> + <widget class="QPushButton" name="pbActualToSetpoint"> <property name="text"> <string>Send</string> </property> @@ -645,25 +872,8 @@ <property name="text"> <string>Current Position</string> </property> - </widget> - </item> - <item> - <widget class="Line" name="line_7"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Current Position</string> + <property name="alignment"> + <set>Qt::AlignCenter</set> </property> </widget> </item>