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()
start(LowPriority);
MAVLinkSimulationMAV* mav1 = new MAVLinkSimulationMAV(this, 1);
MAVLinkSimulationMAV* mav3 = new MAVLinkSimulationMAV(this, 2);
Q_UNUSED(mav1);
// timer->start(rate);
return true;
......
......@@ -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
};
/**
......
......@@ -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;
......
......@@ -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 */
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>469</width>
<width>466</width>
<height>190</height>
</rect>
</property>
......@@ -120,7 +120,7 @@
</widget>
</item>
<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">
<number>5</number>
</property>
......@@ -204,6 +204,16 @@
</property>
</widget>
</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>
<widget class="QPushButton" name="transmitButton">
<property name="toolTip">
......
......@@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>310</width>
<width>260</width>
<height>111</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -22,6 +22,12 @@
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>360</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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()),
......
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