-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponentController.cpp
More file actions
50 lines (40 loc) · 1.2 KB
/
ComponentController.cpp
File metadata and controls
50 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "ComponentController.h"
#include "QuadApplication.h"
#include "VehicleManager.h"
ComponentController::ComponentController(QObject *parent)
: QObject(parent)
, _vehicle(NULL)
, _autopilot(NULL)
, _uas(NULL)
{
_vehicle = qgcApp()->toolbox()->vehicleManager()->activeVehicle();
if(_vehicle) {
_autopilot = _vehicle->autopilotPlugin();
_uas = _vehicle->uas();
///For test
}
}
ComponentController::~ComponentController()
{
}
Fact* ComponentController::getParamFact(int compId,const QString paramName,bool reportMissing)
{
Q_UNUSED(reportMissing);
if(_autopilot && _autopilot->paramExists(compId,paramName)) {
Fact* fact = _autopilot->getParamFact(compId,paramName);
//qDebug()<<"ComponentController: get ParamFact";
return fact;
}
return NULL;
}
bool ComponentController::_allParamsExist(int compId,QStringList params)
{
bool noFactsMissing = true;
foreach(QString paramName,params) {
if(_autopilot && !_autopilot->paramExists(compId,paramName)) {
noFactsMissing = false;
qDebug()<<QString("Parameter : %1 Missing").arg(paramName);
}
}
return noFactsMissing;
}