Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 19-02-2011, 03:20   #1
Registered User

Join Date: Feb 2010
Posts: 619
Organizing Nav Objects into Layers

Quite often I've been using OCPN nav objects just to annotate charts.

I used tracks to draw Traffic Separation Schemes, Prohibited Areas and Firing Ranges (all equally important as shoreline) as well as outlines and status of paper charts making up Forums - Post 458229">various-IRJDSUNE9932123321222xxeww-folios .

I used routes to draw lat/lon grids.

I used waypoints to update charts with new nav marks and dangers as per Notices to Mariners, and to add Radio Call-In Points or to build a database of lights and locations, that I want to see on chart regardless of current scale.

Technically, all of these are standard nav objects to OCPN. About the only difference I want is their persistence and protection from change.

So, after some tweaking, the Route Manager gets a new tab - Layers. Anything imported into a Layer

- is not deletable
- is not modifiable

Objects created in Layers are not subject to Delete (incl. Delete All), Export nor are they saved into navobj.xml upon program termination.

Extended control allows (still to-do) selective show/hide on chart and in general nav objects listing, and deletion on a per-layer basis.

A Layer is a single GPX file, that can be prepared offline by any means.

In addition to a standard set of layers imported during startup from the /Layers subdirectory layers can be imported just for the current session by specifying a file in RM Dialog.

I still have to implement some of the buttons, but it starts to look quite promising.
Attached Thumbnails
Click image for larger version

Name:	layers_sample.jpg
Views:	287
Size:	133.4 KB
ID:	23942  
PjotrC is offline   Reply With Quote
Old 19-02-2011, 03:56   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,197
So simple and so useful Can't wait for the patch.

Pavel
nohal is online now   Reply With Quote
Old 19-02-2011, 12:00   #3
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
PjotrC..

Excellent idea! I have in the past entered many sea markers on various charts but somehow they got lost/deleted.

I also found that the positions change when you change scales or change maps..

Could we not also add a better IALA range of transparent sea markers and lights selectable from within the menu of layers. for both IALA A and IALA B areas.

How is the patch added for us with Windows ops?

Thank you for great ideas...

Tore
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 19-02-2011, 12:57   #4
Registered User
 
sinbad7's Avatar

Join Date: Sep 2003
Location: Ubatuba,SP,Brazil (Ex Norway)
Boat: (Ex) Alu. 60' yacht-"Eight Bells"
Posts: 2,731
Images: 57
Send a message via Skype™ to sinbad7
PjotrC..

These are the IALA sea marks I would like to see in OpenCPN in transparent modus.

Tore
Attached Thumbnails
Click image for larger version

Name:	IALA markers.png
Views:	243
Size:	48.7 KB
ID:	23961  
__________________
"And all I ask is a tall ship and a star to steer her by."
sinbad7 is offline   Reply With Quote
Old 20-02-2011, 17:03   #5
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,197
Tore,
if you don't want to build from source (Compiling - Windows | Official OpenCPN Homepage - pretty easy once you succeed for the first time ) this patch will for sure make it to my personal set so I can provide you the binary I compile for my own purposes before the new features make it into an official release.

Regarding the transparent markers - what's the problem with making a transparent XPM and placing it in the UserIcons subfolder as shown on the attached screenshot? Or did I understand wrong what you mean?

Pavel

P.S. I don't have all the icons to share, just cropped the topmost one from your image, saved as transparent PNG with Paint.NET and issued
Code:
convert mfl.png mfl.xpm
- ImageMagick for Windows (and of course all the other platforms) available at ImageMagick: Install from Binary Distribution
Attached Images
 
nohal is online now   Reply With Quote
Old 21-02-2011, 02:42   #6
Registered User

Join Date: Feb 2010
Posts: 619
First Layers Release Candidate

Attached is the working prototype of layers handling code, based at 2.3.1 1228.

I post it here, rather than to flyspray, since I expect perhaps some testing feedback before final integration.

Still to do:

- save/restore the state of layers visibility upon restarting OCPN. For this I shall wait until all functionality is frozen.
- fix deleting layers while a relevant Route or Wpt Properties Dialog is open... (I think also without Layers this is not always OK)

There is one bug, not directly related to layers, occuring when performing SetInvisible on tracks built with colors (i.e. having some non-default <sym> inside). I hope to fix that separately.

Otherwise it seems to work, and looks quite useful...

Testing feedback much appreciated.

Piotr
Attached Files
File Type: doc 0001-First-layers-release-candidate.zip.doc (10.9 KB, 83 views)
PjotrC is offline   Reply With Quote
Old 21-02-2011, 07:02   #7
Registered User
 
sailorF54's Avatar

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 999
Re: Organizing Nav Objects into Layers

can't test, but your description does....rock...
sailorF54 is offline   Reply With Quote
Old 21-02-2011, 07:37   #8
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,197
Re: Organizing Nav Objects into Layers

Piotr,
thanx for the code, attached is a small fix for a crash when no layers exist.
Will be back when I play with it a bit more.
Do you have your code in some public repository? Patching stuff on e.g. github is a bit more convenient and "flexible" than in a forum thread and at least mine and balp's opencpn code is already hosted there

Pavel
Attached Files
File Type: doc nolayersfix.patch.doc (1.5 KB, 62 views)
nohal is online now   Reply With Quote
Old 21-02-2011, 08:09   #9
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,197
Re: Organizing Nav Objects into Layers

Windows victims,
if you want to play with this feature, I've uploaded the compiled executeble at opencpn.exe - 4shared.com - online file sharing and storage - download
Try to replace the opencpn.exe in your installation folder. I hope it should work but of course can't give any warranty as my machine is definitely not an ordinary user's computer...
If it does not, I'm sorry, just throw it away and get back to the official executable of which I recommend to keep a backup

Pavel
nohal is online now   Reply With Quote
Old 21-02-2011, 08:45   #10
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: Organizing Nav Objects into Layers

Hai Pjotr,
I did give it a try:
Unfortunally OCPN crashed when opening the routemanager.
Then I also applied your previous patch 0001-Routeplan-with-Time-Tide-no-VMG-nor-ETD-per-leg.patch, but this gave me an compile error.
[ 53%] Building CXX object CMakeFiles/opencpn.dir/src/routeprop.cpp.o
/home/dirk/opencpn/GitOpenCPN/opencpn/src/routeprop.cpp: In member function 'void RouteProp::SetRouteAndUpdate(Route*)':
/home/dirk/opencpn/GitOpenCPN/opencpn/src/routeprop.cpp:605: warning: unused variable 'LMT_Offset'
/home/dirk/opencpn/GitOpenCPN/opencpn/src/routeprop.cpp: In member function 'bool RouteProp::UpdateProperties()':
/home/dirk/opencpn/GitOpenCPN/opencpn/src/routeprop.cpp:847: error: invalid conversion from 'const char*' to 'wxChar'
/home/dirk/opencpn/GitOpenCPN/opencpn/src/routeprop.cpp:847: error: initializing argument 1 of 'int wxString::Find(wxChar, bool) const'

I'm working with Gentoo and a 2.6.37 kernel
Pls keep on going.
grjes
Dirk
rooiedirk is offline   Reply With Quote
Old 21-02-2011, 08:52   #11
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,197
Re: Organizing Nav Objects into Layers

Dirk,
the routemanager crash should be fixed by the patch i posted earlier. Just apply it over the Pjotr's one.
Haven't looked at the other patch yet.

Pavel
nohal is online now   Reply With Quote
Old 21-02-2011, 08:56   #12
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Organizing Nav Objects into Layers

Starting with a pure 2.3.1 applying first PjotrCs patch then nohals patch I get a clean compile on kubuntu 10.10. No crash when openong the layers tab. Now for some exploring.....

Thomas
cagney is offline   Reply With Quote
Old 21-02-2011, 09:43   #13
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Organizing Nav Objects into Layers

I get a crash when using the import button in the Layer tab.
"Importing" the same gpx file with "Add Layer" works fine.
Shouldn't "importing" in the Layer tab "add a layer"?

Thomas
cagney is offline   Reply With Quote
Old 21-02-2011, 10:11   #14
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,197
Re: Organizing Nav Objects into Layers

Thomas,
the Import/Export buttons are actually not tab specific, the attached patch restores their original functionality (the code looks like Pjotr intended to do so, just forgot to add some checks later so the import was actually not working at all)
Do we want to change that behavior? I think we don't as then we might have to import just the waypoint part of the gpx on the waypoint tab etc. to stay consistent (I see a lot of problems...).
I personally prefer the solution where Import/Export has nothing to do with the Layers tab (but maybe we should disable those buttons when this tab is selected)

Pavel
Attached Files
File Type: doc importfix.patch.doc (2.9 KB, 67 views)
nohal is online now   Reply With Quote
Old 21-02-2011, 10:37   #15
Registered User

Join Date: Feb 2010
Posts: 619
Re: Organizing Nav Objects into Layers

I have very poor bandwidth now, but the code seems to be in very good hands...

I was wondering, whether to allow more than a single file into a layer - a directory, maybe ? But.. open layer... import* close layer... ? Probably I was just lazy...

Also, time will come for optimizing the compute-cycles.

Cheers,

Piotr
PjotrC 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
Organizing the Cats by Performance Sand crab Multihull Sailboats 68 28-02-2011 13:51
Organizing 12vdc Distribution Panel SV Demeter Electrical: Batteries, Generators & Solar 45 12-12-2010 09:20
What Are the Objects that Display . . . Gilletarom OpenCPN 47 08-09-2010 15:01
Are Ten Layers of Fiberglass Strong? goldbeard Construction, Maintenance & Refit 18 14-04-2010 08:05

Advertise Here


All times are GMT -7. The time now is 14:00.


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.