1static void TerrainAlertStabilitySceneRegressions()
2{
4 {
5 Fixture f;
6 f.bus->MapScaleInnerRingKm = 5;
7 f.bus->VerticalSpeedKms = -.018f; f.Step();
8 Check(f.bus->GPWS.terrain.terrain == Severity::Caution,"descent toward flat terrain creates the video-like caution");
9 const auto revision = f.bus->GPWS.terrainRevision;
10 for (int i = 0; i < 30; ++i)
11 {
12 f.bus->VerticalSpeedKms = i%2 ? -.018f : -.012f;
13 f.bus->AFCS.AutopilotEngaged = i%2 != 0;
14 f.gpws.FrameMove(.1f);
15 Check(f.bus->GPWS.terrain.terrain == Severity::Caution && f.bus->MapScaleInnerRingKm == 10 &&
16 f.bus->GPWS.terrainRevision == revision,
17 "production descent jitter keeps map, range and alert stable in manual and Autoflyte flight");
18 }
19 f.bus->VerticalSpeedKms = 0; f.gpws.FrameMove(1.9f);
20 Check(f.bus->GPWS.TerrainDisplayActive(),"brief safe correction retains the display");
21 f.gpws.FrameMove(.2f);
22 Check(!f.bus->GPWS.TerrainDisplayActive() && f.bus->MapScaleInnerRingKm == 5,
23 "sustained production clearance restores the prior range");
24 f.bus->VerticalSpeedKms = -.018f; f.gpws.FrameMove(.01f);
25 Check(f.bus->GPWS.terrain.terrain == Severity::Caution,"a new encounter re-arms immediately");
26 f.Structure(0,2,1.2f); f.gpws.FrameMove(.01f);
27 Check(f.bus->GPWS.terrain.obstacle == Severity::Warning && f.bus->GPWS.terrain.ObstacleAlert(),
28 "new obstacle warning immediately outranks held terrain caution");
29 }
30
31 for (int mode = 0; mode < 10; ++mode)
32 {
33 Fixture f; f.bus->VerticalSpeedKms = -.018f; f.Step();
34 Check(f.bus->GPWS.terrain.Alert() == Severity::Caution,"reset scenario starts with an active threat");
35 f.bus->VerticalSpeedKms = 0;
36 switch (mode)
37 {
41 case 3: f.bus->GPWS.inhibited = true; break;
42 case 4: f.bus->GPWS.positionValid = false; break;
43 case 5: f.terrain.dataReady = false; break;
48 }
49 f.gpws.FrameMove(.01f);
50 Check(f.bus->GPWS.terrain.Alert() == Severity::None && !f.bus->GPWS.TerrainDisplayActive(),
51 "physical exclusion, hover, data loss or vehicle change clears retained threats immediately");
55 ourcockpit.
power = 1; f.bus->GPWS.inhibited =
false; f.bus->GPWS.positionValid =
true;
56 f.terrain.dataReady = true; f.gpws.FrameMove(.01f);
57 Check(f.bus->GPWS.terrain.Alert() == Severity::None,"re-entry to an eligible state cannot revive old history");
58 f.bus->VerticalSpeedKms = -.018f; f.gpws.FrameMove(.01f);
59 Check(f.bus->GPWS.terrain.Alert() == Severity::Caution,"fresh threat after exclusion is immediate");
60 }
61 {
62 Fixture f;
65 f.Step();
66 Check(!f.bus->GPWS.terrain.predictionEnabled && f.bus->GPWS.terrain.Alert() == Severity::None,
67 "orbital coast retains the existing predictive suspension");
69 Check(!f.bus->GPWS.terrain.predictionEnabled,"high-speed ascent stays suspended above the global hazard bound");
70 f.bus->VerticalSpeedKms = -.2f; f.Step();
71 Check(f.bus->GPWS.terrain.predictionEnabled,"suborbital descending path re-arms before entering the height boundary");
74 f.bus->RadioAltitudeKm = 2; f.bus->VerticalSpeedKms = -.3f;
75 f.bus->IndicatedAirspeedKms = 0; f.Step();
76 Check(f.bus->GPWS.terrain.terrain == Severity::Warning && !f.bus->GPWS.terrain.terrainComplete,
77 "fast re-entry warns immediately for known terrain despite range-limited data and low IAS");
78 }
79}
s_network_objects playerships[MAX_SCAN]
RiseMath::Vector3 barycentric
RiseMath::Vector3 velocity