|
08-01-2022, 07:00
|
#1
|
Registered User
Join Date: May 2012
Posts: 1,209
|
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
|
|
|
08-01-2022, 14:36
|
#2
|
Registered User
Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,212
|
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.
|
|
|
09-01-2022, 02:34
|
#3
|
Registered User
Join Date: May 2012
Posts: 1,209
|
Re: Chart depths - units - plugin API
Thanks Pavel ...
That will save a lot of head banging.
Mike
|
|
|
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?
|
|
|
09-01-2022, 05:24
|
#5
|
Registered User
Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,212
|
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.
|
|
|
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.
|
|
|
09-01-2022, 08:11
|
#7
|
Registered User
Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,212
|
Re: Chart depths - units - plugin API
PI_GetPLIBDepthUnitInt() will give you the depth units used by the S52 presentation library.
|
|
|
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?
|
|
|
09-01-2022, 08:41
|
#9
|
Registered User
Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,212
|
Re: Chart depths - units - plugin API
I'm afraid I don't understand, what does "creating a separate setting" mean exactly?
|
|
|
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.
|
|
|
10-01-2022, 04:45
|
#11
|
Registered User
Join Date: May 2012
Posts: 1,209
|
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
|
|
|
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.
|
|
|
10-01-2022, 05:54
|
#13
|
Registered User
Join Date: May 2012
Posts: 1,209
|
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?
|
|
|
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).
|
|
|
10-01-2022, 07:12
|
#15
|
Registered User
Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,750
|
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.
|
|
|
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
Advertise Here
Recent Discussions |
|
|
|
|
|
|
|
|
|
|
|
|
Vendor Spotlight |
|
|
|
|
|