Пример #1
0
        public static ScaledImu2DTO createScaledImu2DTO(ScaledImu2 source)
        {
            if (null == source)
            {
                return(null);
            }
            ScaledImu2DTO result = new ScaledImu2DTO();

            Utilities.CopySimilar.CopyAll(source, result);
            return(result);
        }
Пример #2
0
        public void CheckScaledImu2DTO()
        {
            MAVLink.mavlink_scaled_imu2_t data = new MAVLink.mavlink_scaled_imu2_t();
            data.time_boot_ms = 1;
            data.xacc         = 2;
            data.xgyro        = 3;
            data.xmag         = 4;
            data.yacc         = 5;
            data.ygyro        = 6;
            data.ymag         = 7;
            data.zacc         = 8;
            data.zgyro        = 9;
            data.zmag         = 10;

            MavLinkMessage message = createSampleMessage(MAVLink.MAVLINK_MSG_ID.SCALED_IMU2, data);

            ScaledImu2 obj = new ScaledImu2(message);

            Assert.AreEqual(data.time_boot_ms, obj.time_boot_ms);
            Assert.AreEqual(data.xacc, obj.xacc);
            Assert.AreEqual(data.xgyro, obj.xgyro);
            Assert.AreEqual(data.xmag, obj.xmag);
            Assert.AreEqual(data.yacc, obj.yacc);
            Assert.AreEqual(data.ygyro, obj.ygyro);
            Assert.AreEqual(data.ymag, obj.ymag);
            Assert.AreEqual(data.zacc, obj.zacc);
            Assert.AreEqual(data.zgyro, obj.zgyro);
            Assert.AreEqual(data.zmag, obj.zmag);

            ScaledImu2DTO dto = DTOFactory.createScaledImu2DTO(obj);

            Assert.AreEqual(dto.time_boot_ms, obj.time_boot_ms);
            Assert.AreEqual(dto.xacc, obj.xacc);
            Assert.AreEqual(dto.xgyro, obj.xgyro);
            Assert.AreEqual(dto.xmag, obj.xmag);
            Assert.AreEqual(dto.yacc, obj.yacc);
            Assert.AreEqual(dto.ygyro, obj.ygyro);
            Assert.AreEqual(dto.ymag, obj.ymag);
            Assert.AreEqual(dto.zacc, obj.zacc);
            Assert.AreEqual(dto.zgyro, obj.zgyro);
            Assert.AreEqual(dto.zmag, obj.zmag);
        }