Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d67a305f
Commit
d67a305f
authored
Apr 18, 2013
by
Michael Carpenter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup and additional error checking in QGCVehicleConfig.cc
parent
5b943e88
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
128 deletions
+47
-128
UAS.cc
src/uas/UAS.cc
+2
-0
QGCVehicleConfig.cc
src/ui/QGCVehicleConfig.cc
+33
-104
QGCVehicleConfig.h
src/ui/QGCVehicleConfig.h
+7
-6
QGCVehicleConfig.ui
src/ui/QGCVehicleConfig.ui
+2
-2
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+3
-16
No files found.
src/uas/UAS.cc
View file @
d67a305f
...
...
@@ -881,6 +881,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
if
(
parameters
.
value
(
component
)
->
contains
(
parameterName
))
parameters
.
value
(
component
)
->
remove
(
parameterName
);
// Insert with correct type
// TODO: This is a hack for MAV_AUTOPILOT_ARDUPILOTMEGA until the new version of MAVLink and a fix for their param handling.
switch
(
value
.
param_type
)
{
case
MAV_PARAM_TYPE_REAL32
:
...
...
@@ -2334,6 +2335,7 @@ void UAS::setParameter(const int component, const QString& id, const QVariant& v
mavlink_param_union_t
union_value
;
// Assign correct value based on QVariant
// TODO: This is a hack for MAV_AUTOPILOT_ARDUPILOTMEGA until the new version of MAVLink and a fix for their param handling.
if
(
getAutopilotType
()
==
MAV_AUTOPILOT_ARDUPILOTMEGA
)
{
switch
(
value
.
type
())
...
...
src/ui/QGCVehicleConfig.cc
View file @
d67a305f
This diff is collapsed.
Click to expand it.
src/ui/QGCVehicleConfig.h
View file @
d67a305f
...
...
@@ -31,7 +31,9 @@ public:
public
slots
:
/** Set the MAV currently being calibrated */
void
setActiveUAS
(
UASInterface
*
active
);
/** Fallback function, automatically called by loadConfig() upon failure to find and xml file*/
void
loadQgcConfig
();
/** Load configuration from xml file */
void
loadConfig
();
/** Start the RC calibration routine */
void
startCalibrationRC
();
...
...
@@ -173,18 +175,17 @@ protected:
QList
<
QGCToolWidget
*>
toolWidgets
;
///< Configurable widgets
bool
calibrationEnabled
;
///< calibration mode on / off
QMap
<
QString
,
QGCToolWidget
*>
*
paramToWidgetMap
;
QMap
<
QString
,
QGCToolWidget
*>
*
libParamToWidgetMap
;
QMap
<
QString
,
QMap
<
QString
,
QGCToolWidget
*>*>
systemTypeToParamMap
;
QMap
<
QGCToolWidget
*
,
QGroupBox
*>
toolToBoxMap
;
QMap
<
QString
,
QString
>
paramTooltips
;
QMap
<
QString
,
QGCToolWidget
*>
*
paramToWidgetMap
;
///< Holds the current active MAV's parameter widgets.
QMap
<
QString
,
QGCToolWidget
*>
*
libParamToWidgetMap
;
///< Holds the library parameter widgets
QMap
<
QString
,
QMap
<
QString
,
QGCToolWidget
*>*>
systemTypeToParamMap
;
///< Holds all loaded MAV specific parameter widgets, for every MAV.
QMap
<
QGCToolWidget
*
,
QGroupBox
*>
toolToBoxMap
;
///< Easy method of figuring out which QGroupBox is tied to which ToolWidget.
QMap
<
QString
,
QString
>
paramTooltips
;
///< Tooltips for the ? button next to a parameter.
private:
Ui
::
QGCVehicleConfig
*
ui
;
signals:
void
visibilityChanged
(
bool
visible
);
void
configReady
();
};
#endif // QGCVEHICLECONFIG_H
src/ui/QGCVehicleConfig.ui
View file @
d67a305f
...
...
@@ -946,7 +946,7 @@ p, li { white-space: pre-wrap; }
<number>
0
</number>
</property>
<item>
<layout
class=
"QVBoxLayout"
name=
"left
HWSpecific
Layout"
/>
<layout
class=
"QVBoxLayout"
name=
"left
Advanced
Layout"
/>
</item>
</layout>
</widget>
...
...
@@ -983,7 +983,7 @@ p, li { white-space: pre-wrap; }
<number>
0
</number>
</property>
<item>
<layout
class=
"QVBoxLayout"
name=
"right
HWSpecific
Layout"
/>
<layout
class=
"QVBoxLayout"
name=
"right
Advanced
Layout"
/>
</item>
</layout>
</widget>
...
...
src/ui/designer/QGCToolWidget.cc
View file @
d67a305f
...
...
@@ -200,18 +200,11 @@ QList<QString> QGCToolWidget::getParamList()
}
void
QGCToolWidget
::
setParameterValue
(
int
uas
,
int
component
,
QString
parameterName
,
const
QVariant
value
)
{
//settings.setValue("QGC_PARAM_SLIDER_PARAMID", parameterName);
//settings.setValue("QGC_PARAM_COMBOBOX_PARAMID", parameterName);
QString
widgetName
=
getTitle
();
//settings.beginGroup(widgetName);
//qDebug() << "LOADING FOR" << widgetName;
//int size = settings.beginReadArray("QGC_TOOL_WIDGET_ITEMS");
int
size
=
settingsMap
[
"count"
].
toInt
();
//qDebug() << "CHILDREN SIZE:" << size;
if
(
paramToItemMap
.
contains
(
parameterName
))
{
//slider->setParameterValue(uas,component,0,-1,paramname,value);
//paramToItemMap[parameterName]->set
//If we already have an item for this parameter, updates are handled internally.
return
;
}
...
...
@@ -221,9 +214,8 @@ void QGCToolWidget::setParameterValue(int uas, int component, QString parameterN
QGCToolWidgetItem
*
item
=
NULL
;
if
(
type
==
"COMMANDBUTTON"
)
{
return
;
//item = new QGCCommandButton(this);
//qDebug() << "CREATED COMMANDBUTTON";
//This shouldn't happen, but I'm not sure... so lets test for it.
continue
;
}
else
if
(
type
==
"SLIDER"
)
{
...
...
@@ -234,11 +226,8 @@ void QGCToolWidget::setParameterValue(int uas, int component, QString parameterN
paramToItemMap
[
parameterName
]
=
item
;
addToolWidget
(
item
);
item
->
readSettings
(
widgetName
+
"
\\
"
+
QString
::
number
(
j
)
+
"
\\
"
,
settingsMap
);
return
;
}
//qDebug() << "CREATED PARAM SLIDER";
}
else
if
(
type
==
"COMBO"
)
{
...
...
@@ -251,8 +240,6 @@ void QGCToolWidget::setParameterValue(int uas, int component, QString parameterN
paramToItemMap
[
parameterName
]
=
item
;
return
;
}
//qDebug() << "CREATED PARAM COMBOBOX";
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment