use of net.sf.marineapi.nmea.util.SatelliteInfo in project marine-api by ktuukkan.
the class SatelliteInfoProviderExample method providerUpdate.
/*
* (non-Javadoc)
* @see
* net.sf.marineapi.provider.event.SatelliteInfoListener#providerUpdate(net.sf.marineapi
* .provider.event.SatelliteInfoEvent)
*/
public void providerUpdate(SatelliteInfoEvent event) {
System.out.println("-- GSV report --");
for (SatelliteInfo si : event.getSatelliteInfo()) {
String ptrn = "%s: %d, %d";
String msg = String.format(ptrn, si.getId(), si.getAzimuth(), si.getElevation());
System.out.println(msg);
}
System.out.println("-----");
}
use of net.sf.marineapi.nmea.util.SatelliteInfo in project marine-api by ktuukkan.
the class GSVTest method testSetSatelliteInfo.
/**
* Test method for
* {@link net.sf.marineapi.nmea.parser.GSVParser#getSatelliteInfo()}.
*/
@Test
public void testSetSatelliteInfo() {
List<SatelliteInfo> si = new ArrayList<SatelliteInfo>();
si.add(new SatelliteInfo("01", 11, 12, 13));
si.add(new SatelliteInfo("02", 21, 22, 23));
si.add(new SatelliteInfo("03", 31, 32, 33));
gsv.setSatelliteInfo(si);
assertTrue(gsv.toString().contains(",03,31,032,33,,,,*"));
List<SatelliteInfo> sat = gsv.getSatelliteInfo();
assertEquals(3, sat.size());
testSatelliteInfo(sat.get(0), "01", 11, 12, 13);
testSatelliteInfo(sat.get(1), "02", 21, 22, 23);
testSatelliteInfo(sat.get(2), "03", 31, 32, 33);
}
Aggregations