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
01498cb2
Commit
01498cb2
authored
Jan 03, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2513 from DonLakeFlyer/ParamEditWork
Parameter editor work
parents
05092fe2
62e45635
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
ParameterEditor.qml
src/QmlControls/ParameterEditor.qml
+1
-1
ParameterEditorDialog.qml
src/QmlControls/ParameterEditorDialog.qml
+31
-8
No files found.
src/QmlControls/ParameterEditor.qml
View file @
01498cb2
...
...
@@ -290,7 +290,7 @@ QGCView {
id
:
valueLabel
width
:
ScreenTools
.
defaultFontPixelWidth
*
20
color
:
factRow
.
modelFact
.
defaultValueAvailable
?
(
factRow
.
modelFact
.
valueEqualsDefault
?
__qgcPal
.
text
:
__qgcPal
.
warningText
)
:
__qgcPal
.
text
text
:
factRow
.
modelFact
.
valueString
+
"
"
+
factRow
.
modelFact
.
units
text
:
factRow
.
modelFact
.
enumStrings
.
length
==
0
?
factRow
.
modelFact
.
valueString
+
"
"
+
factRow
.
modelFact
.
units
:
factRow
.
modelFact
.
enumStringValue
}
QGCLabel
{
text
:
factRow
.
modelFact
.
shortDescription
...
...
src/QmlControls/ParameterEditorDialog.qml
View file @
01498cb2
...
...
@@ -35,6 +35,8 @@ import QGroundControl.FactControls 1.0
import
QGroundControl
.
ScreenTools
1.0
QGCViewDialog
{
id
:
root
property
Fact
fact
property
bool
validate
:
false
property
string
validateValue
...
...
@@ -42,14 +44,19 @@ QGCViewDialog {
ParameterEditorController
{
id
:
controller
;
factPanel
:
parent
}
function
accept
()
{
var
errorString
=
fact
.
validate
(
valueField
.
text
,
forceSave
.
checked
)
if
(
errorString
==
""
)
{
fact
.
value
=
valueField
.
text
fact
.
valueChanged
(
fact
.
value
)
if
(
factCombo
.
visible
)
{
fact
.
enumIndex
=
factCombo
.
currentIndex
hideDialog
()
}
else
{
validationError
.
text
=
errorString
forceSave
.
visible
=
true
var
errorString
=
fact
.
validate
(
valueField
.
text
,
forceSave
.
checked
)
if
(
errorString
==
""
)
{
fact
.
value
=
valueField
.
text
fact
.
valueChanged
(
fact
.
value
)
hideDialog
()
}
else
{
validationError
.
text
=
errorString
forceSave
.
visible
=
true
}
}
}
...
...
@@ -80,14 +87,30 @@ QGCViewDialog {
}
QGCTextField
{
id
:
valueField
text
:
validate
?
validateValue
:
fact
.
valueString
id
:
valueField
text
:
validate
?
validateValue
:
fact
.
valueString
visible
:
fact
.
enumStrings
.
length
==
0
||
validate
//focus: true
// At this point all Facts are numeric
inputMethodHints
:
Qt
.
ImhFormattedNumbersOnly
}
QGCComboBox
{
id
:
factCombo
width
:
valueField
.
width
visible
:
fact
.
enumStrings
.
length
!=
0
&&
!
validate
model
:
fact
.
enumStrings
Component.onCompleted
:
{
// We can't bind directly to fact.enumIndex since that would add an unknown value
// if there are no enum strings.
if
(
visible
)
{
currentIndex
=
fact
.
enumIndex
}
}
}
QGCLabel
{
text
:
fact
.
name
}
Row
{
...
...
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