Cruisers Forum
 


Join CruisersForum Today

Closed Thread
 
Thread Tools Rating: Thread Rating: 4 votes, 4.75 average. Display Modes
Old 18-06-2009, 11:39   #181
Registered User

Join Date: Jun 2009
Location: Morbihan Brittany France
Boat: Hallberg Rassy 37
Posts: 64
Ubuntu Much better after some hack

Dave,

I spend most of my day hacking your code, I hope you'll not be to unhappy about the mess I created .

I solved gpsd issue, by removing low level socket processing and replacing it with gpsd-client hight level library. While I don't especially like their API, I think that it is the best way to make sure your software to automatically support next version of gpsd. Don't you agree ? Using low level API might be an other option, but I did not try that path. This being said having gpsd as a daemon handle super user using for access to /dev/ttyUSB0 very nicely and allow opencpn to run without root privilege. It also allows more than one application to use simultaneously a share gps (if ever this could be useful on a boat ???).

Diging GPSd source code, I find that they have an NMEA emulation mode "n" command. Nevertheless as "w+" is the recommended one I stick on their recommendation. At the end of the day parsing one or the other message is more or less equivalent.

wx-widget bug/limitation. The hardest problem came from with wx-widget, when parsing float it make the accemption that they should conform to local language. I'm French and for us it is not "5.025" but "5,025" . Obviously when wxstring.ToDouble receives "5.05" on a French computer it refuses it. The only hack I found was to "unset LANG" environment variable before starting opencpn. I'm sure that placing the right "wxlocale" call at the right place should fix this, but I spend few hours and miserably failed.

About the graphic, the bug still exist . Even though after my hack on nmea.cpp is disappear . I found out a memory violation during some of my test, unfortunately your code does not run with electicfence malloc debugger and I was not able to find the problem.

Conclusion: your last CVS version did not solve my graphic problem, but since I hack nmea.cpp the probleme is not visible anymore .
1st image is cvs installation before any change.
2nd image the same but after my hack
3rd image CM93 load after adding my GPSD ack (why does it work ???)

My hack is available from:
__________________

__________________
fulup is offline  
Old 18-06-2009, 14:34   #182
Registered User

Join Date: Jun 2009
Location: Morbihan Brittany France
Boat: Hallberg Rassy 37
Posts: 64
I think I get the answer for Linux graphic problem.

As said in my previous post, I found that string->float convention routine used by opencpn (wxstring.ToDouble) can fails whenever your system is not set for English locale. In fact any language that uses ',' as decimal punctuation will fail (French, German, ...)

Here after two images with the same config, the same computer, the same maps, ... the only difference is that:
  • one as LANG=fr_FR.UTF-8 (default for Ubuntu in France)
  • one second one I unset LANG to shift back to English before starting opencpn.
As you can see, it is clear that LANG creates a problem far biger than GPSd interpretation (what I thought previously). As those wxstring->float conversion routine are use in many different places, it is far easier to "unset LANG" before launching opencpn, than try to fix it up. Further more wxwidget version 3.0 should solve the problem with a new conversion routine wxstring.ToCDouble

Conclusion: French, German, ... if you get the blue screen of death . Do not forget to "unset LANG" before starting opencpn. Or use a small shell script like following one:

#!/bin/sh
unset LANG
opencpn
__________________

__________________
fulup is offline  
Old 18-06-2009, 19:15   #183
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Fulup...

Congratulations. I think you got it!

This FR/DE language problem regarding the decimal character seems to have first appeared in Ubuntu Version 8 and later. So far, I cannot reproduce on Ubuntu 7. Did you see this on Ubuntu 7? Anyone using opencpn 1.3.0 on non-English Ubuntu Version 7?

We will have to do some thinking to figure out the "right" way to handle this problem until we reach wxWidgets Version 3. Here are some of the issues:

1. BSB raster charts will always (?) use "." in their header definitions.
2. Should opencpn configuration file, for example, use the locale character, or force the "." in strings such as "Lat = 45.0000", "PlanSpeed = 5.5", etc.
3. Same for SENC files. All(?) S57 ENCs use ".", I think....
Lots the consider.....

In the meantime, your workaround solution seems reasonable to me.

Regarding GPSD: I will study your code and return with comments.

Good job on the debugging!

Dave
__________________
bdbcat is offline  
Old 18-06-2009, 19:48   #184
Registered User
 
scotte's Avatar

Join Date: Apr 2007
Location: SF Bay Area, CA, USA
Boat: Privilege 39
Posts: 664
Sorry to be pedantic, but there is no Ubuntu "version 7" or "version 8". The version numbers look like 9.04 - which means 2009 (9) April (04). The reason this matters is that 8.04 is a way different beast than 8.10, and 9.10 will be significantly different than 9.04. And of course to add to the confusion there's the additional animal alliterations. Thanks!
__________________
scotte is offline  
Old 18-06-2009, 19:59   #185
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
Scotte...

Right. OK. What I meant to communicate is a time reference.

So..
Is anyone using opencpn on non-English Ubuntu before 8.04 ?
And I abjure the animal references. Way too confusing for me.

Thanks for the correction.
Dave
__________________
bdbcat is offline  
Old 19-06-2009, 02:34   #186
Registered User

Join Date: Jun 2009
Location: Morbihan Brittany France
Boat: Hallberg Rassy 37
Posts: 64
Linux LANG issue

Scotte...

What ever Linux version you use, the "unset LANG" will work
. It might be useless, but it cannot hurt. This until opencpn does not have locale translation .

In fact I tried to "unset" it directly in opencpn code, but unfortunately wxwidget main is hidden and wxlocale is set before you get the opportunity to change it. I have nevertheless no doubt that it could be changed with the right call to wxlocale function, but I'm not an wx.... expert and all my tries fail.

The best waiting option might be to retrieved wxstring.ToCDouble from 3.0 cvs tree and stick it to opencpn code.
__________________
fulup is offline  
Old 19-06-2009, 03:21   #187
Registered User

Join Date: Jun 2009
Location: Morbihan Brittany France
Boat: Hallberg Rassy 37
Posts: 64
Solved: LANG/float conversion forcing '.' as separation.

Good news, adding setlocale(LC_NUMERIC,"C"); at application startup method works .

While I still fail to understand how to use wxLocale, or change locale after startup time, when doing it right at application init method it works .

Conclusion: Add line (~524) of chart1.cpp first line of MyApp::OnInit method.
//Fulup force floating point to use dot as separation.
setlocale(LC_NUMERIC,"C");
Then any wxstring.ToDouble uses '.' in place of ',' even if LANG is set to French language.

Cool isn't it ?
__________________
fulup is offline  
Old 19-06-2009, 12:53   #188
EOB
Registered User

Join Date: May 2009
Location: Niterói - RJ - Brasil
Posts: 11
I have the same graphics problems using Debian 5.01 64bits non-english, compiled using wx libraries from debian repository. When I install wxWidgets 2.8.10, I couldn't compile.
I got a lot of wxstrings errors!!!!!!

To Dave...

As you see in fulup´s images the WVS only appears in north hemisphere...
and I notice because I live in south!

In wvschart.cpp, WVSChart::RenderViewOnDC, I comment
if(lat_min < 0)
lat_min = 0;
and seems to work. The code above that apparently need some attention.

Best regards

Eloi Barros
__________________
EOB is offline  
Old 19-06-2009, 14:15   #189
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
Having a Google Earth option in OpenCPN would be a great asset, for close-up assessment prior to arrivals in port. I look forward to see the new version.
Good job Dave...
__________________
sinbad7 is offline  
Old 19-06-2009, 15:10   #190
Registered User

Join Date: Jun 2009
Location: Morbihan Brittany France
Boat: Hallberg Rassy 37
Posts: 64
New feature for next version

Dave,

As I'm afraid your weekend could be too long and boring, here an idea for yet an other new feature for 1.3.2 .

New zoom with mouse's wheel is great , but when switching from one chart to an other one, you loose zoom adjustment. It would be great if opencpn could remember current zoom independently for each chart. Then when navigating in between many charts for one given zone, you would not have to readjust zoom value, after each chart selection.

I personally mostly use CM93 charts, but sometime to double check a detail I shift temporally to SHOM/BBS and then return to CM93, this is exactly when my zoom preference disappear .
__________________
fulup is offline  
Old 19-06-2009, 16:04   #191
Senior Cruiser
 
sinbad7's Avatar

Cruisers Forum Supporter

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,717
Images: 57
Send a message via Skype™ to sinbad7
I don't want to delay the issue of v. 1.3.2 , BUT, I would be grateful if the following issues could be fixed:
1. Reading and displaying AIS targets
2. Reading and displaying ARPA targets (NMEA data)
3. A listing of ship names within the geographical parameters of the map.
4. Only accepting data within the maps geographical parameters. Or, alternatively within a 200 nm radius of the centre of the map. This will enable users to also connect to existing AIS networks via IP and Port.
__________________
sinbad7 is offline  
Old 20-06-2009, 04:03   #192
Senior Cruiser
 
idpnd's Avatar

Cruisers Forum Supporter

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,551

Mouse wheel zoom? Excited!! Are you compiling from CVS?
__________________
idpnd is offline  
Old 20-06-2009, 21:23   #193
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 4,883
For EOB....

I would like to see a copy of your build log with lots of string errors. Maybe we can help. You could email to me, if convenient.

You are absolutely right about southern latitudes in WVS charts. Your solution is right on target. I have implemented it substantially as you suggest.

Check out the latest CVS source for this, and other changes to WVS code.

Thanks for the help
Dave
__________________
bdbcat is offline  
Old 21-06-2009, 02:21   #194
Registered User

Join Date: Jan 2009
Location: Port Fréjus (France)
Boat: Etap 28i Wrenna III
Posts: 23
What I personally appreciate in OpenCPN is its simplicity. It loads very quickly, and it is not crammed with countless options which I don't even understand (I also use Maxsea with SHOM raster charts. I must know one hundredth of its possibilities.)
As far as I am concerned, adding too many features would not be a good idea, although a mouse wheel zoom would be great.
__________________
Wrenna is offline  
Old 21-06-2009, 03:36   #195
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,247
Free charts for OpenCPN

There are quite a few freely available charts to use with OpenCPN.
The first place to check is this site: Inland Waters Resources
Here you will find links to all US and Brazil charts and much more.
A list of European Inland water charts ( S57 vector charts ) has just been added, among them all Dutch Inland (and some coastal) waters.


Do you know of any other freely available charts?

Thomas
__________________

__________________
cagney is offline  
Closed Thread

Thread Tools
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




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

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


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

ShowCase vBulletin Plugins by Drive Thru Online, Inc.