Skip to content

Commit e7ab0b9

Browse files
committed
Implemented priority of RWYs for SIDs if none is assigned by ES
Setting the optional "prio" values for a RWY of a SID allows for prioritisation of departures during multi-runway operations
1 parent 345b59f commit e7ab0b9

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

DelHel/CDelHel.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ void CDelHel::ReadAirportConfig()
440440
sidinfo si{
441441
it.key(), // rwy
442442
it.value().value<std::string>("dep", ""), // dep
443-
it.value().value<std::string>("nap", "") // nap
443+
it.value().value<std::string>("nap", ""), // nap
444+
it.value().value<int>("prio", 0) // prio
444445
};
445446

446447
s.rwys.emplace(si.rwy, si);
@@ -638,17 +639,21 @@ validation CDelHel::ProcessFlightPlan(EuroScopePlugIn::CFlightPlan& fp, bool nap
638639
return res;
639640
}
640641

641-
std::map<std::string, sidinfo>::iterator sit;
642+
std::map<std::string, sidinfo>::iterator sit{};
642643
std::string rwy = fpd.GetDepartureRwy();
643644
if (rwy == "") {
644645
this->LogDebugMessage("No runway assigned, attempting to pick first active runway for SID", cs);
645646

647+
// SIDs can have a priority assigned per runway, allowing for "hierarchy" depending on runway config (as currently possible in ES sectorfiles).
648+
// If no priority is assigned, the default of 0 will be used and the first active runway will be picked.
649+
int prio = -1;
646650
for (auto [r, active] : ap.rwys) {
647651
if (active) {
648-
sit = sid.rwys.find(r);
649-
if (sit != sid.rwys.end()) {
652+
auto s = sid.rwys.find(r);
653+
if (s != sid.rwys.end() && s->second.prio > prio) {
654+
sit = s;
650655
rwy = r;
651-
break;
656+
prio = sit->second.prio;
652657
}
653658
}
654659
}
@@ -662,6 +667,10 @@ validation CDelHel::ProcessFlightPlan(EuroScopePlugIn::CFlightPlan& fp, bool nap
662667

663668
return res;
664669
}
670+
671+
// TODO display warning once "valid" tag override below is fixed
672+
/*res.tag = "SID";
673+
res.color = TAG_COLOR_GREEN;*/
665674
}
666675
else {
667676
sit = sid.rwys.find(rwy);

DelHel/sid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ struct sidinfo {
77
std::string rwy;
88
std::string dep;
99
std::string nap;
10+
int prio{};
1011
};
1112

1213
struct sid {

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,11 @@ rwys | `object` | Object with RWYs as keys and `RWY` objects as values, contains
283283

284284
#### `RWY` object
285285

286-
Key | Type | Description | Required
287-
----|----------|-----------------------------------------|---------
288-
dep | `string` | Full name of SID for RWY | Yes
289-
nap | `string` | Full name of NAP for RWY (if available) | No
286+
Key | Type | Description | Required
287+
-----|----------|------------------------------------------------------------------------------------------|---------
288+
dep | `string` | Full name of SID for RWY | Yes
289+
nap | `string` | Full name of NAP for RWY (if available) | No
290+
prio | `int` | Priority of RWY for SID if no RWY is assigned by EuroScope (higher number = higher prio) | No
290291

291292
### Routing config
292293
All mandatory routings are stored in the `routing.json`file in the same directory as the `DelHel.dll` plugin. Within this file, you can specify routings with optional waypoints, and the corresponding altitudes (min/max cruise altitude for this route).

0 commit comments

Comments
 (0)