Commit fee7929e authored by Don Gagne's avatar Don Gagne

Handle airspeed circuit breaker correctly

parent c3c3f5f8
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "QGCQmlWidgetHolder.h" #include "QGCQmlWidgetHolder.h"
#include "SensorsComponentController.h" #include "SensorsComponentController.h"
// These two list must be kept in sync const char* SensorsComponent::_airspeedBreaker = "CBRK_AIRSPD_CHK";
SensorsComponent::SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) : SensorsComponent::SensorsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) :
VehicleComponent(vehicle, autopilot, parent), VehicleComponent(vehicle, autopilot, parent),
...@@ -62,7 +62,7 @@ bool SensorsComponent::requiresSetup(void) const ...@@ -62,7 +62,7 @@ bool SensorsComponent::requiresSetup(void) const
bool SensorsComponent::setupComplete(void) const bool SensorsComponent::setupComplete(void) const
{ {
foreach(const QString &triggerParam, setupCompleteChangedTriggerList()) { foreach(const QString &triggerParam, setupCompleteChangedTriggerList()) {
if (_autopilot->getParameterFact(FactSystem::defaultComponentId, triggerParam)->rawValue().toFloat() == 0.0f) { if (triggerParam != _airspeedBreaker && _autopilot->getParameterFact(FactSystem::defaultComponentId, triggerParam)->rawValue().toFloat() == 0.0f) {
return false; return false;
} }
} }
...@@ -74,20 +74,9 @@ QStringList SensorsComponent::setupCompleteChangedTriggerList(void) const ...@@ -74,20 +74,9 @@ QStringList SensorsComponent::setupCompleteChangedTriggerList(void) const
{ {
QStringList triggers; QStringList triggers;
triggers << "CAL_MAG0_ID" << "CAL_GYRO0_ID" << "CAL_ACC0_ID"; triggers << "CAL_MAG0_ID" << "CAL_GYRO0_ID" << "CAL_ACC0_ID" << "CBRK_AIRSPD_CHK";
switch (_vehicle->vehicleType()) { if (_vehicle->fixedWing() && _autopilot->getParameterFact(FactSystem::defaultComponentId, _airspeedBreaker)->rawValue().toInt() != 162128) {
case MAV_TYPE_FIXED_WING: triggers << "SENS_DPRES_OFF";
case MAV_TYPE_VTOL_DUOROTOR:
case MAV_TYPE_VTOL_QUADROTOR:
case MAV_TYPE_VTOL_TILTROTOR:
case MAV_TYPE_VTOL_RESERVED2:
case MAV_TYPE_VTOL_RESERVED3:
case MAV_TYPE_VTOL_RESERVED4:
case MAV_TYPE_VTOL_RESERVED5:
triggers << "SENS_DPRES_OFF";
break;
default:
break;
} }
return triggers; return triggers;
......
...@@ -53,6 +53,8 @@ public: ...@@ -53,6 +53,8 @@ public:
private: private:
const QString _name; const QString _name;
QVariantList _summaryItems; QVariantList _summaryItems;
static const char* _airspeedBreaker;
}; };
#endif #endif
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