Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 20-02-2012, 14:33   #1
Registered User

Join Date: Jul 2011
Location: Droebak, Norway
Boat: Princess, 388, 40ft
Posts: 11
Custom Features

I have made some modifications to OCPN to satisfy my personal prefs:
Command line switch to able me to start two instances of OCPN with different config files. This enables me to have one window displaying an overview, next to the main window. Window size, location and other features is saved in the two config files. In addition I have made a switch to turn off the tool-bar as that is not needed in both windows.
Also I have made a mod to toggle course up via CTRL-C, and a mod CTRL-D to toggle the display modes listed in toolbox Rastercharts.
My mods are based upon beta code downloaded yesterday.
If any of this is of interest and not invented earlier, I can publish.
GIT is not my strong side though, so I would need some instructions on how to make the code available.

RGDS
Lasse
__________________

__________________
lurno is offline   Reply With Quote
Old 21-02-2012, 01:03   #2
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
Re: Custom features

Lasse...
The latest code can already be run in portable mode with -p command line switch (but no turning off of the toolbar etc.). I would also personally probably hesitated a lot before using shortcuts as notorious to do something as Ctrl-C.

If you cloned the repository and then just changed the code without doing anything else
Code:
git diff > mypatch.diff
Will produce the patch with all the changes to the codebase (except added files, if any). More in Git Community Book - Chapter 3 will make you a fluent git user in about 10 minutes.

It would actually be much more convenient if you could submit more smaller patches implementing certain features in flyspray as feature requests than one containing everything, called "allmymods.diff".

Thanks

Pavel
__________________

__________________
nohal is online now   Reply With Quote
Old 21-02-2012, 03:51   #3
Registered User

Join Date: Jul 2011
Location: Droebak, Norway
Boat: Princess, 388, 40ft
Posts: 11
Re: Custom features

nohal...
The reason I am in favour of the keyboard is the rocking of the boat, 40' motorized rocks a lot more than sail. hence use of the mouse i difficult.
I don't fully understand the use of the -p switch. I must be root here to run it.
Lasse
__________________
lurno is offline   Reply With Quote
Old 21-02-2012, 04:11   #4
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
Re: Custom features

Lasse...
the -p switch runs opencpn in portable mode - the config etc. is loaded from the local directory and not from the default location (on Linux user, on Windows system wide). Could you be more specific about the reasons why you have to be root to use it? Perhaps you tried to run it in a location where your current user couldn't write?

I support the idea of the keyboard shortcuts of course, I just said I myself try not to use the combinations totally notorious for having some function for something else when I write the code. Obviously just a question of personal preference.

Pavel
__________________
nohal is online now   Reply With Quote
Old 21-02-2012, 09:31   #5
Registered User

Join Date: Jul 2011
Location: Droebak, Norway
Boat: Princess, 388, 40ft
Posts: 11
Re: Custom Features

nohal...
Here is what I get when starting OCPN in terminal with -p switch.
Also with this switch on, it does not find the maps.


17:17:00 CET: 2012-02-21
17:17:00 CET: -------Starting opencpn-------
17:17:00 CET: Version 2.6.1310 Build 2012-01-10
17:17:00 CET: MemoryStatus: mem_total: 3961 mb, mem_initial: 257 mb
17:17:00 CET: SData_Locn is /usr/local/bin/
17:17:00 CET: Using existing Config_File: /usr/local/bin/opencpn.conf
17:17:00 CET: Setting Viewpoint Lat/Lon 33.358, -79.282
17:17:00 CET: Setting Ownship Lat/Lon 33.358, -79.282
17:17:00 CET: Error: can't create file '/usr/local/bin/navobj.xml.1' (error 13: Permission denied)
17:17:00 CET: System default Language: en_US
17:17:00 CET: Opencpn language set to: en_US
17:17:00 CET: S52PLIB: Cannot open S52 rules file /usr/local/bin/s57data/S52RAZDS.RLE
17:17:00 CET: Looking for s57data in /home/lasse/.opencpn/s57data
17:17:00 CET: S52PLIB: Cannot open S52 rules file /home/lasse/.opencpn/s57data/S52RAZDS.RLE
17:17:00 CET: Looking for s57data in /usr/local/bin/s57data
17:17:00 CET: S52PLIB: Cannot open S52 rules file /usr/local/bin/s57data/S52RAZDS.RLE
17:17:00 CET: S52PLIB Initialization failed, disabling S57 charts.
17:17:00 CET: Using Tide/Current data from: /usr/local/bin/tcdata/
17:17:00 CET: Setting Viewpoint Lat/Lon 33.358, -79.282
17:17:00 CET: Setting Ownship Lat/Lon 33.358, -79.282
17:17:01 CET: NMEA Data Source is....NONE
17:17:01 CET: AIS Data Source is....NONE
17:17:01 CET: Unable to open WVSChart datafile: /usr/local/bin/wvsdata/wvs43.dat
17:17:01 CET: NMEA AutoPilot Port is....NONE
17:17:01 CET: PlugInManager searching for PlugIns in location /usr/local/bin/plugins
17:17:01 CET: Directory /usr/local/bin/plugins does not exist.

(opencpn:974): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
17:17:01 CET: ChartDB Cache policy: Max open chart limit is 20.
17:17:01 CET: Loading chart db version: V016
17:17:01 CET: Chartdb: Chart directory list follows
17:17:01 CET: Chart directory #0: ../share/opencpn/maps/CM93
17:17:01 CET: GPS Watchdog Timeout is: 6 sec.
17:18:01 CET: LOGBOOK: 2012-02-21 16:18:01 UTC DR Lat 33.35800 Lon -79.28200
17:19:20 CET:
17:19:20 CET: Starting chart database Update...
17:19:20 CET: Error: can't open file '/usr/local/bin/chartlist.dat' (error 13: Permission denied)
17:19:20 CET: Finished chart database Update
17:19:20 CET:
17:19:20 CET: Error: Failed to create a temporary file name (error 13: Permission denied)
17:19:20 CET: Error: can't open user configuration file.
17:19:20 CET: NMEA Data Source is....None
17:19:20 CET: NMEA AutoPilot Port is....None
17:19:20 CET: AIS Data Source is....None
17:19:20 CET: Error: Failed to create a temporary file name (error 13: Permission denied)
17:19:20 CET: Error: can't open user configuration file.

(opencpn:974): Gdk-CRITICAL **: IA__gdk_colormap_alloc_colors: assertion `GDK_IS_COLORMAP (colormap)' failed

(opencpn:974): Gdk-CRITICAL **: IA__gdk_colormap_query_color: assertion `GDK_IS_COLORMAP (colormap)' failed
17:19:29 CET: opencpn::MyFrame exiting cleanly.
17:19:29 CET: Error: Failed to create a temporary file name (error 13: Permission denied)
17:19:29 CET: Error: can't open user configuration file.
17:19:29 CET: Error: Failed to create a temporary file name (error 13: Permission denied)
17:19:29 CET: Error: can't open user configuration file.
17:19:29 CET: LOGBOOK: 2012-02-21 16:19:29 UTC OFF: Lat 33.35800 Lon -79.28200
17:19:29 CET: opencpn::MyApp exiting cleanly...

17:19:29 CET: Error: Failed to create a temporary file name (error 13: Permission denied)
17:19:29 CET: Error: can't open user configuration file.
lasse@storepesen:~$


Starting as su does not give any errors on command line, but still does not find maps.
My version creates config file under .opencpn dir with different name alongside the regular one when started with alternate config.
Rgds
Lasse
__________________
lurno is offline   Reply With Quote
Old 21-02-2012, 10:20   #6
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,250
Re: Custom Features

It looks like the -p switch on Linux does not work.
After copying all the files and "opencpn" to a directory in my home folder, the program insists on trying to write the user files to /usr/local/bin instead of the directory where "opencpn" is.
Clearly a bug, unless I missed something.........
Thomas
__________________
cagney is offline   Reply With Quote
Old 22-02-2012, 07:18   #7
Registered User

Join Date: Jul 2011
Location: Droebak, Norway
Boat: Princess, 388, 40ft
Posts: 11
Re: Custom Features

Pavel...
I get your drift about the CTRL-C, so I changed that to CTRL-N (North up).
Below is the resulting patch for toggle Course up.
If this is ok, then more will follow.
Lasse


diff --git a/src/chcanv.cpp b/src/chcanv.cpp
index df39322..cb41f51 100755
--- a/src/chcanv.cpp
+++ b/src/chcanv.cpp
@@ -4163,6 +4163,9 @@ void ChartCanvas::OnKeyDown(wxKeyEvent &event)
break;
}

+ case 14: // Ctrl N
+ parent_frame->ToggleCourseUp();
+ break;
case -32: // Ctrl Space // Drop MOB
{
if ( m_modkeys == wxMOD_CONTROL )
mypatch.diff (END)
__________________
lurno is offline   Reply With Quote
Old 22-02-2012, 07:32   #8
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
Re: Custom Features

Lasse...
Yep, that looks done correctly
Just one note - to keep the formatting when posting code to the forum, wrap it with CODE tags - the '#' symbol in the toolbar, to get it to display like
Code:
diff --git a/src/chcanv.cpp b/src/chcanv.cpp
index df39322..cb41f51 100755
--- a/src/chcanv.cpp
+++ b/src/chcanv.cpp
@@ -4163,6 +4163,9 @@ void ChartCanvas::OnKeyDown(wxKeyEvent &event)
                     break;
                }
 
+               case 14:                     // Ctrl N
+                    parent_frame->ToggleCourseUp();
+                    break;
                case -32:                     // Ctrl Space            //    Drop MOB
                {
                     if ( m_modkeys == wxMOD_CONTROL )
Especially if the code is longer, it makes it much more readable and the thread stays reasonably organized. And if you don't mind, please prefer posting patches to OpenCPN's flyspray tracker, although we try hard to pick them up, they sometimes tend to get forgotten here in the forum.

Thanks

Pavel
__________________
nohal is online now   Reply With Quote
Old 22-02-2012, 09:31   #9
Registered User

Join Date: Dec 2005
Location: WNA
Boat: Dufour 35
Posts: 3,250
Re: Custom Features

Quote:
Originally Posted by cagney View Post
...
Clearly a bug, unless I missed something.........
Thomas
Which I obviously did- It spells "./"
Thomas
__________________
cagney is offline   Reply With Quote
Old 23-02-2012, 13:37   #10
Registered User

Join Date: Jul 2011
Location: Droebak, Norway
Boat: Princess, 388, 40ft
Posts: 11
Re: Custom Features

Pavel...
Thanks for the tips.
I'll go to the flyspray for more suggestions.
I sort of thought flyspray was bug corrections only.
I'll go there for next suggestions.


Lasse
__________________

__________________
lurno is offline   Reply With Quote
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Yachts LTD Winches vintageray Deck hardware: Rigging, Sails & Hoisting 12 28-09-2017 10:08
Custom Features lurno OpenCPN 9 23-02-2012 13:37
For Sale: C&C 48 Custom Sailboat rourkeh Classifieds Archive 2 25-01-2012 18:07
Heavy duty or hydraulic or custom tiller pilot options? Ocean Roads Marine Electronics 9 17-12-2011 10:34



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 06:21.


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.