Search in sources :

Example 1 with SatelliteInfoEvent

use of net.sf.marineapi.provider.event.SatelliteInfoEvent in project marine-api by ktuukkan.

the class SatelliteInfoProvider method createProviderEvent.

/*
	 * (non-Javadoc)
	 * @see net.sf.marineapi.provider.AbstractProvider#createProviderEvent()
	 */
@Override
protected SatelliteInfoEvent createProviderEvent() {
    GSASentence gsa = null;
    List<SatelliteInfo> info = new ArrayList<SatelliteInfo>();
    for (Sentence sentence : getSentences()) {
        if ("GSA".equals(sentence.getSentenceId())) {
            gsa = (GSASentence) sentence;
        } else if ("GSV".equals(sentence.getSentenceId())) {
            GSVSentence gsv = (GSVSentence) sentence;
            info.addAll(gsv.getSatelliteInfo());
        }
    }
    return new SatelliteInfoEvent(this, gsa, info);
}
Also used : SatelliteInfoEvent(net.sf.marineapi.provider.event.SatelliteInfoEvent) GSASentence(net.sf.marineapi.nmea.sentence.GSASentence) GSVSentence(net.sf.marineapi.nmea.sentence.GSVSentence) ArrayList(java.util.ArrayList) SatelliteInfo(net.sf.marineapi.nmea.util.SatelliteInfo) GSASentence(net.sf.marineapi.nmea.sentence.GSASentence) GSVSentence(net.sf.marineapi.nmea.sentence.GSVSentence) Sentence(net.sf.marineapi.nmea.sentence.Sentence)

Aggregations

ArrayList (java.util.ArrayList)1 GSASentence (net.sf.marineapi.nmea.sentence.GSASentence)1 GSVSentence (net.sf.marineapi.nmea.sentence.GSVSentence)1 Sentence (net.sf.marineapi.nmea.sentence.Sentence)1 SatelliteInfo (net.sf.marineapi.nmea.util.SatelliteInfo)1 SatelliteInfoEvent (net.sf.marineapi.provider.event.SatelliteInfoEvent)1