public virtual IEnumerator <ITask> HttpGetInfraredSensorHandler(dssphttp.HttpGet httpGet)
        {
            infraredarray.Get get = new infraredarray.Get();
            this.altPort.Post(get);
            yield return(get.ResponsePort.Choice());

            infraredarray.InfraredSensorArrayState infraredState = get.ResponsePort;
            httpGet.ResponsePort.Post(new dssphttp.HttpResponseType(infraredState));
            yield break;
        }
        public IEnumerator <ITask> GetHandler(infraredarray.Get get)
        {
            var state = new infraredarray.InfraredSensorArrayState();

            state.Sensors = new List <infraredsensor.InfraredState>(this.sensorPorts.Length);

            // compose state on the fly by issuing N parallel GET requests to partners
            var getSensorState = new analogsensor.Get();

            foreach (var port in this.sensorPorts)
            {
                state.Sensors.Add(null);
                port.Post(getSensorState);
            }

            ICollection <analogsensor.AnalogSensorState> sensorStates = null;
            ICollection <Fault> faults = null;

            yield return(getSensorState.ResponsePort.MultipleItemReceive(
                             this.sensorPorts.Length,
                             (s, f) =>
            {
                sensorStates = s;
                faults = f;
            }));

            if (faults != null && faults.Count > 0)
            {
                get.ResponsePort.Post(Fault.FromCodeSubcode(FaultCodes.Receiver, DsspFaultCodes.OperationFailed));
                yield break;
            }

            foreach (var sensorState in sensorStates)
            {
                PhysicalModel.Proxy.Pose sensorPose;
                switch (sensorState.HardwareIdentifier)
                {
                case 0:
                    sensorPose = this.LeftIRPose;
                    break;

                case 1:
                    sensorPose = this.MiddleIRPose;
                    break;

                case 2:
                    sensorPose = this.RightIRPose;
                    break;

                default:
                    sensorPose = new PhysicalModel.Proxy.Pose();
                    break;
                }

                state.Sensors[sensorState.HardwareIdentifier] = new infraredsensor.InfraredState()
                {
                    DistanceMeasurement    = sensorState.RawMeasurement,
                    HardwareIdentifier     = sensorState.HardwareIdentifier,
                    ManufacturerIdentifier = SimSensorManufacturer,
                    MaxDistance            = int.MaxValue,
                    MinDistance            = 0,
                    Pose      = sensorPose,
                    TimeStamp = sensorState.TimeStamp
                };
            }

            var stateClone = state.Clone() as infraredarray.InfraredSensorArrayState;

            get.ResponsePort.Post(stateClone);
            yield break;
        }