Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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 09-03-2016, 11:40   #1
Registered User

Join Date: Nov 2015
Posts: 22
OpenCPN Plugin API Documentation / Routes

Is there anywhere with detailed documentation regarding the functions made available to OpenCPN plugins ?

I'm interested in being able to live plot a route.
A proof of concept that I would like to achieve would be having the plugin "listen" for messages containing GPS coordinates, and then creating a route on the fly for display.
I know some plugins support the creation of a gpx file which can then be loaded back in for display.
Are there any open source plugins that create routes without the use of a gpx file ?
I know the plugin header has some functions for Plugin_Waypoint, Plugin_Route, etc. (hence my question about detailed documentation).

Does this seem like a plausible idea ? Or is the gpx method a better way, having the plugin handle this automatically ?
The only issue I see is if I want a live plot, if the coordinates are coming in periodically...do I then have to remove the route, add the newly updated route, etc. ?

V/r,
Chandler
dachancellor is offline   Reply With Quote
Old 09-03-2016, 11:49   #2
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 4,735
Re: OpenCPN Plugin API Documentation / Routes

Quote:
Originally Posted by dachancellor View Post
I'm interested in being able to live plot a route.
A proof of concept that I would like to achieve would be having the plugin "listen" for messages containing GPS coordinates, and then creating a route on the fly for display.
V/r,
Chandler
Live is usually related to a Track.
Own ship? This does OCPN.
Others??
bcn is offline   Reply With Quote
Old 09-03-2016, 12:32   #3
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: OpenCPN Plugin API Documentation / Routes

Chandler...
The header (https://github.com/OpenCPN/OpenCPN/b..._plugin.h#L708) is the best place to look at, there is no other documentation. Pull requests actually documenting it are of course more than welcome, I will gladly run doxygen on it when it makes sense
FWIW the weather routing and squidd.io plugins use this part of the API.
From your brief description it kind of seems that what you are trying to implement is the same as what recording a track already does.

Pavel
nohal is offline   Reply With Quote
Old 09-03-2016, 12:39   #4
Registered User

Join Date: Nov 2015
Posts: 22
Re: OpenCPN Plugin API Documentation / Routes

Quote:
Originally Posted by bcn View Post
Live is usually related to a Track.
Own ship? This does OCPN.
Others??
Good point.
I forgot that I'm using OCPN for the navigation of objects OTHER THAN ownship...
I guess this functionality doesn't really make sense to exist.

I could say it is for route planning, but at that point, a gpx file makes sense.
dachancellor is offline   Reply With Quote
Old 09-03-2016, 12:40   #5
Registered User

Join Date: Nov 2015
Posts: 22
Re: OpenCPN Plugin API Documentation / Routes

Quote:
Originally Posted by nohal View Post
Chandler...
The header (https://github.com/OpenCPN/OpenCPN/b..._plugin.h#L708) is the best place to look at, there is no other documentation. Pull requests actually documenting it are of course more than welcome, I will gladly run doxygen on it when it makes sense
FWIW the weather routing and squidd.io plugins use this part of the API.
From your brief description it kind of seems that what you are trying to implement is the same as what recording a track already does.

Pavel
Thanks Pavel, I figured that might be the case.

In the past hour I've played around with it and been able to add some waypoints, and add a route (though waypoint names are by default not visible when adding a route...anyway to change this ? )
dachancellor is offline   Reply With Quote
Old 09-03-2016, 12:47   #6
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: OpenCPN Plugin API Documentation / Routes

Quote:
Originally Posted by dachancellor View Post
(though waypoint names are by default not visible when adding a route...anyway to change this ? )
Setting https://github.com/OpenCPN/OpenCPN/b..._plugin.h#L552 to true, I would say. If it doesn't work, it's probably broken.

Pavel
nohal is offline   Reply With Quote
Old 09-03-2016, 13:49   #7
Registered User

Join Date: Nov 2015
Posts: 22
Re: OpenCPN Plugin API Documentation / Routes

Quote:
Originally Posted by nohal View Post
Setting https://github.com/OpenCPN/OpenCPN/b..._plugin.h#L552 to true, I would say. If it doesn't work, it's probably broken.
Pavel
Pavel,
I tried setting this value (m_IsVisible) to both true and false.
For a route, neither waypoint name showed.
For a single waypoint, the waypoint name always showed.
It doesn't appear to have any affect, though I figured it may have hid the icon (same effect as unchecking Show on Chart).

I did however find the issue.
https://github.com/OpenCPN/OpenCPN/b...ager.cpp#L2925

When the plugin manager converts the Plugin WPs to RoutePoint, it sets show name to false.
I modified to true and recompiled, and the names showed as expected.

Thanks
dachancellor is offline   Reply With Quote
Reply

Tags
documentation, enc, men, opencpn, plug, route


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
Map API - WMS Support? moyd OpenCPN 15 17-01-2017 07:16
Plugin API and documentation rgleason OpenCPN 2 06-11-2015 10:09
Waterlevel API plugin stedy OpenCPN 3 16-06-2015 06:03
Technical: API to query heading(s)? bushtor OpenCPN 4 03-06-2013 07:38
Plugin api coding rooiedirk OpenCPN 6 03-04-2013 08:49

Advertise Here


All times are GMT -7. The time now is 20:28.


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.