Commit 2d54faaa authored by Rustom Jehangir's avatar Rustom Jehangir

Add mock link for ArduSub

parent 6039eb9a
......@@ -3,6 +3,7 @@
<file alias="PX4MockLink.params">src/comm/PX4MockLink.params</file>
<file alias="APMArduCopterMockLink.params">src/comm/APMArduCopterMockLink.params</file>
<file alias="APMArduPlaneMockLink.params">src/comm/APMArduPlaneMockLink.params</file>
<file alias="APMArduSubMockLink.params">src/comm/APMArduSubMockLink.params</file>
<file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file>
</qresource>
<qresource prefix="/qml">
......
......@@ -137,6 +137,15 @@ void QGroundControlQmlGlobal::startAPMArduPlaneMockLink(bool sendStatusText)
#endif
}
void QGroundControlQmlGlobal::startAPMArduSubMockLink(bool sendStatusText)
{
#ifdef QT_DEBUG
MockLink::startAPMArduSubMockLink(sendStatusText);
#else
Q_UNUSED(sendStatusText);
#endif
}
void QGroundControlQmlGlobal::stopAllMockLinks(void)
{
#ifdef QT_DEBUG
......
......@@ -123,6 +123,7 @@ public:
Q_INVOKABLE void startGenericMockLink (bool sendStatusText);
Q_INVOKABLE void startAPMArduCopterMockLink (bool sendStatusText);
Q_INVOKABLE void startAPMArduPlaneMockLink (bool sendStatusText);
Q_INVOKABLE void startAPMArduSubMockLink (bool sendStatusText);
Q_INVOKABLE void stopAllMockLinks (void);
/// Converts from meters to the user specified distance unit
......
This diff is collapsed.
......@@ -180,6 +180,8 @@ void MockLink::_loadParams(void)
if (_firmwareType == MAV_AUTOPILOT_ARDUPILOTMEGA) {
if (_vehicleType == MAV_TYPE_FIXED_WING) {
paramFile.setFileName(":/unittest/APMArduPlaneMockLink.params");
} else if (_vehicleType == MAV_TYPE_SUBMARINE ) {
paramFile.setFileName(":/unittest/APMArduSubMockLink.params");
} else {
paramFile.setFileName(":/unittest/APMArduCopterMockLink.params");
}
......@@ -1030,6 +1032,18 @@ MockLink* MockLink::startAPMArduPlaneMockLink(bool sendStatusText, MockConfigur
return _startMockLink(mockConfig);
}
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 _startMockLink(mockConfig);
}
void MockLink::_sendRCChannels(void)
{
mavlink_message_t msg;
......
......@@ -148,6 +148,7 @@ public:
static MockLink* startGenericMockLink (bool sendStatusText, MockConfiguration::FailureMode_t failureMode = MockConfiguration::FailNone);
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);
private slots:
virtual void _writeBytes(const QByteArray bytes);
......
......@@ -48,6 +48,10 @@ Rectangle {
text: qsTr("APM ArduPlane Vehicle")
onClicked: QGroundControl.startAPMArduPlaneMockLink(sendStatusText.checked)
}
QGCButton {
text: qsTr("APM ArduSub Vehicle")
onClicked: QGroundControl.startAPMArduSubMockLink(sendStatusText.checked)
}
QGCButton {
text: qsTr("Generic Vehicle")
onClicked: QGroundControl.startGenericMockLink(sendStatusText.checked)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment