Ejemplo n.º 1
0
        /// <summary>
        /// Makes an exact copy of pwm
        /// </summary>
        /// <returns>
        /// The copy.
        /// </returns>
        /// <param name='pwm'>
        /// The pwm to be copied.
        /// </param>
        public static PwmMessage DeepCopy(PwmMessage pwm)
        {
            PwmMessage ans = new PwmMessage();

            ans.ch1 = Field.DeepCopy(pwm.ch1);
            ans.ch2 = Field.DeepCopy(pwm.ch2);
            ans.ch3 = Field.DeepCopy(pwm.ch3);
            ans.ch4 = Field.DeepCopy(pwm.ch4);
            return(ans);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an exact copy of gps
        /// </summary>
        /// <returns>
        /// The copy.
        /// </returns>
        /// <param name='gps'>
        /// gps to be copied.
        /// </param>
        public static GpsMessage DeepCopy(GpsMessage gps)
        {
            GpsMessage ans = new GpsMessage();

            ans.time       = gps.time;
            ans.latitude   = Field.DeepCopy(gps.latitude);
            ans.longitude  = Field.DeepCopy(gps.longitude);
            ans.gndSpeed   = Field.DeepCopy(gps.gndSpeed);
            ans.trackAngle = Field.DeepCopy(gps.trackAngle);
            ans.pos        = new WgsPoint(ans.latitude.V, ans.longitude.V, null);
            return(ans);
        }