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
4f643563
Commit
4f643563
authored
Apr 18, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
3e7c427a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
35 deletions
+33
-35
QGroundControlQmlGlobal.cc
src/QmlControls/QGroundControlQmlGlobal.cc
+9
-0
QGroundControlQmlGlobal.h
src/QmlControls/QGroundControlQmlGlobal.h
+1
-0
MockLink.cc
src/comm/MockLink.cc
+17
-35
MockLink.h
src/comm/MockLink.h
+2
-0
MockLink.qml
src/ui/preferences/MockLink.qml
+4
-0
No files found.
src/QmlControls/QGroundControlQmlGlobal.cc
View file @
4f643563
...
...
@@ -147,6 +147,15 @@ void QGroundControlQmlGlobal::startAPMArduSubMockLink(bool sendStatusText)
#endif
}
void
QGroundControlQmlGlobal
::
startAPMArduRoverMockLink
(
bool
sendStatusText
)
{
#ifdef QT_DEBUG
MockLink
::
startAPMArduRoverMockLink
(
sendStatusText
);
#else
Q_UNUSED
(
sendStatusText
);
#endif
}
void
QGroundControlQmlGlobal
::
stopOneMockLink
(
void
)
{
#ifdef QT_DEBUG
...
...
src/QmlControls/QGroundControlQmlGlobal.h
View file @
4f643563
...
...
@@ -121,6 +121,7 @@ public:
Q_INVOKABLE
void
startAPMArduCopterMockLink
(
bool
sendStatusText
);
Q_INVOKABLE
void
startAPMArduPlaneMockLink
(
bool
sendStatusText
);
Q_INVOKABLE
void
startAPMArduSubMockLink
(
bool
sendStatusText
);
Q_INVOKABLE
void
startAPMArduRoverMockLink
(
bool
sendStatusText
);
Q_INVOKABLE
void
stopOneMockLink
(
void
);
/// Converts from meters to the user specified distance unit
...
...
src/comm/MockLink.cc
View file @
4f643563
...
...
@@ -1159,64 +1159,46 @@ MockLink* MockLink::_startMockLink(MockConfiguration* mockConfig)
return
qobject_cast
<
MockLink
*>
(
linkMgr
->
createConnectedLink
(
config
));
}
MockLink
*
MockLink
::
startPX4MockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
MockLink
*
MockLink
::
_startMockLinkWorker
(
QString
configName
,
MAV_AUTOPILOT
firmwareType
,
MAV_TYPE
vehicleType
,
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
{
MockConfiguration
*
mockConfig
=
new
MockConfiguration
(
"PX4 MockLink"
);
MockConfiguration
*
mockConfig
=
new
MockConfiguration
(
configName
);
mockConfig
->
setFirmwareType
(
MAV_AUTOPILOT_PX4
);
mockConfig
->
setVehicleType
(
MAV_TYPE_QUADROTOR
);
mockConfig
->
setFirmwareType
(
firmwareType
);
mockConfig
->
setVehicleType
(
vehicleType
);
mockConfig
->
setSendStatusText
(
sendStatusText
);
mockConfig
->
setFailureMode
(
failureMode
);
return
_startMockLink
(
mockConfig
);
}
MockLink
*
MockLink
::
start
Generic
MockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
MockLink
*
MockLink
::
start
PX4
MockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
{
MockConfiguration
*
mockConfig
=
new
MockConfiguration
(
"Generic MockLink"
);
mockConfig
->
setFirmwareType
(
MAV_AUTOPILOT_GENERIC
);
mockConfig
->
setVehicleType
(
MAV_TYPE_QUADROTOR
);
mockConfig
->
setSendStatusText
(
sendStatusText
);
mockConfig
->
setFailureMode
(
failureMode
);
return
_startMockLinkWorker
(
"PX4 MultiRotor MockLink"
,
MAV_AUTOPILOT_PX4
,
MAV_TYPE_QUADROTOR
,
sendStatusText
,
failureMode
);
}
return
_startMockLink
(
mockConfig
);
MockLink
*
MockLink
::
startGenericMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
{
return
_startMockLinkWorker
(
"Generic MockLink"
,
MAV_AUTOPILOT_GENERIC
,
MAV_TYPE_QUADROTOR
,
sendStatusText
,
failureMode
);
}
MockLink
*
MockLink
::
startAPMArduCopterMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
{
MockConfiguration
*
mockConfig
=
new
MockConfiguration
(
"APM ArduCopter MockLink"
);
mockConfig
->
setFirmwareType
(
MAV_AUTOPILOT_ARDUPILOTMEGA
);
mockConfig
->
setVehicleType
(
MAV_TYPE_QUADROTOR
);
mockConfig
->
setSendStatusText
(
sendStatusText
);
mockConfig
->
setFailureMode
(
failureMode
);
return
_startMockLink
(
mockConfig
);
return
_startMockLinkWorker
(
"ArduCopter MockLink"
,
MAV_AUTOPILOT_ARDUPILOTMEGA
,
MAV_TYPE_QUADROTOR
,
sendStatusText
,
failureMode
);
}
MockLink
*
MockLink
::
startAPMArduPlaneMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
{
MockConfiguration
*
mockConfig
=
new
MockConfiguration
(
"APM ArduPlane MockLink"
);
mockConfig
->
setFirmwareType
(
MAV_AUTOPILOT_ARDUPILOTMEGA
);
mockConfig
->
setVehicleType
(
MAV_TYPE_FIXED_WING
);
mockConfig
->
setSendStatusText
(
sendStatusText
);
mockConfig
->
setFailureMode
(
failureMode
);
return
_startMockLink
(
mockConfig
);
return
_startMockLinkWorker
(
"ArduPlane MockLink"
,
MAV_AUTOPILOT_ARDUPILOTMEGA
,
MAV_TYPE_FIXED_WING
,
sendStatusText
,
failureMode
);
}
MockLink
*
MockLink
::
startAPMArduSubMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
{
MockConfiguration
*
mockConfig
=
new
MockConfiguration
(
"APM ArduSub MockLink"
);
mockConfig
->
setFirmwareType
(
MAV_AUTOPILOT_ARDUPILOTMEGA
);
mockConfig
->
setVehicleType
(
MAV_TYPE_SUBMARINE
);
mockConfig
->
setSendStatusText
(
sendStatusText
);
mockConfig
->
setFailureMode
(
failureMode
);
return
_startMockLinkWorker
(
"ArduSub MockLink"
,
MAV_AUTOPILOT_ARDUPILOTMEGA
,
MAV_TYPE_SUBMARINE
,
sendStatusText
,
failureMode
);
}
return
_startMockLink
(
mockConfig
);
MockLink
*
MockLink
::
startAPMArduRoverMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
)
{
return
_startMockLinkWorker
(
"ArduRover MockLink"
,
MAV_AUTOPILOT_ARDUPILOTMEGA
,
MAV_TYPE_GROUND_ROVER
,
sendStatusText
,
failureMode
);
}
void
MockLink
::
_sendRCChannels
(
void
)
...
...
src/comm/MockLink.h
View file @
4f643563
...
...
@@ -156,6 +156,7 @@ public:
static
MockLink
*
startAPMArduCopterMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
=
MockConfiguration
::
FailNone
);
static
MockLink
*
startAPMArduPlaneMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
=
MockConfiguration
::
FailNone
);
static
MockLink
*
startAPMArduSubMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
=
MockConfiguration
::
FailNone
);
static
MockLink
*
startAPMArduRoverMockLink
(
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
=
MockConfiguration
::
FailNone
);
private
slots
:
virtual
void
_writeBytes
(
const
QByteArray
bytes
);
...
...
@@ -203,6 +204,7 @@ private:
void
_sendADSBVehicles
(
void
);
void
_moveADSBVehicle
(
void
);
static
MockLink
*
_startMockLinkWorker
(
QString
configName
,
MAV_AUTOPILOT
firmwareType
,
MAV_TYPE
vehicleType
,
bool
sendStatusText
,
MockConfiguration
::
FailureMode_t
failureMode
);
static
MockLink
*
_startMockLink
(
MockConfiguration
*
mockConfig
);
MockLinkMissionItemHandler
_missionItemHandler
;
...
...
src/ui/preferences/MockLink.qml
View file @
4f643563
...
...
@@ -52,6 +52,10 @@ Rectangle {
text
:
qsTr
(
"
APM ArduSub Vehicle
"
)
onClicked
:
QGroundControl
.
startAPMArduSubMockLink
(
sendStatusText
.
checked
)
}
QGCButton
{
text
:
qsTr
(
"
APM ArduRover Vehicle
"
)
onClicked
:
QGroundControl
.
startAPMArduRoverMockLink
(
sendStatusText
.
checked
)
}
QGCButton
{
text
:
qsTr
(
"
Generic Vehicle
"
)
onClicked
:
QGroundControl
.
startGenericMockLink
(
sendStatusText
.
checked
)
...
...
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