diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index c8039c505aad981431205a87c18af5375235c3a3..7920a4be679ef013ead3ae37f1513c55c0764207 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -957,6 +957,7 @@ bool MAVLinkSimulationLink::connect() start(LowPriority); MAVLinkSimulationMAV* mav1 = new MAVLinkSimulationMAV(this, 1); + MAVLinkSimulationMAV* mav3 = new MAVLinkSimulationMAV(this, 2); Q_UNUSED(mav1); // timer->start(rate); return true; diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 8e584e607a3095bb628de8c2441457cb9a59c6de..cf7f65b4891e69ebf0cedb5a359510bdd9129126 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -103,14 +103,15 @@ public: enum Airframe { QGC_AIRFRAME_GENERIC = 0, - QGC_AIRFRAME_EASYSTAR = 1, - QGC_AIRFRAME_TWINSTAR = 2, - QGC_AIRFRAME_MERLIN = 3, - QGC_AIRFRAME_CHEETAH = 4, - QGC_AIRFRAME_MIKROKOPTER = 5, - QGC_AIRFRAME_REAPER = 6, - QGC_AIRFRAME_PREDATOR = 7, - QGC_AIRFRAME_COAXIAL = 8 + QGC_AIRFRAME_EASYSTAR, + QGC_AIRFRAME_TWINSTAR, + QGC_AIRFRAME_MERLIN, + QGC_AIRFRAME_CHEETAH, + QGC_AIRFRAME_MIKROKOPTER, + QGC_AIRFRAME_REAPER, + QGC_AIRFRAME_PREDATOR, + QGC_AIRFRAME_COAXIAL, + QGC_AIRFRAME_PTERYX }; /** diff --git a/src/ui/DebugConsole.cc b/src/ui/DebugConsole.cc index 7c6c112a7ab5fbbc02b08a22179c65c6a47b51ac..820b7d3400954d68c100cfc7e89f4ccc8722f7a8 100644 --- a/src/ui/DebugConsole.cc +++ b/src/ui/DebugConsole.cc @@ -64,6 +64,8 @@ DebugConsole::DebugConsole(QWidget *parent) : m_ui->setupUi(this); // Hide sent text field - it is only useful after send has been hit m_ui->sentText->setVisible(false); + // Hide auto-send checkbox + m_ui->specialCheckBox->setVisible(false); // Make text area not editable m_ui->receiveText->setReadOnly(true); // Limit to 500 lines @@ -109,6 +111,8 @@ DebugConsole::DebugConsole(QWidget *parent) : connect(m_ui->connectButton, SIGNAL(clicked()), this, SLOT(handleConnectButton())); // Connect the special chars combo box connect(m_ui->addSymbolButton, SIGNAL(clicked()), this, SLOT(appendSpecialSymbol())); + // Connect Checkbox + connect(m_ui->specialComboBox, SIGNAL(highlighted(QString)), this, SLOT(specialSymbolSelected(QString))); hold(false); @@ -270,7 +274,7 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes) for (int j = 0; j < bytes.size(); j++) { unsigned char byte = bytes.at(j); - // Filter MAVLink (http://pixhawk.ethz.ch/mavlink) messages out of the stream. + // Filter MAVLink (http://pixhawk.ethz.ch/wiki/mavlink/) messages out of the stream. if (filterMAVLINK && bytes.size() > 1) { // Filtering is done by setting an ignore counter based on the MAVLINK packet length @@ -288,12 +292,13 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes) switch (byte) { // Catch line feed - case (unsigned char)'\n': - m_ui->receiveText->appendPlainText(str); - str = ""; - break; - // Catch carriage return - case (unsigned char)'\r': +// case (unsigned char)'\n': +// m_ui->receiveText->appendPlainText(str); +// str = ""; +// break; + // Catch carriage return and line feed + case (unsigned char)0xD: + case (unsigned char)0xA: // Ignore break; default: @@ -323,7 +328,7 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes) } } - m_ui->receiveText->appendPlainText(lineBuffer); + if (lineBuffer.length() > 0) m_ui->receiveText->appendPlainText(lineBuffer); lineBuffer.clear(); } @@ -376,6 +381,12 @@ QByteArray DebugConsole::symbolNameToBytes(const QString& text) return b; } +void DebugConsole::specialSymbolSelected(const QString& text) +{ + Q_UNUSED(text); + m_ui->specialCheckBox->setVisible(true); +} + void DebugConsole::appendSpecialSymbol(const QString& text) { QString line = m_ui->sendText->text(); @@ -415,6 +426,12 @@ void DebugConsole::sendBytes() return; } + // Append special symbol if checkbox is checked + if (m_ui->specialCheckBox->isChecked()) + { + appendSpecialSymbol(m_ui->specialComboBox->currentText()); + } + QByteArray transmit; QString feedback; bool ok = true; diff --git a/src/ui/DebugConsole.h b/src/ui/DebugConsole.h index db22a1af54a734e72af5b0bd40b74c6910aa3d69..a441d84f446466c7fea48481fa98598e4cdff6f3 100644 --- a/src/ui/DebugConsole.h +++ b/src/ui/DebugConsole.h @@ -87,6 +87,8 @@ public slots: void appendSpecialSymbol(const QString& text); /** @brief Append the special symbol currently selected in combo box */ void appendSpecialSymbol(); + /** @brief A new special symbol is selected */ + void specialSymbolSelected(const QString& text); protected slots: /** @brief Draw information overlay */ diff --git a/src/ui/DebugConsole.ui b/src/ui/DebugConsole.ui index bf7b09233812ab1b51f574c37bf5ba1dbcd721cf..bb32e331b16ab6ed5d4e99bbf7febc7f65513a32 100644 --- a/src/ui/DebugConsole.ui +++ b/src/ui/DebugConsole.ui @@ -6,7 +6,7 @@ 0 0 - 469 + 466 190 @@ -120,7 +120,7 @@ - + 5 @@ -204,6 +204,16 @@ + + + + Automatically send special char at end of message + + + Auto-Add + + + diff --git a/src/ui/UASView.ui b/src/ui/UASView.ui index 3daf1479f8828639fc603c6a837a745dc702e4e8..acdc5dbd6d702e3bfec9f0d81b77e843f62b3813 100644 --- a/src/ui/UASView.ui +++ b/src/ui/UASView.ui @@ -6,12 +6,12 @@ 0 0 - 310 + 260 111 - + 0 0 @@ -22,6 +22,12 @@ 0 + + + 360 + 16777215 + + Form diff --git a/src/ui/designer/QGCToolWidget.cc b/src/ui/designer/QGCToolWidget.cc index 9dc23f98bac27734eb52facb841a61ea057123db..dad5c8a3fbbeb3953b66b90f62bc96e00f5a2362 100644 --- a/src/ui/designer/QGCToolWidget.cc +++ b/src/ui/designer/QGCToolWidget.cc @@ -221,6 +221,7 @@ void QGCToolWidget::addParam() if (ui->hintLabel) { ui->hintLabel->deleteLater(); + ui->hintLabel = NULL; } toolLayout->addWidget(slider); slider->startEditMode(); @@ -232,6 +233,7 @@ void QGCToolWidget::addAction() if (ui->hintLabel) { ui->hintLabel->deleteLater(); + ui->hintLabel = NULL; } toolLayout->addWidget(button); button->startEditMode(); @@ -242,6 +244,7 @@ void QGCToolWidget::addToolWidget(QGCToolWidgetItem* widget) if (ui->hintLabel) { ui->hintLabel->deleteLater(); + ui->hintLabel = NULL; } toolLayout->addWidget(widget); } diff --git a/src/ui/map/MAV2DIcon.cc b/src/ui/map/MAV2DIcon.cc index 1e2dc7651b1e5f6653b21747955202445008b9fa..18440d69719dbaec57658f31f865d430760d3365 100644 --- a/src/ui/map/MAV2DIcon.cc +++ b/src/ui/map/MAV2DIcon.cc @@ -191,6 +191,7 @@ void MAV2DIcon::drawIcon(QPen* pen) case UASInterface::QGC_AIRFRAME_EASYSTAR: case UASInterface::QGC_AIRFRAME_MERLIN: case UASInterface::QGC_AIRFRAME_TWINSTAR: + case UASInterface::QGC_AIRFRAME_PTERYX: { // DRAW AIRPLANE diff --git a/src/ui/uas/UASView.cc b/src/ui/uas/UASView.cc index bcde6a526c7c9c4727322e340b9c74ad4b62b12f..59de83d6a739b1289fbfc4d1a295a4c933e0d399 100644 --- a/src/ui/uas/UASView.cc +++ b/src/ui/uas/UASView.cc @@ -452,7 +452,8 @@ void UASView::selectAirframe() << "Mikrokopter" << "Reaper" << "Predator" - << "Coaxial"; + << "Coaxial" + << "Pteryx"; bool ok; QString item = QInputDialog::getItem(this, tr("Select Airframe for %1").arg(uas->getUASName()),