Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-03-2016, 12: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, 12:49   #2
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 2,769
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 online now   Reply With Quote
Old 09-03-2016, 13:32   #3
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
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, 13: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, 13: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, 13:47   #6
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
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, 14: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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

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


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.