2 #include "../Extensions.h" 9 #pragma region Commands 13 if (command.
delay != 0.0f)
continue;
15 int location = command.
ivalue;
20 if (command.
name ==
"FlightControlPriorityDepress")
22 if (
locations.size() >
static_cast<unsigned>(location))
26 newCommand.
name = location == 0 ?
"FCSPriorityRight" :
"FCSPriorityLeft";
28 locations.at(location).priorityButtonDown =
true;
29 locations.at(location).priorityHeldDownSec = 0.0f;
35 else if (command.
name ==
"FlightControlPriorityRelease")
37 if (
locations.size() >
static_cast<unsigned>(location))
39 locations.at(location).priorityButtonDown =
false;
45 else if (command.
name ==
"PushToTalkDepress")
47 if (
locations.size() >
static_cast<unsigned>(location))
50 newCommand.
name = location == 0 ?
"Push To Talk Pilot" :
"Push To Talk Gunner";
57 else if (command.
name ==
"PushToTalkRelease")
59 if (
locations.size() >
static_cast<unsigned>(location))
62 newCommand.
name = location == 0 ?
"Push To Talk Pilot" :
"Push To Talk Gunner";
74 for (UINT i = 0; i <
locations.size(); i++)
78 locations.at(i).priorityHeldDownSec += fElapsed;
89 bool dualInput =
false;
171 newCommand.
name =
"FCSDualInput";
204 static float oldhdg = 0.0f;
206 if (_yaw < -D3DX_PI) _yaw += D3DX_PI * 2.0f;
207 if (_yaw > D3DX_PI) _yaw -= D3DX_PI * 2.0f;
213 float desiredyaw = 0.0f;
216 float yawcorr = desiredyaw - _yaw;
218 float dampen = yawcorr / 0.05235987756f;
226 const float Vs = 0.010f;
227 const float Vne = 0.128f;
229 if (ifcs > 1) ifcs = 1;
230 if (ifcs < 0) ifcs = 0;
237 const float modarea = 31.796473f / 55.824566f;
238 const float modang = 0.739191473f;
239 const float modcg = 0.14285714285714285714285714285714f;
240 const float moddeflect = 0.392699f / 0.5f;
244 const float modusefullrange = 1.0f / 1.06250954f;
std::vector< Location > locations
int ControlPriorityLocation
float occupantPitchControlAuthority
void ConnectComponent(std::string name, std::string guid)
float occupantRollControlAuthority
std::vector< Command > commandStream
Systems::Fault * GetComponentFaultStatePtr(std::string guidStr)
void FrameMove(float fElapsedTime) override
std::vector< Devices::Joystick * > flightControls
float RollControlSurfacePosition
float IndicatedAirspeed
(3) Indicated Airspeed in km per second?
static float Clamp(float x, float min, float max)
float PitchAttitude
(6) Pitch attitude;
Fcs(Bus *prmBus, int joysticks)
float HeadingTrue
(4) Heading–primary flight crew reference (if selectable, record discrete, true or magnetic); ...
std::vector< bool > Transmitting
(8) Manual radio transmitter keying, or CVR/DFDR synchronization reference;
std::string name
command name
bool ControlPriorityLatched
float RollAttitude
(7) Roll attitude;
float DiscreetSurfacePostion[4]
Abstract base class for modules By definition, instruments don't do any of the work (they don't modif...
void Initialize(Devices::Joystick *prmFlightControl)
float YawControlSurfacePosition
bool IsCommandOnStack(std::string commandName)
float delay
wait number of seconds before executing command
std::vector< Devices::Joystick > joysticks