From 98065beb5f8011b7a09822e5fee18402f868380f Mon Sep 17 00:00:00 2001 From: Leon K Date: Tue, 11 Jul 2023 21:19:56 +0200 Subject: [PATCH 01/12] add time reset tag item functions --- vACDM.cpp | 6 ++++++ vACDM.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/vACDM.cpp b/vACDM.cpp index be38bd4..07e878f 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -717,6 +717,12 @@ void vACDM::RegisterTagItemFuntions() { RegisterTagItemFunction("Startup Request", STARTUP_REQUEST); RegisterTagItemFunction("Request Offblock", OFFBLOCK_REQUEST); RegisterTagItemFunction("Set AOBT and Groundstate", AOBT_NOW_AND_STATE); + // Reset Functions + RegisterTagItemFunction("Reset TOBT", RESET_TOBT); + RegisterTagItemFunction("Reset ASAT", RESET_ASAT); + RegisterTagItemFunction("Reset confirmed TOBT", RESET_TOBT_CONFIRM); + RegisterTagItemFunction("Reset Offblock Request", RESET_OFFBLOCK_REQUEST); + RegisterTagItemFunction("Reset AOBT", RESET_AOBT_AND_STATE); } void vACDM::RegisterTagItemTypes() { diff --git a/vACDM.h b/vACDM.h index 5ef5b13..dff66f1 100644 --- a/vACDM.h +++ b/vACDM.h @@ -48,6 +48,11 @@ enum itemFunction TOBT_CONFIRM, OFFBLOCK_REQUEST, AOBT_NOW_AND_STATE, + RESET_TOBT, + RESET_ASAT, + RESET_TOBT_CONFIRM, + RESET_OFFBLOCK_REQUEST, + RESET_AOBT_AND_STATE, }; class vACDM : public EuroScopePlugIn::CPlugIn { From ee8392e4669b01b641c1cfcd2c02dd79e7207f1e Mon Sep 17 00:00:00 2001 From: Leon K Date: Wed, 12 Jul 2023 10:48:25 +0200 Subject: [PATCH 02/12] refactor, add SetGroundState function --- vACDM.cpp | 34 +++++++++++++++++++++++----------- vACDM.h | 6 ++++-- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/vACDM.cpp b/vACDM.cpp index 07e878f..ca72079 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -322,7 +322,7 @@ void vACDM::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan, EuroScopePlugI stream << std::format("{0:%H%M}", data.ctot); *pRGB = Color::instance().colorizeCtotandCtottimer(data); } - case itemType::EventBooking: + case itemType::EVENT_BOOKING: if (data.hasBooking == true) { stream << "B"; *pRGB = this->m_pluginConfig.green; @@ -650,9 +650,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC currentAirport->updateAsrt(callsign, std::chrono::utc_clock::now()); } - std::string scratchBackup(radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().GetScratchPadString()); - radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().SetScratchPadString("ST-UP"); - radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().SetScratchPadString(scratchBackup.c_str()); + SetGroundState(radarTarget, "ST-UP"); break; } @@ -670,17 +668,12 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC currentAirport->updateAobt(callsign, std::chrono::utc_clock::now()); // set status depending on if the aircraft is positioned at a taxi-out position - std::string status = ""; if (data.taxizoneIsTaxiout) { - status = "TAXI"; + SetGroundState(radarTarget, "TAXI"); } else { - status = "PUSH"; + SetGroundState(radarTarget, "PUSH"); } - - std::string scratchBackup(radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().GetScratchPadString()); - radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().SetScratchPadString(status.c_str()); - radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().SetScratchPadString(scratchBackup.c_str()); break; } case TOBT_CONFIRM: @@ -706,6 +699,25 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC } } +void vACDM::SetGroundState(const EuroScopePlugIn::CRadarTarget radarTarget, const std::string groundstate) { + // using GRP and default Euroscope ground states + // STATE ABBREVIATION GRP STATE + // - No state(departure) NSTS + // - On Freq ONFREQ Y + // - De - Ice DE-ICE Y + // - Start - Up STUP + // - Pushback PUSH + // - Taxi TAXI + // - Line Up LINEUP Y + // - Taxi In TXIN + // - No state(arrival) NOSTATE Y + // - Parked PARK + + std::string scratchBackup(radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().GetScratchPadString()); + radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().SetScratchPadString(groundstate.c_str()); + radarTarget.GetCorrelatedFlightPlan().GetControllerAssignedData().SetScratchPadString(scratchBackup.c_str()); +} + void vACDM::RegisterTagItemFuntions() { RegisterTagItemFunction("Modify EXOT", EXOT_MODIFY); RegisterTagItemFunction("TOBT now", TOBT_NOW); diff --git a/vACDM.h b/vACDM.h index dff66f1..1ba4e06 100644 --- a/vACDM.h +++ b/vACDM.h @@ -30,8 +30,8 @@ enum itemType ASRT, AORT, CTOT, - ECFMP_MEASURES - EventBooking + ECFMP_MEASURES, + EVENT_BOOKING }; enum itemFunction @@ -53,6 +53,7 @@ enum itemFunction RESET_TOBT_CONFIRM, RESET_OFFBLOCK_REQUEST, RESET_AOBT_AND_STATE, + RESET_MENU, }; class vACDM : public EuroScopePlugIn::CPlugIn { @@ -88,6 +89,7 @@ class vACDM : public EuroScopePlugIn::CPlugIn { void DisplayDebugMessage(const std::string &message); void GetAircraftDetails(); + void SetGroundState(const EuroScopePlugIn::CRadarTarget radarTarget, const std::string groundstate); void RegisterTagItemFuntions(); void RegisterTagItemTypes(); }; From 03b2ae952185999db88d09ceea16c5114f36165d Mon Sep 17 00:00:00 2001 From: Leon K Date: Wed, 12 Jul 2023 10:48:46 +0200 Subject: [PATCH 03/12] add reset function logic --- com/Airport.cpp | 6 +++++- vACDM.cpp | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/com/Airport.cpp b/com/Airport.cpp index c792782..fae0b9a 100644 --- a/com/Airport.cpp +++ b/com/Airport.cpp @@ -178,8 +178,12 @@ void Airport::updateTobt(const std::string& callsign, const std::chrono::utc_clo root["vacdm"]["tobt"] = Airport::timestampToIsoString(tobt); if (true == resetTsat) root["vacdm"]["tsat"] = Airport::timestampToIsoString(types::defaultTime); - if (false == manualTobt) + if (false == manualTobt) { root["vacdm"]["tobt_state"] = "CONFIRMED"; + } + else { + root["vacdm"]["tobt_state"] = "GUESS"; + } root["vacdm"]["ttot"] = Airport::timestampToIsoString(types::defaultTime); root["vacdm"]["asat"] = Airport::timestampToIsoString(types::defaultTime); root["vacdm"]["aobt"] = Airport::timestampToIsoString(types::defaultTime); diff --git a/vACDM.cpp b/vACDM.cpp index ca72079..48289ca 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -694,6 +694,43 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC AddPopupListElement("TOBT confirm", NULL, TOBT_CONFIRM, false, 2, false, false); break; } + case RESET_TOBT: + { + currentAirport->updateTobt(callsign, types::defaultTime, false); + break; + } + case RESET_ASAT: + { + currentAirport->updateAsat(callsign, types::defaultTime); + currentAirport->updateAsrt(callsign, types::defaultTime); + break; + } + case RESET_TOBT_CONFIRM: + { + currentAirport->updateTobt(callsign, data.tobt, false); + break; + } + case RESET_OFFBLOCK_REQUEST: + { + currentAirport->updateAsrt(callsign, types::defaultTime); + break; + } + case RESET_AOBT_AND_STATE: + { + SetGroundState(radarTarget, "NSTS"); + currentAirport->updateAobt(callsign, types::defaultTime); + break; + } + case RESET_MENU: + { + this->OpenPopupList(area, "RESET menu", 1); + AddPopupListElement("Reset TOBT", NULL, RESET_TOBT, false, 2, false, false); + AddPopupListElement("Reset ASAT", NULL, RESET_ASAT, false, 2, false, false); + AddPopupListElement("Reset confirmed TOBT", NULL, RESET_TOBT_CONFIRM, false, 2, false, false); + AddPopupListElement("Reset ASRT", NULL, RESET_OFFBLOCK_REQUEST, false, 2, false, false); + AddPopupListElement("Reset AOBT", NULL, RESET_AOBT_AND_STATE, false, 2, false, false); + break; + } default: break; } @@ -735,6 +772,7 @@ void vACDM::RegisterTagItemFuntions() { RegisterTagItemFunction("Reset confirmed TOBT", RESET_TOBT_CONFIRM); RegisterTagItemFunction("Reset Offblock Request", RESET_OFFBLOCK_REQUEST); RegisterTagItemFunction("Reset AOBT", RESET_AOBT_AND_STATE); + RegisterTagItemFunction("Reset Menu", RESET_MENU); } void vACDM::RegisterTagItemTypes() { @@ -749,7 +787,7 @@ void vACDM::RegisterTagItemTypes() { RegisterTagItemType("ASRT", itemType::ASRT); RegisterTagItemType("AORT", itemType::AORT); RegisterTagItemType("CTOT", itemType::CTOT); - RegisterTagItemType("Event Booking", itemType::EventBooking); + RegisterTagItemType("Event Booking", itemType::EVENT_BOOKING); RegisterTagItemType("ECFMP Measures", itemType::ECFMP_MEASURES); } From e07312747475c5e3ac35fca9208704fa0936925a Mon Sep 17 00:00:00 2001 From: Leon K Date: Wed, 12 Jul 2023 11:41:44 +0200 Subject: [PATCH 04/12] refactor reset functions --- vACDM.cpp | 11 ++++++----- vACDM.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/vACDM.cpp b/vACDM.cpp index 48289ca..423d33e 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -710,15 +710,16 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC currentAirport->updateTobt(callsign, data.tobt, false); break; } - case RESET_OFFBLOCK_REQUEST: + case RESET_AORT: { - currentAirport->updateAsrt(callsign, types::defaultTime); + currentAirport->updateAort(callsign, types::defaultTime); break; } case RESET_AOBT_AND_STATE: { SetGroundState(radarTarget, "NSTS"); currentAirport->updateAobt(callsign, types::defaultTime); + currentAirport->updateAort(callsign, types::defaultTime); break; } case RESET_MENU: @@ -727,7 +728,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC AddPopupListElement("Reset TOBT", NULL, RESET_TOBT, false, 2, false, false); AddPopupListElement("Reset ASAT", NULL, RESET_ASAT, false, 2, false, false); AddPopupListElement("Reset confirmed TOBT", NULL, RESET_TOBT_CONFIRM, false, 2, false, false); - AddPopupListElement("Reset ASRT", NULL, RESET_OFFBLOCK_REQUEST, false, 2, false, false); + AddPopupListElement("Reset AORT", NULL, RESET_AORT, false, 2, false, false); AddPopupListElement("Reset AOBT", NULL, RESET_AOBT_AND_STATE, false, 2, false, false); break; } @@ -764,13 +765,13 @@ void vACDM::RegisterTagItemFuntions() { RegisterTagItemFunction("ASAT now", ASAT_NOW); RegisterTagItemFunction("ASAT now and startup state", ASAT_NOW_AND_STARTUP); RegisterTagItemFunction("Startup Request", STARTUP_REQUEST); - RegisterTagItemFunction("Request Offblock", OFFBLOCK_REQUEST); + RegisterTagItemFunction("Request Offblock", RESET_AORT); RegisterTagItemFunction("Set AOBT and Groundstate", AOBT_NOW_AND_STATE); // Reset Functions RegisterTagItemFunction("Reset TOBT", RESET_TOBT); RegisterTagItemFunction("Reset ASAT", RESET_ASAT); RegisterTagItemFunction("Reset confirmed TOBT", RESET_TOBT_CONFIRM); - RegisterTagItemFunction("Reset Offblock Request", RESET_OFFBLOCK_REQUEST); + RegisterTagItemFunction("Reset Offblock Request", RESET_AORT); RegisterTagItemFunction("Reset AOBT", RESET_AOBT_AND_STATE); RegisterTagItemFunction("Reset Menu", RESET_MENU); } diff --git a/vACDM.h b/vACDM.h index 1ba4e06..3a6acc4 100644 --- a/vACDM.h +++ b/vACDM.h @@ -51,7 +51,7 @@ enum itemFunction RESET_TOBT, RESET_ASAT, RESET_TOBT_CONFIRM, - RESET_OFFBLOCK_REQUEST, + RESET_AORT, RESET_AOBT_AND_STATE, RESET_MENU, }; From 97743b7e3da370dc37fa4a85abc928f52d6a3b5c Mon Sep 17 00:00:00 2001 From: Leon K Date: Wed, 12 Jul 2023 20:11:53 +0200 Subject: [PATCH 05/12] fix missing semicolon, add reset aircraft function to reset menu --- vACDM.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vACDM.cpp b/vACDM.cpp index b9f64c8..0142bbe 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -730,6 +730,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC AddPopupListElement("Reset confirmed TOBT", NULL, RESET_TOBT_CONFIRM, false, 2, false, false); AddPopupListElement("Reset AORT", NULL, RESET_AORT, false, 2, false, false); AddPopupListElement("Reset AOBT", NULL, RESET_AOBT_AND_STATE, false, 2, false, false); + AddPopupListElement("Reset Aircraft", NULL, RESET_AIRCRAFT, false, 2, false, false); break; } case RESET_AIRCRAFT: @@ -778,7 +779,7 @@ void vACDM::RegisterTagItemFuntions() { RegisterTagItemFunction("Reset Offblock Request", RESET_AORT); RegisterTagItemFunction("Reset AOBT", RESET_AOBT_AND_STATE); RegisterTagItemFunction("Reset Menu", RESET_MENU); - RegisterTagItemFunction("Reset aircraft", RESET_AIRCRAFT) + RegisterTagItemFunction("Reset aircraft", RESET_AIRCRAFT); } void vACDM::RegisterTagItemTypes() { From 5acca851d9b82c151f6aff3c8c2b9af2640b6eba Mon Sep 17 00:00:00 2001 From: Leon K Date: Wed, 12 Jul 2023 20:33:54 +0200 Subject: [PATCH 06/12] minor reset logic changes, add reset asrt function --- vACDM.cpp | 7 ++++++- vACDM.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vACDM.cpp b/vACDM.cpp index 0142bbe..cd4d36a 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -702,9 +702,13 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC case RESET_ASAT: { currentAirport->updateAsat(callsign, types::defaultTime); - currentAirport->updateAsrt(callsign, types::defaultTime); + SetGroundState(radarTarget, "NSTS"); break; } + case RESET_ASRT: + { + currentAirport->updateAsrt(callsign, types::defaultTime); + } case RESET_TOBT_CONFIRM: { currentAirport->updateTobt(callsign, data.tobt, false); @@ -727,6 +731,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC this->OpenPopupList(area, "RESET menu", 1); AddPopupListElement("Reset TOBT", NULL, RESET_TOBT, false, 2, false, false); AddPopupListElement("Reset ASAT", NULL, RESET_ASAT, false, 2, false, false); + AddPopupListElement("Reset ASRT", NULL, RESET_ASRT, false, 2, false, false); AddPopupListElement("Reset confirmed TOBT", NULL, RESET_TOBT_CONFIRM, false, 2, false, false); AddPopupListElement("Reset AORT", NULL, RESET_AORT, false, 2, false, false); AddPopupListElement("Reset AOBT", NULL, RESET_AOBT_AND_STATE, false, 2, false, false); diff --git a/vACDM.h b/vACDM.h index c659b3c..95e4bd5 100644 --- a/vACDM.h +++ b/vACDM.h @@ -50,6 +50,7 @@ enum itemFunction AOBT_NOW_AND_STATE, RESET_TOBT, RESET_ASAT, + RESET_ASRT, RESET_TOBT_CONFIRM, RESET_AORT, RESET_AOBT_AND_STATE, From 450fbfefaeaee23d3b711fcec61775673cb6c1e0 Mon Sep 17 00:00:00 2001 From: Leon K Date: Wed, 12 Jul 2023 21:10:02 +0200 Subject: [PATCH 07/12] fix C4091 --- types/Flight.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/Flight.h b/types/Flight.h index 042f179..d76885d 100644 --- a/types/Flight.h +++ b/types/Flight.h @@ -11,7 +11,7 @@ static constexpr std::chrono::utc_clock::time_point defaultTime = std::chrono::u typedef struct Measure { std::string ident; // measure id int value = -1; // measure value in seconds, i.e. 5 -}; +} Measure; typedef struct Flight { std::chrono::utc_clock::time_point lastUpdate; From b972daf35c85fadf69e795a49929f1f25589b2f2 Mon Sep 17 00:00:00 2001 From: Leon K Date: Wed, 12 Jul 2023 21:12:21 +0200 Subject: [PATCH 08/12] fix C4018 --- com/Server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com/Server.cpp b/com/Server.cpp index 5001e8a..3c3a7a0 100644 --- a/com/Server.cpp +++ b/com/Server.cpp @@ -276,7 +276,7 @@ std::list Server::allFlights(const std::string& airport) { Json::Value measuresArray = flight["measures"]; std::vector parsedMeasures; if (!measuresArray.empty()) { - for (int i = 0; i < measuresArray.size(); i++) { + for (size_t i = 0; i < measuresArray.size(); i++) { vacdm::types::Measure measure; // Extract the ident and value fields from the JSON object measure.ident = measuresArray[i]["ident"].asString(); From ad4ee74eac0c627991596d4f049b80eb3ecb1d59 Mon Sep 17 00:00:00 2001 From: LeoKle Date: Sun, 23 Jul 2023 17:58:26 +0200 Subject: [PATCH 09/12] minor fixes --- vACDM.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vACDM.cpp b/vACDM.cpp index cd4d36a..54ba82b 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -708,6 +708,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC case RESET_ASRT: { currentAirport->updateAsrt(callsign, types::defaultTime); + break; } case RESET_TOBT_CONFIRM: { @@ -723,7 +724,6 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC { SetGroundState(radarTarget, "NSTS"); currentAirport->updateAobt(callsign, types::defaultTime); - currentAirport->updateAort(callsign, types::defaultTime); break; } case RESET_MENU: @@ -741,6 +741,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC case RESET_AIRCRAFT: { currentAirport->deleteFlight(callsign); + break; } default: break; From 3d86663abe335a3abb0b8e4e64149dd127bb3bae Mon Sep 17 00:00:00 2001 From: LeoKle Date: Sun, 23 Jul 2023 18:01:16 +0200 Subject: [PATCH 10/12] add seperate resetTobt function --- com/Airport.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- com/Airport.h | 2 ++ vACDM.cpp | 4 ++-- 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/com/Airport.cpp b/com/Airport.cpp index 496fb0c..5a60c2f 100644 --- a/com/Airport.cpp +++ b/com/Airport.cpp @@ -181,9 +181,7 @@ void Airport::updateTobt(const std::string& callsign, const std::chrono::utc_clo if (false == manualTobt) { root["vacdm"]["tobt_state"] = "CONFIRMED"; } - else { - root["vacdm"]["tobt_state"] = "GUESS"; - } + root["vacdm"]["ttot"] = Airport::timestampToIsoString(types::defaultTime); root["vacdm"]["asat"] = Airport::timestampToIsoString(types::defaultTime); root["vacdm"]["aobt"] = Airport::timestampToIsoString(types::defaultTime); @@ -211,6 +209,51 @@ void Airport::updateTobt(const std::string& callsign, const std::chrono::utc_clo this->m_manualUpdatePerformance.stop(); } +void Airport::resetTobt(const std::string& callsign, const std::chrono::utc_clock::time_point& tobt, const std::string& tobtState) { + if (true == this->m_pause) + return; + + this->m_manualUpdatePerformance.start(); + auto it = this->m_flights.find(callsign); + if (it != this->m_flights.end() && it->second[FlightServer].callsign == callsign) { + Json::Value root; + + root["callsign"] = callsign; + root["vacdm"] = Json::Value(); + + root["vacdm"]["tobt"] = Airport::timestampToIsoString(tobt); + root["vacdm"]["tobt_state"] = tobtState; + root["vacdm"]["tsat"] = Airport::timestampToIsoString(types::defaultTime); + root["vacdm"]["ttot"] = Airport::timestampToIsoString(types::defaultTime); + root["vacdm"]["asat"] = Airport::timestampToIsoString(types::defaultTime); + root["vacdm"]["asrt"] = Airport::timestampToIsoString(types::defaultTime); + root["vacdm"]["aobt"] = Airport::timestampToIsoString(types::defaultTime); + root["vacdm"]["aort"] = Airport::timestampToIsoString(types::defaultTime); + root["vacdm"]["atot"] = Airport::timestampToIsoString(types::defaultTime); + + it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now(); + it->second[FlightConsolidated].tobt = types::defaultTime; + it->second[FlightConsolidated].tsat = types::defaultTime; + it->second[FlightConsolidated].ttot = types::defaultTime; + it->second[FlightConsolidated].exot = types::defaultTime; + it->second[FlightConsolidated].asat = types::defaultTime; + it->second[FlightConsolidated].asrt = types::defaultTime; + it->second[FlightConsolidated].aobt = types::defaultTime; + it->second[FlightConsolidated].aort = types::defaultTime; + it->second[FlightConsolidated].atot = types::defaultTime; + + logging::Logger::instance().log("Airport", logging::Logger::Level::Debug, "Resetting TOBT: " + callsign + ", " + root["vacdm"]["tobt"].asString()); + + std::lock_guard asyncGuard(this->m_asynchronousMessageLock); + this->m_asynchronousMessages.push_back({ + SendType::Patch, + callsign, + root, + }); + } + this->m_manualUpdatePerformance.stop(); +} + void Airport::updateAsat(const std::string& callsign, const std::chrono::utc_clock::time_point& asat) { if (true == this->m_pause) return; diff --git a/com/Airport.h b/com/Airport.h index 601b164..cfb5ab3 100644 --- a/com/Airport.h +++ b/com/Airport.h @@ -5,6 +5,7 @@ #include #include #include +#include #include @@ -61,6 +62,7 @@ class Airport { void flightDisconnected(const std::string& callsign); void updateExot(const std::string& callsign, const std::chrono::utc_clock::time_point& exot); void updateTobt(const std::string& callsign, const std::chrono::utc_clock::time_point& tobt, bool manualTobt); + void resetTobt(const std::string& callsign, const std::chrono::utc_clock::time_point& tobt, const std::string& tobtState); void updateAsat(const std::string& callsign, const std::chrono::utc_clock::time_point& asat); void updateAobt(const std::string& callsign, const std::chrono::utc_clock::time_point& aobt); void updateAtot(const std::string& callsign, const std::chrono::utc_clock::time_point& atot); diff --git a/vACDM.cpp b/vACDM.cpp index 54ba82b..79558f7 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -696,7 +696,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC } case RESET_TOBT: { - currentAirport->updateTobt(callsign, types::defaultTime, false); + currentAirport->resetTobt(callsign, types::defaultTime, data.tobt_state); break; } case RESET_ASAT: @@ -712,7 +712,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC } case RESET_TOBT_CONFIRM: { - currentAirport->updateTobt(callsign, data.tobt, false); + currentAirport->resetTobt(callsign, data.tobt, data.tobt_state); break; } case RESET_AORT: From e718e1e4742b17c1664fea67dce00b41a6d6d901 Mon Sep 17 00:00:00 2001 From: LeoKle Date: Mon, 4 Sep 2023 11:55:58 +0200 Subject: [PATCH 11/12] add missing break, fix name of item function --- vACDM.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vACDM.cpp b/vACDM.cpp index 79558f7..93b0b50 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -322,6 +322,7 @@ void vACDM::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan, EuroScopePlugI stream << std::format("{0:%H%M}", data.ctot); *pRGB = Color::instance().colorizeCtotandCtottimer(data); } + break; case itemType::EVENT_BOOKING: if (data.hasBooking == true) { stream << "B"; @@ -776,7 +777,7 @@ void vACDM::RegisterTagItemFuntions() { RegisterTagItemFunction("ASAT now", ASAT_NOW); RegisterTagItemFunction("ASAT now and startup state", ASAT_NOW_AND_STARTUP); RegisterTagItemFunction("Startup Request", STARTUP_REQUEST); - RegisterTagItemFunction("Request Offblock", RESET_AORT); + RegisterTagItemFunction("Request Offblock", OFFBLOCK_REQUEST); RegisterTagItemFunction("Set AOBT and Groundstate", AOBT_NOW_AND_STATE); // Reset Functions RegisterTagItemFunction("Reset TOBT", RESET_TOBT); @@ -797,7 +798,7 @@ void vACDM::RegisterTagItemTypes() { RegisterTagItemType("ASAT", itemType::ASAT); RegisterTagItemType("AOBT", itemType::AOBT); RegisterTagItemType("ATOT", itemType::ATOT); - RegisterTagItemType("ASRT", itemType::ASRT); + RegisterTagItemType("ASRT", itemType::ASRT); RegisterTagItemType("AORT", itemType::AORT); RegisterTagItemType("CTOT", itemType::CTOT); RegisterTagItemType("Event Booking", itemType::EVENT_BOOKING); From ae645b65ab996d4a518a22b00ae0ad4ec2137da6 Mon Sep 17 00:00:00 2001 From: LeoKle Date: Tue, 5 Sep 2023 21:30:08 +0200 Subject: [PATCH 12/12] fix send correct tobt state on tobt state reset --- vACDM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vACDM.cpp b/vACDM.cpp index 93b0b50..409c819 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -713,7 +713,7 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC } case RESET_TOBT_CONFIRM: { - currentAirport->resetTobt(callsign, data.tobt, data.tobt_state); + currentAirport->resetTobt(callsign, data.tobt, "GUESS"); break; } case RESET_AORT: