private string CreateAck()
        {
            string ackMessage = String.Format("{0},0", (int)ControlMode.NoControlMode);
            string command    = CommandFormatter.CreateCommand(CtrlCommand, ackMessage);

            return(command);
        }
        public virtual void SendFlightAnimationCommand(IFlightAnimation flightAnimation)
        {
            string message = string.Format("{0},{1}", (int)flightAnimation.Animation,
                                           flightAnimation.MaydayTimeoutInMilliseconds);
            string command = CommandFormatter.CreateCommand(AnimCommand, message);

            CommandQueue.Enqueue(command);
        }
        public virtual void SendLedAnimationCommand(ILedAnimation ledAnimatoin)
        {
            int    freq    = FloatToInt32Converter.Convert(ledAnimatoin.FrequencyInHz);
            string message = string.Format("{0},{1},{2}", (int)ledAnimatoin.Animation, freq, ledAnimatoin.DurationInSeconds);
            string command = CommandFormatter.CreateCommand(LedCommand, message);

            CommandQueue.Enqueue(command);
        }
        private string CreateConfigCommand(string key, string value)
        {
            string configIdsMessage = String.Format("\"{0}\",\"{1}\",\"{2}\"", SessionId, ProfileId, ApplicationId);
            string configIdsCommand = CommandFormatter.CreateCommand(ConfigIdsCommand, configIdsMessage);
            string configMessage    = String.Format("\"{0}\",\"{1}\"", key, value);
            string configCommand    = CommandFormatter.CreateCommand(ConfigCommand, configMessage);
            string command          = configIdsCommand + configCommand;

            return(command);
        }
        internal virtual void SendProgressiveCommand(IProgressiveCommand args)
        {
            string command;

            ProgressiveCommandFormatter.Load(args);

            if (args.AbsoluteControlMode)
            {
                string message = string.Format("{0},{1},{2},{3},{4},{5},{6}", (int)ProgressiveCommandFormatter.Mode,
                                               ProgressiveCommandFormatter.Roll, ProgressiveCommandFormatter.Pitch, ProgressiveCommandFormatter.Gaz,
                                               ProgressiveCommandFormatter.Yaw, ProgressiveCommandFormatter.MagnetoPsi,
                                               ProgressiveCommandFormatter.MagnetoPsiAccuracy);
                command = CommandFormatter.CreateCommand(PcmdMagCommand, message);
            }
            else
            {
                string message = string.Format("{0},{1},{2},{3},{4}", (int)ProgressiveCommandFormatter.Mode,
                                               ProgressiveCommandFormatter.Roll, ProgressiveCommandFormatter.Pitch, ProgressiveCommandFormatter.Gaz,
                                               ProgressiveCommandFormatter.Yaw);
                command = CommandFormatter.CreateCommand(PcmdCommand, message);
            }

            CommandQueue.Enqueue(command);
        }
        public virtual void SendFlatTrimCommand()
        {
            string command = CommandFormatter.CreateCommand(FtrimCommand);

            CommandQueue.Enqueue(command);
        }
        private void SendPModeCommand(int mode)
        {
            string command = CommandFormatter.CreateCommand(PmodeCommand, mode.ToString());

            CommandQueue.Enqueue(command);
        }
        private void SendMiscellaneousCommand(string message)
        {
            string command = CommandFormatter.CreateCommand(MiscCommand, message);

            CommandQueue.Enqueue(command);
        }
        internal virtual void SendResetWatchDogCommand()
        {
            string command = CommandFormatter.CreateCommand(ComwdgCommand);

            CommandQueue.Enqueue(command);
        }
        internal virtual void SendCalibrateCompassCommand()
        {
            string command = CommandFormatter.CreateCommand(CalibCommand, "0");

            CommandQueue.Enqueue(command);
        }
        public virtual void SendRefCommand(RefCommands refCommand)
        {
            string command = CommandFormatter.CreateCommand(RefCommand, ((int)refCommand).ToString());

            CommandQueue.Enqueue(command);
        }
Beispiel #12
0
 public void InitializeTests()
 {
     _target = new CommandFormatter();
 }