Commit a50358e9 authored by Bryant's avatar Bryant

Finished merging QGCVehicleConfig.ui, which I hadn't done properly last night....

Finished merging QGCVehicleConfig.ui, which I hadn't done properly last night. Things are now in a usable state again.
parent 76cea4e1
...@@ -275,12 +275,12 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -275,12 +275,12 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
if (left) if (left)
{ {
left = false; left = false;
ui->leftGeneralLayout->addWidget(box); ui->generalLeftLayout->addWidget(box);
} }
else else
{ {
left = true; left = true;
ui->rightGeneralLayout->addWidget(box); ui->generalRightLayout->addWidget(box);
} }
} else { } else {
delete tool; delete tool;
...@@ -305,12 +305,12 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -305,12 +305,12 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
if (left) if (left)
{ {
left = false; left = false;
ui->leftAdvancedLayout->addWidget(box); ui->advancedLeftLayout->addWidget(box);
} }
else else
{ {
left = true; left = true;
ui->rightAdvancedLayout->addWidget(box); ui->advancedRightLayout->addWidget(box);
} }
} else { } else {
delete tool; delete tool;
...@@ -328,8 +328,6 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -328,8 +328,6 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
button->setMinimumWidth(100); button->setMinimumWidth(100);
button->show(); button->show();
button->setText(dir); button->setText(dir);
//QWidget *tab = new QWidget(ui->tabWidget);
//ui->tabWidget->insertTab(2,tab,dir);
QWidget *tab = new QWidget(ui->stackedWidget); QWidget *tab = new QWidget(ui->stackedWidget);
ui->stackedWidget->insertWidget(2,tab); ui->stackedWidget->insertWidget(2,tab);
buttonToWidgetMap[button] = tab; buttonToWidgetMap[button] = tab;
...@@ -367,8 +365,6 @@ void QGCVehicleConfig::loadQgcConfig(bool primary) ...@@ -367,8 +365,6 @@ void QGCVehicleConfig::loadQgcConfig(bool primary)
// Load additional 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);
//ui->tabWidget->insertTab(2,tab,dir);
QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3); QPushButton *button = new QPushButton(ui->scrollAreaWidgetContents_3);
connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked())); connect(button,SIGNAL(clicked()),this,SLOT(menuButtonClicked()));
ui->navBarLayout->insertWidget(2,button); ui->navBarLayout->insertWidget(2,button);
...@@ -722,11 +718,11 @@ void QGCVehicleConfig::loadConfig() ...@@ -722,11 +718,11 @@ void QGCVehicleConfig::loadConfig()
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
if (valuetype == "vehicles") if (valuetype == "vehicles")
{ {
ui->leftGeneralLayout->addWidget(box); ui->generalLeftLayout->addWidget(box);
} }
else if (valuetype == "libraries") else if (valuetype == "libraries")
{ {
ui->rightGeneralLayout->addWidget(box); ui->generalRightLayout->addWidget(box);
} }
box->hide(); box->hide();
toolToBoxMap[tool] = box; toolToBoxMap[tool] = box;
...@@ -776,11 +772,11 @@ void QGCVehicleConfig::loadConfig() ...@@ -776,11 +772,11 @@ void QGCVehicleConfig::loadConfig()
box->layout()->addWidget(tool); box->layout()->addWidget(tool);
if (valuetype == "vehicles") if (valuetype == "vehicles")
{ {
ui->leftGeneralLayout->addWidget(box); ui->generalLeftLayout->addWidget(box);
} }
else if (valuetype == "libraries") else if (valuetype == "libraries")
{ {
ui->rightGeneralLayout->addWidget(box); ui->generalRightLayout->addWidget(box);
} }
box->hide(); box->hide();
toolToBoxMap[tool] = box; toolToBoxMap[tool] = box;
...@@ -843,7 +839,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -843,7 +839,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
additionalTabs.clear(); additionalTabs.clear();
toolWidgets.clear(); toolWidgets.clear();
paramToWidgetMap = NULL; paramToWidgetMap.clear();
libParamToWidgetMap.clear(); libParamToWidgetMap.clear();
systemTypeToParamMap.clear(); systemTypeToParamMap.clear();
toolToBoxMap.clear(); toolToBoxMap.clear();
...@@ -866,13 +862,13 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -866,13 +862,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())
...@@ -889,7 +885,6 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -889,7 +885,6 @@ 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->setButton->setEnabled(true); ui->setButton->setEnabled(true);
ui->refreshButton->setEnabled(true); ui->refreshButton->setEnabled(true);
ui->readButton->setEnabled(true); ui->readButton->setEnabled(true);
...@@ -1187,7 +1182,7 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete ...@@ -1187,7 +1182,7 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
{ {
//New param type, create a QGroupBox for it. //New param type, create a QGroupBox for it.
QWidget* parent; QWidget* parent;
if (ui->leftAdvancedLayout->count() > ui->rightAdvancedLayout->count()) if (ui->advancedLeftLayout->count() > ui->advancedRightLayout->count())
{ {
parent = ui->advancedRightContents; parent = ui->advancedRightContents;
} }
...@@ -1217,15 +1212,14 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete ...@@ -1217,15 +1212,14 @@ void QGCVehicleConfig::parameterChanged(int uas, int component, QString paramete
libParamToWidgetMap.insert(parameterName,tool); libParamToWidgetMap.insert(parameterName,tool);
toolWidgets.append(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->advancedLeftLayout->count() > ui->advancedRightLayout->count())
if (ui->leftAdvancedLayout->count() > ui->rightAdvancedLayout->count())
{ {
ui->rightAdvancedLayout->addWidget(box); ui->advancedRightLayout->addWidget(box);
} }
else else
{ {
ui->leftAdvancedLayout->addWidget(box); ui->advancedLeftLayout->addWidget(box);
} }
toolToBoxMap[tool] = box; toolToBoxMap[tool] = box;
} }
......
...@@ -138,9 +138,9 @@ Config</string> ...@@ -138,9 +138,9 @@ Config</string>
<item> <item>
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>3</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="rcTab">
<layout class="QVBoxLayout" name="verticalLayout_17"> <layout class="QVBoxLayout" name="verticalLayout_17">
<item> <item>
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
...@@ -872,7 +872,7 @@ Config</string> ...@@ -872,7 +872,7 @@ Config</string>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_2"> <widget class="QWidget" name="sensorTab">
<layout class="QVBoxLayout" name="verticalLayout_14"> <layout class="QVBoxLayout" name="verticalLayout_14">
<item> <item>
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="label_3">
...@@ -901,13 +901,13 @@ p, li { white-space: pre-wrap; } ...@@ -901,13 +901,13 @@ p, li { white-space: pre-wrap; }
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents_7"> <widget class="QWidget" name="sensorContents">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>33</width> <width>530</width>
<height>20</height> <height>574</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_10">
...@@ -924,7 +924,7 @@ p, li { white-space: pre-wrap; } ...@@ -924,7 +924,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_3"> <widget class="QWidget" name="generalTab">
<layout class="QVBoxLayout" name="verticalLayout_11"> <layout class="QVBoxLayout" name="verticalLayout_11">
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
...@@ -976,13 +976,13 @@ p, li { white-space: pre-wrap; } ...@@ -976,13 +976,13 @@ p, li { white-space: pre-wrap; }
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents"> <widget class="QWidget" name="generalLeftContents">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>27</width> <width>525</width>
<height>16</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
...@@ -990,7 +990,7 @@ p, li { white-space: pre-wrap; } ...@@ -990,7 +990,7 @@ p, li { white-space: pre-wrap; }
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QVBoxLayout" name="leftGeneralLayout"/> <layout class="QVBoxLayout" name="generalLeftLayout"/>
</item> </item>
</layout> </layout>
</widget> </widget>
...@@ -1013,13 +1013,13 @@ p, li { white-space: pre-wrap; } ...@@ -1013,13 +1013,13 @@ p, li { white-space: pre-wrap; }
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents_2"> <widget class="QWidget" name="generalRightContents">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>27</width> <width>524</width>
<height>16</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
...@@ -1027,7 +1027,7 @@ p, li { white-space: pre-wrap; } ...@@ -1027,7 +1027,7 @@ p, li { white-space: pre-wrap; }
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QVBoxLayout" name="rightGeneralLayout"/> <layout class="QVBoxLayout" name="generalRightLayout"/>
</item> </item>
</layout> </layout>
</widget> </widget>
...@@ -1040,7 +1040,7 @@ p, li { white-space: pre-wrap; } ...@@ -1040,7 +1040,7 @@ p, li { white-space: pre-wrap; }
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_4"> <widget class="QWidget" name="advancedTab">
<layout class="QVBoxLayout" name="verticalLayout_13"> <layout class="QVBoxLayout" name="verticalLayout_13">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
...@@ -1092,13 +1092,13 @@ p, li { white-space: pre-wrap; } ...@@ -1092,13 +1092,13 @@ p, li { white-space: pre-wrap; }
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents_4"> <widget class="QWidget" name="advancedLeftContents">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>27</width> <width>525</width>
<height>16</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_7"> <layout class="QVBoxLayout" name="verticalLayout_7">
...@@ -1106,7 +1106,7 @@ p, li { white-space: pre-wrap; } ...@@ -1106,7 +1106,7 @@ p, li { white-space: pre-wrap; }
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QVBoxLayout" name="leftAdvancedLayout"/> <layout class="QVBoxLayout" name="advancedLeftLayout"/>
</item> </item>
</layout> </layout>
</widget> </widget>
...@@ -1129,13 +1129,13 @@ p, li { white-space: pre-wrap; } ...@@ -1129,13 +1129,13 @@ p, li { white-space: pre-wrap; }
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<widget class="QWidget" name="scrollAreaWidgetContents_5"> <widget class="QWidget" name="advancedRightContents">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>27</width> <width>524</width>
<height>16</height> <height>523</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_8"> <layout class="QVBoxLayout" name="verticalLayout_8">
...@@ -1143,7 +1143,7 @@ p, li { white-space: pre-wrap; } ...@@ -1143,7 +1143,7 @@ p, li { white-space: pre-wrap; }
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<layout class="QVBoxLayout" name="rightAdvancedLayout"/> <layout class="QVBoxLayout" name="advancedRightLayout"/>
</item> </item>
</layout> </layout>
</widget> </widget>
......
...@@ -136,7 +136,7 @@ void UASListWidget::addUAS(UASInterface* uas) ...@@ -136,7 +136,7 @@ void UASListWidget::addUAS(UASInterface* uas)
updateTimer->start(5000); updateTimer->start(5000);
if (uWidget) if (uWidget)
{ {
listLayout->removeWidget(uWidget); m_ui->verticalLayout->removeWidget(uWidget);
delete uWidget; delete uWidget;
uWidget = NULL; uWidget = NULL;
} }
......
...@@ -69,17 +69,6 @@ void UASQuickView::saveSettings() ...@@ -69,17 +69,6 @@ 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();
...@@ -91,7 +80,6 @@ void UASQuickView::loadSettings() ...@@ -91,7 +80,6 @@ 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();
......
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