Cruisers Forum
 


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 11-02-2019, 17:55   #151
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Oh good lord..LOL. I did not even see that field in the JSON. So I would guess that when the target changes to lost, then the JSON message for that target will arrive...once with lost = true... or could it come in more than once with lost=true?
cryptik is offline   Reply With Quote
Old 11-02-2019, 18:12   #152
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,278
Re: OpenCPN PlugIn Development

If OpenCPN is set to execute this code path, you should see it once with lost == true when it is marked lost and once with both lost == true and removed == true when the target is completely discarded.
Unless the target meanwhile again appeared between the above two states, in which case you will see it with lost == false again and everything starts from zero.
nohal is offline   Reply With Quote
Old 11-02-2019, 23:37   #153
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Okay, so I was able to integrate the changes you made in AIS_Decoder and AIS_Target_Data files into my fork. The lost and remove messages work well. The "remove : true" is currently want I look for. Thank you for that...it works great.

One odd thing... if I set the OCPN preferences to mark targets as lost after 1 min and remove after 2... it works... meaning that targets are marked as lost after 1 minute. They also disappear from the screen after two minutes, but they appear to remain in the AIS target list for about 6 minutes before the "remove : true" value is set and they get removed from the target list. Is this by design?

Thanks,
Ken
cryptik is offline   Reply With Quote
Old 12-02-2019, 09:18   #154
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Actually, I think I can answer my own question. It looks like a target is marked for removal when the static age is 3 * the removelost_Mins. So this works out to 6 minutes.
cryptik is offline   Reply With Quote
Old 12-02-2019, 18:02   #155
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Another question... regarding configuration settings in the opencpn.ini file. When the plugin is uninstalled.... is there a recommended way to delete the configuration items?

-Ken
cryptik is offline   Reply With Quote
Old 12-02-2019, 18:28   #156
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,278
Re: OpenCPN PlugIn Development

Simply not to do anything, there is no way for you to know if the uninstallation is part of an upgrade. It is a normal behavior not to touch user data and settings in the software industry.
nohal is offline   Reply With Quote
Old 12-02-2019, 18:57   #157
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Okay, thanks. That makes sense. I assume this also applies to the GetpPrivateApplicationDataLocation() folder. This folder is not removed when the plugin in uninstalled.

One other question... if I have a text file that has some default data that the user can modify inside the application. I plan to store this file in the folder pointed to GetpPrivateApplicationDataLocation(). However, is there a way to place a default file there while running the install?

Or would it be better to create the file on initial load with values that I have stored in a file in the plugin's data folder?

thx,
Ken
cryptik is offline   Reply With Quote
Old 12-02-2019, 19:12   #158
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,278
Re: OpenCPN PlugIn Development

Both these approaches are possible, depends only on your preference and amount of data.
It is pretty common with the plugins to store static data that is not going to be modified by the user under GetpSharedDataLocation() and in the case you describe I would probably do it as well and copy it to GetpPrivateApplicationDataLocation() on start if not yet present - that will also let you easily implement stuff like resetting everything to defaults on user request.
nohal is offline   Reply With Quote
Old 24-07-2019, 05:28   #159
Registered User

Join Date: Jul 2019
Posts: 5
Re: OpenCPN PlugIn Development

Quote:
Originally Posted by bdbcat View Post
Hello Developers and Testers...

The OpenCPN PlugIn Architecture, API Version 1.0 has been released for Beta discussion and test.

Design and Release Notes:
1. PlugIns are dynamically loaded libraries;
{name}_pi.dll for Windows
lib{name}_pi.so for linux.
2. Plugins are automatically detected when placed in the correct directory.
Windows: {Where OpenCPN is}\plugins ex: C:\Program Files\OpenCPN\plugins
linux: {prefix}/share/opencpn/plugins ex: /usr/local/share/opencpn/plugins
3. All detected, compatible PlugIns are loaded and initialized on application startup. We may want to develop a "PlugInManagerDialog" to allow selective loading...
4. Plugins are written in C++ and use the wxWidgets toolset. Interested developers are invited to consider other, more generic, toolsets and propose useful API extensions thereto. It should be possible to integrate with wxPython, for example...
5. The API is roughly defined in include/ocpn_plugin.h, found in the source tree. More verbage needed here.


I have created two PlugIns:

1. grib_pi
This is a PlugIn implementing the current GRIB overlay functionality. My alpha testing indicates that the functionality of GRIB in 2.1.0 is (almost) exactly duplicated. Full testing is required. Some developer(s) may wish to consider improved performance of this PlugIn. The code is fairly brutish in some places. Better caching and rendering are indicated.
I plan to release this PlugIn as part of opencpn Version 2.2.

This PlugIn does a lot of interesting stuff at the API level.
a. Toolbar Tool addition/management.
b. Toolbox Tab page addition.
c. Config file read/write.
d. Chart overlay rendering.
e. Private dialog management.
f. Mouse tracking.

Observant readers will note that this is exactly the functionality required for many chart overlay applications. Google KML file support is one. Some kind of Active Captain PlugIn is another candidate. Satallite radio weather....BlackBox radar...Others???
We could probably move AIS out to a PlugIn if we wanted to.

2. demo_pi
Demo_pi is, well, a demonstration. It can be used as the skeleton of a more advanced PlugIn development effort. I do not plan to release demo_pi in the next official 2.2 Release. It is for developer discussion and use only. It doesn't really do much, anyway.
Demo_pi exercises and demonstrates at least the following:
a. Private window creation.
b. NMEA data stream interception.
c. Context Menu item addition/management.

I expect demo_pi will be the basis wrapper for the much anticipated "dashboard" function that is our most popular request.

So, this is a start.
I am not smart enough to have anticipated all possible API requirements of a PlugIn. I expect as developers begin to actually consider writing PlugIns, we will have to add new methods, functions, and data types to the API specification. No problem with that. I hope we can stabilize the API for Version 2.2 release. We will make every effort to preserve backward compatibility where possible.

The PlugIn build process is a work-in-progress. Developer comments and improvements regarding the cmake scripts are encouraged.

I welcome spirited discussion of PlugIn development efforts here.
We will want separate threads for discussion of each PlugIn as each is ready for testing.

Good Luck
Dave
Hi,
Happy to see a plug in developer. I have recently joined in a company and they have assigned me a task to develop a new plug in which could be used in openCPN to plot/draw some shapes and move it in a certain speed.

The thing is that i am entirely new to this openCPN and wxWidgets, i don't know to do and also couldn't find any person/tutorial, which can help me.

I kindly request you to give me some guidlines to do this.
I will be grateful if you could provide me a simple plug( for drawing and moving that object) in for this.

Thanks,
Regards,
Jisha.
jishatomc is offline   Reply With Quote
Old 24-07-2019, 23:58   #160
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,375
Re: OpenCPN PlugIn Development

Jisha..
OpenCPN license makes all code available for all.
For a start check the manual: https://opencpn.org/wiki/dokuwiki/do...manual:plugins
Second read the code for OpenCPN and a plugin with functions close to your preferences. All plugin code locations can be found at each download page https://opencpn.org/OpenCPN/info/downloadplugins.html
Hakan is offline   Reply With Quote
Old 04-09-2019, 02:39   #161
Registered User

Join Date: Sep 2019
Posts: 2
Re: OpenCPN PlugIn Development

Hello guys.
I'm starting today with the development of a plugin for OpenCPN, but i know nothing about that... I've been searching for information but without success. My questions are: Where should i start? which platform should i use for the development. Do you know any place to obtain useful information besides opencpn.org.


Thank you!
danielopes02 is offline   Reply With Quote
Old 04-09-2019, 13:50   #162
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,999
Images: 2
Re: OpenCPN PlugIn Development

Use the OS you are familiar with. If it is Linux, you are in luck, compiling is pretty much build in. However you in any case refer to the Developer Manual where development environments for Windows and Linux are shown..



https://opencpn.org/wiki/dokuwiki/do...veloper_manual


If you have questions or problems, make your own thread, and ask questions.


Good luck.







Quote:
Originally Posted by danielopes02 View Post
Hello guys.
I'm starting today with the development of a plugin for OpenCPN, but i know nothing about that... I've been searching for information but without success. My questions are: Where should i start? which platform should i use for the development. Do you know any place to obtain useful information besides opencpn.org.


Thank you!
rgleason is offline   Reply With Quote
Reply

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
New Marina Development in China GordMay Pacific & South China Sea 4 29-09-2009 05:33
New Battery Research & Development BlueSovereign Electrical: Batteries, Generators & Solar 7 31-07-2009 15:47
Nautical Development 39 (Morgan 39?) riptide Monohull Sailboats 1 22-07-2009 12:53
Turks and Caicos Development Petition Canibul Atlantic & the Caribbean 5 24-04-2008 19:15

Advertise Here


All times are GMT -7. The time now is 22:01.


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.