Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 15-08-2016, 15:03   #481
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Development Debugging Environment - Setup Help

Ok, I did the following.

1) Build release of OpenCPN-4.5.0 with the plugin under it.
The plugin .ddl file is generated under plugins\gxradar_pi\release

2) Started OpenCPN under build\release within the development tree.

There is no ethernet data coming into the plugin.

3) Copied the plugin gxradar_pi.dll to the official release under
OpenCPN-4.4.0\plugins

4) Started OpenCPN-4.4.0

Ethernet data is coming in fine.

Obviously, there is nothing wrong with the plugin.
With the plugin under the development tree RecvFrom() does not
receive any data but outside it does.

In every other aspect the OpenCPN-4.5.0 works as it should within the build tree.



What can be wrong ? Why am I not getting data into the plugin
when running it under my build tree ?

I have cloned latest (4.5.0). Is there something changed that could be the cause ?
Should I get the build tree for 4.4.0 ?

/Hans
__________________

__________________
hasse_A is offline   Reply With Quote
Old 16-08-2016, 04:58   #482
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Development Debugging Environment - Setup Help

I have downloaded OpenCPN 4.4.0 and tried to build it.
Doing so, I get the these errors:


"C:\Users\hasse\OpenCPN\build\ALL_BUILD.vcxpro j" (default target) (1) ->
"C:\Users\hasse\OpenCPN\build\plugins\chartdldr_pi \chartdldr_pi.vcxproj" (defau
lt target) (13) ->
"C:\Users\hasse\OpenCPN\build\opencpn.vcxproj" (default target) (15) ->
(ClCompile target) ->
C:\Users\hasse\OpenCPN\src\routeprop.cpp(2816): error C3861: 'min': identifie
r not found [C:\Users\hasse\OpenCPN\build\opencpn.vcxproj]
C:\Users\hasse\OpenCPN\src\routeprop.cpp(3188): error C3861: 'min': identifie
r not found [C:\Users\hasse\OpenCPN\build\opencpn.vcxproj]

routeprop.cpp can't find min.
Is there a math library missing ?

/Hans
__________________

__________________
hasse_A is offline   Reply With Quote
Old 16-08-2016, 05:44   #483
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 4,019
Re: Development Debugging Environment - Setup Help

Quote:
Originally Posted by hasse_A View Post
Ok, I did the following.



1) Build release of OpenCPN-4.5.0 with the plugin under it.

The plugin .ddl file is generated under plugins\gxradar_pi\release



2) Started OpenCPN under build\release within the development tree.



There is no ethernet data coming into the plugin.



3) Copied the plugin gxradar_pi.dll to the official release under

OpenCPN-4.4.0\plugins



4) Started OpenCPN-4.4.0



Ethernet data is coming in fine.



Obviously, there is nothing wrong with the plugin.

With the plugin under the development tree RecvFrom() does not

receive any data but outside it does.



In every other aspect the OpenCPN-4.5.0 works as it should within the build tree.







What can be wrong ? Why am I not getting data into the plugin

when running it under my build tree ?



I have cloned latest (4.5.0). Is there something changed that could be the cause ?

Should I get the build tree for 4.4.0 ?



/Hans


When debugging plugin dlls on Windows you have to copy the plugins from where they are built to build\plugins. But any dll dependencies have to be copied to build\debug. Maybe this is part of the problem.

I would try building and debugging a standard O plugin (say dashboard) first. Clone the latest git and build the debug version. Then copy all the debug plugin DLLs to build\plugins and all dependent dlls to build\debug. Once you have that working (set a breakpoint in the plugin DLL) then copy your new debug DLL to build\plugins and any dependencies to build\debug. You should be able to run your plugin then.

I would not try to go back and build some previous branch at this point. Just build the current origin/head master branch.
__________________
transmitterdan is offline   Reply With Quote
Old 16-08-2016, 07:09   #484
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Development Debugging Environment - Setup Help

Quote:
Originally Posted by transmitterdan View Post
When debugging plugin dlls on Windows you have to copy the plugins from where they are built to build\plugins. But any dll dependencies have to be copied to build\debug. Maybe this is part of the problem.
For the moment and for simplicity, lets forget debugging all together.

I have built a release plugin that works with the official releases 4.2.0.and 4.4.0. I.e the plugin receives data from the ethernet i/f.

I then downloaded head branch 4.5.0 and built a release with a package, used that to install OpenCPN and copied my known good plugin into the plugins directory. The OpenCPN starts fine. So does the plugin but no data is coming in from the ethernet i/f.

I also tried to run OpenCPN in the build tree as described in the developers manual: "6 Running OpenCPN from the build directory (without installing)"
No ethernet data is read by the plugin.

To me this sounds as if there is a problem with the 4.5.0 code or something wrong in the build tree or possibly in the development environment.
Probably not in the development environment as I can build a working plugin outside of the OpenCPN build tree.

/Hans
__________________
hasse_A is offline   Reply With Quote
Old 16-08-2016, 08:16   #485
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Development Debugging Environment - Setup Help

Quote:
Originally Posted by transmitterdan View Post
When debugging plugin dlls on Windows you have to copy the plugins from where they are built to build\plugins.
When I do that the OpenCPN can't see the plugin.

Pavel gave me the advice to modify
src/pluginmanager.cpp Line 292 to
m_plugin_location = _T("C:\\Users\\hasse\\OpenCPN\\build\\plugins\\gxr adar_pi\\Debug");

Then I can place the gxradar code (tree) under plugins and do not have to copy anything.

/Hans
__________________
hasse_A is offline   Reply With Quote
Old 16-08-2016, 16:08   #486
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Development Debugging Environment - Setup Help

transmitterdan.....

I did as you said.
No change regarding my gxradar plugin. Still no ethernet traffic coming in.

When trying to download charts I get a wxWidget Debug Alert.
See attachment.

The other plugins seem to work fine.

/Hans
Attached Thumbnails
Click image for larger version

Name:	chartdldr.jpg
Views:	35
Size:	338.9 KB
ID:	129672  
__________________
hasse_A is offline   Reply With Quote
Old 16-08-2016, 16:42   #487
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 4,019
Re: Development Debugging Environment - Setup Help

Quote:
Originally Posted by hasse_A View Post
transmitterdan.....

I did as you said.
No change regarding my gxradar plugin. Still no ethernet traffic coming in.

When trying to download charts I get a wxWidget Debug Alert.
See attachment.

The other plugins seem to work fine.

/Hans
I see this sometimes when running the release version of O in the VS2013 debugger. I never run the release version in the debugger as a result.

I know of Pavel's edit of the plugin manager. But if you copy files as I suggested then you never have to edit the source code of O. I have a batch file that copies all the plugins and other dependencies which I run after each debug build. It is much easier to me than editing the plugin manager source code.

If you build a debug version of O and a debug version of your plugin can you set a breakpoint in your plugin and actually reach that breakpoint with no wx alerts or traps?
__________________
transmitterdan is offline   Reply With Quote
Old 16-08-2016, 16:58   #488
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Development Debugging Environment - Setup Help

transmitterdan.....

Thanks for your help.

Yes, I have built a debug version of O and a debug version of my plugin and I am able to set breakpoints in the plugin and running it, it will stop at the breakpoint and, there are no problems with wx alerts, traps and there are no crashes.
All this works fine.

Right now I am stepping through wxWidgets code but I must say it feels like I am drowning. There are so many calls just for the RecvFrom() I get lost.
I do not yet have the knowledge for this.

/Hans
__________________
hasse_A is offline   Reply With Quote
Old 16-08-2016, 17:44   #489
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Development Debugging Environment - Setup Help

Pavel had the answer.

My firewall was blocking some of the traffic.
I did not consider this since the plugin worked just fine when
placed under the official release.
The rule set blocked opencpn when launched from within the build environment.

Thanks again Pavel.

/Hans
__________________
hasse_A is offline   Reply With Quote
Old 25-08-2016, 11:58   #490
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
GITHUB WORKFLOW - Fetch from author's github to local

Recently to be able to make a Pull Request, I had to change my GIT Workflow in order to stay current with other authors progress.
Setup:
Quote:
1. In your own github account, fork the author's repository to yours.
2. Then Clone your repository to your local computer.
3. Leave the "Master" branch untouched, that is only for the author's work!
4. Create a new branches and make changes to those branches only.
Staying current on your local PC repository with the author's github repository
https://gun.io/blog/how-to-github-fo...-pull-request/
git - How do I update a GitHub forked repository? - Stack Overflow
Quote:
#Add the remote calling it "upstream"
git remote add --track master upstream git://github.com/upstreamname/projectname.git
# To see the remotes listed
git remote -va to see the remotes made
#Fetch all branches of upstream to in remote tracking branches
git fetch upstream
#Make sure you are on the master branch
git checkout master
# Since you are starting out fresh and going to keep the Master branch solely to update from the upstream author's repository and current version, do not make changes to the the Master Branch.
git pull upstream/master
OR git merge upstream/master
Note: You must not make changes in the master branch.
Now you'll have an up-to-date version of the upstream code in your current branch.

If you have made changes in your Master branch you may need to rebase.
https://robots.thoughtbot.com/keepin...b-fork-updated
git - How do I update a GitHub forked repository? - Stack Overflow
Or you may have to git stash your changes if you have not commited them.

Now we want to update our own forked github repository to match the author's github repository. This is PUSHing the local repository up to your forked github repository to keep your github repository current.
Quote:
Note that you do have "write" privileges to your own github account, but not necessarily to the author's github repository.
See the next post.
__________________
rgleason is offline   Reply With Quote
Old 25-08-2016, 12:15   #491
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
GITHUB WORKFLOW - Push to your github repository

Push the author's changes from your local PC git repository up to your own github repository.
https://help.github.com/articles/pus...shing-a-branch

Quote:
git push origin master
Which is very simple, provided you have not made changes to the master branch on your github repository. If you have made changes you will get a refusal notice because your local copy is behind or out of sync with the upstream "origin".

I received this rejection for "non-fast forward errors" because I had made two pull requests using the master branch. Since my github repository was not used for development and nobody was adding commits except me, I decided to basically overwrite it. Don't do this if you have others working with you on a repository as their commits will get overwritten or be lost.

so I decided to
git - Cannot push to GitHub - keeps saying need merge - Stack Overflow
Quote:
git push -f origin <branch>
git push -f origin master
for one time, and I resolved not to change the Master branch on my github repository. This worked.

Now the following were the same and current to sean's github project.
1. github.com/seandepagnier/weatherfax_pi
2. my local git directory for the project in my computer
3. github.com/rgleason/weatherfax_pi
for the master branch and sean's other branch 'polar view'
__________________
rgleason is offline   Reply With Quote
Old 25-08-2016, 12:45   #492
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
GITHUB WORKFLOW - Make new Directory & Changes on PC

Next to make the necessary Pull Request in order to update some of the weatherfax_pi XML files, On my PC in the local git repository, I had to make a new branch called "xmlupdates" into which I copied the new XML files over the existing ones in the Data directory.

Making the new branch
https://www.atlassian.com/git/tutorials/using-branches
Quote:
git checkout master
git branch xmlupdates
git checkout xmlupdates
also git checkout -b <new-branch> can be used.

Then I just copied the two XML files into the git project file weatherfax/data over the existing ones using windows explorer.

Next I had to add those files to the branch xmlupdates
https://git-scm.com/book/en/v2/Git-B...-in-a-Nutshell
https://git-scm.com/docs/git-commit
https://www.atlassian.com/git/tutorials/saving-changes/
Quote:
git add coordinatesets.xml
git add weatherfaxinternetretrieval.xml
which adds these changes to the index.
git commit -m "Update xml data files"
Now these changes need to be Pushed up to my github account.

GITGUI can also be used for these operations, and that is what I used, trying to learn that too.
__________________
rgleason is offline   Reply With Quote
Old 25-08-2016, 12:52   #493
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
GIT WORKFLOW - Push new branch up to my github repos

The next step Pushing the Branch "xmlupdates" up to my github repository is simple, we've already done it once.

https://help.github.com/articles/pus...shing-a-branch

Quote:
git push origin xmlupdates
Then I logged into my github account and found that that branch was present.

The next step was to create the Pull Request for Sean from within my github account.
__________________
rgleason is offline   Reply With Quote
Old 25-08-2016, 13:12   #494
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
GIT WORKFLOW - Making a pull request from your github fork

From your github account while in the project directory.
github/username/project

First select the new branch "xmlupdate" from the upper lefthand button.
Then pick "New Pull Request" and follow the instructions.
It is pretty easy.

When you get into "Comparing Changes"
remember to dropdown the github/author's/ 'branches'
and create a new branch that matches yours!

In this case "xmlupdates"

PS: Later, Pavel advises that it is not possible for me to add a branch to Sean's repository, so making a Pull Request to Sean's master branch is perfectly normal.

PSS: After the author accepts your Pull Request, you can delete your branch.

========
Reminder: Read this!
DO NOT make changes to the MASTER branch if you are not the author!!
bitbucket - How to resolve git error: "Updates were rejected because the tip of your current branch is behind" - Stack Overflow

"All has been going well up until today when I find a well meaning colleague has pushed changes to the Master instead of making a branch. This means that when I try to commit I get the error: Updates were rejected because the tip of your current branch is behind'
__________________
rgleason is offline   Reply With Quote
Old 25-08-2016, 13:43   #495
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,356
GIT WORKFLOW - Re Pull Requests to author's master

Pavel wrote regarding creating a branch in Sean's repository:
Quote:
There is nothing wrong, this is how it works. You can't force-create branches in Sean's repository using pull requests.
When creating the pull request, you may select agains which upstream branch you want to do it, but that branch must already exist in Sean's upstream repository. Master, being the default, is perfectly appropriate in this particular case.
__________________

__________________
rgleason is offline   Reply With Quote
Reply

Tags
environment

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 08:34.


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.