Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 08-01-2022, 07:00   #1
Registered User

Join Date: May 2012
Posts: 1,205
Chart depths - units - plugin API

Need to access the depth units (feet, metre etc) for the chart in use.

Is this possible? Or do the functions in the API only apply to a chart opened by the plugin?

This is for work on Survey_pi.

Mike
Rasbats is offline   Reply With Quote
Old 08-01-2022, 14:36   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Chart depths - units - plugin API

Mike, it is more complicated than it seems as charts with completely different units can be displayed in a quilt.
For vector charts on the other hand the depth unit is selected by the user and does not depend on the charts at all.
nohal is offline   Reply With Quote
Old 09-01-2022, 02:34   #3
Registered User

Join Date: May 2012
Posts: 1,205
Re: Chart depths - units - plugin API

Thanks Pavel ...

That will save a lot of head banging.

Mike
Rasbats is offline   Reply With Quote
Old 09-01-2022, 05:15   #4
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 65
Re: Chart depths - units - plugin API

What about this?
virtual wxString GetDepthUnits() { return m_DepthUnits;}


from ocpn_plugin.h


What does it return?
ian5142 is offline   Reply With Quote
Old 09-01-2022, 05:24   #5
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Chart depths - units - plugin API

That is an API of plugins implementing charts, like S63, oeSENC and oeRNC. It tells the core what depth units a chart provided by the plugin uses. = It does pretty much exactly the opposite of what Mike would want. What Mike wants is not practically possible in all but special cases where all the displayed charts use the same units.
nohal is offline   Reply With Quote
Old 09-01-2022, 06:13   #6
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 65
Re: Chart depths - units - plugin API

OK, so not that setting.


I am trying to retrieve this setting, from the screenshot.
Attached Thumbnails
Click image for larger version

Name:	OpenCPN setting depth.jpg
Views:	36
Size:	69.2 KB
ID:	250959  
ian5142 is offline   Reply With Quote
Old 09-01-2022, 08:11   #7
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Chart depths - units - plugin API

PI_GetPLIBDepthUnitInt() will give you the depth units used by the S52 presentation library.
nohal is offline   Reply With Quote
Old 09-01-2022, 08:24   #8
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 65
Re: Chart depths - units - plugin API

What is the disadvantage to using that instead of creating a separate setting?
ian5142 is offline   Reply With Quote
Old 09-01-2022, 08:41   #9
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,211
Re: Chart depths - units - plugin API

I'm afraid I don't understand, what does "creating a separate setting" mean exactly?
nohal is offline   Reply With Quote
Old 09-01-2022, 08:43   #10
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 65
Re: Chart depths - units - plugin API

Currently the survey_pi plugin has its own depth setting in its plugin preferences. This is of course independent of the rest of OpenCPN.
ian5142 is offline   Reply With Quote
Old 10-01-2022, 04:45   #11
Registered User

Join Date: May 2012
Posts: 1,205
Re: Chart depths - units - plugin API

Ian ...

I think the real problem is the lack of units in the schema for the soundings table. At the moment we plot what NMEA is feeding the plugin and do not record the units. The workaround is that preferences are used to adjust for the display of the depth in the units you want but it does not change the sounding recorded in the table. Need to add a column for the units in use and display that in the plugin dialog.

Mike
Rasbats is offline   Reply With Quote
Old 10-01-2022, 05:32   #12
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 65
Re: Chart depths - units - plugin API

I thought of another workaround without adding a new column to the table / database. What about just adding an import only setting that is accessible in the import dialog window?


NMEA streams themselves default to meters. https://gpsd.gitlab.io/gpsd/NMEA.htm...depth_of_water Assume all values in the table are meters and convert to anything else.
ian5142 is offline   Reply With Quote
Old 10-01-2022, 05:54   #13
Registered User

Join Date: May 2012
Posts: 1,205
Re: Chart depths - units - plugin API

That's a better idea. What is your source for depths non-metric? Is this a real-world problem? Or is it just to enable the correct display on the chart?
Rasbats is offline   Reply With Quote
Old 10-01-2022, 06:13   #14
Registered User

Join Date: Aug 2017
Location: Cape Breton, NS, Canada
Boat: Cape Islander - tour boat
Posts: 65
Re: Chart depths - units - plugin API

My source for non-metric depths. My equipment all conforms to NMEA standards and outputs DPT sentences in meters. The only problem is if somebody imports something using the import dialog that is in feet or fathoms. I have no idea where this will come from.



I still have an end goal to display the data on the chart overlay in the same measurement as the chart (from the setting mentioned earlier).
ian5142 is offline   Reply With Quote
Old 10-01-2022, 07:12   #15
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,740
Re: Chart depths - units - plugin API

Ideally you would generate a S-57 overlay chart. OpenCPN would take care about the units for presentation then.
bcn is offline   Reply With Quote
Reply

Tags
depth, plug, plugin


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCPN plugin API creekorful OpenCPN 2 08-06-2016 06:09
OpenCPN Plugin API Documentation / Routes dachancellor OpenCPN 6 09-03-2016 13:49
Plugin API and documentation rgleason OpenCPN 2 06-11-2015 10:09
Waterlevel API plugin stedy OpenCPN 3 16-06-2015 06:03
Plugin api coding rooiedirk OpenCPN 6 03-04-2013 08:49

Advertise Here


All times are GMT -7. The time now is 03:19.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.