Cruisers Forum
 


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 24-03-2015, 23:45   #1
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,634
Images: 2
Ocpn-Draw and Boundary

Jon,

I tried moving ocpn_draw_pi into version 4.1 of Opencpn MSVC++10 setup. And tried to build it as one of the plugins. There were some errors as you advised. Perhaps someone can help us get this so it buiilds/compiles. It does not compile as a standalone or under MSVC++10 as far as I can determine. Please see the attached output.
rgleason is offline   Reply With Quote
Old 29-03-2015, 20:54   #2
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

Rick,
I have only built the plugin standalone, I have not tried it they way you have. In standalone mode it builds OK with Linux and compiles but does not link with windows VS2010. I am currently working on the linkage problem with windows.

The errors you seem to be getting are due to the inclusion of the 'styles.h' file which is a copy of the mainline OpenCPN 'styles.h' file.

At the moment the only way to use the plugin is in a linux 4.1 (latest git) install. The plugin is using v1.13 of the API which is still evolving and as Dave addes new functions I consume them. So you need an up to date clean copy of the latest ocpn git and my 'boundary' version of the plugin, then you can compile and link both and put the libocpn_draw_pi.so file in the lib/opencpn directory which will allow you to try it out.

Jon
jongough is offline   Reply With Quote
Old 29-03-2015, 21:38   #3
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Ocpn-Draw and Boundary

The repository contains a readme file... where is the source?
seandepagnier is offline   Reply With Quote
Old 29-03-2015, 21:46   #4
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

The master branch is currently empty until I get to a point where I have it working in both windows and linux. There is a boundary branch which is where my code is currently going:
https://github.com/jongough/ocpn_draw_pi/tree/boundary
It only works under linux.
The next commit will move all the opencpn copy code to separate directories to make working on it easier. I just need to get the delete of a boundary working again and I will put that up.
jongough is offline   Reply With Quote
Old 29-03-2015, 23:48   #5
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Ocpn-Draw and Boundary

Code:
 In file included from /home/sean/build/plugins/ocpn_draw_pi/src/ocpn_draw_pi.cpp:49:0:
/home/sean/build/plugins/ocpn_draw_pi/include/glOCPNDrawChartCanvas.h:27:27: fatal error: glChartCanvas.h: No such file or directory
 #include <glChartCanvas.h>
                           ^
compilation terminated.
make[2]: *** [CMakeFiles/ocpn_draw_pi.dir/src/ocpn_draw_pi.cpp.o] Error 1
make[1]: *** [CMakeFiles/ocpn_draw_pi.dir/all] Error 2
make: *** [all] Error 2
seandepagnier is offline   Reply With Quote
Old 30-03-2015, 00:14   #6
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

I have just added the files, temporarily, as I am trying to remove all this type of usage from the plugin. I have just tried a linux compile and it works, but.....

Jon
jongough is offline   Reply With Quote
Old 30-03-2015, 03:31   #7
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Ocpn-Draw and Boundary

yes, a lot of duplicated code here.

You have no icon? The preferences button doesn't work, it will be disabled if you don't request it with WANTS_PREFERENCES

when I enabled I got two icons on the toolbar. When I clicked the first one I crash:
Code:
#0  0x00007fffd3adf2b8 in wxKeyEvent::GetKeyCode (this=0x62c) at /usr/include/wx-2.8/wx/event.h:980
#1  0x00007fffd3ad994e in ocpn_draw_pi::KeyboardEventHook (this=0x442ff70, event=...)
    at /home/sean/build/plugins/ocpn_draw_pi/src/ocpn_draw_pi.cpp:653
#2  0x000000000071faf8 in ocpnToolBarSimple::OnMouseEvent (this=0x26ef920, event=...)
    at /home/sean/build/OpenCPN/src/toolbar.cpp:1563
#3  0x00007ffff7b68756 in wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-2.8.so.0
#4  0x00007ffff7b687fb in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
   from /usr/lib/x86_64-linux-gnu/libwx_baseu-2.8.so.0
#5  0x00007ffff7b68b67 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-2.8.so.0
#6  0x00007ffff7695c29 in ?? () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-2.8.so.0
#7  0x00007ffff4532645 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#8  0x00007ffff3aa6188 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9  0x00007ffff3ab7b1d in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffff3abf4f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x00007ffff3abfae2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007ffff46425f4 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#13 0x00007ffff4530df4 in gtk_propagate_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#14 0x00007ffff45311ab in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#15 0x00007ffff41ac27c in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#16 0x00007ffff37dd3b6 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007ffff37dd708 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff37ddb0a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007ffff4530277 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#20 0x00007ffff768331a in wxEventLoop::Run() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-2.8.so.0
#21 0x00007ffff76f49ac in wxAppBase::MainLoop() () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-2.8.so.0
#22 0x00007ffff7b15e2d in wxEntry(int&, wchar_t**) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-2.8.so.0
#23 0x0000000000520156 in main (argc=1, argv=0x7fffffffe298) at /home/sean/build/OpenCPN/src/chart1.cpp:819
seandepagnier is offline   Reply With Quote
Old 30-03-2015, 12:21   #8
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

There are two icons put in the toolbar, the first one, the one with the strips through it, is the manager icon, the second is for drawing boundaries. Can you try this one? There used to be a pencil icon shown, but in a recent opencpn update this stopped working. You should still be able to draw a boundary, but the cursor will be an arrow. I am working on finding out why.

I have not implemented preferences yet. I know I want it, just I have been working on getting the drawing bit going.

Not sure why it crashed. That line is just asking for the keycode you pressed from the event. If you used the mouse you should not be in that bit of code. The only two codes that are handled are Ctrl+Shift+B to start a boundary and Esc to stop drawing. It sounds like there is something missing from the compile or link. Can you try again using debug to show you what is happening?

Jon

Quote:
Originally Posted by boat_alexandra View Post
yes, a lot of duplicated code here.

You have no icon? The preferences button doesn't work, it will be disabled if you don't request it with WANTS_PREFERENCES

when I enabled I got two icons on the toolbar. When I clicked the first one I crash:
jongough is offline   Reply With Quote
Old 30-03-2015, 13:20   #9
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,634
Images: 2
Re: Ocpn-Draw and Boundary

Thanks for helping to get this working in windows and linux, jon, bdcat and sean

Sent from my SCH-I545 using Cruisers Sailing Forum mobile app
rgleason is offline   Reply With Quote
Old 30-03-2015, 13:49   #10
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

Hi,
I have just changed the directory layout for the plugin to separate the plugin files from the copied OpenCPN files. So you will need to run cmake again before you can compile. I have not had time to download this upload and do a clean compile to make sure it is all OK, hopefully tonight.

Boundary deletes are working again, so that you can shutdown OCPN without having a segfault.

The code may be a bit more unstable as I try to get it working without reference to the OCPN classes so that it will run in windows. Please bear with me on this as I only get 30-60 mins at a time to do the changes.

Jon
jongough is offline   Reply With Quote
Old 30-03-2015, 20:11   #11
Registered User

Join Date: Aug 2009
Location: oriental
Boat: crowther trimaran 33
Posts: 4,417
Re: Ocpn-Draw and Boundary

I crashed in the key event because my fork of opencpn is not in sync with master (I have different ocpn_plugin.h) so I copied that, fixed the crash.

The two toolbar icons appear as generic puzzle pieces.

I was able to draw a boundary in non-opengl mode, but crash in gl mode. I cannot delete the boundary.

I tried to cross compile for windows with mingw, but of course it cannot link because of all the missing symbols.

Maybe we should step back and think about how to incorporate this plugin while minimizing code duplication.
seandepagnier is offline   Reply With Quote
Old 30-03-2015, 22:15   #12
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

Try pulling the latest from the plugin git. Deletes should work OK. The problem was that a couple of wxString variables were in the 'private' section and the destructor failed as they had nulls in them at the time the destructor was called. Before that they had valid values, so I don't quite know what happend. Fixed this by moving the variables into the 'public' area.

Jon
jongough is offline   Reply With Quote
Old 31-03-2015, 00:39   #13
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

Create boundaries in using OpenGL now works, but the rubber banding does not show.

Quote:
Originally Posted by boat_alexandra View Post
I crashed in the key event because my fork of opencpn is not in sync with master (I have different ocpn_plugin.h) so I copied that, fixed the crash.

The two toolbar icons appear as generic puzzle pieces.

I was able to draw a boundary in non-opengl mode, but crash in gl mode. I cannot delete the boundary.

I tried to cross compile for windows with mingw, but of course it cannot link because of all the missing symbols.

Maybe we should step back and think about how to incorporate this plugin while minimizing code duplication.
jongough is offline   Reply With Quote
Old 31-03-2015, 08:33   #14
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,634
Images: 2
Re: Ocpn-Draw and Boundary

Quote
Rick,
I have only built the plugin standalone, ... In standalone mode it builds OK with Linux and compiles but does not link with windows VS2010.

The errors you seem to be getting are due to the inclusion of the 'styles.h' file which is a copy of the mainline OpenCPN 'styles.h' file.
The plugin is using v1.13 of the API which is still evolving... So you need an up to date clean copy of the latest ocpn git and my 'boundary' version of the plugin, then you can compile and link both and put the libocpn_draw_pi.so file in the lib/opencpn directory which will allow you to try it out.

Jon

Thanks Jon
I am trying to get my head around this.
1. Cuurent master v4.1 required for api 1.13.
2. Compile the boundary plugin (as standalone or with msvc++).
3. Do something with styles.h copy to ehere?
4. Compile opncpn_draw and put the dll under the plugins directory?
5. I should be checking the readme for how to compile use and test. Is there one yet?

Thanks



Sent from my SCH-I545 using Cruisers Sailing Forum mobile app
rgleason is offline   Reply With Quote
Old 31-03-2015, 12:24   #15
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Ocpn-Draw and Boundary

Hi,
Please remember this is an alpha version and is still very much a work in progress. I am trying to remove the dependencies on classes in the mainline code, but it is taking a little time. I really only have a linux development environment with the windows one being for occasional testing (it is way to slow to attempt development with debugging). If you can test under linux it would be much appreciated, if not, then please bear with me as I get it to the point where it will work with windows.

Jon
jongough 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rookie questions - boundary circles; exporting options; GPX files fredgmeyer OpenCPN 5 23-05-2014 22:22
Buoys out in Boundary Bay, BC Carogan Liveaboard's Forum 0 27-08-2012 06:41
For Sale: Cascade Designs Seal Line Boundary 70 Dry Bag thesparrow Classifieds Archive 0 14-03-2011 15:27
Current draw and insulation of portable fridges troppo Plumbing Systems and Fixtures 6 06-03-2011 09:00
amperage draw for Garmin radar and MFD janders Marine Electronics 8 16-12-2008 17:00

Advertise Here


All times are GMT -7. The time now is 15:01.


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.