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 18-02-2018, 03:58   #1381
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,223
Re: Weather Routing

Quote:
Originally Posted by stelian View Post
Pavel,

Please reread http://www.cruisersforum.com/forums/...ml#post2577601 where I explain how the boats and polar are copied over the user's directory on the first invocation. If the user already used WR, the directory will exist and the file will not be copied. This is not a problem per se (the plugin will still work correctly), but could confuse newcomers (we provide a "default" configuration in order to help them !).

Maybe there is a more intelligent way of doing this...

As for opencpn.conf/ini I don't believe it is necessary to edit it by hand.


So all we need is to change the logic to check for existence of a file instead of a directory?
nohal is online now   Reply With Quote
Old 18-02-2018, 04:03   #1382
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 18
Posts: 323
Re: Weather Routing

Quote:
Originally Posted by nohal View Post
So all we need is to change the logic to check for existence of a file instead of a directory?
Sure, look at WeatherRouting.cpp:155

But which file or directory ?
stelian is offline   Reply With Quote
Old 18-02-2018, 04:17   #1383
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,223
Re: Weather Routing

Quote:
Originally Posted by stelian View Post
Sure, look at WeatherRouting.cpp:155

But which file or directory ?
OK, so we are not checking for existence of a directory, but existence of a single file, WeatherRoutingConfiguration.xml, now and based on that decide to copy or not everything.

And we want to change it to check every single item and copy it if it does not exist, right? Is it what resolves that "confusion to newcomers" and saves us that weird writing in the manual? Or is there also something else?
nohal is online now   Reply With Quote
Old 18-02-2018, 04:28   #1384
Registered User

Join Date: Jan 2018
Location: Gold Coast, Australia
Boat: Lagoon 500
Posts: 205
Re: Weather Routing

Hey guys - is there a way to abort the calculation of a weather route while it is in progress. I mistakenly entered a + longitude instead of a - longitude and the calculation was taking me on a "round the world tour" and taking forever to complete.

I am using OpenCPN for Mac and WR PI 1.11.0.

Thanks - Kevin
kevinvh is offline   Reply With Quote
Old 18-02-2018, 04:58   #1385
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,223
Re: Weather Routing

Quote:
Originally Posted by kevinvh View Post
Hey guys - is there a way to abort the calculation of a weather route while it is in progress. I mistakenly entered a + longitude instead of a - longitude and the calculation was taking me on a "round the world tour" and taking forever to complete.

I am using OpenCPN for Mac and WR PI 1.11.0.

Thanks - Kevin
Configuration -> Stop from the menu or Cmd-Z.
nohal is online now   Reply With Quote
Old 18-02-2018, 05:15   #1386
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,223
Re: Weather Routing

And when at it. Is everybody happy with the general location of these files?

Looking at https://github.com/seandepagnier/wea...ng_pi.cpp#L506, we end up with
  • C:\Documents and Settings\All Users\Application Data\opencpn\plugins\weather_routing on Windows - That certainly looks unfortunate to me.
  • ~/opencpn/plugins/weather_routing on Linux - Quite OK
  • ~/Library/Preferences/opencpn/plugins/weather_routing on macO - Also probably acceptable

But wouldn't it make more sense to put everything that the user may want to ever touch manually to wxStandardPaths::GetDocumentsDir?
nohal is online now   Reply With Quote
Old 18-02-2018, 05:44   #1387
Registered User

Join Date: Jan 2018
Location: Gold Coast, Australia
Boat: Lagoon 500
Posts: 205
Re: Weather Routing

Quote:
Originally Posted by nohal View Post
Configuration -> Stop from the menu or Cmd-Z.
Thank you - I missed that
kevinvh is offline   Reply With Quote
Old 18-02-2018, 05:57   #1388
Registered User

Join Date: Jan 2018
Location: Gold Coast, Australia
Boat: Lagoon 500
Posts: 205
Re: Weather Routing

Quote:
Originally Posted by nohal View Post
And when at it. Is everybody happy with the general location of these files?

Looking at https://github.com/seandepagnier/wea...ng_pi.cpp#L506, we end up with
  • C:\Documents and Settings\All Users\Application Data\opencpn\plugins\weather_routing on Windows - That certainly looks unfortunate to me.
  • ~/opencpn/plugins/weather_routing on Linux - Quite OK
  • ~/Library/Preferences/opencpn/plugins/weather_routing on macO - Also probably acceptable

But wouldn't it make more sense to put everything that the user may want to ever touch manually to wxStandardPaths::GetDocumentsDir?
For the Mac, the folder and file structures described in wxStandardPaths::GetDocumentsDir is exactly where I would expect to find everything.

Pavel, bye the way, I did a clean install of OpenCPN_4.8.2, GSHHG, Other user charts, Climatology-Plugin_1.2, Weather_routing-Plugin_1.11.0. Everything worked exactly as you have been saying. ~/Library/Preferences/opencpn/plugins/weather_routing etc and the weather routing example files were all created without manual intervention. The only items I added manually were my specific boat polars to the polars folder.

Don't know what went wrong for me previously.

Thanks - Kevin
kevinvh is offline   Reply With Quote
Old 18-02-2018, 06:00   #1389
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 18
Posts: 323
Re: Weather Routing

Quote:
Originally Posted by nohal View Post
And when at it. Is everybody happy with the general location of these files?

Looking at https://github.com/seandepagnier/wea...ng_pi.cpp#L506, we end up with
  • C:\Documents and Settings\All Users\Application Data\opencpn\plugins\weather_routing on Windows - That certainly looks unfortunate to me.
  • ~/opencpn/plugins/weather_routing on Linux - Quite OK
  • ~/Library/Preferences/opencpn/plugins/weather_routing on macO - Also probably acceptable

But wouldn't it make more sense to put everything that the user may want to ever touch manually to wxStandardPaths::GetDocumentsDir?
Isn't some OpenCPN global function for this ? Because this is something every plugin would want to have ?

On the other side these are not "documents" but "configurations" so it should be wxStarndardPath::GetUserDataDir()...

But why did Sean use #ifdefs for each platform ? Maybe some wxWidgets bug ?
stelian is offline   Reply With Quote
Old 18-02-2018, 06:07   #1390
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 18
Posts: 323
Re: Weather Routing

Quote:
Originally Posted by nohal View Post
OK, so we are not checking for existence of a directory, but existence of a single file, WeatherRoutingConfiguration.xml, now and based on that decide to copy or not everything.

And we want to change it to check every single item and copy it if it does not exist, right? Is it what resolves that "confusion to newcomers" and saves us that weird writing in the manual? Or is there also something else?
This is the simplest way of dealing with it, but it would potentially require some time at each launch (there are quite a few polars, and we will end up by testing each one, each time we open WR)

Moreover, I don't really like this: if I choose to remove some boats/polars from my configuration, I don't want WR to come and put the files again in there. It's minor, but still not pleasant.

I think the real solution (but not very easy to code) is to:
- not copy the polars or boats or configuration at first invocation
- add a button or a menu item saying "Add default configuration" and when this is clicked copy the xml and boats/polars used by the sample configuration to the user directory (this is for newcomers)
- when choosing a boat / polar, use the read/only one from the system directory as long as it is not modified, but if the user chooses to modify something, save the modified file into the user directory, and use this copy instead of the original one.

Stelian.
stelian is offline   Reply With Quote
Old 18-02-2018, 06:37   #1391
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,223
Re: Weather Routing

Quote:
Originally Posted by stelian View Post
This is the simplest way of dealing with it, but it would potentially require some time at each launch (there are quite a few polars, and we will end up by testing each one, each time we open WR)

Moreover, I don't really like this: if I choose to remove some boats/polars from my configuration, I don't want WR to come and put the files again in there. It's minor, but still not pleasant.

I think the real solution (but not very easy to code) is to:
- not copy the polars or boats or configuration at first invocation
- add a button or a menu item saying "Add default configuration" and when this is clicked copy the xml and boats/polars used by the sample configuration to the user directory (this is for newcomers)
- when choosing a boat / polar, use the read/only one from the system directory as long as it is not modified, but if the user chooses to modify something, save the modified file into the user directory, and use this copy instead of the original one.

Stelian.
  • Menu item will as usually not be found by the users (They actually way too often do not find the whole menu at all). Read the post two above this one...
    The space is not unlimited, so adding a button for something I will use once in years is not very practical neither.
  • We are talking only about first launch after an upgrade, so any subsequent launches would not be affected at all as far as I can tell.
  • Wouldn't a simple "This is a first launch after an upgrade, do you want us to deploy the default files if not present?" dialog (If we wanted to be really nice a wxMultiChoiceDialog allowing the user to say which default data he/she wants to deploy) deal with your "I don't want WR to come and put the files again in there"?
nohal is online now   Reply With Quote
Old 18-02-2018, 09:51   #1392
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 18
Posts: 323
Re: Weather Routing

Quote:
Originally Posted by nohal View Post
  • Menu item will as usually not be found by the users (They actually way too often do not find the whole menu at all). Read the post two above this one...
    The space is not unlimited, so adding a button for something I will use once in years is not very practical neither.
Agree on this one.

Quote:
Originally Posted by nohal View Post
  • We are talking only about first launch after an upgrade, so any subsequent launches would not be affected at all as far as I can tell.
  • Wouldn't a simple "This is a first launch after an upgrade, do you want us to deploy the default files if not present?" dialog (If we wanted to be really nice a wxMultiChoiceDialog allowing the user to say which default data he/she wants to deploy) deal with your "I don't want WR to come and put the files again in there"?
This looks like the perfect solution indeed. But how could I detect this is the first invocation of this version of WR (or should I handle some ConfigVersion configuration in the plugin and not forget to increment it each time someone touches the default configuration / boats / plugins) ?
stelian is offline   Reply With Quote
Old 18-02-2018, 10:10   #1393
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,223
Re: Weather Routing

Quote:
Originally Posted by stelian View Post
[/LIST]This looks like the perfect solution indeed. But how could I detect this is the first invocation of this version of WR (or should I handle some ConfigVersion configuration in the plugin and not forget to increment it each time someone touches the default configuration / boats / plugins) ?
I would simply create a new integer configuration key. Read it with a default value of 0 if not present.
Then, at the moment the "upgrade" should potentially take place, compare with the current value of PLUGIN_VERSION_MAJOR * 100 + PLUGIN_VERSION_MINOR, if lower, store the new value and perform the upgrade logic, if equal or higher, do nothing.
nohal is online now   Reply With Quote
Old 18-02-2018, 11:05   #1394
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,690
Images: 2
Re: Weather Routing

It was a while ago that I tested this, but I believe I had to clean the ini of all wxrte aettings and references in order to get it to initialize.

Additionally, it might be better if the initial configurations were added to the current weatherroutingconfiguration.xml if the file exists in the user/plugin/weatherrouting directory.without overwriting prwvious configs.
rgleason is offline   Reply With Quote
Old 18-02-2018, 11:45   #1395
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 18
Posts: 323
Re: Weather Routing

Quote:
Originally Posted by nohal View Post
I would simply create a new integer configuration key. Read it with a default value of 0 if not present.
Then, at the moment the "upgrade" should potentially take place, compare with the current value of PLUGIN_VERSION_MAJOR * 100 + PLUGIN_VERSION_MINOR, if lower, store the new value and perform the upgrade logic, if equal or higher, do nothing.
Ok, I will be coding something along these lines in the next days.

Quote:
Originally Posted by rgleason
Additionally, it might be better if the initial configurations were added to the current weatherroutingconfiguration.xml if the file exists in the user/plugin/weatherrouting directory.without overwriting prwvious configs.
I look into this as well and see if it's simple enough to do.
stelian is offline   Reply With Quote
Reply

Tags
paracelle, weather


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
Yachts in transit - new system for weather, blogging, diving, walking tracking sail-fish Navigation 13 22-05-2016 15:57
SSB Weather info VirtualVagabond General Sailing Forum 8 15-01-2016 08:40
Optimum SSB/satphone combo setup tulsag Marine Electronics 33 30-04-2012 07:19
MaxSea Weather Routing svrevelations Weather | Gear, Reports and Resources 12 10-10-2011 01:08
Sea Myths and Sayings Mariners The Sailor's Confessional 5 29-09-2011 13:51

Advertise Here


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


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.