Example #1
0
        public static NavControllerOutputDTO createNavControllerOutputDTO(NavControllerOutput source)
        {
            if (null == source)
            {
                return(null);
            }
            NavControllerOutputDTO result = new NavControllerOutputDTO();

            Utilities.CopySimilar.CopyAll(source, result);
            return(result);
        }
Example #2
0
        public void CheckNavControllerOutput()
        {
            MAVLink.mavlink_nav_controller_output_t data = new MAVLink.mavlink_nav_controller_output_t();
            data.alt_error      = 1;
            data.aspd_error     = 2;
            data.nav_bearing    = 2;
            data.nav_pitch      = 3;
            data.nav_roll       = 4;
            data.target_bearing = 5;
            data.wp_dist        = 6;
            data.xtrack_error   = 7;

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

            NavControllerOutput obj = new NavControllerOutput(message);

            Assert.AreEqual(data.alt_error, obj.alt_error);
            Assert.AreEqual(data.aspd_error, obj.aspd_error);
            Assert.AreEqual(data.nav_bearing, obj.nav_bearing);
            Assert.AreEqual(data.nav_pitch, obj.nav_pitch);
            Assert.AreEqual(data.nav_roll, obj.nav_roll);
            Assert.AreEqual(data.target_bearing, obj.target_bearing);
            Assert.AreEqual(data.wp_dist, obj.wp_dist);
            Assert.AreEqual(data.xtrack_error, obj.xtrack_error);

            NavControllerOutputDTO dto = DTOFactory.createNavControllerOutputDTO(obj);

            Assert.AreEqual(dto.alt_error, obj.alt_error);
            Assert.AreEqual(dto.aspd_error, obj.aspd_error);
            Assert.AreEqual(dto.nav_bearing, obj.nav_bearing);
            Assert.AreEqual(dto.nav_pitch, obj.nav_pitch);
            Assert.AreEqual(dto.nav_roll, obj.nav_roll);
            Assert.AreEqual(dto.target_bearing, obj.target_bearing);
            Assert.AreEqual(dto.wp_dist, obj.wp_dist);
            Assert.AreEqual(dto.xtrack_error, obj.xtrack_error);
        }