Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 29-11-2021, 09:18   #31
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,532
Images: 2
Re: JavaScript Plugin

Mike is preparing Javascript_pi for the PIM Plugin Manager, and hopefully it will soon be available there, so I would update OpenCPN to the latest release and wait a bit until you see it in PIM or an announcement. (There is a new v3 template he is working with.)
rgleason is online now   Reply With Quote
Old 29-11-2021, 09:45   #32
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 269
Re: JavaScript Plugin

Quote:
Originally Posted by tedcoats View Post
Hi,
I have found the JavaScript Plugin crucial in formatting NMEA 0183 wind speed and direction data coming from an old Dataline aggregator box and sending to a Raymarine autopilot. I am running OpenCPN 5.2 on Windows 10 and want to upgrade to the latest version of the JavaScript Plugin which promises better startup and window handling...
Is there an updated version for Windows, and if so where? I freely admit that the answer may be entirely obvious!
Cheers
Ted
I have the new JavaScript Plugin v0.5 more or less ready to go with the release of OCPN v5.5/6.
v0.5 is not backwards compatible with OCPN v5.2.
Mike assures me it is working on Windows.

Draft release info:
Quote:
Update for OpenCPN v5.6 and with additional APIs

OpenCPN v5.6 includes the new plugin API v1.17, which includes additions to help extend and simplify the JavaScript plugin functionality.
This paves the way for new scripting possibilities and simpler scripts.

Functional changes:

Waypoints
* Enhanced: waypoint APIs have extended attributes allowing more control over waypoint details.
* Additional attribute to distinguish between a free-standing waypoint and a routepoint
* Additional attribute giving a count of the number of routes including this waypoint
* New: get active waypoint GUID

Routes
* New: get all route GUIDs
* New: get active route GUID

Tracks (all new)
* get all track GUIDS
* get/update/delete track

New: get active leg information
New: printUnderlined

Behind the scenes

The plugin options have been moved within the opencpn.ini file from [Settings] to [Plugins]. The plugin will move settings to the new location as required.
Numerous changes for the move from wxWidgetsv512 to v515

Script library

There is now a library of example and useful scripts, which can include your contributions.
Antipole is offline   Reply With Quote
Old 29-11-2021, 09:58   #33
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,532
Images: 2
Re: JavaScript Plugin

Tony, since you've been involved in the extension of the api 117 would you have any idea why I am unable to use the entire ocpn_plugin.h file from api117 in a plugin?
The problem is described here involving AutoTrackRaymarine_pi? Any suggestions would be appreciated.
rgleason is online now   Reply With Quote
Old 29-11-2021, 10:34   #34
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 269
Re: JavaScript Plugin

Quote:
Tony, since you've been involved in the extension of the api 117 would you have any idea why I am unable to use the entire ocpn_plugin.h file from api117 in a plugin?
I have just checked back and the ocpn_plugin.h I am using is identical to that with the latest OCPN release v5.5.1118. I use a mix of api 117 & earlier, as you would expect. I regret I have no idea where your problem lies. Maybe ask Dave @bdbcat?
Antipole is offline   Reply With Quote
Old 01-12-2021, 00:29   #35
Registered User

Join Date: Dec 2011
Posts: 27
Re: JavaScript Plugin

Thanks for the comprehensive set of replies - delivered with speed!
Now I'm really looking forward to OpenCPN 5.5 - and the down-under summer!
Cheers
Ted
tedcoats is offline   Reply With Quote
Old 07-12-2021, 10:08   #36
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 269
JavaScript plugin updated to v0.5 for OpenCPN v5.6

A new version to go with OpenCPN v5.6.

OpenCPN v5.6 includes the new plugin API v1.17, which has additions to help extend and simplify the JavaScript plugin functionality. This paves the way for new scripting possibilities and simpler scripts.

Functional changes:

Waypoints
  • Enhanced: waypoint APIs have extended attributes allowing more control over waypoint details.
  • New: additional attribute to distinguish between a free-standing waypoint and a routepoint
  • New: additional attribute giving a count of the number of routes including this waypoint
  • New: get active waypoint GUID
  • Fix: add/update waypoint was creating invalid CreationDateTime timestamp - now corrected

Routes
  • New: get all route GUIDs
  • New: get active route GUID
Tracks (all new)
  • get all track GUIDS
  • get/update/delete track

Other
New: get active leg information
New: printUnderlined

Documentation

There is an updated user guide.

Fuller details and installers available on the release page.

As usual, huge thanks to Mike for his support and help in the builds.
Antipole is offline   Reply With Quote
Old 08-12-2021, 09:17   #37
Registered User

Join Date: Dec 2011
Posts: 27
Re: JavaScript Plugin

Hi Tony - again!
I have installed v0.5 and had problems with OpenCPN freezing. Mine is a Windows 11 install running OpenCPN 5.6 - ie the latest.
I uninstalled JS 0.5 but could still see JS 0.2 on the toolbar. I deleted all the components of JS 0.2 and reinstalled JS 0.5 from the Plugin catalog.
OpenCPN still became unresponsive when pressing the Run button in the plugin window. The autorun button doesn't seem to behave correctly either - ie show a tick when clicked on.
This may be some problem with my installation of course.
I've tried to attach the OpenCPN logfile in the hope that will be helpful to determine the cause but it exceeds the 1000 byte limit. Can you advise?
Cheers
Ted
tedcoats is offline   Reply With Quote
Old 08-12-2021, 19:37   #38
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,532
Images: 2
Re: JavaScript Plugin

Tony, is there a simple way to make a javascript that tests autopilot plugins? Specifically their ability to stay on a route and turn at a mark? Some of the autopilots use different inputs than the normal ones like XTE.

VDR_pi and VDRplayer have been very useful tools for testing plugins but they are not useful for testing autopilots.


In some cases we need to attach the autopilot to a serial input from a real autopilot.
rgleason is online now   Reply With Quote
Old 09-12-2021, 01:16   #39
Registered User
 
Antipole's Avatar

Join Date: Oct 2019
Location: Emsworth, UK
Boat: Alubat Ovni 395
Posts: 269
Re: JavaScript Plugin

Quote:
Originally Posted by rgleason View Post
VDR_pi and VDRplayer have been very useful tools for testing plugins but they are not useful for testing autopilots.
It would be a simple matter to script the equivalent of the VDR_pi and possible to script the functionality of VDRplayer_pi. No point in duplicating them but a script could be tailored to record extra information and it could also record info that cannot be represented in NMEA sentences

Quote:
Originally Posted by rgleason View Post
VDR_pi and VDRplayer have been very useful tools for testing plugins but they are not useful for testing autopilots.
Not sure what you want here, but the plugin has access to destination waypoint, XTE etc and could monitor, record or analyse (standard deviation etc.) them or raise alerts etc.

There are so many potential applications that this thread could become unmanageable. I think this thread should be reserved for issues with the plugin itself. Please start a separate thread for a particular application, as I did with Shadowing OpenCPN with devices running iNavX
Antipole is offline   Reply With Quote
Old 09-12-2021, 01:35   #40
Registered User

Join Date: May 2012
Posts: 1,184
Re: JavaScript Plugin

ted ...

Only on Win 8.1 but I can reproduce the problem with freezing. Trying to narrow it down to a particular way of using the plugin.

Mike
Rasbats is offline   Reply With Quote
Old 09-12-2021, 01:59   #41
Registered User

Join Date: May 2012
Posts: 1,184
Re: JavaScript Plugin

ted ...

Can you check if JavaScript\:AutoRun is set at '0' in opencpn.ini. If set at '1' change it to '0' and test the plugin again, but without touching autorun.

By minimising and then maximising OpenCPN I find this unfreezes the program.

Mike
Rasbats is offline   Reply With Quote
Old 09-12-2021, 04:24   #42
Registered User

Join Date: May 2012
Posts: 1,184
Re: JavaScript Plugin

ted ...

I can reproduce the problem with the autorun checkbox freezing OpenCPN. This seems to be a Windows issue. We are in the process of fixing this. This shows up another problem with autorun which Tony is working on.

In the meantime using autorun=0 should allow your scripts to run normally. Can you confirm this is the case please.

Mike
Rasbats is offline   Reply With Quote
Old 09-12-2021, 04:46   #43
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,532
Images: 2
Re: JavaScript Plugin

Please move discussion to Reliable Methods for Desktop Testing of Autopilot Plugins

Quote:
Originally Posted by rgleason View Post
Test autopilot plugins?
rgleason is online now   Reply With Quote
Old 10-12-2021, 10:00   #44
Registered User

Join Date: May 2012
Posts: 1,184
Re: JavaScript Plugin

We have a small problem with updating from v0.5.0 to v0.5.1 to fix the autorun problem.

Code:
--2021-12-10 17:52:36--  https://download.opencpn.org/s/E2p4nLDzeqx4SdX/downloadResolving download.opencpn.org (download.opencpn.org)... 168.119.3.125
Connecting to download.opencpn.org (download.opencpn.org)|168.119.3.125|:443... connected.
ERROR: cannot verify download.opencpn.org's certificate, issued by 'CN=R3,O=Let\'s Encrypt,C=US':
  Issued certificate has expired.
To connect to download.opencpn.org insecurely, use `--no-check-certificate'.
This prevents the download of the wxWidgets 3.1.2 archive.
I will provide an update when things are fixed.

Mike
Rasbats is offline   Reply With Quote
Old 10-12-2021, 11:11   #45
Registered User

Join Date: May 2012
Posts: 1,184
Re: JavaScript Plugin

v0.5.1 is now in Cloudsmith:
https://cloudsmith.io/~opencpn/repos...beta/packages/

Tony fixed the build problem for JavaScript_pi v0.5.1 and the plugin is available for all OS other than build-flatpak-x86

v0.5.1 should solve the problem of autorun freezing OpenCPN.

To use the plugin please download the tarball from Cloudsmith and import it.

Feedback always welcome.

Mike
Rasbats is offline   Reply With Quote
Reply

Tags
plug, plugin

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
JavaScript Plugin for OpenCPN? Antipole OpenCPN 2 16-02-2022 06:44
OpenCPN PlugIn Development bdbcat OpenCPN 161 04-09-2019 12:50
Plugin development... How to receive chart objects in my plugin? dmartinez OpenCPN 6 04-08-2017 00:56
Winlink Express problems with GRIB map and Javascript Slow Boat To... Marine Electronics 0 29-04-2017 14:23
Driving Revenue JavaScript S/V_Surya Forum Tech Support & Site Help 22 06-04-2011 12:26

Advertise Here


All times are GMT -7. The time now is 18:49.


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.