public static GpsRawIntDTO createGpsRawIntDTO(GpsRawInt source) { if (null == source) { return(null); } GpsRawIntDTO result = new GpsRawIntDTO(); Utilities.CopySimilar.CopyAll(source, result); result.fixTypeLabel = source.fixTypeEnum.ToString(); return(result); }
public void CheckGpsRawIntObject() { MAVLink.mavlink_gps_raw_int_t gpsStruct = new MAVLink.mavlink_gps_raw_int_t(); gpsStruct.alt = 1; gpsStruct.cog = 2; gpsStruct.eph = 3; gpsStruct.epv = 4; gpsStruct.fix_type = 3; gpsStruct.lat = 6; gpsStruct.lon = 7; gpsStruct.satellites_visible = 8; gpsStruct.time_usec = 9; gpsStruct.vel = 10; MavLinkMessage message = createSampleMessage(MAVLink.MAVLINK_MSG_ID.GPS_RAW_INT, gpsStruct); GpsRawInt obj = new GpsRawInt(message); Assert.AreEqual(gpsStruct.alt, obj.alt); Assert.AreEqual(gpsStruct.cog, obj.cog); Assert.AreEqual(gpsStruct.eph, obj.eph); Assert.AreEqual(gpsStruct.epv, obj.epv); Assert.AreEqual(gpsStruct.fix_type, obj.fix_type); Assert.AreEqual(gpsStruct.lat, obj.lat); Assert.AreEqual(gpsStruct.lon, obj.lon); Assert.AreEqual(gpsStruct.satellites_visible, obj.satellites_visible); Assert.AreEqual(gpsStruct.time_usec, obj.time_usec); Assert.AreEqual(gpsStruct.vel, obj.vel); Assert.AreEqual(GpsRawInt.FixType.FIX_3D, obj.fixTypeEnum); GpsRawIntDTO dto = DTOFactory.createGpsRawIntDTO(obj); Assert.AreEqual(dto.alt, obj.alt); Assert.AreEqual(dto.cog, obj.cog); Assert.AreEqual(dto.eph, obj.eph); Assert.AreEqual(dto.epv, obj.epv); Assert.AreEqual(dto.fix_type, obj.fix_type); Assert.AreEqual(dto.lat, obj.lat); Assert.AreEqual(dto.lon, obj.lon); Assert.AreEqual(dto.satellites_visible, obj.satellites_visible); Assert.AreEqual(dto.time_usec, obj.time_usec); Assert.AreEqual(dto.vel, obj.vel); Assert.AreEqual(GpsRawInt.FixType.FIX_3D, obj.fixTypeEnum); }