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
d1d7a920
Commit
d1d7a920
authored
Dec 28, 2014
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc2param: min and max value
parent
cab3d7ba
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
111 additions
and
53 deletions
+111
-53
v1.0
libs/mavlink/include/mavlink/v1.0
+1
-1
UAS.cc
src/uas/UAS.cc
+9
-5
UAS.h
src/uas/UAS.h
+1
-1
UASInterface.h
src/uas/UASInterface.h
+1
-1
QGCMapRCToParamDialog.cpp
src/ui/QGCMapRCToParamDialog.cpp
+3
-1
QGCMapRCToParamDialog.h
src/ui/QGCMapRCToParamDialog.h
+2
-2
QGCMapRCToParamDialog.ui
src/ui/QGCMapRCToParamDialog.ui
+94
-42
No files found.
v1.0
@
c96b64ad
Subproject commit c
0a0dff2b36a97614208559a23a9804ab9f2e636
Subproject commit c
96b64adc3ff126559366c445633f88252d53b2d
src/uas/UAS.cc
View file @
d1d7a920
...
...
@@ -3468,9 +3468,9 @@ void UAS::stopLowBattAlarm()
}
}
void
UAS
::
sendMapRCToParam
(
QString
param_id
,
float
scale
,
float
current_value
,
quint8
param_rc_channel_inde
x
)
void
UAS
::
sendMapRCToParam
(
QString
param_id
,
float
scale
,
float
value0
,
quint8
param_rc_channel_index
,
float
valueMin
,
float
valueMa
x
)
{
qDebug
()
<<
"sendMapRCToParam"
<<
param_id
<<
"scale"
<<
scale
<<
"
curval"
<<
current_value
<<
"param rc chan index"
<<
param_rc_channel_index
;
qDebug
()
<<
"sendMapRCToParam"
<<
param_id
<<
"scale"
<<
scale
<<
"
value0"
<<
value0
<<
"param rc chan index"
<<
param_rc_channel_index
;
mavlink_message_t
message
;
mavlink_msg_param_map_rc_pack
(
mavlink
->
getSystemId
(),
...
...
@@ -3481,11 +3481,14 @@ void UAS::sendMapRCToParam(QString param_id, float scale, float current_value, q
param_id
.
toStdString
().
c_str
(),
-
1
,
param_rc_channel_index
,
current_value
,
scale
);
value0
,
scale
,
valueMin
,
valueMax
);
sendMessage
(
message
);
qDebug
()
<<
"Mavlink message sent"
;
}
void
UAS
::
unsetRCToParameterMap
()
{
qDebug
()
<<
"unsetRCToParameterMap"
;
...
...
@@ -3500,8 +3503,9 @@ void UAS::unsetRCToParameterMap()
-
2
,
i
,
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
);
sendMessage
(
message
);
}
}
src/uas/UAS.h
View file @
d1d7a920
...
...
@@ -885,7 +885,7 @@ public slots:
void
triggerAction
(
int
action
);
/** @brief Send command to map a RC channel to a parameter */
void
sendMapRCToParam
(
QString
param_id
,
float
scale
,
float
current_value
,
quint8
param_rc_channel_inde
x
);
void
sendMapRCToParam
(
QString
param_id
,
float
scale
,
float
value0
,
quint8
param_rc_channel_index
,
float
valueMin
,
float
valueMa
x
);
/** @brief Send command to disable all bindings/maps between RC and parameters */
void
unsetRCToParameterMap
();
...
...
src/uas/UASInterface.h
View file @
d1d7a920
...
...
@@ -392,7 +392,7 @@ public slots:
float
flow_comp_m_y
,
quint8
quality
,
float
ground_distance
)
=
0
;
/** @brief Send command to map a RC channel to a parameter */
virtual
void
sendMapRCToParam
(
QString
param_id
,
float
scale
,
float
current_value
,
quint8
param_rc_channel_inde
x
)
=
0
;
virtual
void
sendMapRCToParam
(
QString
param_id
,
float
scale
,
float
value0
,
quint8
param_rc_channel_index
,
float
valueMin
,
float
valueMa
x
)
=
0
;
/** @brief Send command to disable all bindings/maps between RC and parameters */
virtual
void
unsetRCToParameterMap
()
=
0
;
...
...
src/ui/QGCMapRCToParamDialog.cpp
View file @
d1d7a920
...
...
@@ -67,7 +67,9 @@ void QGCMapRCToParamDialog::accept() {
emit
mapRCToParamDialogResult
(
param_id
,
(
float
)
ui
->
scaleDoubleSpinBox
->
value
(),
(
float
)
ui
->
value0DoubleSpinBox
->
value
(),
(
quint8
)
ui
->
rcParamChannelComboBox
->
currentIndex
());
(
quint8
)
ui
->
rcParamChannelComboBox
->
currentIndex
(),
(
float
)
ui
->
minValueDoubleSpinBox
->
value
(),
(
float
)
ui
->
maxValueDoubleSpinBox
->
value
());
QDialog
::
accept
();
}
...
...
src/ui/QGCMapRCToParamDialog.h
View file @
d1d7a920
...
...
@@ -76,8 +76,8 @@ public:
~
QGCMapRCToParamDialog
();
signals:
void
mapRCToParamDialogResult
(
QString
param_id
,
float
scale
,
float
current_value
,
quint8
param_rc_channel_index
);
void
mapRCToParamDialogResult
(
QString
param_id
,
float
scale
,
float
value0
,
quint8
param_rc_channel_index
,
float
valueMin
,
float
valueMax
);
void
refreshParam
();
public
slots
:
...
...
src/ui/QGCMapRCToParamDialog.ui
View file @
d1d7a920
...
...
@@ -7,7 +7,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
3
00
</height>
<height>
3
15
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -17,7 +17,7 @@
<property
name=
"geometry"
>
<rect>
<x>
30
</x>
<y>
2
4
0
</y>
<y>
2
8
0
</y>
<width>
341
</width>
<height>
32
</height>
</rect>
...
...
@@ -35,13 +35,59 @@
<x>
9
</x>
<y>
9
</y>
<width>
381
</width>
<height>
2
3
1
</height>
<height>
2
7
1
</height>
</rect>
</property>
<layout
class=
"QFormLayout"
name=
"formLayout"
>
<property
name=
"fieldGrowthPolicy"
>
<enum>
QFormLayout::AllNonFixedFieldsGrow
</enum>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label1"
>
<property
name=
"text"
>
<string>
Bind
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"rcParamChannelInfoLabel"
>
<property
name=
"text"
>
<string>
RC-Parameter Channel (Knob No.)
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"rcParamChannelComboBox"
>
<property
name=
"editable"
>
<bool>
false
</bool>
</property>
<property
name=
"currentText"
>
<string>
1
</string>
</property>
<item>
<property
name=
"text"
>
<string>
1
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
2
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
3
</string>
</property>
</item>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label2"
>
<property
name=
"text"
>
<string>
to
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"paramIdInfoLabel"
>
<property
name=
"text"
>
...
...
@@ -56,6 +102,13 @@
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label3"
>
<property
name=
"text"
>
<string>
with
</string>
</property>
</widget>
</item>
<item
row=
"5"
column=
"0"
>
<widget
class=
"QLabel"
name=
"scaleInfoLabel"
>
<property
name=
"text"
>
...
...
@@ -85,69 +138,68 @@
<property
name=
"decimals"
>
<number>
8
</number>
</property>
<property
name=
"minimum"
>
<double>
-100000.000000000000000
</double>
</property>
<property
name=
"maximum"
>
<double>
100000.000000000000000
</double>
</property>
</widget>
</item>
<item
row=
"
1
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"
rcParamChannel
InfoLabel"
>
<item
row=
"
7
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"
min
InfoLabel"
>
<property
name=
"text"
>
<string>
RC-Parameter Channel (Knob No.)
</string>
<string>
Minimum Value
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"rcParamChannelComboBox"
>
<property
name=
"editable"
>
<bool>
false
</bool>
</property>
<property
name=
"currentText"
>
<string>
1
</string>
<item
row=
"7"
column=
"1"
>
<widget
class=
"QDoubleSpinBox"
name=
"minValueDoubleSpinBox"
>
<property
name=
"decimals"
>
<number>
8
</number>
</property>
<item>
<property
name=
"text"
>
<string>
1
</string>
<property
name=
"minimum"
>
<double>
-100000.000000000000000
</double>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
2
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
3
</string>
<property
name=
"maximum"
>
<double>
100000.000000000000000
</double>
</property>
</item>
</widget>
</item>
<item
row=
"
0
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"
label1
"
>
<item
row=
"
8
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"
maxInfoLabel
"
>
<property
name=
"text"
>
<string>
Bind
</string>
<string>
Maximum Value
</string>
</property>
</widget>
</item>
<item
row=
"
2"
column=
"0
"
>
<widget
class=
"Q
Label"
name=
"label2
"
>
<property
name=
"
text
"
>
<
string>
to
</string
>
<item
row=
"
8"
column=
"1
"
>
<widget
class=
"Q
DoubleSpinBox"
name=
"maxValueDoubleSpinBox
"
>
<property
name=
"
decimals
"
>
<
number>
8
</number
>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label3"
>
<property
name=
"text"
>
<string>
with
</string>
<property
name=
"minimum"
>
<double>
-10000.000000000000000
</double>
</property>
<property
name=
"maximum"
>
<double>
100000.000000000000000
</double>
</property>
<property
name=
"singleStep"
>
<double>
1.000000000000000
</double>
</property>
<property
name=
"value"
>
<double>
10.000000000000000
</double>
</property>
</widget>
</item>
<item
row=
"
8
"
column=
"0"
>
<item
row=
"
10
"
column=
"0"
>
<widget
class=
"QLabel"
name=
"infoLabel"
>
<property
name=
"text"
>
<string>
Waiting for parameter refresh,,,
</string>
</property>
</widget>
</item>
<item
row=
"
7
"
column=
"0"
>
<item
row=
"
9
"
column=
"0"
>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
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