Commit 66d3ab68 authored by Michael Carpenter's avatar Michael Carpenter

Changes to allow for new configuration parameters

parent e13b3a0d
...@@ -184,6 +184,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -184,6 +184,7 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
mav->requestParameters(); mav->requestParameters();
QString defaultsDir = qApp->applicationDirPath() + "/files/" + mav->getAutopilotTypeName().toLower() + "/widgets/"; QString defaultsDir = qApp->applicationDirPath() + "/files/" + mav->getAutopilotTypeName().toLower() + "/widgets/";
qDebug() << "CALIBRATION!! System Type Name:" << mav->getSystemTypeName();
QGCToolWidget* tool; QGCToolWidget* tool;
...@@ -202,7 +203,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -202,7 +203,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
if (tool->loadSettings(defaultsDir + "px4_mc_attitude_pid_params.qgw", false)) if (tool->loadSettings(defaultsDir + "px4_mc_attitude_pid_params.qgw", false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
ui->multiRotorAttitudeLayout->addWidget(tool); QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout());
box->layout()->addWidget(tool);
ui->multiRotorAttitudeLayout->addWidget(box);
//ui->multiRotorAttitudeLayout->addWidget(tool);
} else { } else {
delete tool; delete tool;
} }
...@@ -212,7 +218,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -212,7 +218,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
if (tool->loadSettings(defaultsDir + "px4_mc_position_pid_params.qgw", false)) if (tool->loadSettings(defaultsDir + "px4_mc_position_pid_params.qgw", false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
ui->multiRotorPositionLayout->addWidget(tool); QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout());
box->layout()->addWidget(tool);
ui->multiRotorAttitudeLayout->addWidget(box);
//ui->multiRotorPositionLayout->addWidget(tool);
} else { } else {
delete tool; delete tool;
} }
...@@ -222,7 +233,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -222,7 +233,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
if (tool->loadSettings(defaultsDir + "px4_fw_attitude_pid_params.qgw", false)) if (tool->loadSettings(defaultsDir + "px4_fw_attitude_pid_params.qgw", false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
ui->fixedWingAttitudeLayout->addWidget(tool); QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout());
box->layout()->addWidget(tool);
ui->multiRotorAttitudeLayout->addWidget(box);
//ui->fixedWingAttitudeLayout->addWidget(tool);
} else { } else {
delete tool; delete tool;
} }
...@@ -232,7 +248,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active) ...@@ -232,7 +248,12 @@ void QGCVehicleConfig::setActiveUAS(UASInterface* active)
if (tool->loadSettings(defaultsDir + "px4_fw_position_pid_params.qgw", false)) if (tool->loadSettings(defaultsDir + "px4_fw_position_pid_params.qgw", false))
{ {
toolWidgets.append(tool); toolWidgets.append(tool);
ui->fixedWingPositionLayout->addWidget(tool); QGroupBox *box = new QGroupBox(this);
box->setTitle(tool->objectName());
box->setLayout(new QVBoxLayout());
box->layout()->addWidget(tool);
ui->multiRotorAttitudeLayout->addWidget(box);
//ui->fixedWingPositionLayout->addWidget(tool);
} else { } else {
delete tool; delete tool;
} }
......
...@@ -154,6 +154,7 @@ bool QGCToolWidget::loadSettings(const QString& settings, bool singleinstance) ...@@ -154,6 +154,7 @@ bool QGCToolWidget::loadSettings(const QString& settings, bool singleinstance)
if (groups.length() > 0) if (groups.length() > 0)
{ {
QString widgetName = groups.first(); QString widgetName = groups.first();
this->setObjectName(widgetName);
if (singleinstance && QGCToolWidget::instances()->keys().contains(widgetName)) return false; if (singleinstance && QGCToolWidget::instances()->keys().contains(widgetName)) return false;
// Do not use setTitle() here, // Do not use setTitle() here,
// interferes with loading settings // interferes with loading settings
......
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