Search in sources :

Example 1 with DataStatus

use of net.sf.marineapi.nmea.util.DataStatus in project marine-api by ktuukkan.

the class PositionProvider method isValid.

/*
	 * (non-Javadoc)
	 * @see net.sf.marineapi.provider.AbstractProvider#isValid()
	 */
@Override
protected boolean isValid() {
    for (Sentence s : getSentences()) {
        if (s instanceof RMCSentence) {
            RMCSentence rmc = (RMCSentence) s;
            DataStatus ds = rmc.getStatus();
            if (DataStatus.VOID.equals(ds) || (rmc.getFieldCount() > 11 && FaaMode.NONE.equals(rmc.getMode()))) {
                return false;
            }
        } else if (s instanceof GGASentence) {
            GpsFixQuality fq = ((GGASentence) s).getFixQuality();
            if (GpsFixQuality.INVALID.equals(fq)) {
                return false;
            }
        } else if (s instanceof GLLSentence) {
            DataStatus ds = ((GLLSentence) s).getStatus();
            if (DataStatus.VOID.equals(ds)) {
                return false;
            }
        }
    }
    return true;
}
Also used : GLLSentence(net.sf.marineapi.nmea.sentence.GLLSentence) RMCSentence(net.sf.marineapi.nmea.sentence.RMCSentence) DataStatus(net.sf.marineapi.nmea.util.DataStatus) GpsFixQuality(net.sf.marineapi.nmea.util.GpsFixQuality) VTGSentence(net.sf.marineapi.nmea.sentence.VTGSentence) GLLSentence(net.sf.marineapi.nmea.sentence.GLLSentence) GGASentence(net.sf.marineapi.nmea.sentence.GGASentence) RMCSentence(net.sf.marineapi.nmea.sentence.RMCSentence) Sentence(net.sf.marineapi.nmea.sentence.Sentence) GGASentence(net.sf.marineapi.nmea.sentence.GGASentence)

Example 2 with DataStatus

use of net.sf.marineapi.nmea.util.DataStatus in project marine-api by ktuukkan.

the class APBParser method setPerpendicularPassed.

/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * net.sf.marineapi.nmea.sentence.APBSentence#setPerpendicularPassed(boolean
	 * )
	 */
@Override
public void setPerpendicularPassed(boolean isPassed) {
    DataStatus s = isPassed ? DataStatus.ACTIVE : DataStatus.VOID;
    setCharValue(PERPENDICULAR_STATUS, s.toChar());
}
Also used : DataStatus(net.sf.marineapi.nmea.util.DataStatus)

Example 3 with DataStatus

use of net.sf.marineapi.nmea.util.DataStatus in project marine-api by ktuukkan.

the class APBParser method setArrivalCircleEntered.

/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * net.sf.marineapi.nmea.sentence.APBSentence#setArrivalCircleEntered(boolean
	 * )
	 */
@Override
public void setArrivalCircleEntered(boolean isEntered) {
    DataStatus s = isEntered ? DataStatus.ACTIVE : DataStatus.VOID;
    setCharValue(CIRCLE_STATUS, s.toChar());
}
Also used : DataStatus(net.sf.marineapi.nmea.util.DataStatus)

Aggregations

DataStatus (net.sf.marineapi.nmea.util.DataStatus)3 GGASentence (net.sf.marineapi.nmea.sentence.GGASentence)1 GLLSentence (net.sf.marineapi.nmea.sentence.GLLSentence)1 RMCSentence (net.sf.marineapi.nmea.sentence.RMCSentence)1 Sentence (net.sf.marineapi.nmea.sentence.Sentence)1 VTGSentence (net.sf.marineapi.nmea.sentence.VTGSentence)1 GpsFixQuality (net.sf.marineapi.nmea.util.GpsFixQuality)1