@@ -152,7 +152,13 @@ void CDelHel::OnGetTagItem(EuroScopePlugIn::CFlightPlan FlightPlan, EuroScopePlu
152
152
}
153
153
154
154
*pColorCode = EuroScopePlugIn::TAG_COLOR_RGB_DEFINED;
155
- *pRGB = TAG_COLOR_GREEN;
155
+
156
+ if (res.color == TAG_COLOR_NONE) {
157
+ *pRGB = TAG_COLOR_GREEN;
158
+ }
159
+ else {
160
+ *pRGB = res.color ;
161
+ }
156
162
}
157
163
else
158
164
{
@@ -413,8 +419,15 @@ validation CDelHel::ProcessFlightPlan(const EuroScopePlugIn::CFlightPlan& fp, bo
413
419
}
414
420
415
421
if (validateOnly) {
416
- // If CFL == RFL, EuroScope returns a CFL of 0. Additionally, CFL 1 and 2 indicate ILS and visual approach clearances respectively
417
- // If the RFL is not adapted or confirmed by the controller, cad.GetFinalAltitude() will also return 0
422
+ if (fp.GetFinalAltitude () < sid.cfl ) {
423
+ res.tag = " RFL" ;
424
+ res.color = TAG_COLOR_ORANGE;
425
+
426
+ return res;
427
+ }
428
+
429
+ // If CFL == RFL, EuroScope returns a CFL of 0. Additionally, CFL 1 and 2 indicate ILS and visual approach clearances respectively.
430
+ // If the RFL is not adapted or confirmed by the controller, cad.GetFinalAltitude() will also return 0.
418
431
// To ensure the CFL is actually set, we need to check all three values or check the actual CFL if > 0
419
432
if ((cad.GetClearedAltitude () == 0 && fp.GetFinalAltitude () != sid.cfl && cad.GetFinalAltitude () != sid.cfl ) ||
420
433
(cad.GetClearedAltitude () > 0 && cad.GetClearedAltitude () != sid.cfl )) {
@@ -480,7 +493,17 @@ validation CDelHel::ProcessFlightPlan(const EuroScopePlugIn::CFlightPlan& fp, bo
480
493
return res;
481
494
}
482
495
483
- if (!cad.SetClearedAltitude (sid.cfl )) {
496
+ int cfl = sid.cfl ;
497
+ if (fp.GetFinalAltitude () < sid.cfl ) {
498
+ this ->LogDebugMessage (" Flightplan has RFL below initial CFL for SID, setting RFL" , cs);
499
+
500
+ cfl = fp.GetFinalAltitude ();
501
+
502
+ res.tag = " RFL" ;
503
+ res.color = TAG_COLOR_ORANGE;
504
+ }
505
+
506
+ if (!cad.SetClearedAltitude (cfl)) {
484
507
this ->LogMessage (" Failed to process flightplan, cannot set cleared flightlevel" , cs);
485
508
return res;
486
509
}
0 commit comments