Rise
The Vieneo Province
Loading...
Searching...
No Matches
LandingGearStatus.h
Go to the documentation of this file.
1#pragma once
2
4// Vehicle component status: -1 means not installed, 0..63 cannot confirm
5// position, and 64..127 is serviceable. Keep the CAS condition independent
6// of gear command/animation and of whether its message has been acknowledged.
7constexpr bool StrutDisagrees(int health) { return health >= 0 && health < 64; }
8constexpr bool Disagrees(int left, int right, int nose)
9{
10 return StrutDisagrees(left) || StrutDisagrees(right) || StrutDisagrees(nose);
11}
12constexpr bool StrutKnown(int health) { return health == -1 || (health >= 64 && health <= 127); }
13inline double ConfirmedExtent(double extent, int left, int right, int nose)
14{
15 // Existing DOR configuration/audio checks treat negative extent as unknown.
16 // Preserve the measured extent for healthy or absent struts, including
17 // non-finite extent so those checks continue to reject invalid readings.
18 return StrutKnown(left) && StrutKnown(right) && StrutKnown(nose) ? extent : -1.0;
19}
20}
constexpr bool Disagrees(int left, int right, int nose)
constexpr bool StrutDisagrees(int health)
double ConfirmedExtent(double extent, int left, int right, int nose)
constexpr bool StrutKnown(int health)