Commit d4425e06 authored by Bryant's avatar Bryant

Merge branch 'connStatus' of github.com:Susurrus/qgroundcontrol into connStatus

Conflicts:
	src/ui/QGCVehicleConfig.cc
	src/ui/QGCVehicleConfig.h
	src/ui/QGCVehicleConfig.ui
	src/ui/uas/UASControlWidget.cc
	src/ui/uas/UASListWidget.h
	src/ui/uas/UASQuickView.cc
parents 7aef7fcf 975f4106
...@@ -183,6 +183,9 @@ HSIDisplay::HSIDisplay(QWidget *parent) : ...@@ -183,6 +183,9 @@ HSIDisplay::HSIDisplay(QWidget *parent) :
setActiveUAS(UASManager::instance()->getActiveUAS()); setActiveUAS(UASManager::instance()->getActiveUAS());
} }
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)),
this, SLOT(setActiveUAS(UASInterface*)));
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)),
this, SLOT(setActiveUAS(UASInterface*))); this, SLOT(setActiveUAS(UASInterface*)));
......
...@@ -256,19 +256,21 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -256,19 +256,21 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
//TODO: Throw an error here too, no autopilot specific configuration //TODO: Throw an error here too, no autopilot specific configuration
qWarning() << "Invalid vehicle dir, no vehicle specific configuration will be loaded."; qWarning() << "Invalid vehicle dir, no vehicle specific configuration will be loaded.";
} }
// Generate widgets for the General tab.
QGCToolWidget *tool; QGCToolWidget *tool;
bool left = true; bool left = true;
foreach (QString file,generaldir.entryList(QDir::Files | QDir::NoDotAndDotDot)) foreach (QString file,generaldir.entryList(QDir::Files | QDir::NoDotAndDotDot))
{ {
if (file.toLower().endsWith(".qgw")) { if (file.toLower().endsWith(".qgw")) {
tool = new QGCToolWidget("", this); QWidget* parent = left?ui->generalLeftContents:ui->generalRightContents;
tool = new QGCToolWidget("", parent);
if (tool->loadSettings(generaldir.absoluteFilePath(file), false)) if (tool->loadSettings(generaldir.absoluteFilePath(file), false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
//ui->sensorLayout->addWidget(tool); QGroupBox *box = new QGroupBox(parent);
QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
if (left) if (left)
{ {
...@@ -285,18 +287,20 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -285,18 +287,20 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
} }
} }
} }
// Generate widgets for the Advanced tab.
left = true; left = true;
foreach (QString file,vehicledir.entryList(QDir::Files | QDir::NoDotAndDotDot)) foreach (QString file,vehicledir.entryList(QDir::Files | QDir::NoDotAndDotDot))
{ {
if (file.toLower().endsWith(".qgw")) { if (file.toLower().endsWith(".qgw")) {
tool = new QGCToolWidget("", this); QWidget* parent = left?ui->advancedLeftContents:ui->advancedRightContents;
tool = new QGCToolWidget("", parent);
if (tool->loadSettings(vehicledir.absoluteFilePath(file), false)) if (tool->loadSettings(vehicledir.absoluteFilePath(file), false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
//ui->sensorLayout->addWidget(tool); QGroupBox *box = new QGroupBox(parent);
QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
if (left) if (left)
{ {
...@@ -314,7 +318,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -314,7 +318,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
} }
} }
//Load tabs for general configuration // Load tabs for general configuration
foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) foreach (QString dir,generaldir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{ {
QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3); QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3);
...@@ -331,10 +335,10 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -331,10 +335,10 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
buttonToWidgetMap[button] = tab; buttonToWidgetMap[button] = tab;
tab->setLayout(new QVBoxLayout()); tab->setLayout(new QVBoxLayout());
tab->show(); tab->show();
QScrollArea *area = new QScrollArea(); QScrollArea *area = new QScrollArea(tab);
tab->layout()->addWidget(area); tab->layout()->addWidget(area);
QWidget *scrollArea = new QWidget(); QWidget *scrollArea = new QWidget(tab);
scrollArea->setLayout(new QVBoxLayout()); scrollArea->setLayout(new QVBoxLayout(tab));
area->setWidget(scrollArea); area->setWidget(scrollArea);
area->setWidgetResizable(true); area->setWidgetResizable(true);
area->show(); area->show();
...@@ -343,14 +347,14 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -343,14 +347,14 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
foreach (QString file,newdir.entryList(QDir::Files| QDir::NoDotAndDotDot)) foreach (QString file,newdir.entryList(QDir::Files| QDir::NoDotAndDotDot))
{ {
if (file.toLower().endsWith(".qgw")) { if (file.toLower().endsWith(".qgw")) {
tool = new QGCToolWidget("", this); tool = new QGCToolWidget("", tab);
if (tool->loadSettings(newdir.absoluteFilePath(file), false)) if (tool->loadSettings(newdir.absoluteFilePath(file), false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
//ui->sensorLayout->addWidget(tool); //ui->sensorLayout->addWidget(tool);
QGroupBox *box = new QGroupBox(this); QGroupBox *box = new QGroupBox(tab);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(tab));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
scrollArea->layout()->addWidget(box); scrollArea->layout()->addWidget(box);
} else { } else {
...@@ -360,7 +364,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -360,7 +364,7 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
} }
} }
//Load tabs for vehicle specific configuration // Load additional tabs for vehicle specific configuration
foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) foreach (QString dir,vehicledir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{ {
//QWidget *tab = new QWidget(ui->tabWidget); //QWidget *tab = new QWidget(ui->tabWidget);
...@@ -379,10 +383,10 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -379,10 +383,10 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
button->setText(dir); button->setText(dir);
tab->setLayout(new QVBoxLayout()); tab->setLayout(new QVBoxLayout());
tab->show(); tab->show();
QScrollArea *area = new QScrollArea(); QScrollArea *area = new QScrollArea(tab);
tab->layout()->addWidget(area); tab->layout()->addWidget(area);
QWidget *scrollArea = new QWidget(); QWidget *scrollArea = new QWidget(tab);
scrollArea->setLayout(new QVBoxLayout()); scrollArea->setLayout(new QVBoxLayout(tab));
area->setWidget(scrollArea); area->setWidget(scrollArea);
area->setWidgetResizable(true); area->setWidgetResizable(true);
area->show(); area->show();
...@@ -392,15 +396,15 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -392,15 +396,15 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
foreach (QString file,newdir.entryList(QDir::Files| QDir::NoDotAndDotDot)) foreach (QString file,newdir.entryList(QDir::Files| QDir::NoDotAndDotDot))
{ {
if (file.toLower().endsWith(".qgw")) { if (file.toLower().endsWith(".qgw")) {
tool = new QGCToolWidget("", this); tool = new QGCToolWidget("", tab);
tool->addUAS(mav); tool->addUAS(mav);
if (tool->loadSettings(newdir.absoluteFilePath(file), false)) if (tool->loadSettings(newdir.absoluteFilePath(file), false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
//ui->sensorLayout->addWidget(tool); //ui->sensorLayout->addWidget(tool);
QGroupBox *box = new QGroupBox(); QGroupBox *box = new QGroupBox(tab);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
scrollArea->layout()->addWidget(box); scrollArea->layout()->addWidget(box);
box->show(); box->show();
...@@ -412,30 +416,31 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -412,30 +416,31 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
} }
} }
// Load calibration // Load general calibration for autopilot
//TODO: Handle this more gracefully, maybe have it scan the directory for multiple calibration entries? //TODO: Handle this more gracefully, maybe have it scan the directory for multiple calibration entries?
tool = new QGCToolWidget("", this); tool = new QGCToolWidget("", ui->sensorContents);
tool->addUAS(mav); tool->addUAS(mav);
if (tool->loadSettings(autopilotdir.absolutePath() + "/general/calibration/calibration.qgw", false)) if (tool->loadSettings(autopilotdir.absolutePath() + "/general/calibration/calibration.qgw", false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
QGroupBox *box = new QGroupBox(this); QGroupBox *box = new QGroupBox(ui->sensorContents);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
ui->sensorLayout->addWidget(box); ui->sensorLayout->addWidget(box);
} else { } else {
delete tool; delete tool;
} }
tool = new QGCToolWidget("", this); // Load vehicle-specific autopilot configuration
tool = new QGCToolWidget("", ui->sensorContents);
tool->addUAS(mav); tool->addUAS(mav);
if (tool->loadSettings(autopilotdir.absolutePath() + "/" + mav->getSystemTypeName().toLower() + "/calibration/calibration.qgw", false)) if (tool->loadSettings(autopilotdir.absolutePath() + "/" + mav->getSystemTypeName().toLower() + "/calibration/calibration.qgw", false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
QGroupBox *box = new QGroupBox(this); QGroupBox *box = new QGroupBox(ui->sensorContents);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
ui->sensorLayout->addWidget(box); ui->sensorLayout->addWidget(box);
} else { } else {
...@@ -494,7 +499,7 @@ void QGCVehicleConfig::loadConfig() ...@@ -494,7 +499,7 @@ void QGCVehicleConfig::loadConfig()
QXmlStreamReader xml(xmlfile.readAll()); QXmlStreamReader xml(xmlfile.readAll());
xmlfile.close(); xmlfile.close();
//TODO: Testing to ensure that incorrectly formated XML won't break this. //TODO: Testing to ensure that incorrectly formatted XML won't break this.
while (!xml.atEnd()) while (!xml.atEnd())
{ {
if (xml.isStartElement() && xml.name() == "paramfile") if (xml.isStartElement() && xml.name() == "paramfile")
...@@ -674,7 +679,16 @@ void QGCVehicleConfig::loadConfig() ...@@ -674,7 +679,16 @@ void QGCVehicleConfig::loadConfig()
} }
if (genarraycount > 0) if (genarraycount > 0)
{ {
tool = new QGCToolWidget("", this); QWidget* parent = this;
if (valuetype == "vehicles")
{
parent = ui->generalLeftContents;
}
else if (valuetype == "libraries")
{
parent = ui->generalRightContents;
}
tool = new QGCToolWidget("", parent);
tool->addUAS(mav); tool->addUAS(mav);
tool->setTitle(parametersname); tool->setTitle(parametersname);
tool->setObjectName(parametersname); tool->setObjectName(parametersname);
...@@ -702,9 +716,9 @@ void QGCVehicleConfig::loadConfig() ...@@ -702,9 +716,9 @@ void QGCVehicleConfig::loadConfig()
} }
toolWidgets.append(tool); toolWidgets.append(tool);
QGroupBox *box = new QGroupBox(this); QGroupBox *box = new QGroupBox(parent);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
if (valuetype == "vehicles") if (valuetype == "vehicles")
{ {
...@@ -719,7 +733,16 @@ void QGCVehicleConfig::loadConfig() ...@@ -719,7 +733,16 @@ void QGCVehicleConfig::loadConfig()
} }
if (advarraycount > 0) if (advarraycount > 0)
{ {
tool = new QGCToolWidget("", this); QWidget* parent = this;
if (valuetype == "vehicles")
{
parent = ui->generalLeftContents;
}
else if (valuetype == "libraries")
{
parent = ui->generalRightContents;
}
tool = new QGCToolWidget("", parent);
tool->addUAS(mav); tool->addUAS(mav);
tool->setTitle(parametersname); tool->setTitle(parametersname);
tool->setObjectName(parametersname); tool->setObjectName(parametersname);
...@@ -747,31 +770,25 @@ void QGCVehicleConfig::loadConfig() ...@@ -747,31 +770,25 @@ void QGCVehicleConfig::loadConfig()
} }
toolWidgets.append(tool); toolWidgets.append(tool);
QGroupBox *box = new QGroupBox(this); QGroupBox *box = new QGroupBox(parent);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
if (valuetype == "vehicles") if (valuetype == "vehicles")
{ {
ui->leftAdvancedLayout->addWidget(box); ui->leftGeneralLayout->addWidget(box);
} }
else if (valuetype == "libraries") else if (valuetype == "libraries")
{ {
ui->rightAdvancedLayout->addWidget(box); ui->rightGeneralLayout->addWidget(box);
} }
box->hide(); box->hide();
toolToBoxMap[tool] = box; toolToBoxMap[tool] = box;
} }
} }
xml.readNext(); xml.readNext();
} }
} }
xml.readNext(); xml.readNext();
} }
} }
...@@ -785,7 +802,7 @@ void QGCVehicleConfig::loadConfig() ...@@ -785,7 +802,7 @@ void QGCVehicleConfig::loadConfig()
void QGCVehicleConfig::setActiveUAS(UASInterface* active) void QGCVehicleConfig::setActiveUAS(UASInterface* active)
{ {
// Do nothing if system is the same or NULL // Do nothing if system is the same
if (mav == active) return; if (mav == active) return;
if (mav) if (mav)
...@@ -796,11 +813,41 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -796,11 +813,41 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
disconnect(mav, SIGNAL(parameterChanged(int,int,QString,QVariant)), this, disconnect(mav, SIGNAL(parameterChanged(int,int,QString,QVariant)), this,
SLOT(parameterChanged(int,int,QString,QVariant))); SLOT(parameterChanged(int,int,QString,QVariant)));
foreach (QGCToolWidget* tool, toolWidgets) // Delete all children from all fixed tabs.
foreach(QWidget* child, ui->generalLeftContents->findChildren<QWidget*>())
{ {
delete tool; child->deleteLater();
}
foreach(QWidget* child, ui->generalRightContents->findChildren<QWidget*>())
{
child->deleteLater();
}
foreach(QWidget* child, ui->advancedLeftContents->findChildren<QWidget*>())
{
child->deleteLater();
}
foreach(QWidget* child, ui->advancedRightContents->findChildren<QWidget*>())
{
child->deleteLater();
}
foreach(QWidget* child, ui->sensorContents->findChildren<QWidget*>())
{
child->deleteLater();
}
// And then delete any custom tabs
foreach(QWidget* child, additionalTabs)
{
child->deleteLater();
} }
additionalTabs.clear();
toolWidgets.clear(); toolWidgets.clear();
paramToWidgetMap = NULL;
libParamToWidgetMap.clear();
systemTypeToParamMap.clear();
toolToBoxMap.clear();
paramTooltips.clear();
} }
// Reset current state // Reset current state
...@@ -819,13 +866,13 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -819,13 +866,13 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
if (systemTypeToParamMap.contains(mav->getSystemTypeName())) if (systemTypeToParamMap.contains(mav->getSystemTypeName()))
{ {
paramToWidgetMap = systemTypeToParamMap[mav->getSystemTypeName()]; paramToWidgetMap = &systemTypeToParamMap[mav->getSystemTypeName()];
} }
else else
{ {
//Indication that we have no meta data for this system type. //Indication that we have no meta data for this system type.
qDebug() << "No parameters defined for system type:" << mav->getSystemTypeName(); qDebug() << "No parameters defined for system type:" << mav->getSystemTypeName();
paramToWidgetMap = systemTypeToParamMap[mav->getSystemTypeName()]; paramToWidgetMap = &systemTypeToParamMap[mav->getSystemTypeName()];
} }
if (!paramTooltips.isEmpty()) if (!paramTooltips.isEmpty())
...@@ -842,7 +889,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -842,7 +889,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
updateStatus(QString("Reading from system %1").arg(mav->getUASName())); updateStatus(QString("Reading from system %1").arg(mav->getUASName()));
// Since a system is now connected, enable the VehicleConfig UI. // Since a system is now connected, enable the VehicleConfig UI.
//ui->tabWidget->setEnabled(true); ui->tabWidget->setEnabled(true);
ui->setButton->setEnabled(true); ui->setButton->setEnabled(true);
ui->refreshButton->setEnabled(true); ui->refreshButton->setEnabled(true);
ui->readButton->setEnabled(true); ui->readButton->setEnabled(true);
...@@ -1139,7 +1186,18 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete ...@@ -1139,7 +1186,18 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
if (!found) if (!found)
{ {
//New param type, create a QGroupBox for it. //New param type, create a QGroupBox for it.
QGCToolWidget *tool = new QGCToolWidget("", this); QWidget* parent;
if (ui->leftAdvancedLayout->count() > ui->rightAdvancedLayout->count())
{
parent = ui->advancedRightContents;
}
else
{
parent = ui->advancedLeftContents;
}
// Create the tool, attaching it to the QGroupBox
QGCToolWidget *tool = new QGCToolWidget("", parent);
QString tooltitle = parameterName; QString tooltitle = parameterName;
if (parameterName.split("_").size() > 1) if (parameterName.split("_").size() > 1)
{ {
...@@ -1148,14 +1206,17 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete ...@@ -1148,14 +1206,17 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
tool->setTitle(tooltitle); tool->setTitle(tooltitle);
tool->setObjectName(tooltitle); tool->setObjectName(tooltitle);
//tool->setSettings(set); //tool->setSettings(set);
tool->addParam(uas,component,parameterName,value);
libParamToWidgetMap.insert(parameterName,tool); libParamToWidgetMap.insert(parameterName,tool);
toolWidgets.append(tool); toolWidgets.append(tool);
QGroupBox *box = new QGroupBox(this); tool->addParam(uas, component, parameterName, value);
QGroupBox *box = new QGroupBox(parent);
box->setTitle(tool->objectName()); box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout()); box->setLayout(new QVBoxLayout(box));
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
libParamToWidgetMap.insert(parameterName,tool);
toolWidgets.append(tool);
//Make sure we have similar number of widgets on each side. //Make sure we have similar number of widgets on each side.
if (ui->leftAdvancedLayout->count() > ui->rightAdvancedLayout->count()) if (ui->leftAdvancedLayout->count() > ui->rightAdvancedLayout->count())
......
...@@ -34,8 +34,13 @@ ...@@ -34,8 +34,13 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<<<<<<< HEAD
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
=======
<property name="currentIndex">
<number>0</number>
>>>>>>> 975f41067229245752f23de45b80ca4a7e28642d
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents_3"> <widget class="QWidget" name="scrollAreaWidgetContents_3">
<property name="geometry"> <property name="geometry">
...@@ -1070,9 +1075,20 @@ p, li { white-space: pre-wrap; } ...@@ -1070,9 +1075,20 @@ p, li { white-space: pre-wrap; }
<property name="title"> <property name="title">
<string>Configuration</string> <string>Configuration</string>
</property> </property>
<<<<<<< HEAD
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
=======
<widget class="QWidget" name="sensorContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>362</width>
<height>489</height>
</rect>
>>>>>>> 975f41067229245752f23de45b80ca4a7e28642d
</property> </property>
<item> <item>
<widget class="QScrollArea" name="scrollArea_4"> <widget class="QScrollArea" name="scrollArea_4">
...@@ -1193,11 +1209,104 @@ p, li { white-space: pre-wrap; } ...@@ -1193,11 +1209,104 @@ p, li { white-space: pre-wrap; }
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<<<<<<< HEAD
<property name="toolTip"> <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> <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>
<property name="statusTip"> <property name="statusTip">
<string/> <string/>
=======
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="generalLeftContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>356</width>
<height>438</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="leftGeneralLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="generalRightGroupBox">
<property name="title">
<string>Configuration</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_2">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="generalRightContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>356</width>
<height>438</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="rightGeneralLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<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>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
>>>>>>> 975f41067229245752f23de45b80ca4a7e28642d
</property> </property>
<property name="whatsThis"> <property name="whatsThis">
<string/> <string/>
...@@ -1247,12 +1356,106 @@ p, li { white-space: pre-wrap; } ...@@ -1247,12 +1356,106 @@ p, li { white-space: pre-wrap; }
<property name="toolTip"> <property name="toolTip">
<string>Save parameters in this view to a file on this computer.</string> <string>Save parameters in this view to a file on this computer.</string>
</property> </property>
<<<<<<< HEAD
<property name="statusTip"> <property name="statusTip">
<string/> <string/>
=======
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_4">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="advancedLeftContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<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">
<property name="spacing">
<number>0</number>
</property>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="advancedRightGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
>>>>>>> 975f41067229245752f23de45b80ca4a7e28642d
</property> </property>
<property name="text"> <property name="text">
<string>Save (File)</string> <string>Save (File)</string>
</property> </property>
<<<<<<< HEAD
=======
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_5">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="advancedRightContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<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>
</property>
<item>
<layout class="QVBoxLayout" name="rightAdvancedLayout"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
>>>>>>> 975f41067229245752f23de45b80ca4a7e28642d
</widget> </widget>
</item> </item>
</layout> </layout>
......
...@@ -69,6 +69,17 @@ void UASQuickView::saveSettings() ...@@ -69,6 +69,17 @@ void UASQuickView::saveSettings()
settings.setArrayIndex(count++); settings.setArrayIndex(count++);
settings.setValue("name",i.key()); settings.setValue("name",i.key());
settings.setValue("type","text"); settings.setValue("type","text");
=======
QAction *action = new QAction(tr("longitude"),this);
action->setCheckable(true);
action->setChecked(true);
connect(action,SIGNAL(toggled(bool)),this,SLOT(actionTriggered(bool)));
this->addAction(action);
UASQuickViewItem *item = new UASQuickViewItem(this);
item->setTitle(tr("longitude"));
this->layout()->addWidget(item);
uasPropertyToLabelMap["longitude"] = item;
>>>>>>> 975f41067229245752f23de45b80ca4a7e28642d
} }
settings.endArray(); settings.endArray();
settings.sync(); settings.sync();
...@@ -80,6 +91,7 @@ void UASQuickView::loadSettings() ...@@ -80,6 +91,7 @@ void UASQuickView::loadSettings()
int size = settings.beginReadArray("UAS_QUICK_VIEW_ITEMS"); int size = settings.beginReadArray("UAS_QUICK_VIEW_ITEMS");
for (int i=0;i<size;i++) for (int i=0;i<size;i++)
{ {
<<<<<<< HEAD
settings.setArrayIndex(i); settings.setArrayIndex(i);
QString nameval = settings.value("name").toString(); QString nameval = settings.value("name").toString();
QString typeval = settings.value("type").toString(); QString typeval = settings.value("type").toString();
...@@ -149,6 +161,7 @@ void UASQuickView::addUAS(UASInterface* uas) ...@@ -149,6 +161,7 @@ void UASQuickView::addUAS(UASInterface* uas)
void UASQuickView::setActiveUAS(UASInterface* uas) void UASQuickView::setActiveUAS(UASInterface* uas)
{ {
// Clean up from the old UAS
if (this->uas) if (this->uas)
{ {
uasPropertyValueMap.clear(); uasPropertyValueMap.clear();
...@@ -259,6 +272,9 @@ void UASQuickView::valueChanged(const int uasId, const QString& name, const QStr ...@@ -259,6 +272,9 @@ void UASQuickView::valueChanged(const int uasId, const QString& name, const QStr
{ {
quickViewSelectDialog->addItem(name); quickViewSelectDialog->addItem(name);
} }
// And periodically update the view.
updateTimer->start(1000);
} }
uasPropertyValueMap[name] = value; uasPropertyValueMap[name] = value;
} }
......
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