protected override void ProcessSpoilerDemand(ExtendedSimConnect simConnect, SpoilerData data) { int? newPosition = null; IEvent?toSend = null; if (data.armed != 0) { toSend = armOffEvent; //newPosition = 0; } else if (data.position < 100) { newPosition = Math.Min(data.position + 25, 100); } if (toSend != null) { _logger.LogDebug($"Now send {toSend}"); simConnect.SendEvent(toSend); } if (newPosition != null) { uint eventData = (uint)newPosition * 164; eventData = Math.Min(eventData, 16384u); _logger.LogDebug($"Now demand position {newPosition} or as U {eventData}"); simConnect.SendEvent(setEvent, eventData); } }
public void SetInSim(ExtendedSimConnect simConnect, Int16?value) { Console.Error.WriteLine("Speedbrake from Serial not currently honoured"); return; //TODO: remove when "handle" is exposed again. simConnect.SendEvent(value >= 0 ? armOff : armOn); uint eventData = (uint)Math.Max((int)value !, 0) * 164; eventData = Math.Min(eventData, 16384u); simConnect.SendEvent(set, eventData); }
public void SetInSim(ExtendedSimConnect simConnect, string?newFrequencyString) { var newFrequency = Decimal.Parse(newFrequencyString !); uint hz = Decimal.ToUInt32(Decimal.Multiply(newFrequency, new Decimal(1000000))); simConnect.SendEvent(setEvent, hz); }
protected override void ProcessSpoilerDemand(ExtendedSimConnect simConnect, SpoilerData data) { if (data.position > 0) { int newPosition = Math.Max(data.position - 25, 0); uint eventData = (uint)newPosition * 164u; eventData = Math.Min(eventData, 16384u); _logger.LogDebug($"Now demand position {newPosition} or as U {eventData}"); simConnect.SendEvent(setEvent, eventData); } else if (data.armed == 0) { _logger.LogDebug($"Now send {armOnEvent}"); simConnect.SendEvent(armOnEvent); } }
public void SetInSim(ExtendedSimConnect simConnect, Int16 value) { while (value != 0) { simConnect.SendEvent(value < 0 ? dec : inc); value -= (short)Math.Sign(value); } }
public void SetInSim(ExtendedSimConnect simConnect, Int16 value) { while (value != 0) { simConnect.SendEvent(value < 0 ? dec : inc); value -= (short)Math.Sign(value); } //TODO: in the real FCU, when turning quickly, it takes *two* clicks to change by 100 ft/min V/S. }
public void SetInSim(ExtendedSimConnect simConnect, bool value) { simConnect.SendEvent(toggleBeaconLightsEvent); }
public void SetInSim(ExtendedSimConnect simConnect, bool _) => simConnect.SendEvent(this);
public void SetInSim(ExtendedSimConnect simConnect, uint value) => simConnect.SendEvent(this, value);
public void SetInSim(ExtendedSimConnect simConnect, bool value) { simConnect.SendEvent(setLogoLightsEvent, value ? 1u : 0u); simConnect.SendEvent(setNavLightsEvent, value ? 1u : 0u); }
public void SetInSim(ExtendedSimConnect simConnect, string?code) { simConnect.SendEvent(setEvent, Convert.ToUInt32(code, 16)); }