예제 #1
0
        public bool ProcessPendingMessage(Message message)
        {
            if (!Settings.Default.RunAsServer)
            {
                return(false);
            }
            var toReturn = false;

            if (message == null)
            {
                return(false);
            }
            var messageType = message.MessageType;

            if (messageType == null)
            {
                return(false);
            }
            switch (messageType)
            {
            case "Falcon4SendCallbackMessage":
                var callback = (string)message.Payload;
                _falconCallbackSender.SendCallbackToFalcon(callback);
                toReturn = true;
                break;

            case "Falcon4IncreaseALOW":
            {
                _increaseAlowEventHandler.IncreaseAlow();
                toReturn = true;
            }
            break;

            case "Falcon4DecreaseALOW":
            {
                _decreaseAlowEventHandler.DecreaseAlow();
                toReturn = true;
            }
            break;

            case "Falcon4IncreaseBaro":
            {
                _increaseBaroEventHandler.IncreaseBaro();
                toReturn = true;
            }
            break;

            case "Falcon4DecreaseBaro":
            {
                _decreaseBaroEventHandler.DecreaseBaro();
                toReturn = true;
            }
            break;
            }
            return(toReturn);
        }
 public void DecreaseBaro()
 {
     if (Settings.Default.RunAsClient)
     {
         var message = new Message("Falcon4DecreaseBaro", null);
         _mfdManager.Client.SendMessageToServer(message);
     }
     else
     {
         _falconCallbackSender.SendCallbackToFalcon("SimAltPressDec");
     }
 }
        public void CourseSelectDecrease()
        {
            var useDecrementByOne = false;
            var decByOneCallback  = F4Utils.Process.KeyFileUtils.FindKeyBinding("SimHsiCrsDecBy1");

            if (decByOneCallback != null &&
                decByOneCallback.Key.ScanCode != (int)ScanCodes.NotAssigned)
            {
                useDecrementByOne = true;
            }
            _falconCallbackSender.SendCallbackToFalcon(useDecrementByOne ? "SimHsiCrsDecBy1" : "SimHsiCourseDec");
        }
예제 #4
0
        public void HeadingSelectIncrease()
        {
            var        useIncrementByOne = false;
            KeyBinding incByOneCallback  = F4Utils.Process.KeyFileUtils.FindKeyBinding("SimHsiHdgIncBy1");

            if (incByOneCallback != null &&
                incByOneCallback.Key.ScanCode != (int)ScanCodes.NotAssigned)
            {
                useIncrementByOne = true;
            }
            _falconCallbackSender.SendCallbackToFalcon(useIncrementByOne ? "SimHsiHdgIncBy1" : "SimHsiHeadingInc");
        }
 public void DecreaseAlow()
 {
     if (Settings.Default.RunAsClient)
     {
         var message = new Message("Falcon4DecreaseALOW", _mfdManager.FlightData.AutomaticLowAltitudeWarningInFeet);
         _mfdManager.Client.SendMessageToServer(message);
     }
     else
     {
         if (_mfdManager.FlightData.AutomaticLowAltitudeWarningInFeet > 1000)
         {
             _mfdManager.FlightData.AutomaticLowAltitudeWarningInFeet -= 1000;
         }
         else
         {
             _mfdManager.FlightData.AutomaticLowAltitudeWarningInFeet -= 100;
         }
         _falconCallbackSender.SendCallbackToFalcon("DecreaseAlow");
     }
 }
 public void SetHsiModePlsTcn()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimHSIIlsTcn");
 }
 public void SetExtFuelSwitchTransNorm()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimFuelTransNorm");
 }
예제 #8
0
 public void SetFuelSelectRsvr()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimFuelSwitchResv");
 }
예제 #9
0
 public void SetHsiModeNav()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimHSINav");
 }
예제 #10
0
 public void SetFuelSelectIntWing()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimFuelSwitchWingInt");
 }
 public void SetFuelSelectNorm()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimFuelSwitchNorm");
 }
 public void SetFuelSelectExtCtr()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimFuelSwitchCenterExt");
 }
예제 #13
0
 public void SetFuelSelectTest()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimFuelSwitchTest");
 }
 public void SetExtFuelSwitchTransWingFirst()
 {
     _falconCallbackSender.SendCallbackToFalcon("SimFuelTransWing");
 }