Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Tag Items for colored Runway and SID at LFPG #18

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions CoFrancePlugIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
goulven04 marked this conversation as resolved.
Show resolved Hide resolved
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);
}

Expand Down Expand Up @@ -517,6 +520,51 @@ 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) {
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<std::vector<int>>(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<std::vector<int>>(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_runway);
}

if (ItemCode == CoFranceTags::COLORED_SID) {
if (!FlightPlan.IsValid())
return;
auto departure_lfpg_north = toml::find<std::vector<string>>(CoFranceConfig, "lfpg", "departure_north");
auto departure_lfpg_south = toml::find<std::vector<string>>(CoFranceConfig, "lfpg", "departure_south");
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<std::vector<int>>(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<std::vector<int>>(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)
Expand Down
2 changes: 2 additions & 0 deletions Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
28 changes: 18 additions & 10 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ 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]
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]
size = 5
Expand All @@ -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]]
Expand Down