Ejemplo n.º 1
0
 public MotorCommand(MessageCommand Command, UserCallBackParameters FlightParameters)
 {
     Command.Address = MotorAddress;
     TxMessages      = new List <MessageCommand>();
     TxMessages.Add(Command);
     CompleteTriggered     = false;
     TxMessagedEmitted     = -1;
     OperationMode         = RunMode.Waiting;
     this.FlightParameters = FlightParameters;
 }
Ejemplo n.º 2
0
 public int AddMotionCommand(int MotorAddress, QcCommand Command, List <int> Parameters, UserCallBackParameters FlightParameters = null)
 {
     return(AddMotorCommand(MotorAddress,
                            new QcController.MotorCommands.MotionControlMotorCommand(
                                new QcController.MotorCommands.MessageCommands.MotionCommand(
                                    new QcMessage()
     {
         Command = Command,
         Data = Parameters
     }), FlightParameters)));
 }
Ejemplo n.º 3
0
 public int AddImmediateCommand(int MotorAddress, QcCommand Command, List <int> Parameters = null, UserCallBackParameters FlightParameters = null)
 {
     if (Parameters == null)
     {
         Parameters = new List <int>();
     }
     return(AddMotorCommand(MotorAddress,
                            new QcController.MotorCommands.ImmediateMotorCommand(
                                new QcController.MotorCommands.MessageCommands.ImmediateCommand(
                                    new QcMessage()
     {
         Command = Command,
         Data = Parameters
     }), FlightParameters)));
 }
Ejemplo n.º 4
0
        public Dictionary <int, int> AddCoordinatedMotion(List <Tuple <int, QcCommand, List <int> > > Motion, UserCallBackParameters FlightParameters = null)
        {
            Dictionary <int, int> MotorCommandIds = new Dictionary <int, int>();
            Dictionary <int, QcController.MotorCommands.MessageCommands.SimultaneousMotionCommand> Motions = new Dictionary <int, QcController.MotorCommands.MessageCommands.SimultaneousMotionCommand>();

            foreach (Tuple <int, QcCommand, List <int> > m in Motion)
            {
                Motions.Add(m.Item1, new MotorCommands.MessageCommands.SimultaneousMotionCommand(
                                new QcMessage()
                {
                    Command = m.Item2,
                    Data    = m.Item3
                }));
            }
            foreach (KeyValuePair <int, MotorCommands.MessageCommands.SimultaneousMotionCommand> s in Motions)
            {
                Dictionary <int, QcController.MotorCommands.MessageCommands.SimultaneousMotionCommand> m =
                    new Dictionary <int, QcController.MotorCommands.MessageCommands.SimultaneousMotionCommand>();
                m.Add(s.Key, s.Value);

                foreach (KeyValuePair <int, MotorCommands.MessageCommands.SimultaneousMotionCommand> t in Motions.Except(m))
                {
                    s.Value.CoordinatedMotion += new MotorCommands.MessageCommands.CoordinatedMotionHandler(t.Value.Coordinate);
                }
                int commandid = AddMotorCommand(s.Key, new QcController.MotorCommands.MotionControlMotorCommand(s.Value, FlightParameters));
                MotorCommandIds.Add(s.Key, commandid);
            }
            return(MotorCommandIds);
        }