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
7664ce33
Commit
7664ce33
authored
Oct 22, 2015
by
Gus Grubba
Browse files
Options
Browse Files
Download
Plain Diff
Merge master
parents
b878b8df
95d99cc6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
144 additions
and
32 deletions
+144
-32
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+10
-4
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+31
-19
MockLink.cc
src/comm/MockLink.cc
+54
-5
MockLink.h
src/comm/MockLink.h
+11
-1
MainWindow.qml
src/ui/MainWindow.qml
+19
-0
MockLinkConfiguration.cc
src/ui/MockLinkConfiguration.cc
+11
-3
MockLinkConfiguration.h
src/ui/MockLinkConfiguration.h
+1
-0
MockLinkConfiguration.ui
src/ui/MockLinkConfiguration.ui
+7
-0
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
7664ce33
...
@@ -41,6 +41,9 @@ import QGroundControl.Controllers 1.0
...
@@ -41,6 +41,9 @@ import QGroundControl.Controllers 1.0
Item
{
Item
{
id
:
root
id
:
root
property
alias
latitude
:
flightMap
.
latitude
property
alias
longitude
:
flightMap
.
longitude
// Top margin for all widgets. Used to prevent overlap with the toolbar
// Top margin for all widgets. Used to prevent overlap with the toolbar
property
real
topMargin
:
0
property
real
topMargin
:
0
...
@@ -110,7 +113,6 @@ Item {
...
@@ -110,7 +113,6 @@ Item {
QGroundControl
.
flightMapSettings
.
saveMapSetting
(
flightMap
.
mapName
,
_showMapBackgroundKey
,
setBool
(
_showMap
))
QGroundControl
.
flightMapSettings
.
saveMapSetting
(
flightMap
.
mapName
,
_showMapBackgroundKey
,
setBool
(
_showMap
))
}
}
FlightMap
{
FlightMap
{
id
:
flightMap
id
:
flightMap
anchors.fill
:
parent
anchors.fill
:
parent
...
@@ -122,6 +124,8 @@ Item {
...
@@ -122,6 +124,8 @@ Item {
property
var
rootVehicleCoordinate
:
_vehicleCoordinate
property
var
rootVehicleCoordinate
:
_vehicleCoordinate
property
bool
rootLoadCompleted
:
false
property
bool
rootLoadCompleted
:
false
property
bool
_followVehicle
:
true
onRootVehicleCoordinateChanged
:
updateMapPosition
(
false
/* force */
)
onRootVehicleCoordinateChanged
:
updateMapPosition
(
false
/* force */
)
Component.onCompleted
:
flightMapDelayLoader
.
source
=
"
FlightDisplayViewDelayLoadInner.qml
"
Component.onCompleted
:
flightMapDelayLoader
.
source
=
"
FlightDisplayViewDelayLoadInner.qml
"
...
@@ -132,9 +136,6 @@ Item {
...
@@ -132,9 +136,6 @@ Item {
flightMap
.
longitude
=
root
.
_vehicleCoordinate
.
longitude
flightMap
.
longitude
=
root
.
_vehicleCoordinate
.
longitude
}
}
}
}
property
bool
_followVehicle
:
true
// Home position
// Home position
MissionItemIndicator
{
MissionItemIndicator
{
label
:
"
H
"
label
:
"
H
"
...
@@ -188,6 +189,11 @@ Item {
...
@@ -188,6 +189,11 @@ Item {
id
:
flightMapDelayLoader
id
:
flightMapDelayLoader
anchors.fill
:
parent
anchors.fill
:
parent
}
}
// Used to make pinch zoom work
MouseArea
{
anchors.fill
:
parent
}
}
// Flight Map
}
// Flight Map
Loader
{
Loader
{
...
...
src/MissionEditor/MissionEditor.qml
View file @
7664ce33
...
@@ -60,10 +60,10 @@ QGCView {
...
@@ -60,10 +60,10 @@ QGCView {
property
var
_homePositionManager
:
QGroundControl
.
homePositionManager
property
var
_homePositionManager
:
QGroundControl
.
homePositionManager
property
string
_homePositionName
:
_homePositionManager
.
homePositions
.
get
(
0
).
name
property
string
_homePositionName
:
_homePositionManager
.
homePositions
.
get
(
0
).
name
property
var
offlineHomePosition
:
_homePositionManager
.
homePositions
.
get
(
0
).
coordinate
//
property var offlineHomePosition: _homePositionManager.homePositions.get(0).coordinate
property
var
liveHomePosition
:
controller
.
liveHomePosition
property
var
liveHomePosition
:
controller
.
liveHomePosition
property
var
liveHomePositionAvailable
:
controller
.
liveHomePositionAvailable
property
var
liveHomePositionAvailable
:
controller
.
liveHomePositionAvailable
property
var
homePosition
:
offlineHomePosition
// live or offline depending on state
//
property var homePosition: offlineHomePosition // live or offline depending on state
property
bool
_syncNeeded
:
controller
.
missionItems
.
dirty
property
bool
_syncNeeded
:
controller
.
missionItems
.
dirty
property
bool
_syncInProgress
:
_activeVehicle
?
_activeVehicle
.
missionManager
.
inProgress
:
false
property
bool
_syncInProgress
:
_activeVehicle
?
_activeVehicle
.
missionManager
.
inProgress
:
false
...
@@ -103,13 +103,14 @@ QGCView {
...
@@ -103,13 +103,14 @@ QGCView {
}
}
function
updateHomePosition
()
{
function
updateHomePosition
()
{
homePosition
=
liveHomePositionAvailable
?
liveHomePosition
:
offlineHomePosition
if
(
liveHomePositionAvailable
)
{
_missionItems
.
get
(
0
).
coordinate
=
homePosition
_missionItems
.
get
(
0
).
coordinate
=
liveHomePosition
_missionItems
.
get
(
0
).
homePositionValid
=
true
_missionItems
.
get
(
0
).
homePositionValid
=
true
}
}
}
Component.onCompleted
:
updateHomePosition
()
Component.onCompleted
:
updateHomePosition
()
onOfflineHomePositionChanged
:
updateHomePosition
()
//
onOfflineHomePositionChanged: updateHomePosition()
onLiveHomePositionAvailableChanged
:
updateHomePosition
()
onLiveHomePositionAvailableChanged
:
updateHomePosition
()
onLiveHomePositionChanged
:
updateHomePosition
()
onLiveHomePositionChanged
:
updateHomePosition
()
...
@@ -124,11 +125,8 @@ QGCView {
...
@@ -124,11 +125,8 @@ QGCView {
id
:
editorMap
id
:
editorMap
anchors.fill
:
parent
anchors.fill
:
parent
mapName
:
"
MissionEditor
"
mapName
:
"
MissionEditor
"
latitude
:
tabletPosition
.
latitude
Component.onCompleted
:
{
longitude
:
tabletPosition
.
longitude
latitude
=
homePosition
.
latitude
longitude
=
homePosition
.
longitude
}
readonly
property
real
animationDuration
:
500
readonly
property
real
animationDuration
:
500
...
@@ -161,8 +159,8 @@ QGCView {
...
@@ -161,8 +159,8 @@ QGCView {
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
if
(
homePositionManagerButton
.
checked
)
{
if
(
false
/*homePositionManagerButton.checked*/
)
{
offlineHomePosition
=
coordinate
//
offlineHomePosition = coordinate
}
else
if
(
addMissionItemsButton
.
checked
)
{
}
else
if
(
addMissionItemsButton
.
checked
)
{
var
index
=
controller
.
addMissionItem
(
coordinate
)
var
index
=
controller
.
addMissionItem
(
coordinate
)
addMissionItemsButtonAutoOffTimer
.
start
()
addMissionItemsButtonAutoOffTimer
.
start
()
...
@@ -240,7 +238,7 @@ QGCView {
...
@@ -240,7 +238,7 @@ QGCView {
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
width
:
_rightPanelWidth
width
:
_rightPanelWidth
visible
:
!
homePositionManagerButton
.
checked
&&
_missionItems
.
count
>
1
visible
:
_missionItems
.
count
>
1
opacity
:
_rightPanelOpacity
opacity
:
_rightPanelOpacity
z
:
QGroundControl
.
zOrderTopMost
z
:
QGroundControl
.
zOrderTopMost
...
@@ -257,7 +255,8 @@ QGCView {
...
@@ -257,7 +255,8 @@ QGCView {
MissionItemEditor
{
MissionItemEditor
{
missionItem
:
object
missionItem
:
object
width
:
parent
.
width
width
:
parent
.
width
readOnly
:
object
.
sequenceNumber
==
0
&&
liveHomePositionAvailable
readOnly
:
object
.
sequenceNumber
==
0
visible
:
!
readOnly
||
object
.
homePositionValid
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
onClicked
:
setCurrentItem
(
object
.
sequenceNumber
)
...
@@ -281,6 +280,9 @@ QGCView {
...
@@ -281,6 +280,9 @@ QGCView {
}
}
}
// Item - Mission Item editor
}
// Item - Mission Item editor
/*
Home Position Manager is commented out for now until a better implementation is completed
// Home Position Manager
// Home Position Manager
Rectangle {
Rectangle {
id: homePositionManager
id: homePositionManager
...
@@ -552,6 +554,7 @@ QGCView {
...
@@ -552,6 +554,7 @@ QGCView {
}
}
} // Column - Online view
} // Column - Online view
} // Item - Home Position Manager
} // Item - Home Position Manager
*/
// Help Panel
// Help Panel
Rectangle
{
Rectangle
{
...
@@ -650,6 +653,9 @@ QGCView {
...
@@ -650,6 +653,9 @@ QGCView {
"
Delete the currently selected mission item.
"
"
Delete the currently selected mission item.
"
}
}
/*
Home Position Manager commented until more complete implementation is done
Image {
Image {
id: homePositionManagerHelpIcon
id: homePositionManagerHelpIcon
anchors.topMargin: ScreenTools.defaultFontPixelHeight
anchors.topMargin: ScreenTools.defaultFontPixelHeight
...
@@ -672,11 +678,12 @@ QGCView {
...
@@ -672,11 +678,12 @@ QGCView {
"When enabled, allows you to select/add/update flying field locations. " +
"When enabled, allows you to select/add/update flying field locations. " +
"You can save multiple flying field locations for use while creating missions while you are not connected to your vehicle."
"You can save multiple flying field locations for use while creating missions while you are not connected to your vehicle."
}
}
*/
Image
{
Image
{
id
:
mapCenterHelpIcon
id
:
mapCenterHelpIcon
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.topMargin
:
ScreenTools
.
defaultFontPixelHeight
anchors.top
:
homePositionManager
HelpText
.
bottom
anchors.top
:
delete
HelpText
.
bottom
width
:
ScreenTools
.
defaultFontPixelHeight
*
3
width
:
ScreenTools
.
defaultFontPixelHeight
*
3
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
mipmap
:
true
...
@@ -793,6 +800,9 @@ QGCView {
...
@@ -793,6 +800,9 @@ QGCView {
}
}
}
}
/*
Home Position Manager commented until more complete implementation is done
RoundButton {
RoundButton {
id: homePositionManagerButton
id: homePositionManagerButton
anchors.margins: _margin
anchors.margins: _margin
...
@@ -802,12 +812,13 @@ QGCView {
...
@@ -802,12 +812,13 @@ QGCView {
exclusiveGroup: _dropButtonsExclusiveGroup
exclusiveGroup: _dropButtonsExclusiveGroup
z: QGroundControl.zOrderWidgets
z: QGroundControl.zOrderWidgets
}
}
*/
DropButton
{
DropButton
{
id
:
centerMapButton
id
:
centerMapButton
anchors.margins
:
_margin
anchors.margins
:
_margin
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.top
:
homePositionManager
Button
.
bottom
anchors.top
:
deleteMissionItem
Button
.
bottom
dropDirection
:
dropRight
dropDirection
:
dropRight
buttonImage
:
"
/qmlimages/MapCenter.svg
"
buttonImage
:
"
/qmlimages/MapCenter.svg
"
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
viewportMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
...
@@ -822,11 +833,12 @@ QGCView {
...
@@ -822,11 +833,12 @@ QGCView {
spacing
:
ScreenTools
.
defaultFontPixelWidth
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCButton
{
QGCButton
{
text
:
"
Home
"
text
:
"
Home
"
enabled
:
liveHomePositionAvailable
onClicked
:
{
onClicked
:
{
centerMapButton
.
hideDropDown
()
centerMapButton
.
hideDropDown
()
editorMap
.
center
=
QtPositioning
.
coordinate
(
homePosition
.
latitude
,
homePosition
.
longitude
)
editorMap
.
center
=
liveHomePosition
}
}
}
}
...
...
src/comm/MockLink.cc
View file @
7664ce33
...
@@ -71,7 +71,8 @@ float MockLink::_vehicleLatitude = 47.633033f;
...
@@ -71,7 +71,8 @@ float MockLink::_vehicleLatitude = 47.633033f;
float
MockLink
::
_vehicleLongitude
=
-
122.08794
f
;
float
MockLink
::
_vehicleLongitude
=
-
122.08794
f
;
float
MockLink
::
_vehicleAltitude
=
2.5
f
;
float
MockLink
::
_vehicleAltitude
=
2.5
f
;
const
char
*
MockConfiguration
::
_firmwareTypeKey
=
"FirmwareType"
;
const
char
*
MockConfiguration
::
_firmwareTypeKey
=
"FirmwareType"
;
const
char
*
MockConfiguration
::
_sendStatusTextKey
=
"SendStatusText"
;
MockLink
::
MockLink
(
MockConfiguration
*
config
)
MockLink
::
MockLink
(
MockConfiguration
*
config
)
:
_missionItemHandler
(
this
)
:
_missionItemHandler
(
this
)
...
@@ -85,10 +86,12 @@ MockLink::MockLink(MockConfiguration* config)
...
@@ -85,10 +86,12 @@ MockLink::MockLink(MockConfiguration* config)
,
_mavState
(
MAV_STATE_STANDBY
)
,
_mavState
(
MAV_STATE_STANDBY
)
,
_autopilotType
(
MAV_AUTOPILOT_PX4
)
,
_autopilotType
(
MAV_AUTOPILOT_PX4
)
,
_fileServer
(
NULL
)
,
_fileServer
(
NULL
)
,
_sendStatusText
(
false
)
{
{
_config
=
config
;
_config
=
config
;
if
(
_config
)
{
if
(
_config
)
{
_autopilotType
=
config
->
firmwareType
();
_autopilotType
=
config
->
firmwareType
();
_sendStatusText
=
config
->
sendStatusText
();
}
}
union
px4_custom_mode
px4_cm
;
union
px4_custom_mode
px4_cm
;
...
@@ -168,6 +171,10 @@ void MockLink::_run1HzTasks(void)
...
@@ -168,6 +171,10 @@ void MockLink::_run1HzTasks(void)
if
(
_mavlinkStarted
&&
_connected
)
{
if
(
_mavlinkStarted
&&
_connected
)
{
_sendHeartBeat
();
_sendHeartBeat
();
_sendHomePosition
();
_sendHomePosition
();
if
(
_sendStatusText
)
{
_sendStatusText
=
false
;
_sendStatusTextMessages
();
}
}
}
}
}
...
@@ -747,9 +754,42 @@ void MockLink::_sendGpsRawInt(void)
...
@@ -747,9 +754,42 @@ void MockLink::_sendGpsRawInt(void)
respondWithMavlinkMessage
(
msg
);
respondWithMavlinkMessage
(
msg
);
}
}
void
MockLink
::
_sendStatusTextMessages
(
void
)
{
struct
StatusMessage
{
MAV_SEVERITY
severity
;
const
char
*
msg
;
};
static
const
struct
StatusMessage
rgMessages
[]
=
{
{
MAV_SEVERITY_INFO
,
"#Testing audio output"
},
{
MAV_SEVERITY_EMERGENCY
,
"Status text emergency"
},
{
MAV_SEVERITY_ALERT
,
"Status text alert"
},
{
MAV_SEVERITY_CRITICAL
,
"Status text critical"
},
{
MAV_SEVERITY_ERROR
,
"Status text error"
},
{
MAV_SEVERITY_WARNING
,
"Status text warning"
},
{
MAV_SEVERITY_NOTICE
,
"Status text notice"
},
{
MAV_SEVERITY_INFO
,
"Status text info"
},
{
MAV_SEVERITY_DEBUG
,
"Status text debug"
},
};
for
(
size_t
i
=
0
;
i
<
sizeof
(
rgMessages
)
/
sizeof
(
rgMessages
[
0
]);
i
++
)
{
mavlink_message_t
msg
;
const
struct
StatusMessage
*
status
=
&
rgMessages
[
i
];
mavlink_msg_statustext_pack
(
_vehicleSystemId
,
_vehicleComponentId
,
&
msg
,
status
->
severity
,
status
->
msg
);
respondWithMavlinkMessage
(
msg
);
}
}
MockConfiguration
::
MockConfiguration
(
const
QString
&
name
)
MockConfiguration
::
MockConfiguration
(
const
QString
&
name
)
:
LinkConfiguration
(
name
)
:
LinkConfiguration
(
name
)
,
_firmwareType
(
MAV_AUTOPILOT_PX4
)
,
_firmwareType
(
MAV_AUTOPILOT_PX4
)
,
_sendStatusText
(
false
)
{
{
}
}
...
@@ -757,21 +797,29 @@ MockConfiguration::MockConfiguration(const QString& name)
...
@@ -757,21 +797,29 @@ MockConfiguration::MockConfiguration(const QString& name)
MockConfiguration
::
MockConfiguration
(
MockConfiguration
*
source
)
MockConfiguration
::
MockConfiguration
(
MockConfiguration
*
source
)
:
LinkConfiguration
(
source
)
:
LinkConfiguration
(
source
)
{
{
_firmwareType
=
source
->
_firmwareType
;
_firmwareType
=
source
->
_firmwareType
;
_sendStatusText
=
source
->
_sendStatusText
;
}
}
void
MockConfiguration
::
copyFrom
(
LinkConfiguration
*
source
)
void
MockConfiguration
::
copyFrom
(
LinkConfiguration
*
source
)
{
{
LinkConfiguration
::
copyFrom
(
source
);
LinkConfiguration
::
copyFrom
(
source
);
MockConfiguration
*
usource
=
dynamic_cast
<
MockConfiguration
*>
(
source
);
MockConfiguration
*
usource
=
dynamic_cast
<
MockConfiguration
*>
(
source
);
Q_ASSERT
(
usource
!=
NULL
);
_firmwareType
=
usource
->
_firmwareType
;
if
(
!
usource
)
{
qWarning
()
<<
"dynamic_cast failed"
<<
source
<<
usource
;
return
;
}
_firmwareType
=
usource
->
_firmwareType
;
_sendStatusText
=
usource
->
_sendStatusText
;
}
}
void
MockConfiguration
::
saveSettings
(
QSettings
&
settings
,
const
QString
&
root
)
void
MockConfiguration
::
saveSettings
(
QSettings
&
settings
,
const
QString
&
root
)
{
{
settings
.
beginGroup
(
root
);
settings
.
beginGroup
(
root
);
settings
.
setValue
(
_firmwareTypeKey
,
(
int
)
_firmwareType
);
settings
.
setValue
(
_firmwareTypeKey
,
(
int
)
_firmwareType
);
settings
.
setValue
(
_sendStatusTextKey
,
_sendStatusText
);
settings
.
sync
();
settings
.
sync
();
settings
.
endGroup
();
settings
.
endGroup
();
}
}
...
@@ -780,6 +828,7 @@ void MockConfiguration::loadSettings(QSettings& settings, const QString& root)
...
@@ -780,6 +828,7 @@ void MockConfiguration::loadSettings(QSettings& settings, const QString& root)
{
{
settings
.
beginGroup
(
root
);
settings
.
beginGroup
(
root
);
_firmwareType
=
(
MAV_AUTOPILOT
)
settings
.
value
(
_firmwareTypeKey
,
(
int
)
MAV_AUTOPILOT_PX4
).
toInt
();
_firmwareType
=
(
MAV_AUTOPILOT
)
settings
.
value
(
_firmwareTypeKey
,
(
int
)
MAV_AUTOPILOT_PX4
).
toInt
();
_sendStatusText
=
settings
.
value
(
_sendStatusTextKey
,
false
).
toBool
();
settings
.
endGroup
();
settings
.
endGroup
();
}
}
...
@@ -789,7 +838,7 @@ void MockConfiguration::updateSettings()
...
@@ -789,7 +838,7 @@ void MockConfiguration::updateSettings()
MockLink
*
ulink
=
dynamic_cast
<
MockLink
*>
(
_link
);
MockLink
*
ulink
=
dynamic_cast
<
MockLink
*>
(
_link
);
if
(
ulink
)
{
if
(
ulink
)
{
// Restart connect not supported
// Restart connect not supported
Q_ASSERT
(
false
)
;
qWarning
()
<<
"updateSettings not supported"
;
//ulink->_restartConnection();
//ulink->_restartConnection();
}
}
}
}
...
...
src/comm/MockLink.h
View file @
7664ce33
...
@@ -44,6 +44,10 @@ public:
...
@@ -44,6 +44,10 @@ public:
MAV_AUTOPILOT
firmwareType
(
void
)
{
return
_firmwareType
;
}
MAV_AUTOPILOT
firmwareType
(
void
)
{
return
_firmwareType
;
}
void
setFirmwareType
(
MAV_AUTOPILOT
firmwareType
)
{
_firmwareType
=
firmwareType
;
}
void
setFirmwareType
(
MAV_AUTOPILOT
firmwareType
)
{
_firmwareType
=
firmwareType
;
}
/// @param sendStatusText true: mavlink status text messages will be sent for each severity, as well as voice output info message
void
setSendStatusText
(
bool
sendStatusText
)
{
_sendStatusText
=
sendStatusText
;
}
bool
sendStatusText
(
void
)
{
return
_sendStatusText
;
}
// Overrides from LinkConfiguration
// Overrides from LinkConfiguration
int
type
(
void
)
{
return
LinkConfiguration
::
TypeMock
;
}
int
type
(
void
)
{
return
LinkConfiguration
::
TypeMock
;
}
void
copyFrom
(
LinkConfiguration
*
source
);
void
copyFrom
(
LinkConfiguration
*
source
);
...
@@ -52,9 +56,11 @@ public:
...
@@ -52,9 +56,11 @@ public:
void
updateSettings
(
void
);
void
updateSettings
(
void
);
private:
private:
MAV_AUTOPILOT
_firmwareType
;
MAV_AUTOPILOT
_firmwareType
;
bool
_sendStatusText
;
static
const
char
*
_firmwareTypeKey
;
static
const
char
*
_firmwareTypeKey
;
static
const
char
*
_sendStatusTextKey
;
};
};
class
MockLink
:
public
LinkInterface
class
MockLink
:
public
LinkInterface
...
@@ -70,6 +76,7 @@ public:
...
@@ -70,6 +76,7 @@ public:
int
vehicleId
(
void
)
{
return
_vehicleSystemId
;
}
int
vehicleId
(
void
)
{
return
_vehicleSystemId
;
}
MAV_AUTOPILOT
getAutopilotType
(
void
)
{
return
_autopilotType
;
}
MAV_AUTOPILOT
getAutopilotType
(
void
)
{
return
_autopilotType
;
}
void
setAutopilotType
(
MAV_AUTOPILOT
autopilot
)
{
_autopilotType
=
autopilot
;
}
void
setAutopilotType
(
MAV_AUTOPILOT
autopilot
)
{
_autopilotType
=
autopilot
;
}
void
setSendStatusText
(
bool
sendStatusText
)
{
_sendStatusText
=
sendStatusText
;
}
void
emitRemoteControlChannelRawChanged
(
int
channel
,
uint16_t
raw
);
void
emitRemoteControlChannelRawChanged
(
int
channel
,
uint16_t
raw
);
/// Sends the specified mavlink message to QGC
/// Sends the specified mavlink message to QGC
...
@@ -149,6 +156,7 @@ private:
...
@@ -149,6 +156,7 @@ private:
void
_setParamFloatUnionIntoMap
(
int
componentId
,
const
QString
&
paramName
,
float
paramFloat
);
void
_setParamFloatUnionIntoMap
(
int
componentId
,
const
QString
&
paramName
,
float
paramFloat
);
void
_sendHomePosition
(
void
);
void
_sendHomePosition
(
void
);
void
_sendGpsRawInt
(
void
);
void
_sendGpsRawInt
(
void
);
void
_sendStatusTextMessages
(
void
);
MockLinkMissionItemHandler
_missionItemHandler
;
MockLinkMissionItemHandler
_missionItemHandler
;
...
@@ -173,6 +181,8 @@ private:
...
@@ -173,6 +181,8 @@ private:
MockLinkFileServer
*
_fileServer
;
MockLinkFileServer
*
_fileServer
;
bool
_sendStatusText
;
static
float
_vehicleLatitude
;
static
float
_vehicleLatitude
;
static
float
_vehicleLongitude
;
static
float
_vehicleLongitude
;
static
float
_vehicleAltitude
;
static
float
_vehicleAltitude
;
...
...
src/ui/MainWindow.qml
View file @
7664ce33
...
@@ -82,6 +82,21 @@ Item {
...
@@ -82,6 +82,21 @@ Item {
toolbarLoader
.
source
=
"
MainToolBar.qml
"
toolbarLoader
.
source
=
"
MainToolBar.qml
"
}
}
// Detect tablet position
property
var
tabletPosition
:
QtPositioning
.
coordinate
(
37.803784
,
-
122.462276
)
PositionSource
{
id
:
positionSource
updateInterval
:
1000
active
:
ScreenTools
.
isMobile
onPositionChanged
:
{
tabletPosition
=
positionSource
.
position
.
coordinate
_root
.
latitude
=
tabletPosition
.
latitude
_root
.
longitude
=
tabletPosition
.
longitude
positionSource
.
active
=
false
}
}
Loader
{
Loader
{
id
:
toolbarLoader
id
:
toolbarLoader
width
:
parent
.
width
width
:
parent
.
width
...
@@ -105,6 +120,8 @@ Item {
...
@@ -105,6 +120,8 @@ Item {
anchors.top
:
toolbarLoader
.
bottom
anchors.top
:
toolbarLoader
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
visible
:
false
visible
:
false
property
var
tabletPosition
:
_root
.
tabletPosition
}
}
Loader
{
Loader
{
...
@@ -114,5 +131,7 @@ Item {
...
@@ -114,5 +131,7 @@ Item {
anchors.top
:
toolbarLoader
.
bottom
anchors.top
:
toolbarLoader
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
visible
:
false
visible
:
false
property
var
tabletPosition
:
_root
.
tabletPosition
}
}
}
}
src/ui/MockLinkConfiguration.cc
View file @
7664ce33
...
@@ -43,9 +43,12 @@ MockLinkConfiguration::MockLinkConfiguration(MockConfiguration *config, QWidget
...
@@ -43,9 +43,12 @@ MockLinkConfiguration::MockLinkConfiguration(MockConfiguration *config, QWidget
break
;
break
;
}
}
connect
(
_ui
->
px4Radio
,
&
QRadioButton
::
clicked
,
this
,
&
MockLinkConfiguration
::
_px4RadioClicked
);
_ui
->
sendStatusTextCheckBox
->
setChecked
(
config
->
sendStatusText
());
connect
(
_ui
->
apmRadio
,
&
QRadioButton
::
clicked
,
this
,
&
MockLinkConfiguration
::
_apmRadioClicked
);
connect
(
_ui
->
genericRadio
,
&
QRadioButton
::
clicked
,
this
,
&
MockLinkConfiguration
::
_genericRadioClicked
);
connect
(
_ui
->
px4Radio
,
&
QRadioButton
::
clicked
,
this
,
&
MockLinkConfiguration
::
_px4RadioClicked
);
connect
(
_ui
->
apmRadio
,
&
QRadioButton
::
clicked
,
this
,
&
MockLinkConfiguration
::
_apmRadioClicked
);
connect
(
_ui
->
genericRadio
,
&
QRadioButton
::
clicked
,
this
,
&
MockLinkConfiguration
::
_genericRadioClicked
);
connect
(
_ui
->
sendStatusTextCheckBox
,
&
QCheckBox
::
clicked
,
this
,
&
MockLinkConfiguration
::
_sendStatusTextClicked
);
}
}
MockLinkConfiguration
::~
MockLinkConfiguration
()
MockLinkConfiguration
::~
MockLinkConfiguration
()
...
@@ -73,3 +76,8 @@ void MockLinkConfiguration::_genericRadioClicked(bool checked)
...
@@ -73,3 +76,8 @@ void MockLinkConfiguration::_genericRadioClicked(bool checked)
_config
->
setFirmwareType
(
MAV_AUTOPILOT_GENERIC
);
_config
->
setFirmwareType
(
MAV_AUTOPILOT_GENERIC
);
}
}
}
}
void
MockLinkConfiguration
::
_sendStatusTextClicked
(
bool
checked
)
{
_config
->
setSendStatusText
(
checked
);
}
src/ui/MockLinkConfiguration.h
View file @
7664ce33
...
@@ -44,6 +44,7 @@ private slots:
...
@@ -44,6 +44,7 @@ private slots:
void
_px4RadioClicked
(
bool
checked
);
void
_px4RadioClicked
(
bool
checked
);
void
_apmRadioClicked
(
bool
checked
);
void
_apmRadioClicked
(
bool
checked
);
void
_genericRadioClicked
(
bool
checked
);
void
_genericRadioClicked
(
bool
checked
);
void
_sendStatusTextClicked
(
bool
checked
);
private:
private:
Ui
::
MockLinkConfiguration
*
_ui
;
Ui
::
MockLinkConfiguration
*
_ui
;
...
...
src/ui/MockLinkConfiguration.ui
View file @
7664ce33
...
@@ -35,6 +35,13 @@
...
@@ -35,6 +35,13 @@
</property>
</property>
</widget>
</widget>
</item>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"sendStatusTextCheckBox"
>
<property
name=
"text"
>
<string>
Send status text + voice
</string>
</property>
</widget>
</item>
</layout>
</layout>
</widget>
</widget>
<resources/>
<resources/>
...
...
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