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
cab3d7ba
Commit
cab3d7ba
authored
Dec 28, 2014
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add context menu to refresh a single param
parent
6bc001e6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
4 deletions
+34
-4
QGCBaseParamWidget.cc
src/ui/QGCBaseParamWidget.cc
+5
-0
QGCBaseParamWidget.h
src/ui/QGCBaseParamWidget.h
+4
-1
QGCParamTreeWidget.cpp
src/ui/QGCParamTreeWidget.cpp
+22
-3
QGCParamTreeWidget.h
src/ui/QGCParamTreeWidget.h
+1
-0
QGCParamWidget.cc
src/ui/QGCParamWidget.cc
+2
-0
No files found.
src/ui/QGCBaseParamWidget.cc
View file @
cab3d7ba
...
...
@@ -95,6 +95,11 @@ void QGCBaseParamWidget::requestOnboardParamsUpdate()
paramMgr
->
requestParameterList
();
}
void
QGCBaseParamWidget
::
requestOnboardParamUpdate
(
QString
parameterName
)
{
paramMgr
->
requestParameterUpdate
(
paramMgr
->
getDefaultComponentId
(),
parameterName
);
}
void
QGCBaseParamWidget
::
saveParametersToFile
()
{
...
...
src/ui/QGCBaseParamWidget.h
View file @
cab3d7ba
...
...
@@ -29,7 +29,7 @@ protected:
virtual
void
disconnectFromParamManager
();
///< Disconnect from any connected param manager signals
signals:
public
slots
:
virtual
void
handleOnboardParamUpdate
(
int
component
,
const
QString
&
parameterName
,
QVariant
value
)
=
0
;
virtual
void
handlePendingParamUpdate
(
int
compId
,
const
QString
&
paramName
,
QVariant
value
,
bool
isPending
)
=
0
;
...
...
@@ -43,6 +43,9 @@ public slots:
/** @brief Request list of parameters from MAV */
virtual
void
requestOnboardParamsUpdate
();
/** @brief Request single parameter from MAV */
virtual
void
requestOnboardParamUpdate
(
QString
parameterName
);
/** @brief Store parameters to a file */
virtual
void
saveParametersToFile
();
...
...
src/ui/QGCParamTreeWidget.cpp
View file @
cab3d7ba
...
...
@@ -60,9 +60,19 @@ void QGCParamTreeWidget::showContextMenu(const QPoint &pos)
return
;
}
QString
param_id
=
item
->
data
(
0
,
Qt
::
DisplayRole
).
toString
();
QAction
*
act
=
new
QAction
(
tr
(
"Map Parameter to RC"
),
this
);
// Refresh single parameter
QAction
*
act
=
new
QAction
(
tr
(
"Refresh this param"
),
this
);
act
->
setProperty
(
"action"
,
"refresh"
);
act
->
setProperty
(
"param_id"
,
param_id
);
connect
(
act
,
&
QAction
::
triggered
,
this
,
&
QGCParamTreeWidget
::
contextMenuAction
);
menu
.
addAction
(
act
);
// RC to parameter mapping
act
=
new
QAction
(
tr
(
"Map Parameter to RC"
),
this
);
act
->
setProperty
(
"action"
,
"maprc"
);
act
->
setProperty
(
"param_id"
,
param_id
);
connect
(
act
,
&
QAction
::
triggered
,
this
,
&
QGCParamTreeWidget
::
contextMenuAction
);
...
...
@@ -71,7 +81,16 @@ void QGCParamTreeWidget::showContextMenu(const QPoint &pos)
}
void
QGCParamTreeWidget
::
contextMenuAction
()
{
QString
action
=
qobject_cast
<
QAction
*>
(
sender
())
->
property
(
"action"
).
toString
();
QString
param_id
=
qobject_cast
<
QAction
*>
(
sender
())
->
property
(
"param_id"
).
toString
();
emit
mapRCToParamRequest
(
param_id
);
if
(
action
==
"refresh"
)
{
emit
refreshParamRequest
(
param_id
);
}
else
if
(
action
==
"maprc"
)
{
emit
mapRCToParamRequest
(
param_id
);
}
else
{
qDebug
()
<<
"Undefined context menu action"
;
}
}
src/ui/QGCParamTreeWidget.h
View file @
cab3d7ba
...
...
@@ -40,6 +40,7 @@ public:
signals:
void
mapRCToParamRequest
(
QString
param_id
);
void
refreshParamRequest
(
QString
param_id
);
public
slots
:
void
showContextMenu
(
const
QPoint
&
pos
);
...
...
src/ui/QGCParamWidget.cc
View file @
cab3d7ba
...
...
@@ -79,6 +79,8 @@ void QGCParamWidget::connectViewSignalsAndSlots()
this
,
SLOT
(
parameterItemChanged
(
QTreeWidgetItem
*
,
int
)));
connect
(
tree
,
&
QGCParamTreeWidget
::
mapRCToParamRequest
,
this
,
&
QGCParamWidget
::
configureRCToParam
);
connect
(
tree
,
&
QGCParamTreeWidget
::
refreshParamRequest
,
this
,
&
QGCParamWidget
::
requestOnboardParamUpdate
);
}
...
...
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