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
2e816711
Commit
2e816711
authored
Jun 06, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3497 from DonLakeFlyer/SimpleFlightModeSmallScreen
Simple flight mode small screen
parents
06520510
c2544df7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
20 deletions
+82
-20
PX4SimpleFlightModes.qml
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
+54
-20
MockLink.cc
src/comm/MockLink.cc
+27
-0
MockLink.h
src/comm/MockLink.h
+1
-0
No files found.
src/AutoPilotPlugins/PX4/PX4SimpleFlightModes.qml
View file @
2e816711
...
...
@@ -27,8 +27,8 @@ Item {
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
readonly
property
real
_flightModeComboWidth
:
ScreenTools
.
defaultFontPixelWidth
*
2
3
readonly
property
real
_channelComboWidth
:
ScreenTools
.
defaultFontPixelWidth
*
20
readonly
property
real
_flightModeComboWidth
:
ScreenTools
.
defaultFontPixelWidth
*
1
3
readonly
property
real
_channelComboWidth
:
ScreenTools
.
defaultFontPixelWidth
*
13
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
panel
.
enabled
}
...
...
@@ -80,7 +80,7 @@ Item {
QGCLabel
{
id
:
modeChannelLabel
anchors.baseline
:
modeChannelCombo
.
baseline
text
:
qsTr
(
"
Flight m
ode channel:
"
)
text
:
qsTr
(
"
M
ode channel:
"
)
}
FactComboBox
{
...
...
@@ -139,28 +139,62 @@ Item {
anchors.top
:
parent
.
top
spacing
:
ScreenTools
.
defaultFontPixelHeight
R
epeater
{
model
:
[
"
RC_MAP_RETURN_SW
"
,
"
RC_MAP_KILL_SW
"
,
"
RC_MAP_OFFB_SW
"
]
R
ow
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_RETURN_SW
"
)
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
modelData
)
QGCLabel
{
anchors.baseline
:
returnCombo
.
baseline
text
:
"
Return switch:
"
color
:
fact
.
value
==
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
}
QGCLabel
{
anchors.baseline
:
optCombo
.
baseline
text
:
fact
.
shortDescription
+
"
:
"
color
:
fact
.
value
==
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
}
FactComboBox
{
id
:
returnCombo
width
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
FactComboBox
{
id
:
optCombo
width
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_KILL_SW
"
)
QGCLabel
{
anchors.baseline
:
killCombo
.
baseline
text
:
"
Kill switch:
"
color
:
fact
.
value
==
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
}
FactComboBox
{
id
:
killCombo
width
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
// Repeater
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
property
Fact
fact
:
controller
.
getParameterFact
(
-
1
,
"
RC_MAP_OFFB_SW
"
)
QGCLabel
{
anchors.baseline
:
offboardCombo
.
baseline
text
:
"
Offboard switch:
"
color
:
fact
.
value
==
0
?
qgcPal
.
text
:
(
controller
.
rcChannelValues
[
fact
.
value
-
1
]
>=
1500
?
"
yellow
"
:
qgcPal
.
text
)
}
FactComboBox
{
id
:
offboardCombo
width
:
_channelComboWidth
fact
:
parent
.
fact
indexModel
:
false
}
}
}
// Column
}
// Rectangle
...
...
src/comm/MockLink.cc
View file @
2e816711
...
...
@@ -158,6 +158,10 @@ void MockLink::_run1HzTasks(void)
if
(
_mavlinkStarted
&&
_connected
)
{
_sendHeartBeat
();
_sendVibration
();
if
(
!
qgcApp
()
->
runningUnitTests
())
{
// Sending RC Channels during unit test breaks RC tests which does it's own RC simulation
_sendRCChannels
();
}
if
(
_sendHomePositionDelayCount
>
0
)
{
// We delay home position a bit to be more realistic
_sendHomePositionDelayCount
--
;
...
...
@@ -1026,3 +1030,26 @@ MockLink* MockLink::startAPMArduPlaneMockLink(bool sendStatusText)
return
_startMockLink
(
mockConfig
);
}
void
MockLink
::
_sendRCChannels
(
void
)
{
mavlink_message_t
msg
;
mavlink_msg_rc_channels_pack
(
_vehicleSystemId
,
_vehicleComponentId
,
&
msg
,
0
,
// time_boot_ms
8
,
// chancount
1500
,
// chan1_raw
1500
,
// chan2_raw
1500
,
// chan3_raw
1500
,
// chan4_raw
1500
,
// chan5_raw
1500
,
// chan6_raw
1500
,
// chan7_raw
1500
,
// chan8_raw
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
UINT16_MAX
,
0
);
// rssi
respondWithMavlinkMessage
(
msg
);
}
src/comm/MockLink.h
View file @
2e816711
...
...
@@ -173,6 +173,7 @@ private:
void
_sendVibration
(
void
);
void
_sendStatusTextMessages
(
void
);
void
_respondWithAutopilotVersion
(
void
);
void
_sendRCChannels
(
void
);
static
MockLink
*
_startMockLink
(
MockConfiguration
*
mockConfig
);
...
...
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