示例#1
0
        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);
            }
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 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);
     }
 }
示例#5
0
 public void SetInSim(ExtendedSimConnect simConnect, Int16 value)
 {
     while (value != 0)
     {
         simConnect.SendEvent(value < 0 ? dec : inc);
         value -= (short)Math.Sign(value);
     }
 }
示例#6
0
        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.
        }
示例#7
0
 public void SetInSim(ExtendedSimConnect simConnect, bool value)
 {
     simConnect.SendEvent(toggleBeaconLightsEvent);
 }
示例#8
0
 public void SetInSim(ExtendedSimConnect simConnect, bool _) => simConnect.SendEvent(this);
示例#9
0
 public void SetInSim(ExtendedSimConnect simConnect, uint value) => simConnect.SendEvent(this, value);
示例#10
0
 public void SetInSim(ExtendedSimConnect simConnect, bool value)
 {
     simConnect.SendEvent(setLogoLightsEvent, value ? 1u : 0u);
     simConnect.SendEvent(setNavLightsEvent, value ? 1u : 0u);
 }
示例#11
0
 public void SetInSim(ExtendedSimConnect simConnect, string?code)
 {
     simConnect.SendEvent(setEvent, Convert.ToUInt32(code, 16));
 }