From 33daf42ccc7a9159c12102b5b2ecf54066943f9e Mon Sep 17 00:00:00 2001 From: Goulven Guinel Date: Sun, 1 Dec 2024 08:34:10 +0900 Subject: [PATCH 1/4] Add missing spaces --- config.toml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config.toml b/config.toml index 700294c..b7e9c0c 100644 --- a/config.toml +++ b/config.toml @@ -8,16 +8,16 @@ ac_redundant = [124, 209, 237] conflict_group_moon = [75, 221, 75] conflict_group_losange = [255, 174, 23] conflict_group_star = [255, 255, 127] -sep_tool= [255, 176, 176] -sep_warning=[255, 255, 0] -stca_warning=[255, 0, 0] -sep_background=[40, 40, 40] -sep_border=[0, 0, 0] -intention_code_vfr=[255, 121, 0] -intention_code_arrival=[237, 168, 255] -intention_code_departure=[114, 216, 250] -intention_code_lfpg_arr_south=[255, 176, 176] -ocl_tooltip=[255, 246, 216] +sep_tool = [255, 176, 176] +sep_warning = [255, 255, 0] +stca_warning = [255, 0, 0] +sep_background = [40, 40, 40] +sep_border = [0, 0, 0] +intention_code_vfr = [255, 121, 0] +intention_code_arrival = [237, 168, 255] +intention_code_departure = [114, 216, 250] +intention_code_lfpg_arr_south = [255, 176, 176] +ocl_tooltip = [255, 246, 216] [ac_symbols] size = 5 From a5a7bb3319a349ff8add1aee44c9c0f45b6b03ca Mon Sep 17 00:00:00 2001 From: Goulven Guinel Date: Sun, 1 Dec 2024 09:08:46 +0900 Subject: [PATCH 2/4] Add config for LFPG colors --- config.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config.toml b/config.toml index b7e9c0c..dcffe0a 100644 --- a/config.toml +++ b/config.toml @@ -17,6 +17,10 @@ intention_code_vfr = [255, 121, 0] intention_code_arrival = [237, 168, 255] intention_code_departure = [114, 216, 250] intention_code_lfpg_arr_south = [255, 176, 176] +dep_runway_lfpg_north = [176, 255, 255] +dep_runway_lfpg_south = [255, 176, 176] +sid_lfpg_north = [176, 255, 255] +sid_lfpg_south = [255, 176, 176] ocl_tooltip = [255, 246, 216] [ac_symbols] @@ -40,6 +44,10 @@ altitude_sep = 900 altitude_coarse_filter = 15000 distance_coarse_filter = 70 +[lfpg] +departure_north = ["ELCOB", "OPALE", "ATREX", "NURMO", "DIKOL", "RANUX"] +departure_south = ["LGL", "AGOPA", "ERIXU", "OLZOM", "MONOT", "LATRA", "OKASI", "DORDI", "PILUL", "BAXIR", "BUBLI", "LANVI"] + comment = "LFEE definitions" [[sector_vertical_limit]] From aaad87682c8ead42d0d130d1a0b6c563a19e3cc0 Mon Sep 17 00:00:00 2001 From: Goulven Guinel Date: Fri, 20 Dec 2024 11:03:55 +0900 Subject: [PATCH 3/4] Add new Tag Items for runway and SID --- CoFrancePlugIn.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++++ Constants.h | 2 ++ 2 files changed, 56 insertions(+) diff --git a/CoFrancePlugIn.cpp b/CoFrancePlugIn.cpp index db9810e..5fbaacc 100644 --- a/CoFrancePlugIn.cpp +++ b/CoFrancePlugIn.cpp @@ -58,6 +58,9 @@ CoFrancePlugIn::CoFrancePlugIn(void):CPlugIn(EuroScopePlugIn::COMPATIBILITY_CODE RegisterTagItemType("Stand", CoFranceTags::STAND); RegisterTagItemFunction("Stand popup", CoFranceTags::FUNCTION_STAND_MENU); + RegisterTagItemType("Assigned runway (colored)", CoFranceTags::COLORED_RWY); + RegisterTagItemType("Assigned SID (colored)", CoFranceTags::COLORED_SID); + DisplayUserMessage("Message", "CoFrance PlugIn", string("Version " + string(MY_PLUGIN_VERSION) + " loaded.").c_str(), false, false, false, false, false); } @@ -517,6 +520,57 @@ void CoFrancePlugIn::OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget RadarTarg string Stand = FlightPlan.GetControllerAssignedData().GetFlightStripAnnotation(CoFranceTags::ANNOTATION_STAND); strcpy_s(sItemString, 16, Stand.c_str()); } + + if (ItemCode == CoFranceTags::COLORED_RWY) { + string dep_rwy = ""; + if (FlightPlan.IsValid()) { + if (strlen(FlightPlan.GetFlightPlanData().GetDepartureRwy()) > 0) { + dep_rwy = FlightPlan.GetFlightPlanData().GetDepartureRwy(); + dep_rwy = dep_rwy.substr(0, 3); + if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && + (startsWith("09", FlightPlan.GetFlightPlanData().GetDepartureRwy()) || startsWith("27", FlightPlan.GetFlightPlanData().GetDepartureRwy()))) { + // North runways + auto element_colour = toml::find>(CoFranceConfig, "colours", "dep_runway_lfpg_north"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); + } + if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && + (startsWith("26", FlightPlan.GetFlightPlanData().GetDepartureRwy()) || startsWith("08", FlightPlan.GetFlightPlanData().GetDepartureRwy()))) { + // South runways + auto element_colour = toml::find>(CoFranceConfig, "colours", "dep_runway_lfpg_south"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); + } + } + } + strcpy_s(sItemString, 16, dep_rwy.c_str()); + } + + if (ItemCode == CoFranceTags::COLORED_SID) { + auto departure_lfpg_north = toml::find>(CoFranceConfig, "lfpg", "departure_north"); + auto departure_lfpg_south = toml::find>(CoFranceConfig, "lfpg", "departure_south"); + string sid = ""; + string departure = ""; + if (FlightPlan.IsValid()) { + if (strlen(FlightPlan.GetFlightPlanData().GetSidName()) > 0) { + sid = FlightPlan.GetFlightPlanData().GetSidName(); + departure = sid.substr(0, sid.size() - 2); + // North departures + if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && StringContainsArray(departure, departure_lfpg_north)) { + auto element_colour = toml::find>(CoFranceConfig, "colours", "sid_lfpg_north"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); + } + // South departures + if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && StringContainsArray(departure, departure_lfpg_south)) { + auto element_colour = toml::find>(CoFranceConfig, "colours", "sid_lfpg_south"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); + } + } + } + strcpy_s(sItemString, 16, sid.c_str()); + } } void CoFrancePlugIn::OnTimer(int Counter) diff --git a/Constants.h b/Constants.h index 4ac9ce2..78e09e8 100644 --- a/Constants.h +++ b/Constants.h @@ -41,6 +41,8 @@ namespace CoFranceTags { const int OCL_FLAG = 19; const int ASSIGNED_SPEED = 20; const int STAND = 21; + const int COLORED_RWY = 22; + const int COLORED_SID = 23; const int ANNOTATION_SPEED_SIGN = 2; const int ANNOTATION_STAND = 3; From a2ca8aa708c45458faf4ef8c73dc1a5dc3148103 Mon Sep 17 00:00:00 2001 From: Goulven Guinel Date: Tue, 24 Dec 2024 13:46:32 +0900 Subject: [PATCH 4/4] Refactor with Pierre's comments --- CoFrancePlugIn.cpp | 70 +++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/CoFrancePlugIn.cpp b/CoFrancePlugIn.cpp index 5fbaacc..57cbd93 100644 --- a/CoFrancePlugIn.cpp +++ b/CoFrancePlugIn.cpp @@ -522,51 +522,45 @@ void CoFrancePlugIn::OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget RadarTarg } if (ItemCode == CoFranceTags::COLORED_RWY) { - string dep_rwy = ""; - if (FlightPlan.IsValid()) { - if (strlen(FlightPlan.GetFlightPlanData().GetDepartureRwy()) > 0) { - dep_rwy = FlightPlan.GetFlightPlanData().GetDepartureRwy(); - dep_rwy = dep_rwy.substr(0, 3); - if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && - (startsWith("09", FlightPlan.GetFlightPlanData().GetDepartureRwy()) || startsWith("27", FlightPlan.GetFlightPlanData().GetDepartureRwy()))) { - // North runways - auto element_colour = toml::find>(CoFranceConfig, "colours", "dep_runway_lfpg_north"); - *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; - *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); - } - if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && - (startsWith("26", FlightPlan.GetFlightPlanData().GetDepartureRwy()) || startsWith("08", FlightPlan.GetFlightPlanData().GetDepartureRwy()))) { - // South runways - auto element_colour = toml::find>(CoFranceConfig, "colours", "dep_runway_lfpg_south"); - *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; - *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); - } + if (!FlightPlan.IsValid()) + return; + const char* dep_runway = FlightPlan.GetFlightPlanData().GetDepartureRwy(); + if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin())) { + if (startsWith("09", dep_runway) || startsWith("27", dep_runway)) { + // North runways + auto element_colour = toml::find>(CoFranceConfig, "colours", "dep_runway_lfpg_north"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); + } + if (startsWith("08", dep_runway) || startsWith("26", dep_runway)) { + // South runways + auto element_colour = toml::find>(CoFranceConfig, "colours", "dep_runway_lfpg_south"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); } } - strcpy_s(sItemString, 16, dep_rwy.c_str()); + strcpy_s(sItemString, 16, dep_runway); } if (ItemCode == CoFranceTags::COLORED_SID) { + if (!FlightPlan.IsValid()) + return; auto departure_lfpg_north = toml::find>(CoFranceConfig, "lfpg", "departure_north"); auto departure_lfpg_south = toml::find>(CoFranceConfig, "lfpg", "departure_south"); - string sid = ""; - string departure = ""; - if (FlightPlan.IsValid()) { - if (strlen(FlightPlan.GetFlightPlanData().GetSidName()) > 0) { - sid = FlightPlan.GetFlightPlanData().GetSidName(); - departure = sid.substr(0, sid.size() - 2); - // North departures - if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && StringContainsArray(departure, departure_lfpg_north)) { - auto element_colour = toml::find>(CoFranceConfig, "colours", "sid_lfpg_north"); - *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; - *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); - } - // South departures - if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && StringContainsArray(departure, departure_lfpg_south)) { - auto element_colour = toml::find>(CoFranceConfig, "colours", "sid_lfpg_south"); - *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; - *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); - } + string sid = FlightPlan.GetFlightPlanData().GetSidName(); + if (startsWith("LFPG", FlightPlan.GetFlightPlanData().GetOrigin()) && sid.size() > 2) { + string departure = sid.substr(0, sid.size() - 2); + // North departures + if (StringContainsArray(departure, departure_lfpg_north)) { + auto element_colour = toml::find>(CoFranceConfig, "colours", "sid_lfpg_north"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); + } + // South departures + if (StringContainsArray(departure, departure_lfpg_south)) { + auto element_colour = toml::find>(CoFranceConfig, "colours", "sid_lfpg_south"); + *pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED; + *pRGB = RGB(element_colour[0], element_colour[1], element_colour[2]); } } strcpy_s(sItemString, 16, sid.c_str());