diff --git a/com/Airport.cpp b/com/Airport.cpp index 26c1a69..6a38a53 100644 --- a/com/Airport.cpp +++ b/com/Airport.cpp @@ -150,14 +150,16 @@ void Airport::updateTobt(const std::string& callsign, const std::chrono::utc_clo auto it = this->m_flights.find(callsign); if (it != this->m_flights.end() && it->second[FlightServer].callsign == callsign) { + bool resetTsat = (tobt == types::defaultTime && true == manualTobt) || tobt >= it->second[FlightConsolidated].tsat; Json::Value root; root["callsign"] = callsign; root["vacdm"] = Json::Value(); root["vacdm"]["tobt"] = Airport::timestampToIsoString(tobt); - root["vacdm"]["tsat"] = Airport::timestampToIsoString(types::defaultTime); + if (true == resetTsat) + root["vacdm"]["tsat"] = Airport::timestampToIsoString(types::defaultTime); if (false == manualTobt) - root["vacdm"]["tobt_state"] = "NOW"; + root["vacdm"]["tobt_state"] = "CONFIRMED"; root["vacdm"]["ttot"] = root["vacdm"]["tsat"].asString(); root["vacdm"]["asat"] = root["vacdm"]["tsat"].asString(); root["vacdm"]["aobt"] = root["vacdm"]["tsat"].asString(); @@ -165,7 +167,8 @@ void Airport::updateTobt(const std::string& callsign, const std::chrono::utc_clo it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now(); it->second[FlightConsolidated].tobt = tobt; - it->second[FlightConsolidated].tsat = types::defaultTime; + if (true == resetTsat) + it->second[FlightConsolidated].tsat = types::defaultTime; it->second[FlightConsolidated].ttot = types::defaultTime; it->second[FlightConsolidated].exot = types::defaultTime; it->second[FlightConsolidated].asat = types::defaultTime; @@ -243,6 +246,52 @@ void Airport::updateAtot(const std::string& callsign, const std::chrono::utc_clo } } +void Airport::updateAsrt(const std::string& callsign, const std::chrono::utc_clock::time_point& asrt) { + if (true == this->m_pause) + return; + + std::lock_guard guard(this->m_lock); + + 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"]["asrt"] = Airport::timestampToIsoString(asrt); + + + it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now(); + it->second[FlightConsolidated].asrt = asrt; + + logging::Logger::instance().log("Airport", logging::Logger::Level::Debug, "Updating ASRT: " + callsign + ", " + root["vacdm"]["asrt"].asString()); + Server::instance().patchFlight(callsign, root); + } +} + +void Airport::updateAort(const std::string& callsign, const std::chrono::utc_clock::time_point& aort) { + if (true == this->m_pause) + return; + + std::lock_guard guard(this->m_lock); + + 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"]["aort"] = Airport::timestampToIsoString(aort); + + + it->second[FlightEuroscope].lastUpdate = std::chrono::utc_clock::now(); + it->second[FlightConsolidated].aort = aort; + + logging::Logger::instance().log("Airport", logging::Logger::Level::Debug, "Updating AORT: " + callsign + ", " + root["vacdm"]["aort"].asString()); + Server::instance().patchFlight(callsign, root); + } +} + Airport::SendType Airport::deltaEuroscopeToBackend(const std::array& data, Json::Value& root) { root.clear(); @@ -357,6 +406,10 @@ void Airport::consolidateData(std::array& data) { data[FlightConsolidated].asat = data[FlightServer].asat; data[FlightConsolidated].aobt = data[FlightServer].aobt; data[FlightConsolidated].atot = data[FlightServer].atot; + data[FlightConsolidated].aort = data[FlightServer].aort; + data[FlightConsolidated].asrt = data[FlightServer].asrt; + data[FlightConsolidated].tobt_state = data[FlightServer].tobt_state; + data[FlightConsolidated].hasBooking = data[FlightServer].hasBooking; data[FlightConsolidated].runway = data[FlightEuroscope].runway; diff --git a/com/Airport.h b/com/Airport.h index ba2e4ea..a016849 100644 --- a/com/Airport.h +++ b/com/Airport.h @@ -49,6 +49,8 @@ class Airport { 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); + void updateAsrt(const std::string& callsign, const std::chrono::utc_clock::time_point& asrt); + void updateAort(const std::string& callsign, const std::chrono::utc_clock::time_point& aort); bool flightExists(const std::string& callsign); const types::Flight_t& flight(const std::string& callsign); }; diff --git a/com/Server.cpp b/com/Server.cpp index bc55a04..91f4874 100644 --- a/com/Server.cpp +++ b/com/Server.cpp @@ -271,8 +271,12 @@ std::list Server::allFlights(const std::string& airport) { flights.back().aobt = Server::isoStringToTimestamp(flight["vacdm"]["aobt"].asString()); flights.back().atot = Server::isoStringToTimestamp(flight["vacdm"]["atot"].asString()); flights.back().exot = std::chrono::utc_clock::time_point(std::chrono::minutes(flight["vacdm"]["exot"].asInt64())); - flights.back().hasBooking = flight["hasBooking"].asBool(); + flights.back().asrt = Server::isoStringToTimestamp(flight["vacdm"]["asrt"].asString()); + flights.back().aort = Server::isoStringToTimestamp(flight["vacdm"]["aort"].asString()); + flights.back().tobt_state = flight["vacdm"]["tobt_state"].asString(); + flights.back().hasBooking = flight["hasBooking"].asBool(); + flights.back().runway = flight["clearance"]["dep_rwy"].asString(); flights.back().sid = flight["clearance"]["sid"].asString(); flights.back().assignedSquawk = flight["clearance"]["assigned_squawk"].asString(); diff --git a/config/FileFormat.cpp b/config/FileFormat.cpp index 2632fed..2c18533 100644 --- a/config/FileFormat.cpp +++ b/config/FileFormat.cpp @@ -107,6 +107,8 @@ bool FileFormat::parse(const std::string& filename, SystemConfig& config) { parsed = this->parseColor(entry[1], config.green, lineOffset); } else if ("COLOR_blue" == entry[0]) { parsed = this->parseColor(entry[1], config.blue, lineOffset); + } else if ("COLOR_lightyellow" == entry[0]) { + parsed = this->parseColor(entry[1], config.lightyellow, lineOffset); } else if ("COLOR_yellow" == entry[0]) { parsed = this->parseColor(entry[1], config.yellow, lineOffset); } else if ("COLOR_orange" == entry[0]) { diff --git a/types/Flight.h b/types/Flight.h index a638ffa..9cf7b2d 100644 --- a/types/Flight.h +++ b/types/Flight.h @@ -16,6 +16,7 @@ typedef struct Flight { // position/* double latitude = 0.0; double longitude = 0.0; + bool taxizoneIsTaxiout = false; // flightplan/* std::string origin; @@ -32,6 +33,9 @@ typedef struct Flight { std::chrono::utc_clock::time_point asat = defaultTime; std::chrono::utc_clock::time_point aobt = defaultTime; std::chrono::utc_clock::time_point atot = defaultTime; + std::chrono::utc_clock::time_point asrt = defaultTime; + std::chrono::utc_clock::time_point aort = defaultTime; + std::string tobt_state = ""; // booking/* bool hasBooking = false; diff --git a/types/SystemConfig.h b/types/SystemConfig.h index e10286b..98cf3f6 100644 --- a/types/SystemConfig.h +++ b/types/SystemConfig.h @@ -14,6 +14,7 @@ namespace vacdm { COLORREF lightblue = RGB(53, 218, 235); COLORREF green = RGB(0, 181, 27); COLORREF blue = RGB(0, 0, 255); + COLORREF lightyellow = RGB(255, 255, 191); COLORREF yellow = RGB(255, 255, 0); COLORREF orange = RGB(255, 153, 0); COLORREF red = RGB(255, 0, 0); diff --git a/vACDM.cpp b/vACDM.cpp index e8c5349..705f265 100644 --- a/vACDM.cpp +++ b/vACDM.cpp @@ -224,43 +224,55 @@ void vACDM::OnTimer(const int Counter) { COLORREF vACDM::colorizeEobtAndTobt(const types::Flight_t& flight) const { const auto now = std::chrono::utc_clock::now(); - const auto timeSinceTobt = std::chrono::duration_cast(now - flight.tobt).count(); - const auto diffTsatTobt = std::chrono::duration_cast(flight.tsat - flight.tobt).count(); - if (flight.tsat.time_since_epoch().count() == 0) + const auto timeSinceTobt = std::chrono::duration_cast(now - flight.tobt).count(); + const auto timeSinceTsat = std::chrono::duration_cast(now - flight.tsat).count(); + const auto diffTsatTobt = std::chrono::duration_cast(flight.tsat - flight.tobt).count(); + + if (flight.tsat == types::defaultTime) { return this->m_pluginConfig.grey; } // ASAT exists - if (flight.asat != types::defaultTime) + if (flight.asat.time_since_epoch().count() > 0) { return this->m_pluginConfig.grey; } - // Diff TOBT TSAT >= 5min - if (diffTsatTobt >= 5) + // TOBT in past && TSAT expired, i.e. 5min past TSAT || TOBT >= +1h || TSAT does not exist && TOBT in past + // -> TOBT in past && (TSAT expired || TSAT does not exist) || TOBT >= now + 1h + if (timeSinceTobt > 0 && (timeSinceTsat >= 5 * 60 || flight.tsat == types::defaultTime) || flight.tobt >= now + std::chrono::hours(1)) //last statement could cause problems + { + return this->m_pluginConfig.orange; + } + // Diff TOBT TSAT >= 5min && unconfirmed + if (diffTsatTobt >= 5 * 60 && (flight.tobt_state == "GUESS" || flight.tobt_state == "FLIGHTPLAN")) + { + return this->m_pluginConfig.lightyellow; + } + // Diff TOBT TSAT >= 5min && confirmed + if (diffTsatTobt >= 5 * 60 && flight.tobt_state == "CONFIRMED") { return this->m_pluginConfig.yellow; } // Diff TOBT TSAT < 5min - if (diffTsatTobt < 5) + if (diffTsatTobt < 5 * 60 && flight.tobt_state == "CONFIRMED") { return this->m_pluginConfig.green; } - // TOBT in past && TSAT expired || TOBT >= +1h || TSAT does not exist && TOBT in past - // -> TOBT in past && (TSAT expired || TSAT does not exist) || TOBT >= now + 1h - if (timeSinceTobt > 0 && (flight.tsat < now || flight.tsat == types::defaultTime) || flight.tobt >= now + std::chrono::hours(1)) + // tobt is not confirmed + if (flight.tobt_state != "CONFIRMED") { - return this->m_pluginConfig.orange; + return this->m_pluginConfig.lightgreen; } return this->m_pluginConfig.debug; } -COLORREF vACDM::colorizeTsatandAsrt(const types::Flight_t& flight) const { - if (flight.asat != types::defaultTime || flight.tsat.time_since_epoch().count() == 0) +COLORREF vACDM::colorizeTsat(const types::Flight_t& flight) const { + if (flight.asat != types::defaultTime || flight.tsat == types::defaultTime) { return this->m_pluginConfig.grey; } - const auto timeSinceTsat = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.tsat).count(); - if (timeSinceTsat <= 5 && timeSinceTsat >= -5) + const auto timeSinceTsat = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.tsat).count(); + if (timeSinceTsat <= 5 * 60 && timeSinceTsat >= -5 * 60) { /* CTOT not used atm if (flight.ctot != types::defaultTime) @@ -271,7 +283,7 @@ COLORREF vACDM::colorizeTsatandAsrt(const types::Flight_t& flight) const { return this->m_pluginConfig.green; } // TSAT earlier than 5+ min - if (timeSinceTsat < -5) + if (timeSinceTsat < -5 * 60) { /* if (flight.ctot != types::defaultTime) @@ -282,7 +294,7 @@ COLORREF vACDM::colorizeTsatandAsrt(const types::Flight_t& flight) const { return this->m_pluginConfig.lightgreen; } // TSAT passed by 5+ min - if (timeSinceTsat > 5) + if (timeSinceTsat > 5 * 60) { /* if (flight.ctot != types::defaultTime) @@ -296,77 +308,193 @@ COLORREF vACDM::colorizeTsatandAsrt(const types::Flight_t& flight) const { } COLORREF vACDM::colorizeTtot(const types::Flight_t& flight) const { - if (flight.ttot == types::defaultTime || flight.ttot.time_since_epoch().count() == 0) + if (flight.ttot == types::defaultTime) { return this->m_pluginConfig.grey; } - const auto minutes = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.ttot).count(); - // ATOT exists - if (flight.atot != types::defaultTime) + auto now = std::chrono::utc_clock::now(); + + // Round up to the next 10, 20, 30, 40, 50, or 00 minute interval + auto timeSinceEpoch = flight.ttot.time_since_epoch(); + auto minutesSinceEpoch = std::chrono::duration_cast(timeSinceEpoch); + std::chrono::time_point rounded; + + // Compute the number of minutes remaining to the next highest ten + auto remainingMinutes = 10 - minutesSinceEpoch.count() % 10; + + // If the time point is already at a multiple of ten minutes, no rounding is needed + if (remainingMinutes == 10) { + rounded = std::chrono::time_point_cast(flight.ttot); + } + else { + // Add the remaining minutes to the time point + auto roundedUpMinutes = minutesSinceEpoch + std::chrono::minutes(remainingMinutes); + + // Convert back to a time_point object and return + rounded = std::chrono::time_point_cast(std::chrono::utc_clock::time_point(roundedUpMinutes)); + rounded += std::chrono::seconds(30); + } + + // Check if the current time has passed the ttot time point + if (flight.atot.time_since_epoch().count() > 0) { + // ATOT exists return this->m_pluginConfig.grey; } - // time before TTOT - if (minutes >= 0) + if (now < rounded) { + // time before TTOT and during TTOT block return this->m_pluginConfig.green; } - // time past TTOT - else + else if (now >= rounded) { + // time past TTOT / TTOT block return this->m_pluginConfig.orange; } + return this->m_pluginConfig.debug; } -COLORREF vACDM::colorizeAobt(const types::Flight_t& flight) const { - std::ignore = flight; - return this->m_pluginConfig.grey; -} - -COLORREF vACDM::colorizeAsat(const types::Flight_t& flight) const { - if (flight.ttot == types::defaultTime || flight.ttot.time_since_epoch().count() == 0) +COLORREF vACDM::colorizeAort(const types::Flight_t& flight) const { + if (flight.aort == types::defaultTime) { return this->m_pluginConfig.grey; } - - if (flight.aobt != types::defaultTime) + if (flight.aobt.time_since_epoch().count() > 0) { return this->m_pluginConfig.grey; } - // Preversion, until "Push required"/"Taxi-out positions" are availabe via database - const auto timesinceasat = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.asat).count(); - if (timesinceasat <= 5) + const auto timeSinceAort = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.aort).count(); + + if (timeSinceAort <= 5 * 60 && timeSinceAort >= 0) { return this->m_pluginConfig.green; } - else + if (timeSinceAort > 5 * 60 && timeSinceAort <= 10 * 60) + { + return this->m_pluginConfig.yellow; + } + if (timeSinceAort > 10 * 60 && timeSinceAort <= 15 * 60) { return this->m_pluginConfig.orange; } - // ASAT bs +5 green, orange AOBT, grey - /* - if( aircraft is requiring push and until ASAT < +5min || - PB REQ && DCL Flag && TSAT < +/- 5 min || - in taxi-out? && ASAT < +10min || - in taxi-out? && DCL Flag && TSAT >= -5 && TSAT <= +10min + if (timeSinceAort > 15 * 60) + { + return this->m_pluginConfig.red; + } + + return this->m_pluginConfig.debug; +} - else +COLORREF vACDM::colorizeAsrt(const types::Flight_t& flight) const { + + if (flight.asat.time_since_epoch().count() > 0) + { + return this->m_pluginConfig.grey; + } + const auto timeSinceAsrt = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.asrt).count(); + if (timeSinceAsrt <= 5 * 60 && timeSinceAsrt >= 0) + { + return this->m_pluginConfig.green; + } + if (timeSinceAsrt > 5 * 60 && timeSinceAsrt <= 10 * 60) + { + return this->m_pluginConfig.yellow; + } + if (timeSinceAsrt > 10 * 60 && timeSinceAsrt <= 15 * 60) + { + return this->m_pluginConfig.orange; + } + if (timeSinceAsrt > 15 * 60) { - return orange; + return this->m_pluginConfig.red; } - */ - //return debug; + return this->m_pluginConfig.debug; } -COLORREF vACDM::colorizeAsatTimerandAort(const types::Flight_t& flight) const { +COLORREF vACDM::colorizeAobt(const types::Flight_t& flight) const { std::ignore = flight; + return this->m_pluginConfig.grey; +} - /* same logic as in colorizeAsat*/ - /* to be hidden at AOBT*/ +COLORREF vACDM::colorizeAsat(const types::Flight_t& flight) const { + if (flight.asat == types::defaultTime) + { + return this->m_pluginConfig.grey; + } - return this->m_pluginConfig.debug; + if (flight.aobt.time_since_epoch().count() > 0) + { + return this->m_pluginConfig.grey; + } + + const auto timeSinceAsat = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.asat).count(); + const auto timeSinceTsat = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.tsat).count(); + if (flight.taxizoneIsTaxiout == false) + { + + if (/* Datalink clearance == true &&*/ timeSinceTsat >= -5 * 60 && timeSinceTsat <= 5 * 60) + { + return this->m_pluginConfig.green; + } + if (timeSinceAsat < 5 * 60) + { + return this->m_pluginConfig.green; + } + } + if (flight.taxizoneIsTaxiout == true) + { + if (timeSinceTsat >= -5 * 60 && timeSinceTsat <= 10 * 60 /* && Datalink clearance == true*/) + { + return this->m_pluginConfig.green; + } + if (timeSinceAsat < 10 * 60) + { + return this->m_pluginConfig.green; + } + } + return this->m_pluginConfig.orange; +} + +COLORREF vACDM::colorizeAsatTimer(const types::Flight_t& flight) const { + // aort set + if (flight.aort.time_since_epoch().count() > 0) + { + return this->m_pluginConfig.grey; + } + const auto timeSinceAobt = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.aobt).count(); + if (timeSinceAobt >= 0) + { + // hide Timer + } + const auto timeSinceAsat = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.asat).count(); + const auto timeSinceTsat = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.tsat).count(); + // Pushback required + if (flight.taxizoneIsTaxiout != false) + { + /* + if (hasdatalinkclearance == true && timesincetsat >=5*60 && timesincetsat <=5*60) + { + return this->m_pluginConfig.green + } */ + if (timeSinceAsat < 5 * 60) + { + return this->m_pluginConfig.green; + } + } + if (flight.taxizoneIsTaxiout == true) + { + if (timeSinceTsat >= -5 * 60 && timeSinceTsat <= 10 * 60) + { + return this->m_pluginConfig.green; + } + if (timeSinceAsat <= 10 * 60) + { + return this->m_pluginConfig.green; + } + } + return this->m_pluginConfig.orange; } COLORREF vACDM::colorizeCtotandCtottimer(const types::Flight_t& flight) const { @@ -375,16 +503,16 @@ COLORREF vACDM::colorizeCtotandCtottimer(const types::Flight_t& flight) const { return this->m_pluginConfig.grey; } - const auto timetoctot = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.ctot).count(); - if (timetoctot >= 5) + const auto timetoctot = std::chrono::duration_cast(std::chrono::utc_clock::now() - flight.ctot).count(); + if (timetoctot >= 5 * 60) { return this->m_pluginConfig.lightgreen; } - if (timetoctot <= 5 && timetoctot >= -10) + if (timetoctot <= 5 * 60 && timetoctot >= -10 * 60) { return this->m_pluginConfig.green; } - if (timetoctot < -10) + if (timetoctot < -10 * 60) { return this->m_pluginConfig.orange; } @@ -392,6 +520,7 @@ COLORREF vACDM::colorizeCtotandCtottimer(const types::Flight_t& flight) const { return this->m_pluginConfig.grey; } + void vACDM::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan, EuroScopePlugIn::CRadarTarget RadarTarget, int ItemCode, int TagData, char sItemString[16], int* pColorCode, COLORREF* pRGB, double* pFontSize) { std::ignore = RadarTarget; @@ -431,8 +560,13 @@ void vACDM::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan, EuroScopePlugI break; case itemType::TSAT: if (data.tsat.time_since_epoch().count() > 0) { - stream << std::format("{0:%H%M}", data.tsat); - *pRGB = this->colorizeTsatandAsrt(data); + if (data.asat == types::defaultTime && data.asrt.time_since_epoch().count() > 0) { + stream << std::format("{0:%H%M}", data.tsat) << "R"; // "R" = aircraft ready symbol + } + else { + stream << std::format("{0:%H%M}", data.tsat); + } + *pRGB = this->colorizeTsat(data); } break; case itemType::EXOT: @@ -464,6 +598,18 @@ void vACDM::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan, EuroScopePlugI *pRGB = this->colorizeAobt(data); } break; + case itemType::ASRT: + if (data.asrt.time_since_epoch().count() > 0) { + stream << std::format("{0:%H%M}", data.asrt); + *pRGB = this->colorizeAsrt(data); + } + break; + case itemType::AORT: + if (data.aort.time_since_epoch().count() > 0) { + stream << std::format("{0:%H%M}", data.aort); + *pRGB = this->colorizeAort(data); + } + break; case itemType::EventBooking: if (data.hasBooking == true) { stream << "B"; @@ -742,15 +888,54 @@ void vACDM::OnFunctionCall(int functionId, const char* itemString, POINT pt, REC break; } case ASAT_NOW: + { + currentAirport->updateAsat(callsign, std::chrono::utc_clock::now()); + // if ASRT has not been set yet -> set ASRT + if (data.asrt == types::defaultTime) + { + currentAirport->updateAsrt(callsign, std::chrono::utc_clock::now()); + } + break; + } + case ASAT_NOW_AND_STARTUP: { currentAirport->updateAsat(callsign, std::chrono::utc_clock::now()); + // if ASRT has not been set yet -> set ASRT + if (data.asrt == types::defaultTime) + { + 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()); break; } + case STARTUP_REQUEST: + { + currentAirport->updateAsrt(callsign, std::chrono::utc_clock::now()); + break; + } + case TOBT_CONFIRM: + { + currentAirport->updateTobt(callsign, data.tobt, true); + break; + } + case OFFBLOCK_REQUEST: + { + currentAirport->updateAort(callsign, std::chrono::utc_clock::now()); + break; + } + case TOBT_MENU: + { + this->OpenPopupList(area, "TOBT menu", 1); + AddPopupListElement("TOBT now", NULL, TOBT_NOW, false, 2, false, false); + AddPopupListElement("TOBT edit", NULL, TOBT_MANUAL, false, 2, false, false); + AddPopupListElement("TOBT confirm", NULL, TOBT_CONFIRM, false, 2, false, false); + break; + } default: break; } @@ -760,7 +945,12 @@ void vACDM::RegisterTagItemFuntions() { RegisterTagItemFunction("Modify EXOT", EXOT_MODIFY); RegisterTagItemFunction("TOBT now", TOBT_NOW); RegisterTagItemFunction("Set TOBT", TOBT_MANUAL); + RegisterTagItemFunction("TOBT confirm", TOBT_CONFIRM); + RegisterTagItemFunction("Tobt menu", TOBT_MENU); 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); } void vACDM::RegisterTagItemTypes() { @@ -772,6 +962,8 @@ void vACDM::RegisterTagItemTypes() { RegisterTagItemType("ASAT", itemType::ASAT); RegisterTagItemType("AOBT", itemType::AOBT); RegisterTagItemType("ATOT", itemType::ATOT); + RegisterTagItemType("ASRT", itemType::ASRT); + RegisterTagItemType("AORT", itemType::AORT); RegisterTagItemType("Event Booking", itemType::EventBooking); } diff --git a/vACDM.h b/vACDM.h index d934cf8..e2af2f6 100644 --- a/vACDM.h +++ b/vACDM.h @@ -27,6 +27,8 @@ enum itemType ASAT, AOBT, ATOT, + ASRT, + AORT, EventBooking }; @@ -37,7 +39,12 @@ enum itemFunction TOBT_NOW, TOBT_MANUAL, TOBT_MANUAL_EDIT, + TOBT_MENU, ASAT_NOW, + ASAT_NOW_AND_STARTUP, + STARTUP_REQUEST, + TOBT_CONFIRM, + OFFBLOCK_REQUEST, }; class vACDM : public EuroScopePlugIn::CPlugIn { @@ -59,11 +66,13 @@ class vACDM : public EuroScopePlugIn::CPlugIn { static std::chrono::utc_clock::time_point convertToTobt(const std::string& callsign, const std::string& eobt); COLORREF colorizeEobtAndTobt(const types::Flight_t& flight) const; - COLORREF colorizeTsatandAsrt(const types::Flight_t& flight) const; + COLORREF colorizeTsat(const types::Flight_t& flight) const; COLORREF colorizeTtot(const types::Flight_t& flight) const; + COLORREF colorizeAort(const types::Flight_t& flight) const; + COLORREF colorizeAsrt(const types::Flight_t& flight) const; COLORREF colorizeAobt(const types::Flight_t& flight) const; COLORREF colorizeAsat(const types::Flight_t& flight) const; - COLORREF colorizeAsatTimerandAort(const types::Flight_t& flight) const; + COLORREF colorizeAsatTimer(const types::Flight_t& flight) const; COLORREF colorizeCtotandCtottimer(const types::Flight_t& flight) const; EuroScopePlugIn::CRadarScreen* OnRadarScreenCreated(const char* displayName, bool needsRadarContent, bool geoReferenced,