Esempio n. 1
0
 /// <summary>
 ///Deserializes ReferencePlatform2011Entity
 ///</summary>
 ///<param name="reader">the reader from which to deserialize</param>
 ///<returns>deserialized ReferencePlatform2011Entity</returns>
 public override object Deserialize(System.IO.BinaryReader reader)
 {
     base.Deserialize(reader);
     this._IsEnabled          = reader.ReadBoolean();
     this._MotorTorqueScaling = reader.ReadSingle();
     if ((reader.ReadByte() != 0))
     {
         this._RightWheel = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._LeftWheel = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._ChassisShape = ((global::Microsoft.Robotics.Simulation.Physics.Proxy.BoxShape)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Physics.Proxy.BoxShape())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._CasterWheelShape = ((global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape())).Deserialize(reader)));
     }
     this._RotateDegreesAngleThreshold = reader.ReadDouble();
     if ((reader.ReadByte() != 0))
     {
         this._FrontWheelShape = ((global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._RearWheelShape = ((global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._Kinect = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.KinectEntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.KinectEntity())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._LeftSonar = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._RightSonar = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._FrontLeftIR = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._FrontMiddleIR = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity())).Deserialize(reader)));
     }
     if ((reader.ReadByte() != 0))
     {
         this._FrontRightIR = ((global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity)(((Microsoft.Dss.Core.IDssSerializable)(new global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity())).Deserialize(reader)));
     }
     this._TimeoutSeconds = reader.ReadSingle();
     return(this);
 }
Esempio n. 2
0
 /// <summary>
 ///Copies the data member values of the current ReferencePlatform2011Entity to the specified target object
 ///</summary>
 ///<param name="target">target object (must be an instance of)</param>
 public override void CopyTo(Microsoft.Dss.Core.IDssSerializable target)
 {
     base.CopyTo(target);
     global::Microsoft.Robotics.Services.Simulation.ReferencePlatform2011.Proxy.ReferencePlatform2011Entity typedTarget = ((global::Microsoft.Robotics.Services.Simulation.ReferencePlatform2011.Proxy.ReferencePlatform2011Entity)(target));
     typedTarget._IsEnabled          = this._IsEnabled;
     typedTarget._MotorTorqueScaling = this._MotorTorqueScaling;
     if ((this._RightWheel != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity tmp = new global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._RightWheel)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp)));
         typedTarget._RightWheel = tmp;
     }
     if ((this._LeftWheel != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity tmp0 = new global::Microsoft.Robotics.Simulation.Engine.Proxy.WheelEntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._LeftWheel)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp0)));
         typedTarget._LeftWheel = tmp0;
     }
     if ((this._ChassisShape != null))
     {
         global::Microsoft.Robotics.Simulation.Physics.Proxy.BoxShape tmp1 = new global::Microsoft.Robotics.Simulation.Physics.Proxy.BoxShape();
         ((Microsoft.Dss.Core.IDssSerializable)(this._ChassisShape)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp1)));
         typedTarget._ChassisShape = tmp1;
     }
     if ((this._CasterWheelShape != null))
     {
         global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape tmp2 = new global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape();
         ((Microsoft.Dss.Core.IDssSerializable)(this._CasterWheelShape)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp2)));
         typedTarget._CasterWheelShape = tmp2;
     }
     typedTarget._RotateDegreesAngleThreshold = this._RotateDegreesAngleThreshold;
     if ((this._FrontWheelShape != null))
     {
         global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape tmp3 = new global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape();
         ((Microsoft.Dss.Core.IDssSerializable)(this._FrontWheelShape)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp3)));
         typedTarget._FrontWheelShape = tmp3;
     }
     if ((this._RearWheelShape != null))
     {
         global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape tmp4 = new global::Microsoft.Robotics.Simulation.Physics.Proxy.SphereShape();
         ((Microsoft.Dss.Core.IDssSerializable)(this._RearWheelShape)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp4)));
         typedTarget._RearWheelShape = tmp4;
     }
     if ((this._Kinect != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.KinectEntity tmp5 = new global::Microsoft.Robotics.Simulation.Engine.Proxy.KinectEntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._Kinect)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp5)));
         typedTarget._Kinect = tmp5;
     }
     if ((this._LeftSonar != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity tmp6 = new global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._LeftSonar)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp6)));
         typedTarget._LeftSonar = tmp6;
     }
     if ((this._RightSonar != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity tmp7 = new global::Microsoft.Robotics.Simulation.Engine.Proxy.SonarEntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._RightSonar)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp7)));
         typedTarget._RightSonar = tmp7;
     }
     if ((this._FrontLeftIR != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity tmp8 = new global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._FrontLeftIR)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp8)));
         typedTarget._FrontLeftIR = tmp8;
     }
     if ((this._FrontMiddleIR != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity tmp9 = new global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._FrontMiddleIR)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp9)));
         typedTarget._FrontMiddleIR = tmp9;
     }
     if ((this._FrontRightIR != null))
     {
         global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity tmp10 = new global::Microsoft.Robotics.Simulation.Engine.Proxy.IREntity();
         ((Microsoft.Dss.Core.IDssSerializable)(this._FrontRightIR)).CopyTo(((Microsoft.Dss.Core.IDssSerializable)(tmp10)));
         typedTarget._FrontRightIR = tmp10;
     }
     typedTarget._TimeoutSeconds = this._TimeoutSeconds;
 }