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 21-11-2015, 10:23   #391
Registered User

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

Jon,

The plugin was installing into /usr/local/local instead of /usr/local which was not working too well. When build as a package it normally installs into /usr

I had to apply this to get it to install right:

Code:
diff --git a/cmake/PluginInstall.cmake b/cmake/PluginInstall.cmake
index f242ec3..b48f71a 100644
--- a/cmake/PluginInstall.cmake
+++ b/cmake/PluginInstall.cmake
@@ -62,8 +62,8 @@ ENDIF(UNIX AND NOT APPLE)
 SET(PARENT opencpn)
 
 IF(EXISTS /etc/debian_version)
-    SET(PREFIX_DATA local/share)
-    SET(PREFIX_LIB local/lib)
+    SET(PREFIX_DATA share)
+    SET(PREFIX_LIB lib)
 ELSE(EXISTS /etc/debian_version)
     SET(PREFIX_DATA share)
     SET(PREFIX_LIB lib)
Why did you change it and test for debian_version?

Sean
seandepagnier is offline   Reply With Quote
Old 21-11-2015, 11:41   #392
Registered User
 
transmitterdan's Avatar

Join Date: Oct 2011
Boat: Valiant 42
Posts: 6,008
Re: Ocpn-Draw and Boundary

Quote:
Originally Posted by rgleason View Post
Dan. I think I understand part of this rekated to nmea and vdr, and having a server, but what is regression testing? I agree it is more difficult negotiating multiple platforms.
Regression testing is when someone "tests" all the features of a system even those features that software revisions were not supposed to affect. It is often the case that new software features or optimizations will have unintended consequences.

If you are a Python user this is a little server that will send VDR files to OpenCPN without the VDR plugin.
Code:
import socket
import sys
import time

if len(sys.argv) < 4:
    print("USAGE:")
    print("[python] VDRServer1.py VDRFile IP_Address Port# [Sleep time]")
    print("Sleep time is the delay in seconds between UDP messages sent.")
    print("Sleep time defaults to 0.1 seconds")
    sys.exit()

UDP_IP = sys.argv[2]
UDP_PORT = int(sys.argv[3])
filename = sys.argv[1]

if len(sys.argv) > 4:
    delay = float(sys.argv[4])
else:
    delay = 0.1

print(['UDP target IP:', UDP_IP])
print(['UDP target port:', str(UDP_PORT)])

sock = socket.socket(socket.AF_INET, # Internet
                     socket.SOCK_DGRAM) # UDP
f = open(filename, 'rb')

while True :
    if f._checkClosed() :
        sys.exit()
    mess = f.readline()
    if len(mess) < 1:
        f.close()
        sys.exit()
#    print(mess)
    sock.sendto(mess,(UDP_IP, UDP_PORT))
    time.sleep(delay)
I only tested on Windows. If you run this on the same computer as OpenCPN then you configure the connection in OpenCPN like this.
Attached Thumbnails
Click image for larger version

Name:	2015-11-21.png
Views:	127
Size:	22.3 KB
ID:	113457  
transmitterdan is offline   Reply With Quote
Old 21-11-2015, 12:17   #393
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: Ocpn-Draw and Boundary

Quote:
Originally Posted by transmitterdan View Post
It is often the case that new software features or optimizations will have unintended consequences.
It is not often but always the case that so called optimizations for boards only a few people use like the Raspberry Pi killed not only several functions but sometimes even makes OCPN unusable. It has taken nearly 2 years to have been able to release a stable version 4.0.0 after such optimizations which doesn't even work with Mac OSX. Incredible why after all another trial and error period takes place now. Reading the code it is full of potential memory leaks, dereferenced null pointers, dead variables, garbage values and so on and so on. Finally mixing the code with Android ifdefs has made this Spaghetti code even worse.

Gerhard
CarCode is offline   Reply With Quote
Old 21-11-2015, 12:33   #394
Registered User

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

Quote:
Originally Posted by CarCode View Post
It is not often but always the case that so called optimizations for boards only a few people use like the Raspberry Pi killed not only several functions but sometimes even makes OCPN unusable. It has taken nearly 2 years to have been able to release a stable version 4.0.0 after such optimizations which doesn't even work with Mac OSX. Incredible why after all another trial and error period takes place now. Reading the code it is full of potential memory leaks, dereferenced null pointers, dead variables, garbage values and so on and so on. Finally mixing the code with Android ifdefs has made this Spaghetti code even worse.

Gerhard
Thank you for not submitting any pull requests to fix anything.

All mac users besides you have applauded version 4.0 as before opencpn was so slow as to be unusable on mac. Now it's still very slow on mac compared to other operating systems, but possible to use at least.
seandepagnier is offline   Reply With Quote
Old 21-11-2015, 12:47   #395
Registered User
 
INTP's Avatar

Join Date: Jul 2010
Location: East Coast US and Gulf of Mexico
Boat: Eastward Ho 24 Hull #6
Posts: 25
Re: Ocpn-Draw and Boundary

Quote:
Originally Posted by CarCode View Post
It is not often but always the case that so called optimizations for boards only a few people use like the Raspberry Pi killed not only several functions but sometimes even makes OCPN unusable. It has taken nearly 2 years to have been able to release a stable version 4.0.0 after such optimizations which doesn't even work with Mac OSX. Incredible why after all another trial and error period takes place now. Reading the code it is full of potential memory leaks, dereferenced null pointers, dead variables, garbage values and so on and so on. Finally mixing the code with Android ifdefs has made this Spaghetti code even worse.

Gerhard
Here's another way of looking at it.

In as much as OpenCPN is an open source project, perhaps it should be built only for open source OS's, (Linux and Android), and developed for only open source hardware, (Raspberry Pi, et, al).

Development would no doubt progress so much faster. iFruit and WinBroke causes just as many problems from what is apparent.

A ridiculous concept ? No more so than your idea of a perfect "iWorld".

Gerhard, I truly mean no offense, but you come across as quite selfish at times.

I'll go back to shutting up.....
INTP is offline   Reply With Quote
Old 21-11-2015, 14:09   #396
Registered User

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

Rick,
The alarm message you are seeing is for the type of alarm, i.e. outside of inclusion boundary. When the alarm fires that message should change from black text to red text.

I have just got a windows version working. The current watchdog will not fire the alarm as there is a unix specific test that will fail under windows. I have submitted a patch for that, so hopefully you will be able to test it soon. I do get sound as well as the message box when the boat is outside of the boundary.

Jon

Quote:
Originally Posted by rgleason View Post
Sean and Jon,

I moved the boat inside the "Boundary Point Inclusion" example.
Then copied the Guid from "Boundary Point Inclusion" properties and pasted that Guid into Watchdog > Configuration > Edit.
I then tried the Watchdog button to get Guid from the Boundary Point Inclusion example. It got the correct Guid. This was with opengl on and off.

However, the alarm notice is, as you can see, the "Anchor is outside the inclusion area"

Also the alarm is still not sounding.

I have recompiled both Ocpn_Draw and Watchdog this morning with fresh git, and have used yesterday's compile of opencpn with fresh opencpn.lib for both plugins.

I think it the alarm has something to do with portaudio, but first we have to get the reversal of outside and inside alarms fixed. Then deal with the audio in Windows. By the way, the audio for windows, was a problem before the reversal of outside and inside cropped up.

What happens in Linux?
jongough is offline   Reply With Quote
Old 21-11-2015, 15:38   #397
Registered User
 
rgleason's Avatar

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

INTP
Can you explain what " iFruit and WinBrok" are? --Just kidding. At this point I don't really like your idea, opensource only, but it sure would make things easier for those programming. You'd loose part of the community of course.
rgleason is offline   Reply With Quote
Old 21-11-2015, 15:39   #398
Registered User
 
rgleason's Avatar

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

Back on topic.

Jon wrote,
"unix specific test that will fail under windows. I have submitted a patch for that, so hopefully you will be able to test it soon. I do get sound as well as the message box when the boat is outside of the boundary."

Super! How nice. Thank you.

PS: Jon, if you don't mind I am going to add to Tracker some "possible" feature requests as per
http://www.cruisersforum.com/forums/...ml#post1967111
just so the requests can be worked on, improved, or discarded after discussion.
rgleason is offline   Reply With Quote
Old 21-11-2015, 19:03   #399
Registered User

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

Sean,
I can see when the change was made, I think I was trying to get the install to work for Linux. I am currently using Linux Mint (Ubuntu) for development and testing. When I create an install package using the current PluginInstall.cmake the log shows:
12:17:06 AEDT: PlugInManager: Loading PlugIn: /usr/local/lib/opencpn/libocpn_draw_pi.so

When I use your modification the plugin does not load as it is located in /usr/lib/opencpn

So, is debian different from ubuntu for this cmake file? Is there a way to distinguish between debian and ubuntu when building the code?

Jon

Quote:
Originally Posted by boat_alexandra View Post
Jon,

The plugin was installing into /usr/local/local instead of /usr/local which was not working too well. When build as a package it normally installs into /usr

I had to apply this to get it to install right:

Code:
diff --git a/cmake/PluginInstall.cmake b/cmake/PluginInstall.cmake
index f242ec3..b48f71a 100644
--- a/cmake/PluginInstall.cmake
+++ b/cmake/PluginInstall.cmake
@@ -62,8 +62,8 @@ ENDIF(UNIX AND NOT APPLE)
 SET(PARENT opencpn)
 
 IF(EXISTS /etc/debian_version)
-    SET(PREFIX_DATA local/share)
-    SET(PREFIX_LIB local/lib)
+    SET(PREFIX_DATA share)
+    SET(PREFIX_LIB lib)
 ELSE(EXISTS /etc/debian_version)
     SET(PREFIX_DATA share)
     SET(PREFIX_LIB lib)
Why did you change it and test for debian_version?

Sean
jongough is offline   Reply With Quote
Old 21-11-2015, 19:31   #400
Registered User

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

Rick,
What version are you using? When I run the current version, 561, under windows and opengl I do not see this affect. I only saw this before putting the opengl code in place.

Jon

Quote:
Originally Posted by rgleason View Post
Jon, I found a rendering problem when OpenGL is on, because the inclusion "center" area gets rendered with hatch, when it should not. Please see attached. I hope you can fix it. Thanks.
jongough is offline   Reply With Quote
Old 21-11-2015, 21:41   #401
Registered User

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

Quote:
Originally Posted by jongough View Post
Sean,
I can see when the change was made, I think I was trying to get the install to work for Linux. I am currently using Linux Mint (Ubuntu) for development and testing. When I create an install package using the current PluginInstall.cmake the log shows:
12:17:06 AEDT: PlugInManager: Loading PlugIn: /usr/local/lib/opencpn/libocpn_draw_pi.so

When I use your modification the plugin does not load as it is located in /usr/lib/opencpn

So, is debian different from ubuntu for this cmake file? Is there a way to distinguish between debian and ubuntu when building the code?

Jon
Jon

It is supposed to install to /usr/lib/opencpn with a debian package. That is where all the debian packages go. When using "make install" it is meant to go to /usr/local/lib/opencpn.
seandepagnier is offline   Reply With Quote
Old 22-11-2015, 00:03   #402
Registered User

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

Sean,
I have updated (patch 562) the cmake to be more compliant with OCPN. If you now build/package having done a "cmake -DCMAKE_INSTALL_PREFIX=/usr" you will now get OD installed in /usr/lib.

Jon
jongough is offline   Reply With Quote
Old 22-11-2015, 03:39   #403
Registered User
 
rgleason's Avatar

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

I should identify the version. I think it was something like 554. It was the most recent at that time. Will check.
rgleason is offline   Reply With Quote
Old 22-11-2015, 17:43   #404
Registered User
 
rgleason's Avatar

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

Jon I was on c58a122 which is now behind 6. Will do git pull origin master, compile and try.

Quote:
\GitHub\o-plugin\j-ocpn_draw_pi>git branch -va
* master c58a122 [behind 6] Merge pull request #114 from jongough/fixes
remotes/origin/HEAD -> origin/master
remotes/origin/master e3ad8ff Merge pull request #117 from jongough/fixes
c58a122 [behind 6] Merge pull request #114 from jongough/fixes was
ocpn_draw_pi-0.4.559-ov4.1.1108-win32

Jon, I compiled and ran a test. Unfortunately the Boundary Inclusion is not a hole when using Opengl.
Will test for other things tomorrow evening.
rgleason is offline   Reply With Quote
Old 22-11-2015, 21:05   #405
Registered User

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

Rick,
I am currently using patch 562 and have tried it in Win 7 under VirtualBox, Win 8.1 and now (it auto upgraded me) Win 10 and they show Inclusion Boundary Points correctly. You need to have "Show Point Range Rings" checked, Number of Point Range Rings > 0, a big enough range ring to clearly show and a colour that you can see. I have attached two images showing this working. If it is not working for you then I need some more information, does it work without opengl? Do Boundaries work, Exclusion and Inclusion? What is the patch level (show in the OD properties 'About' tab)? The Inclusion boundary will not show if it is less than 10 pixels across (this avoids a crash when polygons get down to very small sizes).

Patch 563 makes the difference between opengl and non-opengl more difficult to see as I have made the fill pattern almost the same.

Do you know anyone else who is having the same issue under opengl? Are there any error messages displayed or in the opencpn.log file? Windows and opengl either seems to work, or not, but there are very few indications of what is going wrong. I seem to spend a lot of time 'fixing' windows opengl long after the code is working in linux. It seems to be VERY picky and not very obvious.

I have put a new pre-release, 563, of OD into git. You will find my installable windows, RPM and DEB files there for the plugin if you want to try that and see if it shows the boundaries correctly.

Jon
Attached Thumbnails
Click image for larger version

Name:	OD_opengl boundary points.png
Views:	149
Size:	164.2 KB
ID:	113597   Click image for larger version

Name:	win10 opengl.png
Views:	155
Size:	64.7 KB
ID:	113598  

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 16: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.