Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 20-05-2013, 21:34   #1
Registered User

Join Date: May 2013
Posts: 10
opencpn code structure...

First, I should admit I'm new to the OpenCPN project.
I downloaded the code, looked into it...
The following question appears -
Is there some notes, documents, threads, etc. - about the structure of the whole code base? For example, I would like to identify 'quickly' the rendering part, S57 reading/processing part, etc...
Any advice how to 'make familiar' myself with the code as quickly as possible are really appreciated.
Thanks,
Michael.
P.S. I tried to find similar question/thread, but failed. My apology if I missed something obvious.
__________________

__________________
ma5645 is offline   Reply With Quote
Old 21-05-2013, 06:39   #2
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
Re: opencpn code structure...

Michael...
The short answer is "no, read the code and step through it" Basically what has S57 in the name is usually S57 related etc.

Pavel
__________________

__________________
nohal is offline   Reply With Quote
Old 21-05-2013, 16:12   #3
Registered User

Join Date: May 2013
Posts: 10
Re: opencpn code structure...

Pavel -
Thanks for your reply.
I was expecting such answer, but there is always a hope

>>>...what has S57 in the name is usually S57 related...
S57 is relatively easy.
My major concerns :
- rendering, or how the information finally appears on the screen;
- how different modules are "communicating" with each other...

If there are any "tips" where to start looking - especially for rendering -
I would really appreciate it. Thanks in advance!

Michael.
__________________
ma5645 is offline   Reply With Quote
Old 21-05-2013, 16:27   #4
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
Re: opencpn code structure...

Michael...
I would probably start at https://github.com/OpenCPN/OpenCPN/b...hart1.cpp#L841
Without that you can't do anything. Knowing what exactly you want to do would perhaps help to send you to other places... As you have sure seen already, there's not much of an internal API, so tasks like "I would like to borrow that fancy S57 rendering OpenCPN has" are non-trivial.

Pavel
__________________
nohal is offline   Reply With Quote
Old 21-05-2013, 18:01   #5
Registered User

Join Date: May 2013
Posts: 10
Re: opencpn code structure...

Pavel -

>>>tasks like "I would like to borrow that fancy S57 rendering OpenCPN has" are non-trivial.
It is not about it.
It is more about 'gaining full control' over the software.

>>>Knowing what exactly you want to do would perhaps help to send you to other places...

I have a small 34 footer, sailing. Being involved with building embedded systems, I'm in a process assembling the 'proper system' for my boat.
From hardware prospective - the core at this point is Panda board.
So, it is Linux, Ubuntu... Seems no problem to run OpenCPN 'as is'.

My challenge with rendering is 2 folded :
- the default configuration of most devices - like Panda board, DreamPlug, Rasberry Pi - assumed some kind of screen, usually HDMI. It is not ideal, in my opinion, for a lot of reasons. Those are not battery friendly, to say at least...
It is OK to start OpenCPN, and to get used to it... But on a long run - I would like to get the whole 'control' of the code, and to have the possibility to display info in some different manner: to display some briefs on small display, and only if I need a detailed picture - to switch to a big display...
To display the same info on different devices - including mobile - would be next step. Again - not to run the multiple OpenCPN(s), but to have 1 OpenCPN on, say, Panda - and sharing screens on different devices... (Including iOS(s) -- but it is the whole different story... I know what may be involved on that road...).
- the second direction - to add some features to my system ( And, if people like it - theirs too). Like adding comments, exchange info, etc. I'm sure that most of features exists already.(And I just need to learn OpenCPN more )... But some, probably, not. And I would like to add them...

In other words, I have a few motivations to get the good knowledge of code, running on my machine. Otherwise, it would be no different then my Garmin GPS ...

So, thanks for your advice. I'll start with init(), and then - slowly further.

Michael.
__________________
ma5645 is offline   Reply With Quote
Old 06-09-2013, 07:21   #6
Registered User

Join Date: Jul 2011
Location: Brooklyn
Boat: Catalina 30
Posts: 60
Re: opencpn code structure...

I am interested in digging into the OpenCPN code to understand it more as well, but luckily I have a goal. I would like to see how possible it would be to add a command line option to specify a single S-57 chart and an output image file and possibly a scale/resolution, if necessary. I suppose layers could rely on defaults.

Why would I want this? I find myself wondering what a particular S-57 chart looks like, and I would like to create thumbnails as part of a different project.

I have had some success using the OGR library/utilities to extract the charts, but I see that one really needs much of the same functionality that a true chartplotter has.

So I would need to look at where the command line is parsed, if there is an internal representation of the chart as some sort of raster bitmap, and if there is a way to restrict the array of charts loaded short of deleting all charts except one.

Obviously I would want to just have OpenCPN run without a display, dump the image and exit. Something like imagemagick can deal with post processing.

Hints about what files/classes/methods to look at are welcome. Does anyone see this as useful as a contributed patch? Sadly my C++ sucks. Still, I am game to see what I can figure out.
__________________
carlspackler is offline   Reply With Quote
Old 06-09-2013, 07:37   #7
Registered User

Join Date: May 2011
Location: Toronto
Boat: Sandpiper 565
Posts: 2,943
Re: opencpn code structure...

Quote:
Originally Posted by ma5645 View Post
My challenge with rendering is two-fold:
- the default configuration of most devices - like Panda board, DreamPlug, Rasberry Pi - assumed some kind of screen, usually HDMI. It is not ideal, in my opinion, for a lot of reasons. Those are not battery friendly, to say at least...
It is OK to start OpenCPN, and to get used to it... But on a long run - I would like to get the whole 'control' of the code, and to have the possibility to display info in some different manner: to display some briefs on small display, and only if I need a detailed picture - to switch to a big display...
To display the same info on different devices - including mobile - would be next step.
My understanding of the code behind OpenCPN is that it is built using the open-source cross-platform library wxWidgets, and this provides the low-level functionality, or wraps the OS functionality, for things like display rendering. So, it would be appropriate to learn that library.

To do the stuff you want, you'd probably have to extend or replace some of the wxWidget objects with other or custom low-level code. Not trivial.
__________________
Lake-Effect is offline   Reply With Quote
Old 07-09-2013, 10:29   #8
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,020
Re: opencpn code structure...

carlspackler...
You want to start at https://github.com/OpenCPN/OpenCPN/b...hart1.cpp#L745, that's for sure.
After you get at least a bit familiar with how OpenCPN works, we will be very glad to help you get further and answer your specific questions.

Pavel
__________________

__________________
nohal is offline   Reply With Quote
Reply

Tags
opencpn, paracelle

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 00:40.


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.