-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NMEA 4.1 Nav Status field to RMC sentence (#142)
- Loading branch information
Showing
6 changed files
with
134 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package net.sf.marineapi.nmea.util; | ||
|
||
/** | ||
* <p>FAA operating modes reported by RMC sentences since NMEA 4.1. </p> | ||
* @author John | ||
*/ | ||
|
||
public enum NavStatus { | ||
|
||
/** Navigation status is autonomous. */ | ||
AUTONOMOUS('A'), | ||
|
||
/** Navigation status is differential. */ | ||
DIFFERENTIAL('D'), | ||
|
||
/** Navigation status is Estimated. */ | ||
ESTIMATED('E'), | ||
|
||
/** Navigation status is Manual. */ | ||
MANUAL('M'), | ||
|
||
/** Navigation status is Not valid. */ | ||
NOT_VALID('N'), | ||
|
||
/** Navigation status is Simulator. */ | ||
SIMULATOR('S'), | ||
|
||
/** Navigation status is Valid. */ | ||
VALID('V'); | ||
|
||
private final char navStatus; | ||
|
||
NavStatus(char navStatusCh) { | ||
navStatus = navStatusCh; | ||
} | ||
|
||
/** | ||
* Returns the corresponding char indicator of Navigation Status. | ||
* | ||
* @return NavStatus char used in sentences. | ||
*/ | ||
public char toChar() { | ||
return navStatus; | ||
} | ||
|
||
/** | ||
* Returns the NavStatus enum corresponding the actual char indicator used in | ||
* the sentencess. | ||
* | ||
* @param ch Char mode indicator | ||
* @return NavStatus enum | ||
*/ | ||
public static NavStatus valueOf(char ch) { | ||
for (NavStatus gm : values()) { | ||
if (gm.toChar() == ch) { | ||
return gm; | ||
} | ||
} | ||
return valueOf(String.valueOf(ch)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters