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 06-12-2013, 07:41   #196
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Development Debugging Environment - Setup Help

Yes, Jean Pierre, it solved the immediate break that I was getting. I'd forgotten those steps! Thanks.
rgleason is offline   Reply With Quote
Old 06-12-2013, 07:49   #197
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Development Debugging Environment - Setup Help

I just noticed the "buildwin" directory, does that take the place of creating a "build" directory? Can we run Cmake, MSVC Build and Debug and Release in that directory?

If it is not for that purpose, what is it for? Thanks.

I also had a question about plugin Ilegal External file references related to Grib_pi and Dashboard_pi. Are these plugins subject to this rule too?
rgleason is offline   Reply With Quote
Old 12-12-2013, 16:35   #198
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Development Debugging Environment - Setup Help

NTRO on use of GITHUB.COM and Git

After setting up git

https://help.github.com/articles/set-up-git
and registering for a public account (free) on github.com and setting up and becoming familiar with github.

Then Create A Repository https://help.github.com/articles/create-a-repo

Fork a Repository
To make my own Fork (a snapshot in time of a copy of another repository on github)
see "Fork a Repository" https://help.github.com/articles/fork-a-repo
Using the above, I forked: github.com/seandepagnier/weatherfax_pi to github.com/rgleason/weatherfax_pi about six months ago.

Clone the Fork to your Local Repository
Next "Clone your Fork to a Local Repository" read the end of Fork-a-repo
Note how to keep track of the original repository (seandepagnier/weatherfax_pi) by "Configuring Remotes" by adding 'upstream'.

Six months went by and Sean Depagnier had made changes to his repository.
I needed to get my fork up to date with Sean's repository.

Synch a Fork
So I "Synched a Fork" https://help.github.com/articles/syncing-a-fork
Syncing your fork only updates your local copy of the repository; it does not update your repository on GitHub.
Done using the commands:
git remote -v
git remote add upstream https://github.com/seandepagnier/weatherfax_pi.git
git remote -v
git fetch upstream
git branch -va -Should show the most current upstream commit.
"remotes/upstream/master 5fdff0f Some upstream commit"
Now your Local repository on your computer has a remote branch 'upstream' with the most current commits from seandepagnier/weatherfax_pi
We have fetched the 'upstream' repository.

Next we need to Merge those changes into our local repository.
git checkout master (now pointing to the local repository master)
git merge upstream/master (now merging upstream to the local master)
Make changes on the Local, compile, test and then Commit.
After getting the local repository current with the original repository seandepagnier/weatherfax_pi,
we've made some changes and run some tests on the changes by compiling the code with MSVC++
and those changes work fine. Now we need to commit the changes and updat the personal repository on gitub:

Commit those changes and add an identifying note.
Then publish the commits from your repository into a remote for other users to view and potentially fetch.

Commit changes made.
1. Determine any untracked files that are needed as a part of the commit using git status. Write them down.
2. Add necessary untracked files using git add <file1> <file2> etc.
3. Check for untracked files again using git status.
3. Then commit using git commit -a
git status
show files added to the staging area, files with changes, and untracked files
git diff show a diff of the changes made since your last commit to diff one file: "git diff -- <filename>" to show a diff between staging area and HEAD: `git diff --cached`

git add <file1> <file2> ... add <file1>, <file2>, etc... to the project git add <dir> add all files under directory <dir> to the project, including subdirectories
git commit -a
commit all files changed since your last commit
(does not include new (untracked) files)
Update your personal forked repository on GitHub. ( github.com/rgleason/weatherfax_pi )
When you've made your awesome updates locally, you'll want to synchronize that work back onto GitHub. It's super easy to do:
https://help.github.com/articles/syn...g-repositories

https://help.github.com/articles/pus...shing-a-branch
You can only push to one of two writeable protocol URL addresses.
Those two include an SSH URL like git@github.com:user/repo.git
or HTTPS URL like https://github.com/user/repo.git.
If you cloned a repository with a read-only git:// URL and you have been granted permissions to write to it, you can update the URL to one of the writable forms with:
git remote set-url origin <NEWURL>
Pushing a Branch
To push a local branch to an established remote, you need to issue the command:
git push <REMOTENAME> <BRANCHNAME>

This is most typically invoked as
git push origin master

git push
update the server with your commits across all branches that are *COMMON*
between your local copy and the server. Local branches that were never
pushed to the server in the first place are not shared.

git push origin <branch>
update the server with your commits made to <branch> since your last push.
This is always *required* for new branches that you wish to share. After
the first explicit push, "git push" by itself is sufficient.
After the [git push origin master] is issued, open github and check the commits in your forked repository.
For example: https://github.com/rgleason/weatherfax_pi
To issued the "pull request" to sean was quite easy. I had two commits in the bin waiting.
I picked the "Compare" button on the right which created a diff and showed the pull details and had a green button to make the pull request.

====
Git Help https://help.github.com
Git Cheatsheet https://help.github.com/articles/git-cheatsheet
Cheatsheet $ command line ruby cheat sheets
rgleason is offline   Reply With Quote
Old 04-11-2014, 08:49   #199
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Development Debugging Environment - Setup Help

Quote:
Small advice: Keeping your build under C:\Program Files (x86) is not really a good idea. Permission problems are likely.

Better to have a c:\OpenCPN-Dev folder with a build and a OpenCPN repository underneath.
Agreed!
rgleason is offline   Reply With Quote
Old 05-11-2014, 22:37   #200
Registered User
 
hasse_A's Avatar

Join Date: Feb 2013
Location: Tyrell Bay,Carriacou
Boat: Allegro 33
Posts: 560
Re: Development Debugging Environment - Setup Help

Hi!

I am trying to debeug OpenCPN. I have managed to compile and link all files.
I can start debugging in Visual Studio. All menus are fine except the plugin menu. It is completely blank when I am expecting the dashboard and the grib plugin to be there.
Also there must be something wrong with a makefile since I get "These projects are out of date" no madder how many time I recompile it. Se attachment.
Is there anyone experienced this and can it have something to do with the plugins not showing up ?
/Hans
Attached Thumbnails
Click image for larger version

Name:	Out_of_Date.jpg
Views:	177
Size:	31.6 KB
ID:	90970  
hasse_A is offline   Reply With Quote
Old 06-11-2014, 00:10   #201
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,245
Re: Development Debugging Environment - Setup Help

Hasse..
I'm not sure if this is your sollution but....:
First:
In pluginmanager.cpp around ~224 based on advices from our guru Pavel I use to edit this function:
Code:
bool PlugInManager::LoadAllPlugIns(const wxString &plugin_dir, bool load_enabled)
{
    #if _DEBUG
        m_plugin_location = _T("C:\\Builds\\OpenCPN\\opencpn\\build\\plugins\\dashboard_pi\\Debug\\"); //Has for debug use
    #else
        m_plugin_location = plugin_dir;
    #endif
Second:
Now when I've pointed to dashboard_pi as the plugin directory all plugins I want to debug must be found there.
So, every time your gradar_pi project is built for debug you've to copy all files in ....\gradar_pi\debug\ to (in my case) .....dashboard_pi\debug\.

And, of course, all path to be edited to fit your environment.
So, if you make a change in gradar_pi and want to test it you've to first build it and then again copy the debug files before the debug test. In VC++ I use to "build only xxxx_pi" and then copy the files before running OCPN debug.
Håkan
Hakan is offline   Reply With Quote
Old 06-11-2014, 02:41   #202
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Development Debugging Environment - Setup Help

Did not know about pluggin manager edit. Never had to do that, but Hakan has described copying the files as i need to do yo run a plugin in debug mode. Hope his suggestion works. Also make sure your git head is ok and you have git fetch to where you want to be, sometimes not everything comes down. Do the same with the plugin git fetch too

Sent from my SCH-I545 using Cruisers Sailing Forum mobile app
rgleason is offline   Reply With Quote
Old 06-11-2014, 03:38   #203
Registered User
 
hasse_A's Avatar

Join Date: Feb 2013
Location: Tyrell Bay,Carriacou
Boat: Allegro 33
Posts: 560
Re: Development Debugging Environment - Setup Help

Quote:
Originally Posted by rgleason View Post
Also make sure your git head is ok and you have git fetch to where you want to be, sometimes not everything comes down. Do the same with the plugin git fetch too
So, might this be the reason I get the "Out of date" warning ?

/Hans
hasse_A is offline   Reply With Quote
Old 06-11-2014, 03:55   #204
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Development Debugging Environment - Setup Help

Sometimes I will get errors and find the problem is solved by git pull, however if you have created a git branch and are coding you probably dont want to do that. I only try to fix code but i am not very skilled at it, so for me, git pulll will assure I've got everything needed. My head is usually at master * because i am just compiling code not making it. Git pull will over wrote stuff you've changed or written. Unless you stashed it or created your own branch first and got on that, do coding, then switch branch back to master. But you probably know that better than i do.

Sent from my SCH-I545 using Cruisers Sailing Forum mobile app
rgleason is offline   Reply With Quote
Old 06-11-2014, 04:51   #205
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Development Debugging Environment - Setup Help

Just ignore those warnings, zero_check does nothing, i18n has to do with localization files. Both irrelevant for your build.

Pavel


Sent from my iPhone using Cruisers Sailing Forum
nohal is offline   Reply With Quote
Old 06-11-2014, 14:38   #206
Registered User
 
hasse_A's Avatar

Join Date: Feb 2013
Location: Tyrell Bay,Carriacou
Boat: Allegro 33
Posts: 560
Re: Development Debugging Environment - Setup Help

Håkan

I changed the pluginmanager.cpp according to your instructions and copied the named files to the Debug directory after the build but I still can't see any plugins there.
F.Y.I. there was already the files for the dashboard there.

/Hans
hasse_A is offline   Reply With Quote
Old 06-11-2014, 15:39   #207
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,234
Re: Development Debugging Environment - Setup Help

Hans...
Look into your logfile. Both the location where the plugins are looked for and, if the location is the place where your plugin libraries really are, the reason for failure loading them is there.
You are looking for a section similar to
Code:
18:01:38 CST: PlugInManager searching for PlugIns in location /home/nohal/source/opencpn/build/plugins/secret_pi/
18:01:38 CST: PlugInManager: Loading PlugIn: /home/nohal/source/opencpn/build/plugins/secret_pi/libsecret_pi.so
18:01:38 CST: Error: /home/nohal/source/opencpn/build/plugins/secret_pi/libsecret_pi.so: undefined symbol: _ZTV8AcThread
18:01:38 CST:    PlugInManager: Cannot load library: /home/nohal/source/opencpn/build/plugins/secret_pi/libsecret_pi.so
Of course in your case the paths will be different, but you get the picture - For example in this case the loading failed because I have tried to use an unfinished plugin, without a critical function implemented.

Pavel
nohal is offline   Reply With Quote
Old 07-11-2014, 06:25   #208
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,711
Images: 2
Re: Development Debugging Environment - Setup Help

Some help for reverting back to an earlier version of Garmin Radar that works better.[ I did the exercise below in order to extract the previous opencpn.lib files for the critical versions 3.2.0, 3.2.2 etc for the purpose of running plugins in the Standalone Compile format.] It should serve as an example of how to go back to a particular previous git commit.

Git checkout of various versions of Opencpn to get opencpn.lib versions

https://github.com/OpenCPN/OpenCPN/releases
on May 7, 2013 opencpn-3.2.2 … 0c4bcc9

git checkout 0c4bcc9
Head is not at 0c4bcc9 3.2.2

git branch -v
* no branch 0c4bcc9 3.2.2
master 3ef3142
opencpn-3.2.0 cf69568 3.2.0

git checkout -b opencpn-3.2.2
cd build
cmake ..
cmake --build .
cmake --build . --config release

then search on opencpn.lib and find two
C:\Data-Dart\Up-Soft\Navigation\opencpn-git2\build\release
C:\Data-Dart\Up-Soft\Navigation\opencpn-git2\build\debug
both the same 59kb
copy one to opencpn-lib folder

checkout master

Also did the same for
git checkout -b opencpn-3.2.0
Have included this opencpn-3-2.lib too, but they appear to be the same size.

To help Matt Neptune's Gear
http://www.cruisersforum.com/forums/...ml#post1666596
rgleason is offline   Reply With Quote
Old 07-11-2014, 09:06   #209
Registered User
 
hasse_A's Avatar

Join Date: Feb 2013
Location: Tyrell Bay,Carriacou
Boat: Allegro 33
Posts: 560
Re: Development Debugging Environment - Setup Help

Håkan

Some progress.
Fallowing your advise, a "Build Clean" and a rebuild now shows the icons in the plugins menue.

Pavel
Now I will have to do some studying if the documents Pavel pointed me to.
Tanks Pavel. Very interesting software.

/Hans
hasse_A is offline   Reply With Quote
Old 07-11-2014, 09:33   #210
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,245
Re: Development Debugging Environment - Setup Help

Hans..
Nice to hear. Please enjoy debugging.
If you come to a working data transmit simulation please advise how. My short attempts to use Ostinato is not yet very successful.
Håkan
Hakan is offline   Reply With Quote
Reply

Tags
environment


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 07:04.


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.