forked from hydroffice/hyo2_soundspeed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
517 additions
and
24 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ Setup | |
user_manual_setup_settings | ||
user_manual_setup_sis_v4 | ||
user_manual_setup_sis_v5 | ||
user_manual_setup_nmea0183 |
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,30 @@ | ||
.. _nmea0183: | ||
|
||
Sound Speed Manager - NMEA-0183 interaction | ||
=========================================== | ||
|
||
.. index:: NMEA-0183; | ||
|
||
A rudimentary NMEA-0183 listener can be used to capture the current location via a UDP broadcast of NMEA-0183 $--GGA or $--GLL sentences. This feature can be used to associate the current position to the sound speed profile formats that cannot store location information. | ||
|
||
Open in editing mode the Sound Speed Manager’s Setup Tab, then set the NMEA-0183 listen port the Listeners sub-tab (see :numref:`ssm_nmea0183_listeners_fig`). | ||
|
||
.. _ssm_nmea0183_listeners_fig: | ||
.. figure:: ./_static/ssm_nmea0183_listeners.png | ||
:width: 618px | ||
:align: center | ||
:alt: figure with nmea0183 settings part 1 | ||
:figclass: align-center | ||
|
||
*Sound Speed Manager Setup Listeners* dialog, with the *Listen Port* setting and incoming NMEA-0183 data highlighted in red. | ||
|
||
Then, switch to the Input sub-tab (see :numref:`ssm_nmea0183_input_fig`) and select the True value for the Listen NMEA-0183 field. After a **restart**, the current position is displayed in the status bar. | ||
|
||
.. _ssm_nmea0183_input_fig: | ||
.. figure:: ./_static/ssm_nmea0183_input.png | ||
:width: 618px | ||
:align: center | ||
:alt: figure with nmea0183 settings part 2 | ||
:figclass: align-center | ||
|
||
*Input tab* in the Sound Speed Manager’s Setup. |
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
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
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,94 @@ | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Nmea0183Nav: | ||
|
||
def __init__(self, data): | ||
|
||
self.data = data | ||
self.msg = None | ||
|
||
self.latitude = None | ||
self.longitude = None | ||
|
||
self.parse() | ||
|
||
def parse(self) -> None: | ||
self.msg = self.data.split(',') | ||
|
||
def __str__(self): | ||
return "Latitude: {0}, Longitude: {1}\n".format(self.latitude, self.longitude) | ||
|
||
|
||
|
||
class Nmea0183GGA(Nmea0183Nav): | ||
|
||
def __init__(self, data): | ||
super(Nmea0183GGA, self).__init__(data) | ||
|
||
self.timestamp = self.msg[1] | ||
self.lat = self.msg[2] | ||
self.lat_dir = self.msg[3] | ||
self.lon = self.msg[4] | ||
self.lon_dir = self.msg[5] | ||
self.gps_qual = self.msg[6] | ||
self.num_sats = self.msg[7] | ||
self.horizontal_dil = self.msg[8] | ||
self.altitude = self.msg[9] | ||
self.altitude_units = self.msg[10] | ||
self.geo_sep = self.msg[11] | ||
self.geo_sep_units = self.msg[12] | ||
self.age_gps_data = self.msg[13] | ||
self.ref_station_id = self.msg[14] | ||
|
||
try: | ||
self.latitude = int(self.lat[:2]) + float(self.lat[2:])/60. | ||
if self.lat_dir == 'S': | ||
self.latitude = -1.0 * self.latitude | ||
#logger.debug("NMEA-0183 $$GGA lat: {}".format(self.latitude)) | ||
except Exception as e: | ||
logger.warning("unable to interpret latitude from {0} and {1}, {2}".format(self.lat, self.lat_dir, e)) | ||
|
||
try: | ||
self.longitude = int(self.lon[:3]) + float(self.lon[3:])/60. | ||
if self.lon_dir == 'W': | ||
self.longitude = -1.0 * self.longitude | ||
#logger.debug("NMEA-0183 $$GGA lon: {}".format(self.longitude)) | ||
except Exception as e: | ||
logger.warning("unable to interpret longitude from {0} and {1}, {2}".format(self.lon, self.lon_dir, e)) | ||
|
||
|
||
|
||
|
||
class Nmea0183GLL(Nmea0183Nav): | ||
|
||
def __init__(self, data): | ||
super(Nmea0183GLL, self).__init__(data) | ||
|
||
self.msg = self.data.split(',') | ||
|
||
self.lat = self.msg[1] | ||
self.lat_dir = self.msg[2] | ||
self.lon = self.msg[3] | ||
self.lon_dir = self.msg[4] | ||
self.timestamp = self.msg[5] | ||
self.status = self.msg[6] | ||
|
||
try: | ||
self.latitude = int(self.lat[:2]) + float(self.lat[2:])/60. | ||
if self.lat_dir == 'S': | ||
self.latitude = -1.0 * self.latitude | ||
#logger.debug("NMEA-0183 $$GLL lat: {}".format(self.latitude)) | ||
except Exception as e: | ||
logger.warning("unable to interpret latitude from {0} and {1}, {2}".format(self.lat, self.lat_dir, e)) | ||
|
||
try: | ||
self.longitude = int(self.lon[:3]) + float(self.lon[3:])/60. | ||
if self.lon_dir == 'W': | ||
self.longitude = -1.0 * self.longitude | ||
#logger.debug("NMEA-0183 $$GLL lon: {}".format(self.longitude)) | ||
except Exception as e: | ||
logger.warning("unable to interpret longitude from {0} and {1}, {2}".format(self.lon, self.lon_dir, e)) | ||
|
Oops, something went wrong.