Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

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-12-2017, 21:36   #16
Registered User

Join Date: Mar 2016
Location: San Francisco
Boat: Morgan 382
Posts: 3,246
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by stelian View Post
In your boat XML file I see this:
CrossOverPercentage="-2147483648"

Obviously this is incorrect, go in "Edit boat" -> "Crossover..." and set the percent to something sensitive (even 0 is OK). After that, your routing will complete.
I am back from my trip to Bodega, and changing CrossOverPercentage fixed the issue. I'm curious how it happened. I did play with the crossover screen trying to figure out what it did, and must of changed it. But it shouldn't allow invalid numbers like that. I certainly didn't type in that large negative number anywhere.

Do I understand that Crossover percentage is related to how much better a new polar should be before changing to it? For example, given a polar for a 130 and a 100, if the conditions are such that they perform similar, instead of changing sails back and forth, stay with whatever you are using until one or the other is clearly better. A percentage of 1 would change sails right away, a percentage or 15 would wait a while. Is that correct?
wholybee is offline   Reply With Quote
Old 12-12-2017, 02:31   #17
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by wholybee View Post
I am back from my trip to Bodega, and changing CrossOverPercentage fixed the issue. I'm curious how it happened. I did play with the crossover screen trying to figure out what it did, and must of changed it. But it shouldn't allow invalid numbers like that. I certainly didn't type in that large negative number anywhere.
Glad it worked. This is clearly a bug in the GUI, I'll look into it when I'll have some spare time...

Quote:
Originally Posted by wholybee View Post
Do I understand that Crossover percentage is related to how much better a new polar should be before changing to it? For example, given a polar for a 130 and a 100, if the conditions are such that they perform similar, instead of changing sails back and forth, stay with whatever you are using until one or the other is clearly better. A percentage of 1 would change sails right away, a percentage or 15 would wait a while. Is that correct?
Looking at the source code, it appears that the crossover percentage is simply used to choose which polar performs better given the current wind:
double speed = Polars[p].Speed(H, VW, true)*(1+Polars[p].m_crossoverpercentage);

If the calculated 'speed' using the formula above is better then the polar is used.
stelian is offline   Reply With Quote
Old 12-12-2017, 03:59   #18
Registered User
 
NahanniV's Avatar

Join Date: Mar 2011
Location: Nova Scotia Canada
Boat: Wharram Tiki 46
Posts: 1,321
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by rgleason View Post
It should not do that. Would you please give me a screenshot blowup of your settings for grib and climatology? Thanks.
OK, see below. But, I think it might be simpler than you are thinking: It happens when there are NO GRIBS. Trying to use Climatology only. Climatology loads, then GRIB loads and OpenCPN crashes.

Quote:
Originally Posted by rgleason View Post
Are you using the Irma grib file and the downloaded configuratiions?
The crash happens when there is NO GRIB file, I'm trying to get a route based on historical data only. Not a very likely use case, but possible when you want to try a Configuration (Route) that you plan to do in the future.
Attached Thumbnails
Click image for larger version

Name:	Weather Routing Crash.jpg
Views:	137
Size:	402.4 KB
ID:	160413  
__________________
Cheers,
JM
nahannivatsea.blogspot.ca
NahanniV is offline   Reply With Quote
Old 12-12-2017, 04:59   #19
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by NahanniV View Post
OK, see below. But, I think it might be simpler than you are thinking: It happens when there are NO GRIBS. Trying to use Climatology only. Climatology loads, then GRIB loads and OpenCPN crashes.
Yeah, I can reproduce this on Linux too (and I don't even have the climatology plugin installed):
*** opencpn (wxWidgets 3.0.3) crashed ***, see backtrace!
0x5584e93b8189 in wxCrashPrint::Report() at ??:0
0x7f4b56a7b27c in at ??:0
0x7f4b54322150 in at ??:0
0x7f4b2bafd635 in at ??:0
0x7f4b2bacec66 in at ??:0
0x5584e92ec6a9 in PlugInManager::SendMessageToAllPlugins(wxString const&, wxString const&) at ??:0
0x5584e92f04a2 in SendPluginMessage at ??:0
0x7f4b30221eb0 in RouteMapOverlay::RequestGrib(wxDateTime) at ??:0
0x7f4b301c382d in WeatherRouting::OnComputationTimer(wxTimerEvent&) at ??:0
0x7f4b56aa47ee in wxEvtHandler::ProcessEventIfMatchesId(wxEventTable EntryBase const&, wxEvtHandler*, wxEvent&) at ??:0

If I open the grib plugin manually (click on the grib icon) it says "no valid grib file"

Stelian.
stelian is offline   Reply With Quote
Old 12-12-2017, 05:24   #20
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by stelian View Post
Yeah, I can reproduce this on Linux too.
Bug is in grib plugin, fix below:

Code:
diff --git a/plugins/grib_pi/src/GribUIDialog.cpp b/plugins/grib_pi/src/GribUIDialog.cpp
index 102348b6..b009d4d8 100644
--- a/plugins/grib_pi/src/GribUIDialog.cpp
+++ b/plugins/grib_pi/src/GribUIDialog.cpp
@@ -1322,6 +1327,8 @@ wxDateTime GRIBUICtrlBar::MinTime()
 
 GribTimelineRecordSet* GRIBUICtrlBar::GetTimeLineRecordSet(wxDateTime time)
 {
+    if (m_bGRIBActiveFile == NULL)
+        return NULL;
     ArrayOfGribRecordSets *rsa = m_bGRIBActiveFile->GetRecordSetArrayPtr();
 
     if(rsa->GetCount() == 0)
stelian is offline   Reply With Quote
Old 12-12-2017, 07:37   #21
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,808
Images: 2
Re: Can't get rid of Polar Failed Error

Grib_pi failure
John and Stelian, Thank you!! I think this might have been plaguing me too and I had gotten used to it and was trying to get other things done with the plugin. Stelian, is the fix in your github, and have you made a PR or should I just recompile?
Should we make a new Task in Tracker with Stelian's notes? or put it under OpenCPN Issues on github?

WxRoute crossover
Stelian, Wholybe & John once again you guys are getting thing straightened out! Thank you. Is this in your github repos stelian?
Shouldn't there be Range Checking for user entry?

Definition of Crossover Percent
The crossover percentage [boat speed] is simply used to choose which polar performs better by the user %, given the current wind:
double speed = Polars[p].Speed(H, VW, true)*(1+Polars[p].m_crossoverpercentage);
If the calculated 'speed' using the formula above is better then the polar is used. (This is intended to reduce sail changes.)

Installation changes for files
Stelian, I have not looked at the plugin and cmake yet re this issue, but do you think it is possible to direct the exe to install the data files in the USER directory so it has read write privileges (for Windows that would be c:\programdata\opencpn\plugins\weather_routing) and get all the paths in the plugin set properly to the proper directories?
rgleason is offline   Reply With Quote
Old 12-12-2017, 08:20   #22
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by rgleason View Post
Grib_pi failure
John and Stelian, Thank you!! I think this might have been plaguing me too and I had gotten used to it and was trying to get other things done with the plugin. Stelian, is the fix in your github, and have you made a PR or should I just recompile?
Should we make a new Task in Tracker with Stelian's notes? or put it under OpenCPN Issues on github?
I've put this on a branch in my github and made a pull request: https://github.com/OpenCPN/OpenCPN/pull/919

Didn't opened an issue on either github or tracker though...

Quote:
Originally Posted by rgleason View Post
WxRoute crossover
Stelian, Wholybe & John once again you guys are getting thing straightened out! Thank you. Is this in your github repos stelian?
Shouldn't there be Range Checking for user entry?
It should of course have a range check. I didn't look at this yet...

Quote:
Originally Posted by rgleason View Post
Definition of Crossover Percent
The crossover percentage [boat speed] is simply used to choose which polar performs better by the user %, given the current wind:
double speed = Polars[p].Speed(H, VW, true)*(1+Polars[p].m_crossoverpercentage);
If the calculated 'speed' using the formula above is better then the polar is used. (This is intended to reduce sail changes.)
Useful addition to the documentation indeed.

Quote:
Originally Posted by rgleason View Post
Installation changes for files
Stelian, I have not looked at the plugin and cmake yet re this issue, but do you think it is possible to direct the exe to install the data files in the USER directory so it has read write privileges (for Windows that would be c:\programdata\opencpn\plugins\weather_routing) and get all the paths in the plugin set properly to the proper directories?
I have no idea on this, this question should be probably directed to someone with better knowledge of Windows/Windows installer abilities (my view on this, as a Linux user/developer, is that an installer for a system-wide application shouldn't be allowed to install files in a home directory - which home directory btw, since this is supposed to be a multi-user OS ? - and it should be the application itself who should create these files on the first invocation. <troll>But then again, maybe it's a bit different in Windows world where multi-user and security aren't so important</troll>).
stelian is offline   Reply With Quote
Old 12-12-2017, 08:47   #23
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,808
Images: 2
Re: Can't get rid of Polar Failed Error

Stelian, Thanks. Windows should be secure too, and is not so different from Linux in that respect. Something is amiss, because the plugin presently installs data files that the user has read/write access to from the plugin, into the Application directory (C:/programfiles (x86)/opencpn/plugins/weather_routing)!!!! -In this case windows users get errors when they try to save a file!!!

Does the installation of weather_routing do that same kind of thing with Linux?

There are other plugins such as Ocpn_Draw that save user data and allow read write and that installs fine. I wonder how that works internally?
rgleason is offline   Reply With Quote
Old 12-12-2017, 08:50   #24
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by stelian View Post
BTW: it looks like this plugin has the same issues regarding the saving of date/time in local format (mm/dd) as celestial_nav had. Since I'm in Europe, when I read wholybee's XML file I get August 12th instead of December 8th...
FWIW, I've fixed this (by saving all the dates and times in ISO format in the XML files) and sent a pull request to Sean.
stelian is offline   Reply With Quote
Old 12-12-2017, 08:55   #25
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by rgleason View Post
Stelian, Thanks. Windows should be secure too, and is not so different from Linux in that respect. Something is amiss, because the plugin presently installs data files that the user has read/write access to from the plugin, into the Application directory (C:/programfiles (x86)/opencpn/plugins/weather_routing)!!!! -In this case windows users get errors when they try to save a file!!!

Does the installation of weather_routing do that same kind of thing with Linux?

There are other plugins such as Ocpn_Draw that save user data and allow read write and that installs fine. I wonder how that works internally?
On Linux, the files that the user is allowed to write to (WeatherRoutingConfiguration.xml , <boat>.xml, <boat>.pol/csv) are located inside the user's home directory, and are not created by the installer but by the plugin itself. I believe both Linux and Windows are doing the same thing.

I believe your issue is a bit different, because you want to include pre-configured files in the distribution, to help newcomers. The problem is with these files not the plugin installer...
stelian is offline   Reply With Quote
Old 12-12-2017, 08:57   #26
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by stelian View Post
It should of course have a range check. I didn't look at this yet...
And it do have one, and it is working correctly on Linux (impossible to enter any value not between 0 and 100).

This is a Windows specific bug, will need to fire my virtual machine and try to reproduce it...
stelian is offline   Reply With Quote
Old 12-12-2017, 09:50   #27
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,808
Images: 2
Re: Can't get rid of Polar Failed Error

Very sorry Stelian, MS VC++ is a darn picky compiler, as we have learned from CelNav, it wants everything perfect.
rgleason is offline   Reply With Quote
Old 12-12-2017, 11:59   #28
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Ok, I have fixed the two Windows issues: the one which prevented the crossover charts to be displayed at all, and the one which caused an invalid value for the percentage to be saved into the Boat.xml file.

I pushed both fixed into my github master branch (https://github.com/stelian42/weather_routing_pi).

I also made another pull request to Sean, hope this will have more success than my celnav fixes...
stelian is offline   Reply With Quote
Old 12-12-2017, 13:53   #29
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,808
Images: 2
Re: Can't get rid of Polar Failed Error

Bravo!! Stelian.
Thank you.
I have not given up on getting Sean to merge those CelNav as that is what we are using!!! & I think he will once he focuses on it.

When you install weather_routing, from scratch, with a new opencpn.ini or with all the weather _routing settings taken out of opencpn.ini, where do all the data files land?
In Linux ?
In Windows? c:\programfiles (x86)\opencpn\plugins\weather_routing\data for me.
rgleason is offline   Reply With Quote
Old 13-12-2017, 00:40   #30
Registered User

Join Date: Mar 2017
Location: Brittany, France
Boat: First 30 (1976)
Posts: 324
Re: Can't get rid of Polar Failed Error

Quote:
Originally Posted by rgleason View Post
Bravo!! Stelian.
Thank you.
I have not given up on getting Sean to merge those CelNav as that is what we are using!!! & I think he will once he focuses on it.
Hurray ! Sean merged both the celnav and weather_routing changes this night.

Quote:
Originally Posted by rgleason View Post
When you install weather_routing, from scratch, with a new opencpn.ini or with all the weather _routing settings taken out of opencpn.ini, where do all the data files land?
In Linux ?
In Windows? c:\programfiles (x86)\opencpn\plugins\weather_routing\data for me.
In Linux, when you install the plugin, no files are created into the home directory (this is perfectly normal, because the installation is done as the superuser, and there might be several users on the system, each of them having its private home directory).

So the files get installed to "$PREFIX/share/opencpn/plugins/weather_routing_pi/data". In this folder you'll find "info.html", "WeatherRoutingInformation.html", and a "polars" folder containing all the polars (where $PREFIX is normally "/usr/" or "/usr/local").

When you activate the plugin for the first time and start using it, it will create a folder inside the user's home directory ("/home/USER/.opencpn/plugins/weather_routing/"), which will contain "WeatherRoutingConfiguration.xml", all the "BOAT.xml" files, and the "contours" folder related to the polars.

I believe the current behaviour is perfectly fine, except for the polars. When a user choose a polar, because he might later want to customize it, he needs to have write access to the file. I think the plugin should automatically copy the polar from the system directory inside the users directory.

There is also another issue, specific to your package, because you're offering a precustomized WeatherRoutingConfiguration.xml and associated files. I don't know if the Windows installer can be told to install those to the users directory. On Linux I'm sure this cannot be done. I think those files should be installed in the system directory (as of now), and the plugin itself would copy those files to the home directory on the first invocation.

Either that, or just tell the user: if you want an example, working setup, just copy all the files from c:\programfiles (x86)\opencpn\plugins\weather_routing\data\example \ to c:\programdata\opencpn\plugins\weather_routing\ . I think it's not too complex even for beginners.
stelian is offline   Reply With Quote
Reply


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
Zeus2 Not updatting but get "upgrade failed. Retry upgrade procedure" Fluenta Marine Electronics 6 22-11-2020 05:32
Can I get rid of this Thick Black Line in Vector charts? HappySeagull OpenCPN 2 22-01-2014 15:46
I Want to Get Rid of Some Cross Trimaran Brochures sww914 Classifieds Archive 0 31-05-2011 20:21
Polar View / Polar Com Digital Map Software tomj Navigation 1 17-05-2011 19:24
HELP! How to Get Rid of Gas Smell wristwister General Sailing Forum 6 29-04-2011 23:51

Advertise Here
  Vendor Spotlight
No Threads to Display.


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


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.