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
c4ff7197
Unverified
Commit
c4ff7197
authored
Mar 30, 2018
by
Don Gagne
Committed by
GitHub
Mar 30, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6275 from DonLakeFlyer/SerialEdit
Serial comm link: Allow editing of disconnected port
parents
d2a1bb6f
a5ddd1e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
10 deletions
+25
-10
PowerComponent.h
src/AutoPilotPlugins/PX4/PowerComponent.h
+1
-1
SerialSettings.qml
src/ui/preferences/SerialSettings.qml
+24
-9
No files found.
src/AutoPilotPlugins/PX4/PowerComponent.h
View file @
c4ff7197
...
...
@@ -25,7 +25,7 @@ public:
PowerComponent
(
Vehicle
*
vehicle
,
AutoPilotPlugin
*
autopilot
,
QObject
*
parent
=
NULL
);
// Overrides from VehicleComponent
virtual
QStringList
setupCompleteChangedTriggerList
(
void
)
const
;
QStringList
setupCompleteChangedTriggerList
(
void
)
const
override
;
// Overrides from VehicleComponent
QString
name
(
void
)
const
override
;
...
...
src/ui/preferences/SerialSettings.qml
View file @
c4ff7197
...
...
@@ -59,26 +59,41 @@ Item {
id
:
commPortCombo
anchors.verticalCenter
:
parent
.
verticalCenter
width
:
_secondColumn
model
:
QGroundControl
.
linkManager
.
serialPortStrings
visible
:
QGroundControl
.
linkManager
.
serialPortStrings
.
length
>
0
onActivated
:
{
if
(
index
!=
-
1
)
{
subEditConfig
.
portName
=
QGroundControl
.
linkManager
.
serialPorts
[
index
]
if
(
index
>=
QGroundControl
.
linkManager
.
serialPortStrings
.
length
)
{
// This item was adding at the end, must use added text as name
subEditConfig
.
portName
=
commPortCombo
.
textAt
(
index
)
}
else
{
subEditConfig
.
portName
=
QGroundControl
.
linkManager
.
serialPorts
[
index
]
}
}
}
Component
.
onCompleted
:
{
if
(
subEditConfig
!=
null
)
{
if
(
subEditConfig
.
portDisplayName
===
""
&&
QGroundControl
.
linkManager
.
serialPorts
.
length
>
0
)
var
index
var
serialPorts
=
[
]
for
(
var
i
=
0
;
i
<
QGroundControl
.
linkManager
.
serialPortStrings
.
length
;
i
++
)
{
serialPorts
.
push
(
QGroundControl
.
linkManager
.
serialPortStrings
[
i
])
}
if
(
subEditConfig
!=
null
)
{
if
(
subEditConfig
.
portDisplayName
===
""
&&
QGroundControl
.
linkManager
.
serialPorts
.
length
>
0
)
{
subEditConfig
.
portName
=
QGroundControl
.
linkManager
.
serialPorts
[
0
]
var
index
=
commPortCombo
.
find
(
subEditConfig
.
portDisplayName
)
}
index
=
serialPorts
.
indexOf
(
subEditConfig
.
portDisplayName
)
if
(
index
===
-
1
)
{
console
.
warn
(
qsTr
(
"
Serial Port not present
"
),
subEditConfig
.
portName
)
}
else
{
commPortCombo
.
currentIndex
=
index
serialPorts
.
push
(
subEditConfig
.
portName
)
index
=
serialPorts
.
indexOf
(
subEditConfig
.
portName
)
}
}
else
{
commPortCombo
.
currentI
ndex
=
0
i
ndex
=
0
}
commPortCombo
.
model
=
serialPorts
commPortCombo
.
currentIndex
=
index
}
}
}
...
...
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