Commit 51c45920 authored by Lorenz Meier's avatar Lorenz Meier

Merge branch 'master' of github.com:mavlink/qgroundcontrol

parents 233a1716 89696feb
......@@ -38,7 +38,7 @@ This file is part of the QGROUNDCONTROL project
#define PROTOCOL_TIMEOUT_MS 2000 ///< maximum time to wait for pending messages until timeout
#define PROTOCOL_DELAY_MS 20 ///< minimum delay between sent messages
#define PROTOCOL_MAX_RETRIES 5 ///< maximum number of send retries (after timeout)
const float UASWaypointManager::defaultAltitudeHomeOffset = 30.0f;
UASWaypointManager::UASWaypointManager(UAS* _uas)
: uas(_uas),
current_retries(0),
......
......@@ -180,7 +180,7 @@ private:
quint16 uasid;
// XXX export to settings
static const float defaultAltitudeHomeOffset = 30.0f; ///< Altitude offset in meters from home for new waypoints
static const float defaultAltitudeHomeOffset; ///< Altitude offset in meters from home for new waypoints
};
#endif // UASWAYPOINTMANAGER_H
......@@ -177,6 +177,7 @@ void QGCToolBar::createUI()
addLink(LinkManager::instance()->getLinks().last());
// XXX implies that connect button is always active for the last used link
connect(LinkManager::instance(), SIGNAL(newLink(LinkInterface*)), this, SLOT(addLink(LinkInterface*)));
connect(LinkManager::instance(), SIGNAL(linkRemoved(LinkInterface*)), this, SLOT(removeLink(LinkInterface*)));
// Update label if required
if (LinkManager::instance()->getLinks().count() < 3) {
......
......@@ -52,7 +52,7 @@ QGCVehicleConfig::QGCVehicleConfig(QWidget *parent) :
ui->rcCalibrationButton->setCheckable(true);
connect(ui->rcCalibrationButton, SIGNAL(clicked(bool)), this, SLOT(toggleCalibrationRC(bool)));
connect(ui->storeButton, SIGNAL(clicked()), this, SLOT(writeParameters()));
connect(ui->setButton, SIGNAL(clicked()), this, SLOT(writeParameters()));
connect(ui->rcModeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setRCModeIndex(int)));
connect(ui->setTrimButton, SIGNAL(clicked()), this, SLOT(setTrimPositions()));
......@@ -174,6 +174,7 @@ void QGCVehicleConfig::stopCalibrationRC()
void QGCVehicleConfig::loadQgcConfig(bool primary)
{
Q_UNUSED(primary);
QDir autopilotdir(qApp->applicationDirPath() + "/files/" + mav->getAutopilotTypeName().toLower());
QDir generaldir = QDir(autopilotdir.absolutePath() + "/general/widgets");
QDir vehicledir = QDir(autopilotdir.absolutePath() + "/" + mav->getSystemTypeName().toLower() + "/widgets");
......@@ -321,7 +322,6 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
}
}
// Load calibration
//TODO: Handle this more gracefully, maybe have it scan the directory for multiple calibration entries?
tool = new QGCToolWidget("", this);
......@@ -338,7 +338,6 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
delete tool;
}
tool = new QGCToolWidget("", this);
tool->addUAS(mav);
if (tool->loadSettings(autopilotdir.absolutePath() + "/" + mav->getSystemTypeName().toLower() + "/calibration/calibration.qgw", false))
......@@ -352,16 +351,12 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
} else {
delete tool;
}
//description.txt
QFile sensortipsfile(autopilotdir.absolutePath() + "/general/calibration/description.txt");
sensortipsfile.open(QIODevice::ReadOnly);
ui->sensorTips->setHtml(sensortipsfile.readAll());
sensortipsfile.close();
}
void QGCVehicleConfig::loadConfig()
......@@ -679,10 +674,8 @@ void QGCVehicleConfig::loadConfig()
}
xml.readNext();
}
if (mav)
{
mav->getParamManager()->setParamInfo(paramTooltips);
}
mav->getParamManager()->setParamInfo(paramTooltips);
doneLoadingConfig = true;
mav->requestParameters(); //Config is finished, lets do a parameter request to ensure none are missed if someone else started requesting before we were finished.
}
......@@ -736,18 +729,24 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
mav->getParamManager()->setParamInfo(paramTooltips);
}
// mav->requestParameters();
QString defaultsDir = qApp->applicationDirPath() + "/files/" + mav->getAutopilotTypeName().toLower() + "/widgets/";
qDebug() << "CALIBRATION!! System Type Name:" << mav->getSystemTypeName();
//Load configuration after 1ms. This allows it to go into the event loop, and prevents application hangups due to the
//amount of time it actually takes to load the configuration windows.
QTimer::singleShot(1,this,SLOT(loadConfig()));
updateStatus(QString("Reading from system %1").arg(mav->getUASName()));
// Since a system is now connected, enable the VehicleConfig UI.
ui->tabWidget->setEnabled(true);
ui->setButton->setEnabled(true);
ui->refreshButton->setEnabled(true);
ui->readButton->setEnabled(true);
ui->writeButton->setEnabled(true);
ui->loadFileButton->setEnabled(true);
ui->saveFileButton->setEnabled(true);
}
void QGCVehicleConfig::resetCalibrationRC()
{
for (unsigned int i = 0; i < chanMax; ++i)
......@@ -1065,9 +1064,9 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (minTpl.exactMatch(parameterName)) {
bool ok;
int index = parameterName.mid(2, 1).toInt(&ok) - 1;
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
//qDebug() << "PARAM:" << parameterName << "index:" << index;
if (ok && (index >= 0) && (index < chanMax))
if (ok && index < chanMax)
{
rcMin[index] = value.toInt();
}
......@@ -1075,8 +1074,8 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (maxTpl.exactMatch(parameterName)) {
bool ok;
int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && (index >= 0) && (index < chanMax))
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && index < chanMax)
{
rcMax[index] = value.toInt();
}
......@@ -1084,8 +1083,8 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (trimTpl.exactMatch(parameterName)) {
bool ok;
int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && (index >= 0) && (index < chanMax))
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && index < chanMax)
{
rcTrim[index] = value.toInt();
}
......@@ -1093,8 +1092,8 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (revTpl.exactMatch(parameterName)) {
bool ok;
int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && (index >= 0) && (index < chanMax))
unsigned int index = parameterName.mid(2, 1).toInt(&ok) - 1;
if (ok && index < chanMax)
{
rcRev[index] = (value.toInt() == -1) ? true : false;
updateInvertedCheckboxes(index);
......
......@@ -6,52 +6,53 @@
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>541</height>
<width>774</width>
<height>846</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="horizontalSpacing">
<number>6</number>
</property>
<property name="verticalSpacing">
<number>8</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<property name="margin">
<number>6</number>
</property>
<item row="2" column="1">
<widget class="QPushButton" name="storeButton">
<property name="text">
<string>Store to EEPROM</string>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="statusLabel">
<property name="text">
<string>No pending changes</string>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>3</number>
</property>
<widget class="QWidget" name="rcTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>RC Calibration</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5" columnstretch="1,1,10,1,1,10,1,1,1,1,1,1,1,1,10">
<layout class="QGridLayout" name="gridLayout_5" columnstretch="1,0,0,0,0,0,0,0,0,0,0,0,0,0,0">
<property name="topMargin">
<number>20</number>
</property>
<item row="8" column="1" rowspan="3">
<widget class="QSlider" name="throttleSlider">
<item row="8" column="4" rowspan="3" colspan="2">
<widget class="QSlider" name="pitchSlider">
<property name="minimum">
<number>0</number>
</property>
......@@ -66,8 +67,21 @@
</property>
</widget>
</item>
<item row="8" column="4" rowspan="3" colspan="2">
<widget class="QSlider" name="pitchSlider">
<item row="3" column="0" colspan="12">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>598</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1" rowspan="3">
<widget class="QSlider" name="throttleSlider">
<property name="minimum">
<number>0</number>
</property>
......@@ -82,6 +96,19 @@
</property>
</widget>
</item>
<item row="8" column="11" rowspan="3">
<widget class="QSlider" name="aux2Slider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="1" column="0" rowspan="2" colspan="9">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
......@@ -102,7 +129,7 @@
<item>
<widget class="QComboBox" name="rcModeComboBox">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<item>
<property name="text">
......@@ -128,15 +155,31 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="12">
<spacer name="verticalSpacer_2">
<item row="5" column="13" colspan="2">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>22</width>
<height>122</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>598</width>
<height>5</height>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
......@@ -148,6 +191,187 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="15">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>598</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="14">
<widget class="QPushButton" name="setTrimButton">
<property name="text">
<string>Set Trim</string>
</property>
</widget>
</item>
<item row="8" column="3" rowspan="3">
<widget class="QLabel" name="rightStickLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../qgroundcontrol.qrc">:/files/images/rc_stick.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="2" rowspan="3">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" rowspan="3">
<widget class="QLabel" name="leftStickLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="sizeIncrement">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="baseSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../qgroundcontrol.qrc">:/files/images/rc_stick.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="14">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="10" rowspan="3">
<widget class="QSlider" name="aux1Slider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="8" column="12" rowspan="3" colspan="2">
<widget class="QSlider" name="aux3Slider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="8" column="9" rowspan="3">
<widget class="QSlider" name="modeSwitchSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="7" column="5" rowspan="2" colspan="4">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="0">
<widget class="QSlider" name="yawSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="11" column="3">
<widget class="QSlider" name="rollSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="11" column="6" colspan="8">
<widget class="QPushButton" name="rcCalibrationButton">
<property name="text">
<string>Start Calibration</string>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QLabel" name="instructionLabel">
<property name="text">
......@@ -246,6 +470,9 @@
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="invertCheckBox_3">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Invert</string>
</property>
......@@ -401,6 +628,9 @@
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="invertCheckBox_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Invert</string>
</property>
......@@ -408,6 +638,9 @@
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="invertCheckBox_4">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Invert</string>
</property>
......@@ -489,6 +722,9 @@
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="invertCheckBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Invert</string>
</property>
......@@ -496,232 +732,15 @@
</item>
</layout>
</item>
<item row="5" column="13" colspan="2">
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>22</width>
<height>122</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0" colspan="15">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>598</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="3" rowspan="3">
<widget class="QLabel" name="rightStickLabel">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../qgroundcontrol.qrc">:/files/images/rc_stick.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="2" rowspan="3">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0" rowspan="3">
<widget class="QLabel" name="leftStickLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="sizeIncrement">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="baseSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../qgroundcontrol.qrc">:/files/images/rc_stick.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="14">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="0">
<widget class="QSlider" name="yawSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="11" column="3">
<widget class="QSlider" name="rollSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="11" column="6" colspan="8">
<widget class="QPushButton" name="rcCalibrationButton">
<property name="text">
<string>Start Calibration</string>
</property>
</widget>
</item>
<item row="0" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="10" rowspan="3">
<widget class="QSlider" name="aux1Slider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="8" column="11" rowspan="3">
<widget class="QSlider" name="aux2Slider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="8" column="12" rowspan="3" colspan="2">
<widget class="QSlider" name="aux3Slider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="8" column="9" rowspan="3">
<widget class="QSlider" name="modeSwitchSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="7" column="5" rowspan="2" colspan="4">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="11" column="14">
<widget class="QPushButton" name="setTrimButton">
<property name="text">
<string>Set Trim</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="sensorTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>Sensor Calibration</string>
</attribute>
......@@ -734,8 +753,8 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
......@@ -751,8 +770,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>448</height>
<width>362</width>
<height>489</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_10">
......@@ -769,7 +788,13 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="multirotorTab">
<widget class="QWidget" name="generalTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>General Config</string>
</attribute>
......@@ -790,10 +815,17 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
<widget class="QComboBox" name="multiRotorComboBox"/>
<widget class="QComboBox" name="generalComboBox_2">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="loadMultiRotorDefaultsButton">
<widget class="QPushButton" name="loadGeneralDefaultsButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Load Platform Defaults</string>
</property>
......@@ -804,7 +836,7 @@ p, li { white-space: pre-wrap; }
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QGroupBox" name="multiRotorControlAttitudeGroupBox">
<widget class="QGroupBox" name="generalLeftGroupBox">
<property name="title">
<string>Configuration</string>
</property>
......@@ -822,8 +854,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>404</height>
<width>356</width>
<height>438</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
......@@ -841,7 +873,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QGroupBox" name="multiRotorControlAttitudeGroupBox_2">
<widget class="QGroupBox" name="generalRightGroupBox">
<property name="title">
<string>Configuration</string>
</property>
......@@ -859,8 +891,8 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>404</height>
<width>356</width>
<height>438</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
......@@ -881,7 +913,13 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="fixedWingTab">
<widget class="QWidget" name="advancedTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>Advanced Config</string>
</attribute>
......@@ -902,10 +940,17 @@ p, li { white-space: pre-wrap; }
</spacer>
</item>
<item>
<widget class="QComboBox" name="fixedWingComboBox"/>
<widget class="QComboBox" name="advancedComboBox">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="loadFixedWingDefaultsButton">
<widget class="QPushButton" name="loadAdvancedDefaultsButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Load Platform Defaults</string>
</property>
......@@ -916,11 +961,20 @@ p, li { white-space: pre-wrap; }
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QGroupBox" name="fixedWingControlAttitudeGroupBox">
<widget class="QGroupBox" name="advancedLeftGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Configuration</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<property name="margin">
<number>0</number>
</property>
......@@ -934,16 +988,26 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>404</height>
<width>356</width>
<height>438</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="leftAdvancedLayout"/>
<layout class="QVBoxLayout" name="leftAdvancedLayout">
<property name="spacing">
<number>0</number>
</property>
</layout>
</item>
</layout>
</widget>
......@@ -953,7 +1017,13 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QGroupBox" name="fixedWingControlAttitudeGroupBox_2">
<widget class="QGroupBox" name="advancedRightGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Configuration</string>
</property>
......@@ -971,10 +1041,16 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>354</width>
<height>404</height>
<width>356</width>
<height>438</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="margin">
<number>0</number>
......@@ -995,6 +1071,218 @@ p, li { white-space: pre-wrap; }
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_15">
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="statusLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>No pending changes</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_12">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="refreshButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Load parameters currently in non-permanent memory of aircraft.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Get (UAS)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="setButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Set current parameters in non-permanent onboard memory.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Set (UAS)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_14">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="loadFileButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Load parameters from a file on this computer in the view. To write them to the aircraft, use transmit after loading them.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Load (File)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveFileButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Save parameters in this view to a file on this computer.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Save (File)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_13">
<property name="spacing">
<number>6</number>
</property>
<item>
<spacer name="verticalSpacer_8">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="readButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Copy parameters from permanent memory to non-permanent current memory of aircraft. DOES NOT update the parameters in this view, click refresh after copying them to get them.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="text">
<string>Read (ROM)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="writeButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Copy current parameters in non-permanent memory of the aircraft to permanent memory. Transmit your parameters first to write these.</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="text">
<string>Write (ROM)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
......
......@@ -122,6 +122,11 @@ WaypointList::WaypointList(QWidget *parent, UASWaypointManager* wpm) :
connect(WPM, SIGNAL(waypointViewOnlyListChanged(void)), this, SLOT(waypointViewOnlyListChanged(void)));
connect(WPM, SIGNAL(waypointViewOnlyChanged(int,Waypoint*)), this, SLOT(updateWaypointViewOnly(int,Waypoint*)));
connect(WPM, SIGNAL(currentWaypointChanged(quint16)), this, SLOT(currentWaypointViewOnlyChanged(quint16)));
//Even if there are no waypoints, since this is a new instance and there is an
//existing WPM, then we need to assume things have changed, and act appropriatly.
waypointEditableListChanged();
waypointViewOnlyListChanged();
}
// STATUS LABEL
......
......@@ -263,11 +263,7 @@ void QGCParamSlider::endEditMode()
switch (parameterValue.type())
{
case QVariant::Char:
ui->intValueSpinBox->show();
break;
case QVariant::Int:
ui->intValueSpinBox->show();
break;
case QVariant::UInt:
ui->intValueSpinBox->show();
break;
......@@ -381,14 +377,6 @@ void QGCParamSlider::setParameterValue(int uas, int component, int paramCount, i
ui->editSelectParamComboBox->addItem(parameterName, paramIndex);
}
if (this->parameterName == "RC5_MIN")
{
int stopper = 1;
}
if (parameterName == "RC5_MIN")
{
int stpoper = 1;
}
if (visibleParam != "")
{
if (parameterName == visibleParam)
......@@ -427,51 +415,51 @@ void QGCParamSlider::setParameterValue(int uas, int component, int paramCount, i
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toUInt());
ui->intValueSpinBox->setMinimum(-ui->intValueSpinBox->maximum());
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
ui->intValueSpinBox->setRange(0, UINT8_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(255);
ui->editMaxSpinBox->setValue(UINT8_MAX);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
break;
case QVariant::Int:
ui->intValueSpinBox->show();
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toInt());
ui->valueSlider->setValue(floatToScaledInt(value.toInt()));
ui->intValueSpinBox->setMinimum(-ui->intValueSpinBox->maximum());
ui->intValueSpinBox->setRange(INT32_MIN, INT32_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(65535);
ui->editMinSpinBox->setValue(0);
ui->editMaxSpinBox->setValue(INT32_MAX);
ui->editMinSpinBox->setValue(INT32_MIN);
}
ui->valueSlider->setValue(floatToScaledInt(value.toInt()));
break;
case QVariant::UInt:
ui->intValueSpinBox->show();
ui->intValueSpinBox->setEnabled(true);
ui->doubleValueSpinBox->hide();
ui->intValueSpinBox->setValue(value.toUInt());
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
ui->intValueSpinBox->setMinimum(0);
ui->intValueSpinBox->setRange(0, UINT32_MAX);
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(65535);
ui->editMaxSpinBox->setValue(UINT32_MAX);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toUInt()));
break;
case QMetaType::Float:
ui->doubleValueSpinBox->setValue(value.toFloat());
ui->doubleValueSpinBox->show();
ui->doubleValueSpinBox->setEnabled(true);
ui->intValueSpinBox->hide();
ui->valueSlider->setValue(floatToScaledInt(value.toFloat()));
if (parameterMax == 0 && parameterMin == 0)
{
ui->editMaxSpinBox->setValue(10000);
ui->editMinSpinBox->setValue(0);
}
ui->valueSlider->setValue(floatToScaledInt(value.toFloat()));
break;
default:
qCritical() << "ERROR: NO VALID PARAM TYPE";
......
......@@ -6,7 +6,6 @@ DockWidgetTitleBarEventFilter::DockWidgetTitleBarEventFilter(QObject *parent) :
}
bool DockWidgetTitleBarEventFilter::eventFilter(QObject *object,QEvent *event)
{
qDebug() << event->type();
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease)
{
return true;
......
......@@ -212,7 +212,11 @@ void QGCMapWidget::loadSettings(bool changePosition)
if (trailType == mapcontrol::UAVTrailType::ByDistance)
{
// XXX
#ifdef Q_OS_WIN
#pragma message ("WARNING: Settings loading for trail type not implemented")
#else
#warning Settings loading for trail type not implemented
#endif
}
else if (trailType == mapcontrol::UAVTrailType::ByTimeElapsed)
{
......
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