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
29d0fa44
Commit
29d0fa44
authored
Jan 09, 2015
by
Thomas Gubler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MockUAS: add missing functions
parent
ef7e7774
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
21 deletions
+24
-21
MockUAS.h
src/qgcunittest/MockUAS.h
+24
-21
No files found.
src/qgcunittest/MockUAS.h
View file @
29d0fa44
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef MOCKUAS_H
...
...
@@ -39,43 +39,43 @@
class
MockUAS
:
public
UASInterface
{
Q_OBJECT
signals:
// The following UASInterface signals are supported
// void parameterChanged(int uas, int component, QString parameterName, QVariant value);
// void remoteControlChannelRawChanged(int channelId, float raw);
public:
// Implemented UASInterface overrides
virtual
int
getSystemType
(
void
)
{
return
_systemType
;
}
virtual
int
getUASID
(
void
)
const
{
return
_systemId
;
}
virtual
QGCUASParamManagerInterface
*
getParamManager
()
{
return
&
_paramManager
;
};
// sendMessage is only supported if a mavlink plugin is installed.
virtual
void
sendMessage
(
mavlink_message_t
message
);
public:
// MockUAS methods
MockUAS
(
void
);
// Use these methods to setup/control the mock UAS
void
setMockSystemType
(
int
systemType
)
{
_systemType
=
systemType
;
}
void
setMockSystemId
(
int
systemId
)
{
_systemId
=
systemId
;
}
/// @return returns mock QGCUASParamManager associated with the UAS. This mock implementation
/// allows you to simulate parameter input and validate parameter setting
MockQGCUASParamManager
*
getMockQGCUASParamManager
(
void
)
{
return
&
_paramManager
;
}
/// @brief Sets the parameter map into the mock QGCUASParamManager and signals parameterChanged for
/// each param
void
setMockParametersAndSignal
(
MockQGCUASParamManager
::
ParamMap_t
&
map
);
void
emitRemoteControlChannelRawChanged
(
int
channel
,
float
raw
)
{
emit
remoteControlChannelRawChanged
(
channel
,
raw
);
}
/// @brief Installs a mavlink plugin. Only a single mavlink plugin is supported at a time.
void
setMockMavlinkPlugin
(
MockMavlinkInterface
*
mavlinkPlugin
)
{
_mavlinkPlugin
=
mavlinkPlugin
;
};
public:
// Unimplemented UASInterface overrides
virtual
QString
getUASName
()
const
{
Q_ASSERT
(
false
);
return
_bogusString
;
};
...
...
@@ -168,16 +168,19 @@ public slots:
virtual
void
sendHilOpticalFlow
(
quint64
time_us
,
qint16
flow_x
,
qint16
flow_y
,
float
flow_comp_m_x
,
float
flow_comp_m_y
,
quint8
quality
,
float
ground_distance
)
{
Q_UNUSED
(
time_us
);
Q_UNUSED
(
flow_x
);
Q_UNUSED
(
flow_y
);
Q_UNUSED
(
flow_comp_m_x
);
Q_UNUSED
(
flow_comp_m_y
);
Q_UNUSED
(
quality
);
Q_UNUSED
(
ground_distance
);
Q_ASSERT
(
false
);};
virtual
void
sendMapRCToParam
(
QString
param_id
,
float
scale
,
float
value0
,
quint8
param_rc_channel_index
,
float
valueMin
,
float
valueMax
)
{
Q_UNUSED
(
param_id
);
Q_UNUSED
(
scale
);
Q_UNUSED
(
value0
);
Q_UNUSED
(
param_rc_channel_index
);
Q_UNUSED
(
valueMin
);
Q_UNUSED
(
valueMax
);
}
virtual
void
unsetRCToParameterMap
()
{}
virtual
bool
isRotaryWing
()
{
Q_ASSERT
(
false
);
return
false
;
}
virtual
bool
isFixedWing
()
{
Q_ASSERT
(
false
);
return
false
;
}
private:
int
_systemType
;
int
_systemId
;
MockQGCUASParamManager
_paramManager
;
MockMavlinkInterface
*
_mavlinkPlugin
;
///< Mock Mavlink plugin, NULL for none
// Bogus variables used for return types of NYI methods
...
...
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