Example #1
0
        public virtual IEnumerator <ITask> SetVectorHandler(SetVector request)
        {
            brick.SetAllLedsBody setAll = new brick.SetAllLedsBody();
            SetVectorRequest     ledreq = request.Body;

            //decompose binary
            setAll.RightLED  = ledreq.State.LEDVec[2].State;
            setAll.CenterLED = ledreq.State.LEDVec[1].State;
            setAll.LeftLED   = ledreq.State.LEDVec[0].State;

            //update our state
            _state.LEDs[ledreq.Which].LEDVec[2].State     = setAll.RightLED;
            _state.LEDs[ledreq.Which].LEDVec[1].State     = setAll.CenterLED;
            _state.LEDs[ledreq.Which].LEDVec[0].State     = setAll.LeftLED;
            _state.LEDs[ledreq.Which].LEDVec[0].TimeStamp = DateTime.Now;
            _state.LEDs[ledreq.Which].LEDVec[1].TimeStamp = DateTime.Now;
            _state.LEDs[ledreq.Which].LEDVec[2].TimeStamp = DateTime.Now;

            //send message to brick service
            _scribblerPort.SetAllLEDs(setAll);

            request.ResponsePort.Post(DefaultUpdateResponseType.Instance);
            yield break;
        }
Example #2
0
 public virtual IEnumerator <ITask> SetVectorHandler(SetVector get)
 {
     throw new NotImplementedException();
 }