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
dcc977c4
Commit
dcc977c4
authored
Sep 19, 2017
by
Beat Küng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ParameterEditor: allow searching for multiple independent words
parent
add505fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
ParameterEditor.qml
src/QmlControls/ParameterEditor.qml
+1
-1
ParameterEditorController.cc
src/QmlControls/ParameterEditorController.cc
+13
-4
No files found.
src/QmlControls/ParameterEditor.qml
View file @
dcc977c4
...
...
@@ -32,7 +32,7 @@ QGCView {
property
Fact
_editorDialogFact
:
Fact
{
}
property
int
_rowHeight
:
ScreenTools
.
defaultFontPixelHeight
*
2
property
int
_rowWidth
:
10
// Dynamic adjusted at runtime
property
bool
_searchFilter
:
searchText
.
text
!=
""
///< true: showing results of search
property
bool
_searchFilter
:
searchText
.
text
.
trim
()
!=
""
///< true: showing results of search
property
var
_searchResults
///< List of parameter names from search results
property
bool
_showRCToParam
:
!
ScreenTools
.
isMobile
&&
QGroundControl
.
multiVehicleManager
.
activeVehicle
.
px4Firmware
...
...
src/QmlControls/ParameterEditorController.cc
View file @
dcc977c4
...
...
@@ -158,8 +158,9 @@ void ParameterEditorController::setRCToParam(const QString& paramName)
void
ParameterEditorController
::
_updateParameters
(
void
)
{
QObjectList
newParameterList
;
QStringList
searchItems
=
_searchText
.
split
(
' '
,
QString
::
SkipEmptyParts
);
if
(
_searchText
.
isEmpty
())
{
if
(
searchItems
.
isEmpty
())
{
const
QMap
<
int
,
QMap
<
QString
,
QStringList
>
>&
groupMap
=
_vehicle
->
parameterManager
()
->
getGroupMap
();
foreach
(
const
QString
&
parameter
,
groupMap
[
_currentComponentId
][
_currentGroup
])
{
newParameterList
.
append
(
_vehicle
->
parameterManager
()
->
getParameter
(
_currentComponentId
,
parameter
));
...
...
@@ -167,9 +168,17 @@ void ParameterEditorController::_updateParameters(void)
}
else
{
foreach
(
const
QString
&
parameter
,
_vehicle
->
parameterManager
()
->
parameterNames
(
_vehicle
->
defaultComponentId
()))
{
Fact
*
fact
=
_vehicle
->
parameterManager
()
->
getParameter
(
_vehicle
->
defaultComponentId
(),
parameter
);
if
(
fact
->
name
().
contains
(
_searchText
,
Qt
::
CaseInsensitive
)
||
fact
->
shortDescription
().
contains
(
_searchText
,
Qt
::
CaseInsensitive
)
||
fact
->
longDescription
().
contains
(
_searchText
,
Qt
::
CaseInsensitive
))
{
bool
matched
=
true
;
// all of the search items must match in order for the parameter to be added to the list
for
(
const
auto
&
searchItem
:
searchItems
)
{
if
(
!
fact
->
name
().
contains
(
searchItem
,
Qt
::
CaseInsensitive
)
&&
!
fact
->
shortDescription
().
contains
(
searchItem
,
Qt
::
CaseInsensitive
)
&&
!
fact
->
longDescription
().
contains
(
searchItem
,
Qt
::
CaseInsensitive
))
{
matched
=
false
;
}
}
if
(
matched
)
{
newParameterList
.
append
(
fact
);
}
}
...
...
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