/// <summary>
        /// Copies this object to the target
        /// </summary>
        /// <remarks>This assumes that target is the correct type</remarks>
        /// <param name="target">A WebCamSensorState instance to copy to</param>
        public void CopyTo(IDssSerializable target)
        {
            var other = (WebCamSensorState)target;

            other.DeviceName = this.DeviceName;
            other.TimeStamp  = this.TimeStamp;
            other.Width      = this.Width;
            other.Height     = this.Height;
            other.Stride     = this.Stride;
            other.Data       = this.Data;
        }
        /// <summary>
        /// CopyTo
        /// </summary>
        /// <param name="target"></param>
        public void CopyTo(IDssSerializable target)
        {
            ActuatorCoordination typedTarget = target as ActuatorCoordination;

            if (typedTarget == null)
            {
                throw new ArgumentException(string.Format("CopyTo({0}) requires type {0}", this.GetType().FullName));
            }
            typedTarget.Count     = this.Count;
            typedTarget.RequestId = this.RequestId;
        }
        /// <summary>
        /// Shallow copy
        /// </summary>
        /// <param name="target">An instance of RawKinectFrames to be shallow copied</param>
        public void CopyTo(IDssSerializable target)
        {
            var copy = target as RawKinectFrames;

            // While it is risky to not clone, its necessery to avoid copies.
            // users that need to manipulate bits will need to make copies
            copy.RawColorFrameInfo    = this.RawColorFrameInfo;
            copy.RawColorFrameData    = this.RawColorFrameData;
            copy.RawDepthFrameInfo    = this.RawDepthFrameInfo;
            copy.RawDepthFrameData    = this.RawDepthFrameData;
            copy.RawSkeletonFrameData = this.RawSkeletonFrameData;
        }
        /// <summary>
        /// Copy To Dss TimeSpan
        /// </summary>
        public virtual void CopyTo(IDssSerializable target)
        {
            if (target == null)
            {
                target = new DssTimeSpan();
            }

            DssTimeSpan typedTarget = target as DssTimeSpan;

            if (typedTarget == null)
            {
                throw new ArgumentException("CopyTo({0}) requires type {0}", this.GetType().FullName);
            }

            typedTarget.Ticks = this.Ticks;
        }
示例#5
0
        /// <summary>
        /// copies all members to a target
        /// </summary>
        /// <param name="target"></param>
        public virtual void CopyTo(IDssSerializable target)
        {
            // throw new NotImplementedException("class GpsState does not have to implement IDssSerializable - do not call CopyTo()");

            GpsState typedTarget = target as GpsState;

            if (typedTarget == null)
            {
                throw new ArgumentException("GpsState::CopyTo({0}) requires type {0}", this.GetType().FullName);
            }

            typedTarget.GPGGA_PositionFixIndicator          = this.GPGGA_PositionFixIndicator;
            typedTarget.GPGGA_AltitudeMeters                = this.GPGGA_AltitudeMeters;
            typedTarget.GPGGA_Latitude                      = this.GPGGA_Latitude;
            typedTarget.GPGGA_Longitude                     = this.GPGGA_Longitude;
            typedTarget.GPGGA_HorizontalDilutionOfPrecision = this.GPGGA_HorizontalDilutionOfPrecision;
            typedTarget.GPGGA_SatellitesUsed                = this.GPGGA_SatellitesUsed;
            typedTarget.GPGGA_LastUpdate                    = this.GPGGA_LastUpdate;

            typedTarget.GPGLL_MarginOfError = this.GPGLL_MarginOfError;
            typedTarget.GPGLL_Status        = this.GPGLL_Status;
            typedTarget.GPGLL_Latitude      = this.GPGLL_Latitude;
            typedTarget.GPGLL_Longitude     = this.GPGLL_Longitude;
            typedTarget.GPGLL_LastUpdate    = this.GPGLL_LastUpdate;

            typedTarget.GPGSA_Status = this.GPGSA_Status;
            typedTarget.GPGSA_Mode   = this.GPGSA_Mode;
            typedTarget.GPGSA_SphericalDilutionOfPrecision  = this.GPGSA_SphericalDilutionOfPrecision;
            typedTarget.GPGSA_HorizontalDilutionOfPrecision = this.GPGSA_HorizontalDilutionOfPrecision;
            typedTarget.GPGSA_VerticalDilutionOfPrecision   = this.GPGSA_VerticalDilutionOfPrecision;
            typedTarget.GPGSA_LastUpdate = this.GPGSA_LastUpdate;

            typedTarget.GPGSV_SatellitesInView = this.GPGSV_SatellitesInView;
            typedTarget.GPGSV_LastUpdate       = this.GPGSV_LastUpdate;

            typedTarget.GPRMC_Status     = this.GPRMC_Status;
            typedTarget.GPRMC_Latitude   = this.GPRMC_Latitude;
            typedTarget.GPRMC_Longitude  = this.GPRMC_Longitude;
            typedTarget.GPRMC_LastUpdate = this.GPRMC_LastUpdate;

            typedTarget.GPVTG_CourseDegrees        = this.GPVTG_CourseDegrees;
            typedTarget.GPVTG_SpeedMetersPerSecond = this.GPVTG_SpeedMetersPerSecond;
            typedTarget.GPVTG_LastUpdate           = this.GPVTG_LastUpdate;
        }
        /// <summary>
        /// Copy to another instance
        /// </summary>
        /// <param name="target">Instance to copy to</param>
        public void CopyTo(IDssSerializable target)
        {
            var copy = target as DepthCamSensorState;

            // While it is very risky to not clone, its necessery to avoid copies.
            // Users of depthcam data requiring write access must clone then
            //  manipulate the arrays
            copy.DepthImage               = this.DepthImage;
            copy.DepthImageSize           = this.DepthImageSize;
            copy.FieldOfView              = this.FieldOfView;
            copy.MaximumRange             = this.MaximumRange;
            copy.MinimumRange             = this.MinimumRange;
            copy.FurtherThanMaxDepthValue = this.FurtherThanMaxDepthValue;
            copy.NearerThanMinDepthValue  = this.NearerThanMinDepthValue;
            copy.Pose         = this.Pose;
            copy.TimeStamp    = this.TimeStamp;
            copy.VisibleImage = this.VisibleImage;
            copy.ImageMode    = this.ImageMode;
        }
示例#7
0
        /// <summary>
        /// copies all members to a target
        /// </summary>
        /// <param name="target"></param>
        public virtual void CopyTo(IDssSerializable target)
        {
            // throw new NotImplementedException("class GpsState does not have to implement IDssSerializable - do not call CopyTo()");

            GpsState typedTarget = target as GpsState;

            if (typedTarget == null)
                throw new ArgumentException("GpsState::CopyTo({0}) requires type {0}", this.GetType().FullName);

            typedTarget.GPGGA_PositionFixIndicator = this.GPGGA_PositionFixIndicator;
            typedTarget.GPGGA_AltitudeMeters = this.GPGGA_AltitudeMeters;
            typedTarget.GPGGA_Latitude = this.GPGGA_Latitude;
            typedTarget.GPGGA_Longitude = this.GPGGA_Longitude;
            typedTarget.GPGGA_HorizontalDilutionOfPrecision = this.GPGGA_HorizontalDilutionOfPrecision;
            typedTarget.GPGGA_SatellitesUsed = this.GPGGA_SatellitesUsed;
            typedTarget.GPGGA_LastUpdate = this.GPGGA_LastUpdate;

            typedTarget.GPGLL_MarginOfError = this.GPGLL_MarginOfError;
            typedTarget.GPGLL_Status = this.GPGLL_Status;
            typedTarget.GPGLL_Latitude = this.GPGLL_Latitude;
            typedTarget.GPGLL_Longitude = this.GPGLL_Longitude;
            typedTarget.GPGLL_LastUpdate = this.GPGLL_LastUpdate;

            typedTarget.GPGSA_Status = this.GPGSA_Status;
            typedTarget.GPGSA_Mode = this.GPGSA_Mode;
            typedTarget.GPGSA_SphericalDilutionOfPrecision = this.GPGSA_SphericalDilutionOfPrecision;
            typedTarget.GPGSA_HorizontalDilutionOfPrecision = this.GPGSA_HorizontalDilutionOfPrecision;
            typedTarget.GPGSA_VerticalDilutionOfPrecision = this.GPGSA_VerticalDilutionOfPrecision;
            typedTarget.GPGSA_LastUpdate = this.GPGSA_LastUpdate;

            typedTarget.GPGSV_SatellitesInView = this.GPGSV_SatellitesInView;
            typedTarget.GPGSV_LastUpdate = this.GPGSV_LastUpdate;

            typedTarget.GPRMC_Status = this.GPRMC_Status;
            typedTarget.GPRMC_Latitude = this.GPRMC_Latitude;
            typedTarget.GPRMC_Longitude = this.GPRMC_Longitude;
            typedTarget.GPRMC_LastUpdate = this.GPRMC_LastUpdate;

            typedTarget.GPVTG_CourseDegrees = this.GPVTG_CourseDegrees;
            typedTarget.GPVTG_SpeedMetersPerSecond = this.GPVTG_SpeedMetersPerSecond;
            typedTarget.GPVTG_LastUpdate = this.GPVTG_LastUpdate;
        }
        /// <summary>
        /// Copys the values of the current instance to the target instance
        /// </summary>
        /// <param name="target">target instance</param>
        public void CopyTo(IDssSerializable target)
        {
            RecognizedSemanticValue clone = (RecognizedSemanticValue)target;

            clone.TypeOfValue = this.TypeOfValue;
            clone.Value       = this.Value;

            clone.KeyName    = this.KeyName;
            clone.Confidence = this.Confidence;

            if (Children != null)
            {
                clone.Children = new DssDictionary <string, RecognizedSemanticValue>();
                foreach (var child in Children)
                {
                    clone.Children[child.Key] = child.Value == null ? null : (RecognizedSemanticValue)child.Value.Clone();
                }
            }
            else
            {
                clone.Children = null;
            }
        }
示例#9
0
        /// <summary>
        /// copies all members to a target
        /// </summary>
        /// <param name="target"></param>
        public virtual void CopyTo(IDssSerializable target)
        {
            // throw new NotImplementedException("class PIDController does not have to implement IDssSerializable - do not call CopyTo()");

            PIDController typedTarget = target as PIDController;

            if (typedTarget == null)
            {
                throw new ArgumentException("PIDController::CopyTo({0}) requires type {0}", this.GetType().FullName);
            }

            typedTarget.Kp = this.Kp;
            typedTarget.Ki = this.Ki;
            typedTarget.Kd = this.Kd;
            typedTarget.MaxIntegralError     = this.MaxIntegralError;
            typedTarget.MaxUpdateIntervalSec = this.MaxUpdateIntervalSec;
            typedTarget.MaxPidValue          = this.MaxPidValue;
            typedTarget.MinPidValue          = this.MinPidValue;
            typedTarget.Name                     = this.Name;
            typedTarget.PreviousError            = this.PreviousError;
            typedTarget.CurrentError             = this.CurrentError;
            typedTarget.DerivativeErrorPerSecond = this.DerivativeErrorPerSecond;
            typedTarget.IntegralError            = this.IntegralError;
        }
        /// <summary>
        /// Copy To Lego NXT Connection
        /// </summary>
        public virtual void CopyTo(IDssSerializable target)
        {
            LegoNxtConnection typedTarget = target as LegoNxtConnection;

            if (typedTarget == null)
                throw new ArgumentException("CopyTo({0}) requires type {0}", this.GetType().FullName);
            typedTarget.Port = this.Port;
            typedTarget.PortOverride = this.PortOverride;
        }
        /// <summary>
        /// Copy To Accelerometer Reading
        /// </summary>
        public virtual void CopyTo(IDssSerializable target)
        {
            AccelerometerReading typedTarget = target as AccelerometerReading;

            if (typedTarget == null)
                throw new ArgumentException("CopyTo({0}) requires type {0}", this.GetType().FullName);
            typedTarget.X = this.X;
            typedTarget.Y = this.Y;
            typedTarget.Z = this.Z;
            typedTarget.TimeStamp = this.TimeStamp;
        }
 /// <summary>
 /// CopyTo - NOT IMPLEMENTED
 /// </summary>
 /// <param name="target"></param>
 public void CopyTo(IDssSerializable target)
 {
     throw new Exception("The method or operation is not implemented.");
 }
示例#13
0
        /// <summary>
        /// copies all members to a target
        /// </summary>
        /// <param name="target"></param>
        public virtual void CopyTo(IDssSerializable target)
        {
            // throw new NotImplementedException("class PIDController does not have to implement IDssSerializable - do not call CopyTo()");

            PIDController typedTarget = target as PIDController;

            if (typedTarget == null)
                throw new ArgumentException("PIDController::CopyTo({0}) requires type {0}", this.GetType().FullName);

            typedTarget.Kp = this.Kp;
            typedTarget.Ki = this.Ki;
            typedTarget.Kd = this.Kd;
            typedTarget.MaxIntegralError = this.MaxIntegralError;
            typedTarget.MaxUpdateIntervalSec = this.MaxUpdateIntervalSec;
            typedTarget.MaxPidValue = this.MaxPidValue;
            typedTarget.MinPidValue = this.MinPidValue;
            typedTarget.Name = this.Name;
            typedTarget.PreviousError = this.PreviousError;
            typedTarget.CurrentError = this.CurrentError;
            typedTarget.DerivativeErrorPerSecond = this.DerivativeErrorPerSecond;
            typedTarget.IntegralError = this.IntegralError;
        }
        /// <summary>
        /// Copy To Sonar Entity
        /// </summary>
        public override void CopyTo(IDssSerializable target)
        {
            SonarEntity typedTarget = target as SonarEntity;

            if (typedTarget == null)
                throw new ArgumentException("CopyTo({0}) requires type {0}", this.GetType().FullName);
            base.CopyTo(typedTarget);
            typedTarget.SonarBox = (this.SonarBox == null) ? null : (Microsoft.Robotics.Simulation.Physics.Proxy.BoxShape)((Microsoft.Dss.Core.IDssSerializable)this.SonarBox).Clone();
        }