Ejemplo n.º 1
0
        /// <summary>
        /// Creates a clone  of the field f
        /// </summary>
        /// <returns>
        /// The copy.
        /// </returns>
        /// <param name='f'>
        /// The field to clone
        /// </param>
        public static Field2 DeepCopy(Field2 f)
        {
            Field2 ans = new Field2(f.min, f.max, f.prevValue);

            ans.v = f.v;
            return(ans);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GroundStation.AdcMessage"/> class.
 /// </summary>
 /// <param name='time'>
 /// Timestamp.
 /// </param>
 /// <param name='b'>
 /// Message as an array of bytes
 /// </param>
 public AdcMessage()
     : base()
 {
     //this.barometer = new Field(barMin, barMax, barPrevValue, barPrevPrevValue, barMaxVar);
     //this.thermometer = new Field(tempMin, tempMax, tempPrevValue, tempPrevPrevValue, tempMaxVar);
     //this.pitot = new Field(pitotMin, pitotMax, pitotPrevValue, pitotPrevPrevValue, pitotMaxVar);
     this.barometer   = new Field2(barMin, barMax, barPrevValue);
     this.thermometer = new Field2(tempMin, tempMax, tempPrevValue);
     this.pitot       = new Field2(pitotMin, pitotMax, pitotPrevValue);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Makes and exact copy of the adc message
        /// </summary>
        /// <returns>
        /// The copy.
        /// </returns>
        /// <param name='adc'>
        /// The adc message to copy
        /// </param>
        public static AdcMessage DeepCopy(AdcMessage adc)
        {
            AdcMessage ans = new AdcMessage();

            ans.time     = adc.time;
            ans.altitude = adc.altitude;
            ans.tas      = adc.tas - 29; //Offset degut a error en la tensio.

            ans.barometer   = Field2.DeepCopy(adc.barometer);
            ans.thermometer = Field2.DeepCopy(adc.thermometer);
            ans.pitot       = Field2.DeepCopy(adc.pitot);

            return(ans);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Makes an exact copy of imu
        /// </summary>
        /// <returns>
        /// The copy.
        /// </returns>
        /// <param name='imu'>
        /// The imu message to be copied
        /// </param>
        public static ImuEulerMessage DeepCopy(ImuEulerMessage imu)
        {
            ImuEulerMessage ans = new ImuEulerMessage();

            ans.time   = imu.time;
            ans.accelX = Field2.DeepCopy(imu.accelX);
            ans.accelY = Field2.DeepCopy(imu.accelY);
            ans.accelZ = Field2.DeepCopy(imu.accelZ);
            ans.roll   = Field2.DeepCopy(imu.roll);
            ans.pitch  = Field2.DeepCopy(imu.pitch);
            ans.yaw    = Field2.DeepCopy(imu.yaw);

            return(ans);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GroundStation.ImuEulerMessage"/> class.
 /// </summary>
 /// <param name='time'>
 /// Timestamp
 /// </param>
 /// <param name='b'>
 /// Message as a byte array
 /// </param>
 public ImuEulerMessage()
     : base()
 {
     //this.roll = new Field(rollMin, rollMax, rollPrevValue, rollPrevPrevValue, rollMaxVar);
     //this.pitch = new Field(pitchMin, pitchMax, pitchPrevValue, pitchPrevPrevValue, pitchMaxVar);
     //this.yaw = new Field(yawMin, yawMax,yawPrevValue, yawPrevPrevValue, yawMaxVar);
     //this.accelX = new Field(accelXMin, accelXMax, accelXPrevValue, accelXPrevPrevValue, accelXMaxVar);
     //this.accelY = new Field(accelYMin, accelYMax, accelYPrevValue, accelYPrevPrevValue, accelYMaxVar);
     //this.accelZ = new Field(accelZMin, accelZMax, accelZPrevValue, accelZPrevPrevValue, accelZMaxVar);
     this.roll   = new Field2(rollMin, rollMax, rollPrevValue, rollMaxVar);
     this.pitch  = new Field2(pitchMin, pitchMax, pitchPrevValue, pitchMaxVar);
     this.yaw    = new Field2(yawMin, yawMax, yawPrevValue, yawMaxVar);
     this.accelX = new Field2(accelXMin, accelXMax, accelXPrevValue);
     this.accelY = new Field2(accelYMin, accelYMax, accelYPrevValue);
     this.accelZ = new Field2(accelZMin, accelZMax, accelZPrevValue);
 }
Ejemplo n.º 6
0
		/// <summary>
		/// Initializes a new instance of the <see cref="GroundStation.AdcMessage"/> class.
		/// </summary>
		/// <param name='time'>
		/// Timestamp.
		/// </param>
		/// <param name='b'>
		/// Message as an array of bytes
		/// </param>
        public AdcMessage()
            : base()
        {
            //this.barometer = new Field(barMin, barMax, barPrevValue, barPrevPrevValue, barMaxVar);
            //this.thermometer = new Field(tempMin, tempMax, tempPrevValue, tempPrevPrevValue, tempMaxVar);
            //this.pitot = new Field(pitotMin, pitotMax, pitotPrevValue, pitotPrevPrevValue, pitotMaxVar);
			this.barometer = new Field2(barMin, barMax, barPrevValue);
            this.thermometer = new Field2(tempMin, tempMax, tempPrevValue);
            this.pitot = new Field2(pitotMin, pitotMax, pitotPrevValue);
        }
Ejemplo n.º 7
0
		/// <summary>
		/// Creates a clone  of the field f
		/// </summary>
		/// <returns>
		/// The copy.
		/// </returns>
		/// <param name='f'>
		/// The field to clone
		/// </param>
        public static Field2 DeepCopy(Field2 f)
        {
            Field2 ans = new Field2(f.min, f.max, f.prevValue);
            ans.v = f.v;
            return ans;
		}
Ejemplo n.º 8
0
		/// <summary>
		/// Initializes a new instance of the <see cref="GroundStation.ImuEulerMessage"/> class.
		/// </summary>
		/// <param name='time'>
		/// Timestamp
		/// </param>
		/// <param name='b'>
		/// Message as a byte array
		/// </param>
        public ImuEulerMessage()
        : base ()
        {
            //this.roll = new Field(rollMin, rollMax, rollPrevValue, rollPrevPrevValue, rollMaxVar);
            //this.pitch = new Field(pitchMin, pitchMax, pitchPrevValue, pitchPrevPrevValue, pitchMaxVar);
            //this.yaw = new Field(yawMin, yawMax,yawPrevValue, yawPrevPrevValue, yawMaxVar);
            //this.accelX = new Field(accelXMin, accelXMax, accelXPrevValue, accelXPrevPrevValue, accelXMaxVar);
            //this.accelY = new Field(accelYMin, accelYMax, accelYPrevValue, accelYPrevPrevValue, accelYMaxVar);
            //this.accelZ = new Field(accelZMin, accelZMax, accelZPrevValue, accelZPrevPrevValue, accelZMaxVar);
			this.roll = new Field2(rollMin, rollMax, rollPrevValue, rollMaxVar);
            this.pitch = new Field2(pitchMin, pitchMax, pitchPrevValue, pitchMaxVar);
            this.yaw = new Field2(yawMin, yawMax, yawPrevValue, yawMaxVar);
            this.accelX = new Field2(accelXMin, accelXMax, accelXPrevValue);
            this.accelY = new Field2(accelYMin, accelYMax, accelYPrevValue);
            this.accelZ = new Field2(accelZMin, accelZMax, accelZPrevValue);
        }