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
cea599b9
Commit
cea599b9
authored
Mar 10, 2017
by
Jacob Walser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add manual entry option for enumerated and bitmask parameters
parent
6b10539a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
ParameterEditorDialog.qml
src/QmlControls/ParameterEditorDialog.qml
+34
-11
No files found.
src/QmlControls/ParameterEditorDialog.qml
View file @
cea599b9
...
...
@@ -34,18 +34,11 @@ QGCViewDialog {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
function
accept
()
{
if
(
bitmaskColumn
.
visible
)
{
var
value
=
0
;
for
(
var
i
=
0
;
i
<
fact
.
bitmaskValues
.
length
;
++
i
)
{
var
checkbox
=
bitmaskRepeater
.
itemAt
(
i
)
if
(
checkbox
.
checked
)
{
value
|=
fact
.
bitmaskValues
[
i
];
}
}
fact
.
value
=
value
;
if
(
bitmaskColumn
.
visible
&&
!
manualEntry
.
checked
)
{
fact
.
value
=
bitmaskValue
();
fact
.
valueChanged
(
fact
.
value
)
hideDialog
();
}
else
if
(
factCombo
.
visible
)
{
}
else
if
(
factCombo
.
visible
&&
!
manualEntry
.
checked
)
{
fact
.
enumIndex
=
factCombo
.
currentIndex
hideDialog
()
}
else
{
...
...
@@ -61,6 +54,17 @@ QGCViewDialog {
}
}
function
bitmaskValue
()
{
var
value
=
0
;
for
(
var
i
=
0
;
i
<
fact
.
bitmaskValues
.
length
;
++
i
)
{
var
checkbox
=
bitmaskRepeater
.
itemAt
(
i
)
if
(
checkbox
.
checked
)
{
value
|=
fact
.
bitmaskValues
[
i
];
}
}
return
value
}
Component.onCompleted
:
{
if
(
validate
)
{
validationError
.
text
=
fact
.
validate
(
validateValue
,
false
/* convertOnly */
)
...
...
@@ -79,6 +83,17 @@ QGCViewDialog {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
// Checkbox to allow manual entry of enumerated or bitmask parameters
QGCCheckBox
{
id
:
manualEntry
visible
:
factCombo
.
visible
||
bitmaskColumn
.
visible
text
:
qsTr
(
"
Manual Entry (Advanced User)
"
)
onClicked
:
{
valueField
.
text
=
fact
.
valueString
}
}
QGCLabel
{
id
:
validationError
width
:
parent
.
width
...
...
@@ -94,7 +109,7 @@ QGCViewDialog {
QGCTextField
{
id
:
valueField
text
:
validate
?
validateValue
:
fact
.
valueString
visible
:
fact
.
enumStrings
.
length
==
0
||
validate
visible
:
fact
.
enumStrings
.
length
==
0
||
validate
||
manualEntry
.
checked
unitsLabel
:
fact
.
units
showUnits
:
fact
.
units
!=
""
Layout.fillWidth
:
true
...
...
@@ -132,6 +147,10 @@ QGCViewDialog {
currentIndex
=
fact
.
enumIndex
}
}
onCurrentIndexChanged
:
{
valueField
.
text
=
fact
.
enumValues
[
currentIndex
]
}
}
Column
{
...
...
@@ -146,6 +165,10 @@ QGCViewDialog {
delegate
:
QGCCheckBox
{
text
:
modelData
checked
:
fact
.
value
&
fact
.
bitmaskValues
[
index
]
onClicked
:
{
valueField
.
text
=
bitmaskValue
()
}
}
}
}
...
...
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