From ff429fd3599e498ed75aff65980d18bd20200318 Mon Sep 17 00:00:00 2001 From: EllissaPeterson <ellissa@iastate.edu> Date: Mon, 21 Feb 2022 12:28:40 -0600 Subject: [PATCH] Rough edits for new ground station gui --- groundStation/gui/MicroCART/mainwindow.cpp | 406 +++++----- groundStation/gui/MicroCART/mainwindow.h | 5 - groundStation/gui/MicroCART/mainwindow.ui | 841 +-------------------- 3 files changed, 217 insertions(+), 1035 deletions(-) diff --git a/groundStation/gui/MicroCART/mainwindow.cpp b/groundStation/gui/MicroCART/mainwindow.cpp index ca0d2ee6f..2e1d3381e 100644 --- a/groundStation/gui/MicroCART/mainwindow.cpp +++ b/groundStation/gui/MicroCART/mainwindow.cpp @@ -36,7 +36,7 @@ MainWindow::MainWindow(QWidget *parent) : ui->setupUi(this); QGraphicsScene *posScene = new QGraphicsScene(this); - ui->posView->setScene(posScene); + // ui->posView->setScene(posScene); QuadItem * posIndicator = new QuadItem(); posScene->addItem(posIndicator); @@ -85,8 +85,8 @@ MainWindow::MainWindow(QWidget *parent) : connect(controlWorker, SIGNAL (paramSet(QString, QString)), controlWorker, SLOT (getParamValue(QString, QString))); /* Signals to control worker */ - connect(ui->pbControlRefresh, SIGNAL (clicked()), controlWorker, SLOT (getNodes())); - connect(ui->nodeSelect, SIGNAL (currentIndexChanged(QString)), controlWorker, SLOT (getParams(QString))); + // connect(ui->pbControlRefresh, SIGNAL (clicked()), controlWorker, SLOT (getNodes())); + // connect(ui->nodeSelect, SIGNAL (currentIndexChanged(QString)), controlWorker, SLOT (getParams(QString))); connect(this, SIGNAL (getParamValue(QString, QString)), controlWorker, SLOT (getParamValue(QString, QString))); connect(this, SIGNAL (setParamValue(QString, QString, float)), controlWorker, SLOT (setParamValue(QString, QString, float))); connect(this, SIGNAL (getNodeOutput(QString)), controlWorker, SLOT (getNodeOutput(QString))); @@ -113,7 +113,7 @@ MainWindow::MainWindow(QWidget *parent) : /* Connect refresh button and refresh timer to tracker worker */ connect(trackerTimer, SIGNAL(timeout()), this, SLOT(updatePosAtt())); - connect(ui->pbRefresh, SIGNAL (clicked()), this, SLOT (updatePosAtt())); + // connect(ui->pbRefresh, SIGNAL (clicked()), this, SLOT (updatePosAtt())); connect(this, SIGNAL(getPosAttFromBackend()), trackerWorker, SLOT(process())); @@ -128,11 +128,11 @@ MainWindow::MainWindow(QWidget *parent) : matlabProcess->start(); /* Connect the setpointlist to the model */ - ui->setpointList->setModel(setpointList); + // ui->setpointList->setModel(setpointList); /* Connect various things that can result in sending setpoints */ - connect(ui->pbSendSetpoint, SIGNAL (clicked()), this, SLOT (sendSetpoints())); - connect(ui->setpointList, SIGNAL (doubleClicked(QModelIndex)), this, SLOT (sendSelectedSetpoint())); + // connect(ui->pbSendSetpoint, SIGNAL (clicked()), this, SLOT (sendSetpoints())); + // connect(ui->setpointList, SIGNAL (doubleClicked(QModelIndex)), this, SLOT (sendSelectedSetpoint())); /* Populate scripts list */ QDir scriptsDir("scripts/"); @@ -165,16 +165,12 @@ void MainWindow::on_run_data_analysis_button_clicked() void MainWindow::updatePosAtt() { - if (ui->posattSrcVrpn->isChecked()) { - emit(getPosAttFromBackend()); - } else if (ui->posattSrcQuad->isChecked()) { - emit(getNodeOutput(ui->xPositionSelect->currentText())); - emit(getNodeOutput(ui->yPositionSelect->currentText())); - emit(getNodeOutput(ui->zPositionSelect->currentText())); - emit(getNodeOutput(ui->pAttitudeSelect->currentText())); - emit(getNodeOutput(ui->rAttitudeSelect->currentText())); - emit(getNodeOutput(ui->yAttitudeSelect->currentText())); - } + // emit(getNodeOutput(ui->xPositionSelect->currentText())); + // emit(getNodeOutput(ui->yPositionSelect->currentText())); + // emit(getNodeOutput(ui->zPositionSelect->currentText())); + // emit(getNodeOutput(ui->pAttitudeSelect->currentText())); + // emit(getNodeOutput(ui->rAttitudeSelect->currentText())); + // emit(getNodeOutput(ui->yAttitudeSelect->currentText())); } void MainWindow::updateTracker(float x, float y, float z, float p, float r, float yaw) @@ -188,12 +184,12 @@ void MainWindow::updateTracker(float x, float y, float z, float p, float r, floa float dist = sqrt(pow(x - sp_x, 2.0) + pow(y - sp_y, 2.0) + pow(z - sp_z, 2.0)); - ui->dist->setText(QString::number(dist)); + // ui->dist->setText(QString::number(dist)); - if (!nextSpTimer->isActive() && ui->autonavEnabled->isChecked() && - (dist < ui->autonavThreshold->text().toFloat())) { - nextSpTimer->start(ui->autonavDelay->text().toInt()); - } + // if (!nextSpTimer->isActive() && ui->autonavEnabled->isChecked() && + // (dist < ui->autonavThreshold->text().toFloat())) { + // nextSpTimer->start(ui->autonavDelay->text().toInt()); + // } } void MainWindow::on_pbStart_clicked() @@ -269,224 +265,224 @@ void MainWindow::on_chooseBackend_clicked() void MainWindow::newNodes(QStringList blocks) { - QComboBox * select = ui->nodeSelect; - select->clear(); - select->addItems(blocks); + // QComboBox * select = ui->nodeSelect; + // select->clear(); + // select->addItems(blocks); - this->ui->noGraphWarning1->setVisible(false); - this->ui->noGraphWarning2->setVisible(false); - this->ui->noGraphWarningLine->setVisible(false); + // this->ui->noGraphWarning1->setVisible(false); + // this->ui->noGraphWarning2->setVisible(false); + // this->ui->noGraphWarningLine->setVisible(false); } void MainWindow::newConstantBlocks(QStringList blocks) { - ui->xSetpointSelect->clear(); - ui->xSetpointSelect->addItems(blocks); + // ui->xSetpointSelect->clear(); + // ui->xSetpointSelect->addItems(blocks); - ui->ySetpointSelect->clear(); - ui->ySetpointSelect->addItems(blocks); + // ui->ySetpointSelect->clear(); + // ui->ySetpointSelect->addItems(blocks); - ui->zSetpointSelect->clear(); - ui->zSetpointSelect->addItems(blocks); + // ui->zSetpointSelect->clear(); + // ui->zSetpointSelect->addItems(blocks); - ui->yawSetpointSelect->clear(); - ui->yawSetpointSelect->addItems(blocks); + // ui->yawSetpointSelect->clear(); + // ui->yawSetpointSelect->addItems(blocks); - ui->xPositionSelect->clear(); - ui->xPositionSelect->addItems(blocks); + // ui->xPositionSelect->clear(); + // ui->xPositionSelect->addItems(blocks); - ui->yPositionSelect->clear(); - ui->yPositionSelect->addItems(blocks); + // ui->yPositionSelect->clear(); + // ui->yPositionSelect->addItems(blocks); - ui->zPositionSelect->clear(); - ui->zPositionSelect->addItems(blocks); + // ui->zPositionSelect->clear(); + // ui->zPositionSelect->addItems(blocks); - ui->pAttitudeSelect->clear(); - ui->pAttitudeSelect->addItems(blocks); + // ui->pAttitudeSelect->clear(); + // ui->pAttitudeSelect->addItems(blocks); - ui->rAttitudeSelect->clear(); - ui->rAttitudeSelect->addItems(blocks); + // ui->rAttitudeSelect->clear(); + // ui->rAttitudeSelect->addItems(blocks); - ui->yAttitudeSelect->clear(); - ui->yAttitudeSelect->addItems(blocks); + // ui->yAttitudeSelect->clear(); + // ui->yAttitudeSelect->addItems(blocks); - for (ssize_t i = 0; i < blocks.size(); i++) { - if (blocks[i].contains("setpoint", Qt::CaseInsensitive) || blocks[i].contains("sp", Qt::CaseInsensitive)) { - if (blocks[i].contains("x ", Qt::CaseInsensitive)) { - ui->xSetpointSelect->setCurrentIndex(i); - } - if (blocks[i].contains("y ", Qt::CaseInsensitive)) { - ui->ySetpointSelect->setCurrentIndex(i); - } - if (blocks[i].contains("z ", Qt::CaseInsensitive) || blocks[i].contains("alt", Qt::CaseInsensitive)) { - ui->zSetpointSelect->setCurrentIndex(i); - } - if (blocks[i].contains("yaw", Qt::CaseInsensitive) || blocks[i].contains("alt", Qt::CaseInsensitive)) { - ui->yawSetpointSelect->setCurrentIndex(i); - } - } + // for (ssize_t i = 0; i < blocks.size(); i++) { + // if (blocks[i].contains("setpoint", Qt::CaseInsensitive) || blocks[i].contains("sp", Qt::CaseInsensitive)) { + // if (blocks[i].contains("x ", Qt::CaseInsensitive)) { + // ui->xSetpointSelect->setCurrentIndex(i); + // } + // if (blocks[i].contains("y ", Qt::CaseInsensitive)) { + // ui->ySetpointSelect->setCurrentIndex(i); + // } + // if (blocks[i].contains("z ", Qt::CaseInsensitive) || blocks[i].contains("alt", Qt::CaseInsensitive)) { + // ui->zSetpointSelect->setCurrentIndex(i); + // } + // if (blocks[i].contains("yaw", Qt::CaseInsensitive) || blocks[i].contains("alt", Qt::CaseInsensitive)) { + // ui->yawSetpointSelect->setCurrentIndex(i); + // } + // } - if (blocks[i] == QString("Pitch")) { - ui->pAttitudeSelect->setCurrentIndex(i); - } + // if (blocks[i] == QString("Pitch")) { + // ui->pAttitudeSelect->setCurrentIndex(i); + // } - if (blocks[i] == QString("Roll")) { - ui->rAttitudeSelect->setCurrentIndex(i); - } + // if (blocks[i] == QString("Roll")) { + // ui->rAttitudeSelect->setCurrentIndex(i); + // } - if (blocks[i] == QString("Yaw")) { - ui->yAttitudeSelect->setCurrentIndex(i); - } + // if (blocks[i] == QString("Yaw")) { + // ui->yAttitudeSelect->setCurrentIndex(i); + // } - if (blocks[i] == QString("Lidar")) { - ui->zPositionSelect->setCurrentIndex(i); - } + // if (blocks[i] == QString("Lidar")) { + // ui->zPositionSelect->setCurrentIndex(i); + // } - if (blocks[i] == QString("OF X Trim Add")) { - ui->xPositionSelect->setCurrentIndex(i); - } + // if (blocks[i] == QString("OF X Trim Add")) { + // ui->xPositionSelect->setCurrentIndex(i); + // } - if (blocks[i] == QString("OF Y Trim Add")) { - ui->yPositionSelect->setCurrentIndex(i); - } - } + // if (blocks[i] == QString("OF Y Trim Add")) { + // ui->yPositionSelect->setCurrentIndex(i); + // } + // } } void MainWindow::newNodeOutput(QString node, float val) { - /* Update the nav page if quad is set as the source for pos/att */ - if (node == ui->xPositionSelect->currentText()) { - ui->xActual->setText(QString::number(val)); - } else if (node == ui->yPositionSelect->currentText()) { - ui->yActual->setText(QString::number(val)); - } else if (node == ui->zPositionSelect->currentText()) { - ui->zActual->setText(QString::number(val)); - } else if (node == ui->pAttitudeSelect->currentText()) { - ui->pitchActual->setText(QString::number(val)); - } else if (node == ui->rAttitudeSelect->currentText()) { - ui->rollActual->setText(QString::number(val)); - } else if (node == ui->yAttitudeSelect->currentText()) { - ui->yawActual->setText(QString::number(val)); - } + // /* Update the nav page if quad is set as the source for pos/att */ + // if (node == ui->xPositionSelect->currentText()) { + // ui->xActual->setText(QString::number(val)); + // } else if (node == ui->yPositionSelect->currentText()) { + // ui->yActual->setText(QString::number(val)); + // } else if (node == ui->zPositionSelect->currentText()) { + // ui->zActual->setText(QString::number(val)); + // } else if (node == ui->pAttitudeSelect->currentText()) { + // ui->pitchActual->setText(QString::number(val)); + // } else if (node == ui->rAttitudeSelect->currentText()) { + // ui->rollActual->setText(QString::number(val)); + // } else if (node == ui->yAttitudeSelect->currentText()) { + // ui->yawActual->setText(QString::number(val)); + // } } void MainWindow::newParams(QStringList params) { - QComboBox * select = ui->paramSelect; - select->clear(); - select->addItems(params); + // QComboBox * select = ui->paramSelect; + // select->clear(); + // select->addItems(params); } void MainWindow::newParamValue(QString node, QString param, float val) { - ui->paramValue->setText(QString::number(val)); + // ui->paramValue->setText(QString::number(val)); - /* Update the nav page setpoints if it's a setpoint paramvalue */ - if (node == ui->xSetpointSelect->currentText()) { - ui->xSetpoint->setText(QString::number(val)); - } else if (node == ui->ySetpointSelect->currentText()) { - ui->ySetpoint->setText(QString::number(val)); - } else if (node == ui->zSetpointSelect->currentText()) { - ui->zSetpoint->setText(QString::number(val)); - } + // /* Update the nav page setpoints if it's a setpoint paramvalue */ + // if (node == ui->xSetpointSelect->currentText()) { + // ui->xSetpoint->setText(QString::number(val)); + // } else if (node == ui->ySetpointSelect->currentText()) { + // ui->ySetpoint->setText(QString::number(val)); + // } else if (node == ui->zSetpointSelect->currentText()) { + // ui->zSetpoint->setText(QString::number(val)); + // } } void MainWindow::on_paramSelect_currentIndexChanged(const QString &arg1) { - emit(getParamValue(ui->nodeSelect->currentText(), arg1)); + // emit(getParamValue(ui->nodeSelect->currentText(), arg1)); } void MainWindow::on_paramValue_returnPressed() { - emit (setParamValue(ui->nodeSelect->currentText(), - ui->paramSelect->currentText(), - ui->paramValue->text().toFloat())); + // emit (setParamValue(ui->nodeSelect->currentText(), + // ui->paramSelect->currentText(), + // ui->paramValue->text().toFloat())); } void MainWindow::sendSetpoints() { - if (ui->sendX->isChecked()) { - sp_x = ui->xSetpoint->text().toFloat(); - emit (setParamValue(ui->xSetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], sp_x)); - } + // if (ui->sendX->isChecked()) { + // sp_x = ui->xSetpoint->text().toFloat(); + // emit (setParamValue(ui->xSetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], sp_x)); + // } - if (ui->sendY->isChecked()) { - sp_y = ui->ySetpoint->text().toFloat(); - emit (setParamValue(ui->ySetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], sp_y)); - } + // if (ui->sendY->isChecked()) { + // sp_y = ui->ySetpoint->text().toFloat(); + // emit (setParamValue(ui->ySetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], sp_y)); + // } - if (ui->sendZ->isChecked()) { - sp_z = ui->zSetpoint->text().toFloat(); - emit (setParamValue(ui->zSetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], sp_z)); - } + // if (ui->sendZ->isChecked()) { + // sp_z = ui->zSetpoint->text().toFloat(); + // emit (setParamValue(ui->zSetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], sp_z)); + // } - if (ui->sendYaw->isChecked()) { - emit (setParamValue(ui->yawSetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], - ui->yawSetpoint->text().toFloat())); - } + // if (ui->sendYaw->isChecked()) { + // emit (setParamValue(ui->yawSetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], + // ui->yawSetpoint->text().toFloat())); + // } } void MainWindow::on_pbAppendSetpoint_clicked() { - QString str("[" + ui->xSetpoint->text() + ", "+ - ui->ySetpoint->text() + ", " + - ui->zSetpoint->text() + ", " + - ui->yawSetpoint->text() + "]"); + // QString str("[" + ui->xSetpoint->text() + ", "+ + // ui->ySetpoint->text() + ", " + + // ui->zSetpoint->text() + ", " + + // ui->yawSetpoint->text() + "]"); - setpointList->appendRow(new QStandardItem(str)); + // setpointList->appendRow(new QStandardItem(str)); } void MainWindow::on_pbNextSetpoint_clicked() { - QListView * listView = ui->setpointList; - if (listView->currentIndex().isValid() && setpointList->index(listView->currentIndex().row() + 1, 0).isValid()) { - listView->setCurrentIndex(setpointList->index(listView->currentIndex().row() + 1, 0)); - } else { - listView->setCurrentIndex(setpointList->index(0, 0)); - } - sendSelectedSetpoint(); + // QListView * listView = ui->setpointList; + // if (listView->currentIndex().isValid() && setpointList->index(listView->currentIndex().row() + 1, 0).isValid()) { + // listView->setCurrentIndex(setpointList->index(listView->currentIndex().row() + 1, 0)); + // } else { + // listView->setCurrentIndex(setpointList->index(0, 0)); + // } + // sendSelectedSetpoint(); } void MainWindow::sendSelectedSetpoint() { - if (ui->setpointList->currentIndex().isValid()) { - QRegExp regex("\\[(.*), (.*), (.*), (.*)\\]"); - int row = ui->setpointList->currentIndex().row(); + // if (ui->setpointList->currentIndex().isValid()) { + // QRegExp regex("\\[(.*), (.*), (.*), (.*)\\]"); + // int row = ui->setpointList->currentIndex().row(); - regex.indexIn(setpointList->item(row)->text()); - ui->xSetpoint->setText(regex.cap(1)); - ui->ySetpoint->setText(regex.cap(2)); - ui->zSetpoint->setText(regex.cap(3)); - ui->yawSetpoint->setText(regex.cap(4)); + // regex.indexIn(setpointList->item(row)->text()); + // ui->xSetpoint->setText(regex.cap(1)); + // ui->ySetpoint->setText(regex.cap(2)); + // ui->zSetpoint->setText(regex.cap(3)); + // ui->yawSetpoint->setText(regex.cap(4)); - sendSetpoints(); - } + // sendSetpoints(); + // } } void MainWindow::on_pbActualToSetpoint_clicked() { - ui->xSetpoint->setText(ui->xActual->text()); - ui->ySetpoint->setText(ui->yActual->text()); - ui->zSetpoint->setText(ui->zActual->text()); - ui->yawSetpoint->setText(ui->yawActual->text()); + // ui->xSetpoint->setText(ui->xActual->text()); + // ui->ySetpoint->setText(ui->yActual->text()); + // ui->zSetpoint->setText(ui->zActual->text()); + // ui->yawSetpoint->setText(ui->yawActual->text()); } void MainWindow::on_pbDeleteSetpoint_clicked() { - if (ui->setpointList->currentIndex().isValid()) { - setpointList->removeRow(ui->setpointList->currentIndex().row()); - } + // if (ui->setpointList->currentIndex().isValid()) { + // setpointList->removeRow(ui->setpointList->currentIndex().row()); + // } } -void MainWindow::newControlGraph(QString graph) -{ - ui->graphImage->setPixmap(QPixmap(graph)); -} +// void MainWindow::newControlGraph(QString graph) +// { +// ui->graphImage->setPixmap(QPixmap(graph)); +// } void MainWindow::on_pbActualToWaypoint_clicked() { @@ -500,38 +496,38 @@ void MainWindow::on_pbActualToWaypoint_clicked() void MainWindow::on_pbMoveUp_clicked() { - if (ui->setpointList->currentIndex().isValid()) { - int current = ui->setpointList->currentIndex().row(); - if (current > 0) { - setpointList->insertRow(current - 1, setpointList->takeItem(current)); - setpointList->removeRow(current + 1); - } - } + // if (ui->setpointList->currentIndex().isValid()) { + // int current = ui->setpointList->currentIndex().row(); + // if (current > 0) { + // setpointList->insertRow(current - 1, setpointList->takeItem(current)); + // setpointList->removeRow(current + 1); + // } + // } } void MainWindow::on_pbMoveDown_clicked() { - if (ui->setpointList->currentIndex().isValid()) { - int current = ui->setpointList->currentIndex().row(); - if (current < (setpointList->rowCount() - 1)) { - setpointList->insertRow(current + 2, setpointList->takeItem(current)); - setpointList->removeRow(current); - } - } + // if (ui->setpointList->currentIndex().isValid()) { + // int current = ui->setpointList->currentIndex().row(); + // if (current < (setpointList->rowCount() - 1)) { + // setpointList->insertRow(current + 2, setpointList->takeItem(current)); + // setpointList->removeRow(current); + // } + // } } void MainWindow::on_pbInsertSetpoint_clicked() { - int current = 0; - if (ui->setpointList->currentIndex().isValid()) { - current = ui->setpointList->currentIndex().row(); - } + // int current = 0; + // if (ui->setpointList->currentIndex().isValid()) { + // current = ui->setpointList->currentIndex().row(); + // } - QString str("[" + ui->xSetpoint->text() + ", "+ - ui->ySetpoint->text() + ", " + - ui->zSetpoint->text() + ", " + - ui->yawSetpoint->text() + "]"); - setpointList->insertRow(current, new QStandardItem(str)); + // QString str("[" + ui->xSetpoint->text() + ", "+ + // ui->ySetpoint->text() + ", " + + // ui->zSetpoint->text() + ", " + + // ui->yawSetpoint->text() + "]"); + // setpointList->insertRow(current, new QStandardItem(str)); } void MainWindow::on_pbSaveWaypoints_clicked() @@ -575,38 +571,28 @@ void MainWindow::on_pbLoadWaypoints_clicked() void MainWindow::on_xSetpoint_returnPressed() { - sp_x = ui->xSetpoint->text().toFloat(); - emit (setParamValue(ui->xSetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], sp_x)); + // sp_x = ui->xSetpoint->text().toFloat(); + // emit (setParamValue(ui->xSetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], sp_x)); } void MainWindow::on_ySetpoint_returnPressed() { - sp_y = ui->ySetpoint->text().toFloat(); - emit (setParamValue(ui->ySetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], sp_y)); + // sp_y = ui->ySetpoint->text().toFloat(); + // emit (setParamValue(ui->ySetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], sp_y)); } void MainWindow::on_zSetpoint_returnPressed() { - sp_z = ui->zSetpoint->text().toFloat(); - emit (setParamValue(ui->zSetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], sp_z)); + // sp_z = ui->zSetpoint->text().toFloat(); + // emit (setParamValue(ui->zSetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], sp_z)); } void MainWindow::on_yawSetpoint_returnPressed() { - emit (setParamValue(ui->yawSetpointSelect->currentText(), - blockDefs[BLOCK_CONSTANT]->param_names[0], - ui->yawSetpoint->text().toFloat())); -} - -void MainWindow::on_posattSrcVrpn_clicked() -{ - trackerTimer->setInterval(100); -} - -void MainWindow::on_posattSrcQuad_clicked() -{ - trackerTimer->setInterval(750); + // emit (setParamValue(ui->yawSetpointSelect->currentText(), + // blockDefs[BLOCK_CONSTANT]->param_names[0], + // ui->yawSetpoint->text().toFloat())); } diff --git a/groundStation/gui/MicroCART/mainwindow.h b/groundStation/gui/MicroCART/mainwindow.h index 3ad5ed1da..4e24931aa 100644 --- a/groundStation/gui/MicroCART/mainwindow.h +++ b/groundStation/gui/MicroCART/mainwindow.h @@ -45,7 +45,6 @@ private slots: void newParamValue(QString node, QString param, float val); void newNodeOutput(QString node, float output); void newConstantBlocks(QStringList blocks); - void newControlGraph(QString graph); void on_paramSelect_currentIndexChanged(const QString &arg1); @@ -82,10 +81,6 @@ private slots: void on_zSetpoint_returnPressed(); - void on_posattSrcVrpn_clicked(); - - void on_posattSrcQuad_clicked(); - void on_yawSetpoint_returnPressed(); void backendStarted(); diff --git a/groundStation/gui/MicroCART/mainwindow.ui b/groundStation/gui/MicroCART/mainwindow.ui index 17c9cd8d6..ffddb703d 100644 --- a/groundStation/gui/MicroCART/mainwindow.ui +++ b/groundStation/gui/MicroCART/mainwindow.ui @@ -115,402 +115,26 @@ </item> </layout> </widget> - <widget class="QWidget" name="controlGraph"> + <widget class="QWidget" name="param"> <attribute name="title"> - <string>Controller Graph</string> + <string>Param</string> + </attribute> + </widget> + <widget class="QWidget" name="controller"> + <attribute name="title"> + <string>Controller</string> + </attribute> + </widget> + <widget class="QWidget" name="plots"> + <attribute name="title"> + <string>Plots</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="widgetResizable"> - <bool>true</bool> - </property> - <widget class="QWidget" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>1144</width> - <height>679</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QLabel" name="graphImage"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>32</pointsize> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <widget class="Line" name="line_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbControlRefresh"> - <property name="text"> - <string>Refresh Controller Graph</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Node:</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="nodeSelect"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Param:</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="paramSelect"/> - </item> - <item> - <widget class="QLineEdit" name="paramValue"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QLabel" name="label_4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>X Setpoint</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="xSetpointSelect"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Y Setpoint</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="ySetpointSelect"/> - </item> - <item> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Z Setpoint</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="zSetpointSelect"/> - </item> - <item> - <widget class="QLabel" name="label_18"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Yaw Setpoint:</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="yawSetpointSelect"/> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QLabel" name="label_11"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>X Position</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="xPositionSelect"/> - </item> - <item> - <widget class="QLabel" name="label_13"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Y Position </string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="yPositionSelect"/> - </item> - <item> - <widget class="QLabel" name="label_14"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Z Position</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="zPositionSelect"/> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_11"> - <item> - <widget class="QLabel" name="label_15"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>P Attitude</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="pAttitudeSelect"/> - </item> - <item> - <widget class="QLabel" name="label_16"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>R Attitude</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="rAttitudeSelect"/> - </item> - <item> - <widget class="QLabel" name="label_17"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Y Attitude</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="yAttitudeSelect"/> - </item> - </layout> - </item> - </layout> </widget> <widget class="QWidget" name="navigation"> <attribute name="title"> <string>Navigation</string> </attribute> <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QLabel" name="noGraphWarning1"> - <property name="font"> - <font> - <pointsize>32</pointsize> - <weight>75</weight> - <bold>true</bold> - <underline>true</underline> - </font> - </property> - <property name="styleSheet"> - <string notr="true">QLabel {color : red; }</string> - </property> - <property name="text"> - <string>NO CONTROL GRAPH LOADED!</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="noGraphWarning2"> - <property name="text"> - <string>These controls won't work right unless the correct control graph is loaded.</string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item> - <widget class="Line" name="noGraphWarningLine"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <item> - <widget class="QLabel" name="label_12"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Position/Attitude Source: </string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="posattSrcVrpn"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Backend Tracker (&VRPN)</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="posattSrcQuad"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>From &Quad</string> - </property> - </widget> - </item> - </layout> - </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> @@ -524,7 +148,7 @@ </sizepolicy> </property> <property name="text"> - <string>Current Position</string> + <string>Send Position</string> </property> </widget> </item> @@ -536,7 +160,7 @@ <item row="0" column="0"> <widget class="QLabel" name="xLabel"> <property name="text"> - <string>X</string> + <string>P</string> </property> </widget> </item> @@ -556,7 +180,7 @@ <item row="1" column="0"> <widget class="QLabel" name="yLabel"> <property name="text"> - <string>Y</string> + <string>R</string> </property> </widget> </item> @@ -576,7 +200,7 @@ <item row="2" column="0"> <widget class="QLabel" name="zLabel"> <property name="text"> - <string>Z</string> + <string>Y</string> </property> </widget> </item> @@ -596,7 +220,7 @@ <item row="3" column="0"> <widget class="QLabel" name="pLabel"> <property name="text"> - <string>P</string> + <string>P Rate</string> </property> </widget> </item> @@ -616,7 +240,7 @@ <item row="4" column="0"> <widget class="QLabel" name="rLabel"> <property name="text"> - <string>R</string> + <string>R Rate</string> </property> </widget> </item> @@ -636,7 +260,7 @@ <item row="5" column="0"> <widget class="QLabel" name="yLabel_2"> <property name="text"> - <string>Y</string> + <string>Y Rate</string> </property> </widget> </item> @@ -662,422 +286,24 @@ </property> </widget> </item> - <item> - <layout class="QFormLayout" name="formLayout_5"> - <item row="0" column="1"> - <widget class="QLineEdit" name="dist"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="label_10"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>D</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_5"/> - </item> <item> <widget class="QPushButton" name="pbActualToSetpoint"> <property name="text"> - <string>To Setpoint</string> + <string>Send</string> </property> </widget> </item> <item> <widget class="QPushButton" name="pbActualToWaypoint"> <property name="text"> - <string>To Waypoint</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_4"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QLabel" name="label_7"> - <property name="text"> - <string>Position Setpoints</string> - </property> - </widget> - </item> - <item> - <layout class="QFormLayout" name="formLayout_2"> - <item row="0" column="0"> - <widget class="QLabel" name="setpointLabel"> - <property name="text"> - <string>X</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="setpointLabel_3"> - <property name="text"> - <string>Z</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="setpointLabel_2"> - <property name="text"> - <string>Y</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="yawLabel"> - <property name="text"> - <string>Yaw</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_12"> - <item> - <widget class="QLineEdit" name="xSetpoint"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="sendX"> - <property name="text"> - <string/> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_13"> - <item> - <widget class="QLineEdit" name="ySetpoint"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="sendY"> - <property name="text"> - <string/> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_14"> - <item> - <widget class="QLineEdit" name="zSetpoint"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="sendZ"> - <property name="text"> - <string/> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </item> - <item row="3" column="1"> - <layout class="QHBoxLayout" name="horizontalLayout_15"> - <item> - <widget class="QLineEdit" name="yawSetpoint"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="sendYaw"> - <property name="text"> - <string/> - </property> - <property name="checked"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <widget class="QPushButton" name="pbSendSetpoint"> - <property name="text"> - <string>Send to Quad</string> - </property> - </widget> - </item> - <item> - <widget class="Line" name="line_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbAppendSetpoint"> - <property name="text"> - <string>Append</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbInsertSetpoint"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="text"> - <string>Insert</string> + <string>Send</string> </property> </widget> </item> - <item> - <widget class="QPushButton" name="pbDeleteSetpoint"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="text"> - <string>Delete</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QLabel" name="label_8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Waypoints</string> - </property> - </widget> - </item> - <item> - <widget class="QListView" name="setpointList"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="editTriggers"> - <set>QAbstractItemView::NoEditTriggers</set> - </property> - <property name="dragEnabled"> - <bool>false</bool> - </property> - <property name="dragDropOverwriteMode"> - <bool>false</bool> - </property> - <property name="dragDropMode"> - <enum>QAbstractItemView::NoDragDrop</enum> - </property> - <property name="defaultDropAction"> - <enum>Qt::MoveAction</enum> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbNextSetpoint"> - <property name="text"> - <string>Send Next</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QPushButton" name="pbMoveUp"> - <property name="text"> - <string>Move Up</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbMoveDown"> - <property name="text"> - <string>Move Down</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QPushButton" name="pbSaveWaypoints"> - <property name="text"> - <string>Save</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pbLoadWaypoints"> - <property name="text"> - <string>Load</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="Line" name="line_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="autonavEnabled"> - <property name="text"> - <string>Enable Autonavigation</string> - </property> - </widget> - </item> - <item> - <layout class="QFormLayout" name="formLayout_6"> - <item row="0" column="0"> - <widget class="QLabel" name="label_9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Threshold</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="delayLabel"> - <property name="text"> - <string>Delay</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="autonavThreshold"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>0.1</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="autonavDelay"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>88</string> - </property> - </widget> - </item> - </layout> - </item> </layout> </item> <item> <layout class="QVBoxLayout" name="verticalLayout_9"> - <item> - <widget class="QGraphicsView" name="posView"> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - </widget> - </item> <item> <widget class="QGraphicsView" name="attView"/> </item> @@ -1085,33 +311,8 @@ </item> </layout> </item> - <item> - <widget class="QPushButton" name="pbRefresh"> - <property name="text"> - <string>Refresh</string> - </property> - </widget> - </item> </layout> </widget> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>Flight Data</string> - </attribute> - <widget class="QPushButton" name="run_data_analysis_button"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>1141</width> - <height>28</height> - </rect> - </property> - <property name="text"> - <string>Run Data Analysis (Will Open Separate Window)</string> - </property> - </widget> - </widget> </widget> </item> </layout> -- GitLab