Copter: rename RTLAltType enumeration entries

removes redundant namespacing as this is enum class
This commit is contained in:
Peter Barker 2024-09-05 12:35:23 +10:00 committed by Peter Barker
parent 2e1af82044
commit e6ccaeb2c9
3 changed files with 7 additions and 7 deletions

View File

@ -179,7 +179,7 @@ bool AP_Arming_Copter::terrain_database_required() const
} }
if (copter.wp_nav->get_terrain_source() == AC_WPNav::TerrainSource::TERRAIN_FROM_TERRAINDATABASE && if (copter.wp_nav->get_terrain_source() == AC_WPNav::TerrainSource::TERRAIN_FROM_TERRAINDATABASE &&
copter.mode_rtl.get_alt_type() == ModeRTL::RTLAltType::RTL_ALTTYPE_TERRAIN) { copter.mode_rtl.get_alt_type() == ModeRTL::RTLAltType::TERRAIN) {
return true; return true;
} }
return AP_Arming::terrain_database_required(); return AP_Arming::terrain_database_required();
@ -252,7 +252,7 @@ bool AP_Arming_Copter::parameter_checks(bool display_failure)
// checks when using range finder for RTL // checks when using range finder for RTL
#if MODE_RTL_ENABLED == ENABLED #if MODE_RTL_ENABLED == ENABLED
if (copter.mode_rtl.get_alt_type() == ModeRTL::RTLAltType::RTL_ALTTYPE_TERRAIN) { if (copter.mode_rtl.get_alt_type() == ModeRTL::RTLAltType::TERRAIN) {
// get terrain source from wpnav // get terrain source from wpnav
const char *failure_template = "RTL_ALT_TYPE is above-terrain but %s"; const char *failure_template = "RTL_ALT_TYPE is above-terrain but %s";
switch (copter.wp_nav->get_terrain_source()) { switch (copter.wp_nav->get_terrain_source()) {

View File

@ -1420,8 +1420,8 @@ public:
// enum for RTL_ALT_TYPE parameter // enum for RTL_ALT_TYPE parameter
enum class RTLAltType : int8_t { enum class RTLAltType : int8_t {
RTL_ALTTYPE_RELATIVE = 0, RELATIVE = 0,
RTL_ALTTYPE_TERRAIN = 1 TERRAIN = 1
}; };
ModeRTL::RTLAltType get_alt_type() const; ModeRTL::RTLAltType get_alt_type() const;

View File

@ -52,11 +52,11 @@ ModeRTL::RTLAltType ModeRTL::get_alt_type() const
{ {
// sanity check parameter // sanity check parameter
switch ((ModeRTL::RTLAltType)g.rtl_alt_type) { switch ((ModeRTL::RTLAltType)g.rtl_alt_type) {
case RTLAltType::RTL_ALTTYPE_RELATIVE ... RTLAltType::RTL_ALTTYPE_TERRAIN: case RTLAltType::RELATIVE ... RTLAltType::TERRAIN:
return g.rtl_alt_type; return g.rtl_alt_type;
} }
// user has an invalid value // user has an invalid value
return RTLAltType::RTL_ALTTYPE_RELATIVE; return RTLAltType::RELATIVE;
} }
// rtl_run - runs the return-to-launch controller // rtl_run - runs the return-to-launch controller
@ -410,7 +410,7 @@ void ModeRTL::compute_return_target()
// determine altitude type of return journey (alt-above-home, alt-above-terrain using range finder or alt-above-terrain using terrain database) // determine altitude type of return journey (alt-above-home, alt-above-terrain using range finder or alt-above-terrain using terrain database)
ReturnTargetAltType alt_type = ReturnTargetAltType::RELATIVE; ReturnTargetAltType alt_type = ReturnTargetAltType::RELATIVE;
if (terrain_following_allowed && (get_alt_type() == RTLAltType::RTL_ALTTYPE_TERRAIN)) { if (terrain_following_allowed && (get_alt_type() == RTLAltType::TERRAIN)) {
// convert RTL_ALT_TYPE and WPNAV_RFNG_USE parameters to ReturnTargetAltType // convert RTL_ALT_TYPE and WPNAV_RFNG_USE parameters to ReturnTargetAltType
switch (wp_nav->get_terrain_source()) { switch (wp_nav->get_terrain_source()) {
case AC_WPNav::TerrainSource::TERRAIN_UNAVAILABLE: case AC_WPNav::TerrainSource::TERRAIN_UNAVAILABLE: