Cruisers Forum
 


Join CruisersForum Today

Reply
 
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: On the go. Not in Prague.
Posts: 4,757
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: On the go. Not in Prague.
Posts: 4,757
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: On the go. Not in Prague.
Posts: 4,757
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
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



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 03:45.


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.