From 0f0023e62d6e3cf0cee42725eb6e52dbf5ad3ac7 Mon Sep 17 00:00:00 2001 From: muramura Date: Sat, 13 Apr 2024 11:02:52 +0900 Subject: [PATCH] Copter: Get the flight mode name display from the name method --- ArduCopter/mode_zigzag.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ArduCopter/mode_zigzag.cpp b/ArduCopter/mode_zigzag.cpp index fbf43aa50e..6847126f36 100644 --- a/ArduCopter/mode_zigzag.cpp +++ b/ArduCopter/mode_zigzag.cpp @@ -170,12 +170,12 @@ void ModeZigZag::save_or_move_to_destination(Destination ab_dest) if (ab_dest == Destination::A) { // store point A dest_A = curr_pos; - gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: point A stored"); + gcs().send_text(MAV_SEVERITY_INFO, "%s: point A stored", name()); LOGGER_WRITE_EVENT(LogEvent::ZIGZAG_STORE_A); } else { // store point B dest_B = curr_pos; - gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: point B stored"); + gcs().send_text(MAV_SEVERITY_INFO, "%s: point B stored", name()); LOGGER_WRITE_EVENT(LogEvent::ZIGZAG_STORE_B); } // if both A and B have been stored advance state @@ -203,10 +203,10 @@ void ModeZigZag::save_or_move_to_destination(Destination ab_dest) spray(true); reach_wp_time_ms = 0; if (is_auto == false || line_num == ZIGZAG_LINE_INFINITY) { - gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s", (ab_dest == Destination::A) ? "A" : "B"); + gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s", name(), (ab_dest == Destination::A) ? "A" : "B"); } else { line_count++; - gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s (line %d/%d)", (ab_dest == Destination::A) ? "A" : "B", line_count, line_num); + gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s (line %d/%d)", name(), (ab_dest == Destination::A) ? "A" : "B", line_count, line_num); } } } @@ -228,7 +228,7 @@ void ModeZigZag::move_to_side() current_terr_alt = terr_alt; reach_wp_time_ms = 0; char const *dir[] = {"forward", "right", "backward", "left"}; - gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s", dir[(uint8_t)zigzag_direction]); + gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s", name(), dir[(uint8_t)zigzag_direction]); } } } @@ -251,7 +251,7 @@ void ModeZigZag::return_to_manual_control(bool maintain_target) loiter_nav->init_target(); } is_auto = false; - gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: manual control"); + gcs().send_text(MAV_SEVERITY_INFO, "%s: manual control", name()); } } @@ -542,7 +542,7 @@ void ModeZigZag::run_auto() stage = AUTO; reach_wp_time_ms = 0; char const *dir[] = {"forward", "right", "backward", "left"}; - gcs().send_text(MAV_SEVERITY_INFO, "ZigZag: moving to %s", dir[(uint8_t)zigzag_direction]); + gcs().send_text(MAV_SEVERITY_INFO, "%s: moving to %s", name(), dir[(uint8_t)zigzag_direction]); } } } else {