Skip to content

Commit c12e261

Browse files
committed
Merge branch 'freshd'
# Conflicts: # version.txt
2 parents 0eb6f79 + 4924c89 commit c12e261

File tree

4 files changed

+27
-35
lines changed

4 files changed

+27
-35
lines changed

DelHel/CDelHel.cpp

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ validation CDelHel::ProcessFlightPlan(const EuroScopePlugIn::CFlightPlan& fp, bo
646646
flightplan fpl = flightplan(fp.GetCallsign(), fp.GetExtractedRoute(), fpd.GetRoute()); // create fp for route validation
647647

648648
bool routecheck = false;
649+
int count = 0;
649650
for (auto vait = ap.validroutes.begin(); vait != ap.validroutes.end(); ++vait) {
650651

651652
routecheck = false;
@@ -655,25 +656,33 @@ validation CDelHel::ProcessFlightPlan(const EuroScopePlugIn::CFlightPlan& fp, bo
655656
if (vait->waypts.size() > 1) {
656657
try {
657658

658-
auto wyprouit = vait->waypts.begin();
659+
660+
count = 0; //counter to disregard previous found waypoints in fpl
661+
for (auto wyprouit = vait->waypts.begin(); wyprouit != vait->waypts.end(); ++wyprouit) {
662+
for (auto wypfpl = fpl.route.begin() + count; wypfpl != fpl.route.end(); ++wypfpl) {
659663

660-
for (auto wypfpl = fpl.route.begin(); wypfpl != fpl.route.end(); ++wypfpl) {
661-
662-
if (wypfpl->name == *wyprouit) {
663-
routecheck = true;
664-
665-
if (wyprouit == vait->waypts.end() - 1) {
664+
this->LogDebugMessage("Looking for json-Wypt: " + *wyprouit + " comparing to fpl-Wypt: " + wypfpl->name, cs);
665+
if (wypfpl->airway && wypfpl->name.rfind(*wyprouit) == 0) { // check if waypoint name is part of the airway (e.g. SID)
666+
667+
routecheck = true;
668+
++count;
669+
break;
670+
}
671+
if (*wyprouit == wypfpl->name) {
672+
routecheck = true;
673+
++count;
666674
break;
667675
}
668676
else {
669-
++wyprouit;
677+
routecheck = false;
670678
}
679+
++count;
671680
}
672-
else {
673-
routecheck = false;
681+
if (!routecheck) {
682+
break;
674683
}
675-
}
676684

685+
}
677686
}
678687
catch (std::exception e) {
679688
this->LogDebugMessage("Error, No Routing", cs);
@@ -787,6 +796,11 @@ validation CDelHel::ProcessFlightPlan(const EuroScopePlugIn::CFlightPlan& fp, bo
787796
res.valid = false;
788797
res.tag = "INV";
789798
res.color = TAG_COLOR_ORANGE;
799+
800+
if (!validateOnly) {
801+
this->LogMessage("Some Waypoints may be incorrect. Check routing!", cs);
802+
}
803+
790804
continue;
791805
}
792806
else {

airports.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,6 @@
268268
"LOWI": {
269269
"elevation": 1907,
270270
"sids": {
271-
"ADILO": {
272-
"cfl": 16000,
273-
"rwys": {
274-
"08": {
275-
"dep": "ADILO2J"
276-
},
277-
"26": {
278-
"dep": "ADILO3H"
279-
}
280-
}
281-
},
282271
"BRENO": {
283272
"cfl": 12000,
284273
"rwys": {
@@ -769,4 +758,4 @@
769758
}
770759
}
771760
}
772-
}
761+
}

routing.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -471,17 +471,6 @@
471471
}
472472
]
473473
},
474-
{
475-
"name": "ADILO",
476-
"routes": [
477-
{
478-
"icao": "",
479-
"maxlvl": 660,
480-
"minlvl": 165,
481-
"waypoints": []
482-
}
483-
]
484-
},
485474
{
486475
"name": "KPT",
487476
"routes": [

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.4
1+
0.0.5

0 commit comments

Comments
 (0)