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
42c52402
Commit
42c52402
authored
6 years ago
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow editing of disconnected port
parent
07805f16
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
SerialSettings.qml
src/ui/preferences/SerialSettings.qml
+24
-9
No files found.
src/ui/preferences/SerialSettings.qml
View file @
42c52402
...
...
@@ -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
)
{
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
}
}
}
...
...
This diff is collapsed.
Click to expand it.
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