Beispiel #1
0
        public void IssueSingleCommand(Command comm)
        {
            SerialComm serialComm = r.comm;
            CommBuffer buffer     = serialComm.outputBuffer;

            bool send, free;

            if (comm.Send(buffer, out send, out free))
            {
                if (send)
                {
                    serialComm.ForceSendMessage();
                }
            }
        }
Beispiel #2
0
        public override State DoStuff()
        {
            Command_StopAll comm = new Command_StopAll(c);

            Robot      r          = c.r;
            SerialComm serialComm = r.comm;
            CommBuffer buffer     = serialComm.outputBuffer;

            bool send, free;

            comm.Send(buffer, out send, out free);

            serialComm.ForceSendMessage();

            return(this);
        }
Beispiel #3
0
        public override State DoStuff()
        {
            Robot r = c.r;

            if (r.Ready)
            {
                SerialComm serialComm = r.comm;
                CommBuffer buffer     = serialComm.outputBuffer;

                Command comm = commands.Peek();

                bool send, free;
                if (comm.Send(buffer, out send, out free))
                {
                    if (send)
                    {
                        serialComm.ForceSendMessage();
                    }
                    //if (send) serialComm.SendMessage();

                    if (free)
                    {
                        commands.Dequeue();

                        if (commands.Count == 0)
                        {
                            return(c.GetNextState());
                        }
                    }
                }

                Thread.Sleep(100);
            }

            return(this);
        }