Esempio n. 1
0
        public IEnumerator <ITask> GetHandler(Get get)
        {
            MarkRobotState getState = new MarkRobotState();

            drive.Get driveGet = new drive.Get();

            getState.DriveState = new drive.DriveDifferentialTwoWheelState();

            // Get the up-to-date drive state
            this.controllerDrivePort.Post(driveGet);
            yield return(driveGet.ResponsePort.Choice(s => getState.DriveState = s, EmptyHandler));

            // MarkRobot service specific configuration
            getState.SonarTimeValueMultiplier      = this.state.SonarTimeValueMultiplier;
            getState.SensorPollingInterval         = this.state.SensorPollingInterval;
            getState.LastStartTime                 = this.state.LastStartTime;
            getState.InfraredRawValueDivisorScalar = this.state.InfraredRawValueDivisorScalar;
            getState.InfraredDistanceExponent      = this.state.InfraredDistanceExponent;
            getState.BatteryVoltagePinIndex        = this.state.BatteryVoltagePinIndex;
            getState.BatteryVoltageDivider         = this.state.BatteryVoltageDivider;

            // Polled state
            getState.BatteryState        = this.state.BatteryState;
            getState.InfraredSensorState = this.state.InfraredSensorState;
            getState.SonarSensorState    = this.state.SonarSensorState;

            get.ResponsePort.Post(getState);
        }
Esempio n. 2
0
 public void DriveGetHandler(drive.Get get)
 {
     this.controllerDrivePort.Post(
         new drive.Get()
     {
         Body = get.Body, ResponsePort = get.ResponsePort
     });
 }
Esempio n. 3
0
        public IEnumerator <ITask> DriveHttpGetHandler(Microsoft.Dss.Core.DsspHttp.HttpGet httpget)
        {
            drive.Get get = new drive.Get();

            this.controllerDrivePort.Post(get);

            yield return(get.ResponsePort.Choice());

            drive.DriveDifferentialTwoWheelState newState = (drive.DriveDifferentialTwoWheelState)get.ResponsePort;

            if (newState != null)
            {
                HttpResponseType resp = new HttpResponseType(HttpStatusCode.OK, newState);
                httpget.ResponsePort.Post(resp);
            }
            else
            {
                HttpResponseType resp = new HttpResponseType(HttpStatusCode.InternalServerError, (soap.Fault)get.ResponsePort);
                httpget.ResponsePort.Post(resp);
            }

            yield break;
        }
Esempio n. 4
0
 public void DriveGetHandler(drive.Get get)
 {
     this.state.DriveState.TimeStamp = DateTime.Now;
     get.ResponsePort.Post(this.state.DriveState);
 }
Esempio n. 5
0
 public virtual IEnumerator <ITask> GetHandler(drive.Get get)
 {
     get.ResponsePort.Post(_state);
     yield break;
 }
Esempio n. 6
0
 public void DriveGetHandler(diffdrive.Get get)
 {
     this.UpdateStateFromSimulation();
     get.ResponsePort.Post(this.state.DriveState);
 }