Commit 5dcdc1ec authored by lm's avatar lm

Fixed CRLF, fixed some graphic issues, improved other minor things

parent fc44c0c2
...@@ -957,6 +957,7 @@ bool MAVLinkSimulationLink::connect() ...@@ -957,6 +957,7 @@ bool MAVLinkSimulationLink::connect()
start(LowPriority); start(LowPriority);
MAVLinkSimulationMAV* mav1 = new MAVLinkSimulationMAV(this, 1); MAVLinkSimulationMAV* mav1 = new MAVLinkSimulationMAV(this, 1);
MAVLinkSimulationMAV* mav3 = new MAVLinkSimulationMAV(this, 2);
Q_UNUSED(mav1); Q_UNUSED(mav1);
// timer->start(rate); // timer->start(rate);
return true; return true;
......
...@@ -103,14 +103,15 @@ public: ...@@ -103,14 +103,15 @@ public:
enum Airframe { enum Airframe {
QGC_AIRFRAME_GENERIC = 0, QGC_AIRFRAME_GENERIC = 0,
QGC_AIRFRAME_EASYSTAR = 1, QGC_AIRFRAME_EASYSTAR,
QGC_AIRFRAME_TWINSTAR = 2, QGC_AIRFRAME_TWINSTAR,
QGC_AIRFRAME_MERLIN = 3, QGC_AIRFRAME_MERLIN,
QGC_AIRFRAME_CHEETAH = 4, QGC_AIRFRAME_CHEETAH,
QGC_AIRFRAME_MIKROKOPTER = 5, QGC_AIRFRAME_MIKROKOPTER,
QGC_AIRFRAME_REAPER = 6, QGC_AIRFRAME_REAPER,
QGC_AIRFRAME_PREDATOR = 7, QGC_AIRFRAME_PREDATOR,
QGC_AIRFRAME_COAXIAL = 8 QGC_AIRFRAME_COAXIAL,
QGC_AIRFRAME_PTERYX
}; };
/** /**
......
...@@ -64,6 +64,8 @@ DebugConsole::DebugConsole(QWidget *parent) : ...@@ -64,6 +64,8 @@ DebugConsole::DebugConsole(QWidget *parent) :
m_ui->setupUi(this); m_ui->setupUi(this);
// Hide sent text field - it is only useful after send has been hit // Hide sent text field - it is only useful after send has been hit
m_ui->sentText->setVisible(false); m_ui->sentText->setVisible(false);
// Hide auto-send checkbox
m_ui->specialCheckBox->setVisible(false);
// Make text area not editable // Make text area not editable
m_ui->receiveText->setReadOnly(true); m_ui->receiveText->setReadOnly(true);
// Limit to 500 lines // Limit to 500 lines
...@@ -109,6 +111,8 @@ DebugConsole::DebugConsole(QWidget *parent) : ...@@ -109,6 +111,8 @@ DebugConsole::DebugConsole(QWidget *parent) :
connect(m_ui->connectButton, SIGNAL(clicked()), this, SLOT(handleConnectButton())); connect(m_ui->connectButton, SIGNAL(clicked()), this, SLOT(handleConnectButton()));
// Connect the special chars combo box // Connect the special chars combo box
connect(m_ui->addSymbolButton, SIGNAL(clicked()), this, SLOT(appendSpecialSymbol())); connect(m_ui->addSymbolButton, SIGNAL(clicked()), this, SLOT(appendSpecialSymbol()));
// Connect Checkbox
connect(m_ui->specialComboBox, SIGNAL(highlighted(QString)), this, SLOT(specialSymbolSelected(QString)));
hold(false); hold(false);
...@@ -270,7 +274,7 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes) ...@@ -270,7 +274,7 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes)
for (int j = 0; j < bytes.size(); j++) for (int j = 0; j < bytes.size(); j++)
{ {
unsigned char byte = bytes.at(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) if (filterMAVLINK && bytes.size() > 1)
{ {
// Filtering is done by setting an ignore counter based on the MAVLINK packet length // 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) ...@@ -288,12 +292,13 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes)
switch (byte) switch (byte)
{ {
// Catch line feed // Catch line feed
case (unsigned char)'\n': // case (unsigned char)'\n':
m_ui->receiveText->appendPlainText(str); // m_ui->receiveText->appendPlainText(str);
str = ""; // str = "";
break; // break;
// Catch carriage return // Catch carriage return and line feed
case (unsigned char)'\r': case (unsigned char)0xD:
case (unsigned char)0xA:
// Ignore // Ignore
break; break;
default: default:
...@@ -323,7 +328,7 @@ void DebugConsole::receiveBytes(LinkInterface* link, QByteArray bytes) ...@@ -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(); lineBuffer.clear();
} }
...@@ -376,6 +381,12 @@ QByteArray DebugConsole::symbolNameToBytes(const QString& text) ...@@ -376,6 +381,12 @@ QByteArray DebugConsole::symbolNameToBytes(const QString& text)
return b; return b;
} }
void DebugConsole::specialSymbolSelected(const QString& text)
{
Q_UNUSED(text);
m_ui->specialCheckBox->setVisible(true);
}
void DebugConsole::appendSpecialSymbol(const QString& text) void DebugConsole::appendSpecialSymbol(const QString& text)
{ {
QString line = m_ui->sendText->text(); QString line = m_ui->sendText->text();
...@@ -415,6 +426,12 @@ void DebugConsole::sendBytes() ...@@ -415,6 +426,12 @@ void DebugConsole::sendBytes()
return; return;
} }
// Append special symbol if checkbox is checked
if (m_ui->specialCheckBox->isChecked())
{
appendSpecialSymbol(m_ui->specialComboBox->currentText());
}
QByteArray transmit; QByteArray transmit;
QString feedback; QString feedback;
bool ok = true; bool ok = true;
......
...@@ -87,6 +87,8 @@ public slots: ...@@ -87,6 +87,8 @@ public slots:
void appendSpecialSymbol(const QString& text); void appendSpecialSymbol(const QString& text);
/** @brief Append the special symbol currently selected in combo box */ /** @brief Append the special symbol currently selected in combo box */
void appendSpecialSymbol(); void appendSpecialSymbol();
/** @brief A new special symbol is selected */
void specialSymbolSelected(const QString& text);
protected slots: protected slots:
/** @brief Draw information overlay */ /** @brief Draw information overlay */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>469</width> <width>466</width>
<height>190</height> <height>190</height>
</rect> </rect>
</property> </property>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="100,0,1,10,1,1,1"> <layout class="QHBoxLayout" name="horizontalLayout" stretch="100,0,0,1,10,1,1,1">
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
...@@ -204,6 +204,16 @@ ...@@ -204,6 +204,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="specialCheckBox">
<property name="toolTip">
<string>Automatically send special char at end of message</string>
</property>
<property name="text">
<string>Auto-Add</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="transmitButton"> <widget class="QPushButton" name="transmitButton">
<property name="toolTip"> <property name="toolTip">
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>310</width> <width>260</width>
<height>111</height> <height>111</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize">
<size>
<width>360</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
......
...@@ -221,6 +221,7 @@ void QGCToolWidget::addParam() ...@@ -221,6 +221,7 @@ void QGCToolWidget::addParam()
if (ui->hintLabel) if (ui->hintLabel)
{ {
ui->hintLabel->deleteLater(); ui->hintLabel->deleteLater();
ui->hintLabel = NULL;
} }
toolLayout->addWidget(slider); toolLayout->addWidget(slider);
slider->startEditMode(); slider->startEditMode();
...@@ -232,6 +233,7 @@ void QGCToolWidget::addAction() ...@@ -232,6 +233,7 @@ void QGCToolWidget::addAction()
if (ui->hintLabel) if (ui->hintLabel)
{ {
ui->hintLabel->deleteLater(); ui->hintLabel->deleteLater();
ui->hintLabel = NULL;
} }
toolLayout->addWidget(button); toolLayout->addWidget(button);
button->startEditMode(); button->startEditMode();
...@@ -242,6 +244,7 @@ void QGCToolWidget::addToolWidget(QGCToolWidgetItem* widget) ...@@ -242,6 +244,7 @@ void QGCToolWidget::addToolWidget(QGCToolWidgetItem* widget)
if (ui->hintLabel) if (ui->hintLabel)
{ {
ui->hintLabel->deleteLater(); ui->hintLabel->deleteLater();
ui->hintLabel = NULL;
} }
toolLayout->addWidget(widget); toolLayout->addWidget(widget);
} }
......
...@@ -191,6 +191,7 @@ void MAV2DIcon::drawIcon(QPen* pen) ...@@ -191,6 +191,7 @@ void MAV2DIcon::drawIcon(QPen* pen)
case UASInterface::QGC_AIRFRAME_EASYSTAR: case UASInterface::QGC_AIRFRAME_EASYSTAR:
case UASInterface::QGC_AIRFRAME_MERLIN: case UASInterface::QGC_AIRFRAME_MERLIN:
case UASInterface::QGC_AIRFRAME_TWINSTAR: case UASInterface::QGC_AIRFRAME_TWINSTAR:
case UASInterface::QGC_AIRFRAME_PTERYX:
{ {
// DRAW AIRPLANE // DRAW AIRPLANE
......
...@@ -452,7 +452,8 @@ void UASView::selectAirframe() ...@@ -452,7 +452,8 @@ void UASView::selectAirframe()
<< "Mikrokopter" << "Mikrokopter"
<< "Reaper" << "Reaper"
<< "Predator" << "Predator"
<< "Coaxial"; << "Coaxial"
<< "Pteryx";
bool ok; bool ok;
QString item = QInputDialog::getItem(this, tr("Select Airframe for %1").arg(uas->getUASName()), QString item = QInputDialog::getItem(this, tr("Select Airframe for %1").arg(uas->getUASName()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment