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 26-11-2021, 08:04   #1
Registered User

Join Date: May 2012
Posts: 1,231
opencpn.ini Configuration File

mea culpa ...

For some time I have been polluting this file by using [Settings/xxx_pi] to hold the settings, for some of the plugins I have made.

imo [Settings] should have the core OpenCPN settings and the plugin settings should be under [PlugIns] (Capital I).

As plugins are being updated I will be using [PlugIns/xxx_pi] for the settings for those plugins.

After doing a parallel installation for the new version of OpenCPN and upgrading the master catalog you may find two sections [Settings/xxx_pi] and [PlugIns/xxx_pi]. You may want to remove the [Settings/xxx_pi] section to ensure the settings you choose appear in the plugin correctly.

Mike
Rasbats is offline   Reply With Quote
Old 26-11-2021, 10:54   #2
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,309
Re: opencpn.ini Configuration File

Mike..
I may agree about your logic discussion.
But..

Most users wont know how to manage the config file. And, not less, read, or understand, messages here on the forum.
If what you say above is important for any function I think the plugin itself has to maintain what's needed in the config file. We can't trust any user would clean up.
Hakan is offline   Reply With Quote
Old 26-11-2021, 12:18   #3
Registered User

Join Date: May 2012
Posts: 1,231
Re: opencpn.ini Configuration File

Is there a way for the plugin to remove a section in the config file? If not maybe things should be left as they are. Good intentions????

Mike
Rasbats is offline   Reply With Quote
Old 26-11-2021, 13:07   #4
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,309
Re: opencpn.ini Configuration File

You're most probably correct. No way for a plugin to delete a setting. If they not interfere with the "new" plugin we may have to just leave them or, if of any value, set the value to "emptystring"
Hakan is offline   Reply With Quote
Old 26-11-2021, 19:14   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,808
Images: 2
Re: opencpn.ini Configuration File

If the old section is defunct and cant be removed doesnt really causemuch of a problem does it? If the values can be emptied that would be good. When the user renames or removes ini the the settings version will disappear.
rgleason is offline   Reply With Quote
Old 26-11-2021, 22:52   #6
Registered User

Join Date: Feb 2012
Location: Austria
Posts: 320
Re: opencpn.ini Configuration File

Probably the best would be to include a cleaning of the ini file in the save/recover template function.
skipperearly is offline   Reply With Quote
Old 27-11-2021, 04:05   #7
Registered User

Join Date: May 2012
Posts: 1,231
Re: opencpn.ini Configuration File

@Antipole2 pointed me to:
Code:
pConf->DeleteGroup ( "/Settings/xxx_pi" );
Mike
Rasbats is offline   Reply With Quote
Old 27-11-2021, 06:02   #8
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,808
Images: 2
Re: opencpn.ini Configuration File

Is this for the javascript plugin? Where is that I haven't seen it in PIM?
rgleason is offline   Reply With Quote
Old 27-11-2021, 06:56   #9
Registered User

Join Date: May 2012
Posts: 1,231
Re: opencpn.ini Configuration File

@Antipole2 JavaScript_pi v0.5 ...

Not in PIM yet.
My fork with CI updates:
https://github.com/rasbats/JavaScript_pi/tree/v0.5

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

Join Date: Mar 2011
Posts: 745
Re: opencpn.ini Configuration File

Mike,

DeleteGroup is a wxConfig method.

Here is a link

In your case, for something like your shipdriver plugin it might be something like
Code:
if (pConf->HasGroup(_T("/Settings/ShipDriver_pi"))) {
    //Read the existing settings
    ....
    pConf->DeleteGroup(_T("/Settings/ShipDriver_pi"));
}
Good luck...
stevead is offline   Reply With Quote
Old 27-11-2021, 10:56   #11
Registered User

Join Date: May 2012
Posts: 1,231
Re: opencpn.ini Configuration File

Thanks Steve.
Rasbats is offline   Reply With Quote
Old 27-11-2021, 17:12   #12
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,808
Images: 2
Re: opencpn.ini Configuration File

Quote:
Originally Posted by Rasbats View Post
@Antipole2 JavaScript_pi v0.5 ...

Not in PIM yet.
My fork with CI updates:
https://github.com/rasbats/JavaScript_pi/tree/v0.5

Mike

Thanks Mike, ...lots of moving parts, I know.
rgleason is offline   Reply With Quote
Reply

Tags
enc, opencpn


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
OpenCPN ignoring CurrentArrowScale and TideRectangleScale in opencpn.ini _QB_ OpenCPN 3 09-11-2021 22:32
Can’t find .ini file, XP ron ll OpenCPN 5 17-09-2018 18:01
opencpn.ini file possible bug rslotpole OpenCPN 1 20-06-2017 21:06
opencpn.ini file rslotpole OpenCPN 6 20-06-2017 13:59
OpenCPN.ini bug in 3.3.719 fgd3 OpenCPN 4 09-08-2013 11:15

Advertise Here
  Vendor Spotlight
No Threads to Display.


All times are GMT -7. The time now is 08:26.


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.