Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 06-07-2016, 14:19   #1
Registered User

Join Date: Jul 2016
Posts: 2
Accessing active route data in the Plugin interface?

Hello,

Is it possible to access the Active Route, or even just 'total distance to run on the active route', via the Plugin interface?

I have had a good look through the source and it seems that I can only access/manipulate routes in the plugin that are first instantiated in the plugin and then passed to the main application - but not routes that already exist in the application?

I am trying to implement a simple calculator that shows how much 'slack time' is available on a voyage, based on the active route, a fixed arrival time, and predicted average cruise speed scenarios. This is relevant on our ship.

I have already implemented this externally to OpenCPN, by monitoring NMEA $..RMB sentences to monitor progress on the current leg, but I also need the rest of the route data (to calculate total distance to run), which I communicate to my external application using the "Send to GPS..." method to send WPT and RTE sentences, but this can only send serially (not via sockets, like for other NMEA messages) and so I have to send it through a serial loopback, which is awkward. I was hoping I could improve this by using the plugin mechanism, but I'm not sure that I can access the data that I require in the API?

I see where the total remaining distance to run is calculated in 'concanv.cpp', but it is able to access the g_pRouteMan instance, which I don't think is possible in a plugin?

Ideas and/or alternatives very welcome and appreciated.

Thanks and regards,
Brett
Brett Muir is offline   Reply With Quote
Old 07-07-2016, 00:42   #2
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,537
Re: Accessing active route data in the Plugin interface?

Brett,

have a look at the logbook plugin sources.
https://github.com/delatbabel/LogbookKonni-1.2

Gerhard
CarCode is offline   Reply With Quote
Old 07-07-2016, 17:34   #3
Registered User

Join Date: Jul 2016
Posts: 2
Re: Accessing active route data in the Plugin interface?

Thanks a lot Gerhard. I hadn't seen/understood the SendMessage/SetMessage aspect of the API. I've got the source and a plug-in building/debugging and I can get the data from OpenCPN that I need to make it all work.

Thanks again.

Brett
Brett Muir is offline   Reply With Quote
Reply

Tags
plug, route

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Accessing waypoints from plugin development Cags OpenCPN 16 22-10-2015 10:05
Integration of Active Captain Data LH44 Anne OpenCPN 21 30-09-2014 07:36
Question About the Plugin Interface PjotrC OpenCPN 17 06-12-2011 11:09
Sending 'Go to Here' Active Route to an Autopilot Sail323 OpenCPN 11 01-08-2011 15:44
Export Active Captain Route To Garmin Therapy Navigation 14 05-04-2011 13:13

Advertise Here


All times are GMT -7. The time now is 16: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.