Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 17-07-2011, 11:39   #1
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Plugin Help

Hoi everybody,
I'm trying to change the grib plugin, inorder to have it again showing the isobars (as it did before it was moved to a plugin).
After my editing it is compiling without errors, libgrib_pi.so is made and installed in the right place. BUT Opencpn is not recognize the libgrib_pi.so as a plugin.
I didn't make any changes at the grib_pi and cmake files.
Anybody any idea what is going wrong??
Dirk
Code:
[  0%] grib-i18n [ru]: Created mo file.
[  0%] grib-i18n [fi_FI]: Created mo file.
[  0%] grib-i18n [pt_PT]: Created mo file.
[  0%] grib-i18n [de]: Created mo file.
[  0%] grib-i18n [pl_PL]: Created mo file.
[  0%] grib-i18n [fr]: Created mo file.
[  0%] grib-i18n [et]: Created mo file.
[  0%] grib-i18n [es]: Created mo file.
[  0%] grib-i18n [da]: Created mo file.
[  0%] grib-i18n [zh_TW]: Created mo file.
[  0%] grib-i18n [nl]: Created mo file.
[  0%] grib-i18n [cs]: Created mo file.
[  0%] grib-i18n [sv]: Created mo file.
[  0%] grib-i18n [pt_BR]: Created mo file.
[  0%] grib-i18n [pl]: Created mo file.
[  0%] grib-i18n [it]: Created mo file.
[  0%] grib-i18n [el_GR]: Created mo file.
[  0%] grib-i18n [nb_NO]: Created mo file.
[  0%] grib-i18n: Done.
[ 75%] Built target grib-i18n
[ 75%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/grib_pi.cpp.o
[ 75%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/grib.cpp.o
[ 87%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/icons.cpp.o
[ 87%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/GribReader.cpp.o
[ 87%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/GribRecord.cpp.o
[100%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/zuFile.cpp.o
[100%] Building CXX object plugins/grib_pi/CMakeFiles/grib_pi.dir/src/IsoLine.cpp.o
Linking CXX shared library libgrib_pi.so
[100%] Built target grib_pi
dirk@dirk-desktop:~/development/opencpn-714/opencpn/build/plugins/grib_pi$ sudo make install
[sudo] password for dirk: 
[  0%] grib-i18n: Done.
[ 75%] Built target grib-i18n                                                                                                                                                 
[100%] Built target grib_pi
Install the project...
-- Install configuration: ""                                                                                                                                                  
-- Installing: /usr/local/lib/opencpn/libgrib_pi.so
-- Installing: /usr/local/share/locale/fi_FI/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/pt_PT/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/de/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/pl_PL/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/fr/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/et/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/es/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/da/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/zh_TW/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/nl/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/cs/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/sv/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/pt_BR/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/pl/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/it/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/el_GR/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/nb_NO/LC_MESSAGES/opencpn-grib_pi.mo
-- Installing: /usr/local/share/locale/ru/LC_MESSAGES/opencpn-grib_pi.mo
rooiedirk is offline   Reply With Quote
Old 17-07-2011, 13:01   #2
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,145
Re: Plugin help

Dirk,
did you have a look into the log? The core should complain there, if at all...

Pavel
nohal is online now   Reply With Quote
Old 17-07-2011, 13:39   #3
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Re: Plugin help

Dirk,

Maybe a prefix problem? You're installing you plugin in /usr/local:
/usr/local/lib/opencpn/libgrib_pi.so

If you installed "official" rpm, default prefix is /usr (so plugins are expected to be in /usr/lib/opencpn)

What is the output of:
$ which opencpn
/usr/bin/opencpn
SethDart is offline   Reply With Quote
Old 18-07-2011, 01:23   #4
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: Plugin Help

Found the answer in the logfile, thanks for help
Dirk
rooiedirk is offline   Reply With Quote
Old 18-07-2011, 08:50   #5
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: Plugin Help

Hoi everybody,
I do have a grib plugin now that does show the isobars again. pls find attached the patch file. It works under Linux, I can't test under windows, so if somebody would do this, thanks on forehand.
WKR
Dirk
rooiedirk is offline   Reply With Quote
Old 18-07-2011, 08:54   #6
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: Plugin Grib

Hey the attachment disappears, try again
Attached Thumbnails
Click image for larger version

Name:	snapshot2.jpg
Views:	190
Size:	419.4 KB
ID:	29712  
Attached Files
File Type: doc grib_1.patch.doc (10.9 KB, 73 views)
rooiedirk is offline   Reply With Quote
Old 18-07-2011, 08:56   #7
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,145
Re: Plugin Help

Dirk, change the extension to .doc - the forum tries to keep us "safe"...

Pavel
nohal is online now   Reply With Quote
Old 18-07-2011, 09:46   #8
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,145
Re: Plugin Help

To be able to link successfully under Windoze, I had to add
Code:
diff --git a/plugins/grib_pi/CMakeLists.txt b/plugins/grib_pi/CMakeLists.txt
index 68dc7b3..de69d20 100644
--- a/plugins/grib_pi/CMakeLists.txt
+++ b/plugins/grib_pi/CMakeLists.txt
@@ -69,6 +69,7 @@ SET(SRC_GRIB
             src/GribRecord.cpp
             src/zuFile.cpp
             src/IsoLine.cpp
+           ../../src/cutil.c
 )
 ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRC_GRIB})
Looks working well

Pavel
nohal is online now   Reply With Quote
Old 18-07-2011, 10:37   #9
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: Plugin Help

hoi Pavel,
Thanks for the fast testing.
Attached the updated patchfile.
Dirk
Attached Files
File Type: doc grib_2.patch.doc (11.3 KB, 80 views)
rooiedirk is offline   Reply With Quote
Old 18-07-2011, 13:06   #10
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,384
Re: Plugin Help

rooiedirk....

Nice work!

One problem: I don't see directly what "cutil.c" is used for. In any case, its not quite kosher to get it like this:

+ ../../src/cutil.c

Plugins (in theory) have no access to the mainline source tree. Nor should they require it. All they need from the mainline is ocpn_plugin.h


So, simple solution is to duplicate whatever parts of cutil.c that are needed by the PlugIn in the plugin branch itself.
For example, Dashboard does this now with NEMA decoding....

I know, I know, its silly duplication of code. But we need a real chinese wall here if we are ever to attract useful closed source (i.e. proprietary) plugins.

Of course, that's "whole 'nother thing", as they say, and lets not go there on this thread.....


Thanks
Dave
bdbcat is offline   Reply With Quote
Old 18-07-2011, 13:18   #11
Registered User

Join Date: Feb 2010
Location: Tierra del Fuego
Boat: Phantom 19
Posts: 6,145
Re: Plugin Help

Dave...
Code:
ClipResult cohen_sutherland_line_clip_i (int *x0_, int *y0_, int *x1_, int *y1_,
                                         int xmin_, int xmax_, int ymin_, int ymax_)
(and it's dependencies) is the only part used. To make it properly, we should also duplicate cutil.h
Not a big deal here - it's a couple of lines of code, but... We have to think about it anyway, as solving the possible conflicts between the libraries needed by different plugins could start to be non-trivial in the future.

Pavel
nohal is online now   Reply With Quote
Old 18-07-2011, 15:34   #12
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,384
Re: Plugin Help

Pavel....

My point exactly. If the only interface is ocpn_plugin.h, then we can manage the dependencies cleanly.

In other words, each PlugIn must be self contained. They must not depend on anything which may now be embedded but unexported in mainline, and which may go away, or worse, change definition.

I agree the the instant case is simply a matter of incorporating the required utility subroutine into one or another of grib's source modules, and not exporting it.

Dave
bdbcat is offline   Reply With Quote
Old 19-07-2011, 03:17   #13
Registered User
 
rooiedirk's Avatar

Join Date: Aug 2010
Location: Netherlands
Boat: Oneoff
Posts: 510
Re: Plugin Help

Hoi Dave, Pavel,
Does make sence a complete seperation. So I copied the used functions into IsoLine files.
I found that still some work to be done an the seawater temperature readings.

regards
Dirk
Attached Files
File Type: doc grib_3.patch.doc (18.9 KB, 79 views)
rooiedirk is offline   Reply With Quote
Old 19-07-2011, 10:06   #14
Registered User

Join Date: Jul 2011
Location: Köln / Cologne / Germany
Posts: 3
Send a message via Skype™ to Rheinsegler
Re: Plugin Help

More help with Linux (Ubuntu) and plugin

@SethDart:
on my Computer the openCPN is located in: /usr/local/bin/opencpn
the path to plugin is: /usr/local/share/opencpn/plugins
I moved the *.pl.so files to this folder
but! openCPN only shows the dashbord and the Dashbord an the Grib plugin.
Where is my fault?

Thanks for your help.
Holger
Rheinsegler is offline   Reply With Quote
Old 19-07-2011, 10:29   #15
Registered User

Join Date: Mar 2010
Location: Normandy, France
Boat: Flush Poker, 8.25m (Point Barre)
Posts: 340
Re: Plugin Help

Since 2.4.628 plugins moved to $PREFIX/lib/opencpn (or lib64 depending on your arch)

So try to move the plugins to /usr/local/lib/opencpn/ (for Ubuntu lib64/ is a symlink to lib/)
and it should work.
SethDart is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VDR Plugin SethDart OpenCPN 126 25-02-2024 05:19
World Magnetic Model Plugin nohal OpenCPN 149 31-01-2023 05:06
Google Earth Plugin r.fairman OpenCPN 445 29-04-2020 10:11
NV Digital Verlag Chart PlugIn bdbcat OpenCPN 21 23-04-2012 16:51
Route Properties, Missing Functions James Baines OpenCPN 13 13-07-2011 04:31

Advertise Here


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


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.