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 10-05-2012, 06:05   #1
Registered User

Join Date: Jan 2011
Posts: 670
Running two instances - how to save settings?

I have been running two instances of OpenCPN under WindowsXP. I launch the program twice, then set the windows to tile vertically. I use XPort to feed GPS to both instances on different COM ports. I set one of the windows to receive AIS through another COM port, and zoom way out for a broad view of shipping traffic on my busy river. I set the other window to zoom in so I can see detailed features on my chart as I sail.



Having both windows side-by-side is fantastic. I can go sailing and just leave OpenCPN running without the need to touch the computer at all. There's no need to zoom in and out because I can see it all at a glance.

The only problem is that I need to manually set this up every time I launch OpenCPN. When I go to quit, OpenCPN only remembers the settings from the last window I closed. When I reopen OpenCPN, it defaults to those settings, and when I launch the second instance, I get the usual COM port error message because the second instance is trying to access the same COM port. Once I change it, everything works OK, but it is a pain having to redo the settings every time I relaunch the applications.

So here is my question: Is there a way, by manually editing the opencpn.ini file, or creating two .ini files, that I can save the settings for both instances so that the program launches (twice) with the appropriate settings (and vertical tiling) for both?

Please note that I can't just put the computer to sleep with OpenCPN running. I tried it and it does not work for mebecause the GPS and AIS signals are coming to the computer wirelessly via Bluetooth, and once I put the machine to sleep the Bluetooth connections break and XPort and OpenCPN both need to be relaunched. So I need to be able to quit out of the applications when I'm done sailing, and relaunch everything next time I go out.
RhythmDoctor is offline   Reply With Quote
Old 10-05-2012, 06:17   #2
Registered User
 
Viking Sailor's Avatar

Join Date: Nov 2006
Location: San Francisco Bay
Boat: Fantasia 35
Posts: 1,251
Re: Running two instances - how to save settings?

Run one or more instances of OpenCPN in portable mode.

Viking Sailor is offline   Reply With Quote
Old 10-05-2012, 07:32   #3
Registered User

Join Date: Jan 2011
Posts: 670
Re: Running two instances - how to save settings?

Quote:
Originally Posted by Viking Sailor View Post
Run one or more instances of OpenCPN in portable mode.

Please be more specific. The settings are stored in the opencpn.ini file in Window's Application settings. Portable mode enables you to move the executables to a thumb drive or other directory location, but it sure looks to me like it still goes to the same local .ini file to retrieve the settings, so this would not accomplish what I need to do.

If you have actually done what I'm asking for, please explain how. It could save me a few hours of fruitless effort.
RhythmDoctor is offline   Reply With Quote
Old 10-05-2012, 07:44   #4
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Running two instances - how to save settings?

RhythmDoctor...
in portable mode, OpenCPN looks for the ini file in the current application directory, not in the systemwide location - that's why it's portable.
If you run one instance as portable and one as standalone, each will use it's own settings as VS suggests.

Pavel
nohal is offline   Reply With Quote
Old 10-05-2012, 07:55   #5
Registered User

Join Date: Jan 2011
Posts: 670
Re: Running two instances - how to save settings?

Thanks. Does 2.5.0 have portable mode, or is it only available in the 2.6 beta? The DocFile chapter on portable mode does not make this clear.
RhythmDoctor is offline   Reply With Quote
Old 10-05-2012, 08:00   #6
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,207
Re: Running two instances - how to save settings?

No, 2.5 does not support it, portable mode is available only in the 2.6 beta series.
nohal is offline   Reply With Quote
Old 10-05-2012, 08:09   #7
Registered User
 
sailorF54's Avatar

Join Date: Dec 2009
Location: Perros-Guirec, France
Boat: Jeanneau Sunshine 36
Posts: 999
Re: Running two instances - how to save settings?

VIking Sailor is right, as you would have discovered if you had tried.

Each instance of a portable setup has its OWN ini, log... file...Ortherwise it would not be portable...
You can start several instances of portable versions on the same computer. Simply duplicate the portable folder.
Have a look at my typical portable folder
BTW, I put an instance of the charts (e.g. a subset of CM93, plus kap charts) in the higher order folder that contains the portable OpenCpn folder
The bat file simply contains
opencpn -p
Don't forget to start opencpn through the bat file.

I am using 2.6.1715

PS By using Xport for instance, you can feed the GPS to both instances using the same port number.
Attached Thumbnails
Click image for larger version

Name:	Image001.jpg
Views:	148
Size:	316.3 KB
ID:	40900   Click image for larger version

Name:	Image002.jpg
Views:	139
Size:	84.2 KB
ID:	40901  

Click image for larger version

Name:	Image003.jpg
Views:	207
Size:	104.8 KB
ID:	40905  
sailorF54 is offline   Reply With Quote
Old 10-05-2012, 08:59   #8
Registered User

Join Date: Jan 2011
Posts: 670
Re: Running two instances - how to save settings?

Quote:
Originally Posted by sailorF54 View Post
VIking Sailor is right, as you would have discovered if you had tried. .
Sorry, I would have tried if it was in a stable release. I will not use betas for real-time navigation. I'll wait for the stable release.
Quote:
Originally Posted by sailorF54 View Post
PS By using Xport for instance, you can feed the GPS to both instances using the same port number.
Does this work for bidirectional communications? I can imagine sending GPS signals out to both instances using the same port number, but this might run into problems for full duplex, sending autopilot commands back the other direction on the same port. Or does Xport have a way of multiplexing those on one port?

Also, is there a way to have XPort multiplex two different COM ports at the same time? It would be nice if I could also split my AIS COM port into two. But I've been unable to figure out how to run two instances of XPort, or to get one instance to split two different COM ports.
RhythmDoctor is offline   Reply With Quote
Old 10-05-2012, 09:39   #9
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Running two instances - how to save settings?

Quote:
Originally Posted by RhythmDoctor View Post
Thanks. Does 2.5.0 have portable mode, or is it only available in the 2.6 beta? The DocFile chapter on portable mode does not make this clear.
All the features in 2.5 are described in the documentation that comes as a part of your installation. Click ?->Help and look in your browser.
When there is a beta series, the documentation is slowly updated to include all news and changes. This is clearly stated in the introduction to the wiki Book - Documentation Wiki | Official OpenCPN Homepage.
All the different versions of the documentation are available towards the bottom of Download OpenCPN | Official OpenCPN Homepage

Thomas
cagney is offline   Reply With Quote
Old 10-05-2012, 10:35   #10
Registered User
 
Tristan's Avatar

Join Date: Aug 2006
Location: Cruising
Boat: Custom Ketch Asperida
Posts: 230
Re: Running two instances - how to save settings?

Another solution is to run a copy of OpenCPN in a virtual machine. This way you can run any version of the software and still share your COM ports. If you run the VirtualBox you can run it in border-less mode in this case you wouldn't see any differences between you current setup but the two application are running in the two separated virtual computers.
The overhead is really minimal.
T.
Tristan is offline   Reply With Quote
Old 10-05-2012, 10:40   #11
Registered User
 
Tristan's Avatar

Join Date: Aug 2006
Location: Cruising
Boat: Custom Ketch Asperida
Posts: 230
Re: Running two instances - how to save settings?

You can also use the same set of resources (charts,tracks,routes...) by sharing them between two VM
T.
Tristan is offline   Reply With Quote
Old 11-05-2012, 05:54   #12
Registered User

Join Date: Jan 2011
Posts: 670
Re: Running two instances - how to save settings?

Thanks for all of your suggestions. I will try the beta upgrade with portable mode this weekend. Not sure I'm up to installing a virtual machine on my little Netbook that I use in the cockpit.

Until I'm convinced that the latest 2.6 beta has no bugs that would affect the stability of my real-time usage, I've created a batch file that:

  1. Backs up the latest opencpn.ini file
  2. Copies a .ini file with GPS settings (close-up zoom, window on left side of screen, no AIS) to opencpn.ini
  3. Launches a first instance of opencpn
  4. Copies a different .ini file with AIS settings (wide zoom, window on right side of screen, AIS active) to opencpn.ini
  5. Launches a second instance of opencpn
Over the weekend, I'm going to try to expand this batch file to also establish my Bluetooth connections and launch/activate XPort. I'm not sure yet whether this can be done - it will depend on what kind of DOS scripting support those programs have.
RhythmDoctor is offline   Reply With Quote
Old 11-05-2012, 07:30   #13
Registered User
 
HappySeagull's Avatar

Join Date: Dec 2010
Location: B.C.,Canada
Boat: 29'
Posts: 2,423
Re: Running two instances - how to save settings?

Per the portable version,that lives on your hdd, you can use the "-p" switch in a desktop shortcut to it.. in XP this goes in the "target" slot of the shortcut's properties dialogue. Much nicer than a .bat script...
The bat script is only needed in a usb stick version because Winblows can't keep Drive letters reserved for drives you plug in.
HappySeagull is offline   Reply With Quote
Old 11-05-2012, 08:11   #14
Registered User

Join Date: Jan 2011
Posts: 670
Re: Running two instances - how to save settings?

Quote:
Originally Posted by HappySeagull View Post
Per the portable version,that lives on your hdd, you can use the "-p" switch in a desktop shortcut to it.. in XP this goes in the "target" slot of the shortcut's properties dialogue. Much nicer than a .bat script...
The bat script is only needed in a usb stick version because Winblows can't keep Drive letters reserved for drives you plug in.
Yes, I've done similar things many times. Since I'll be looking to automate several tasks in sequence, I'll probably create a multi-line batch file anyway, and make a shortcut that points to it.
RhythmDoctor 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


Advertise Here


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


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.