mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 12:38:33 -04:00
ArduPlane: use static method to construct AP_Arming_Plane
This commit is contained in:
parent
5ec1430726
commit
2d2876a226
@ -14,11 +14,16 @@ public:
|
|||||||
ARMING_RUDDER_ARMDISARM = 2
|
ARMING_RUDDER_ARMDISARM = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
AP_Arming_Plane(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass,
|
static AP_Arming_Plane create(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass, const AP_BattMonitor &battery) {
|
||||||
const AP_BattMonitor &battery) :
|
return AP_Arming_Plane{ahrs_ref, baro, compass, battery};
|
||||||
AP_Arming(ahrs_ref, baro, compass, battery) {
|
|
||||||
AP_Param::setup_object_defaults(this, var_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr AP_Arming_Plane(AP_Arming_Plane &&other) = default;
|
||||||
|
|
||||||
|
/* Do not allow copies */
|
||||||
|
AP_Arming_Plane(const AP_Arming_Plane &other) = delete;
|
||||||
|
AP_Arming_Plane &operator=(const AP_Baro&) = delete;
|
||||||
|
|
||||||
bool pre_arm_checks(bool report);
|
bool pre_arm_checks(bool report);
|
||||||
|
|
||||||
ArmingRudder rudder_arming() const { return (ArmingRudder)rudder_arming_value.get(); }
|
ArmingRudder rudder_arming() const { return (ArmingRudder)rudder_arming_value.get(); }
|
||||||
@ -27,6 +32,13 @@ public:
|
|||||||
static const struct AP_Param::GroupInfo var_info[];
|
static const struct AP_Param::GroupInfo var_info[];
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
AP_Arming_Plane(const AP_AHRS &ahrs_ref, const AP_Baro &baro, Compass &compass,
|
||||||
|
const AP_BattMonitor &battery)
|
||||||
|
: AP_Arming(ahrs_ref, baro, compass, battery)
|
||||||
|
{
|
||||||
|
AP_Param::setup_object_defaults(this, var_info);
|
||||||
|
}
|
||||||
|
|
||||||
bool ins_checks(bool report);
|
bool ins_checks(bool report);
|
||||||
enum HomeState home_status() const override;
|
enum HomeState home_status() const override;
|
||||||
|
|
||||||
|
@ -772,7 +772,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Arming/Disarming mangement class
|
// Arming/Disarming mangement class
|
||||||
AP_Arming_Plane arming {ahrs, barometer, compass, battery};
|
AP_Arming_Plane arming = AP_Arming_Plane::create(ahrs, barometer, compass, battery);
|
||||||
|
|
||||||
AP_Param param_loader {var_info};
|
AP_Param param_loader {var_info};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user