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 09-07-2020, 06:48   #2596
Registered User

Join Date: May 2012
Posts: 1,226
Re: Beta Test / Technical

Rick...

If you are using Visual Studio you need to remove 'version.h' from your 'src' folder. Studio needs to find the 'version.h' built in the 'build\CMakeFiles\include' folder.

Mike
Rasbats is offline   Reply With Quote
Old 09-07-2020, 08:34   #2597
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

Mike, this is very helpful. Thank you.

Quote:
Originally Posted by Rasbats View Post
Rick...

The testplugin_pi icon code may lead you into over-complication. If you look at DR_pi you will see SVG in use, without too much extra code.

The files to look at are here:
CMakeLists.txt line 80 Opion DR_USE_SVG

icons.cpp (assumes using SVG) also has some coded info about the image. How do we get this or make this?

icons.h at the top is says autogenerated by png2wx. How do I use that?
DR_pi.cpp (the plugins panel icon is a .png, side-bar icons are .SVG) I see DR_pi init and #ifdef DR_USE_SVG
DR_pi.h Not sure what is needed here.


https://github.com/Rasbats/DR_pi

Mike

I assume you run png2wx to create something. I already converted one icon. Does this do conversions on the fly or is it manual?
rgleason is offline   Reply With Quote
Old 11-07-2020, 14:20   #2598
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

We just upgraded the Dokuwiki to "Hogfather" I had been holding off, apprehensive of problems with plugins "indexmenu" and "bootstrap3" however it appears we are using those within normal parameters and the upgrade was without a problem.


There was an interesting short article by Andreas Gohr, the primary author of Dokuwiki, titled Rebasing


Also, Things you should never do, Part 1
rgleason is offline   Reply With Quote
Old 13-07-2020, 08:22   #2599
Registered User

Join Date: Mar 2011
Posts: 732
Re: Beta Test / Technical

Quote:
Originally Posted by jongough View Post
The common name is handled by the version.h.in file to create 'PLUGIN_COMMON_NAME' and then this is used within the c code:

wxString testplugin_pi::GetCommonName()
{
return _T(PLUGIN_COMMON_NAME);
}
There should be no conflicts as the name spcified in CMakeLists.txt is what is used.
What will happen if I want to use a human readable string for my plugin (human readable meaning capitalization and spaces)?
Consider CMakeLists.txt with the following:
Code:
set(VERBOSE_NAME "racingplugin")
set(COMMON_NAME "Race Start Display")
set(TITLE_NAME "racingplugin")
set(PACKAGE_CONTACT "twocanplugin@hotmail.com")
set(PACKAGE "racingplugin")
set(SHORT_DESCRIPTION "Race Start Display, A simple tool for yacht racing")
set(LONG_DESCRIPTION "Race Start Display, A simple tool for yacht racing, Displays countdown timer, distance and time to start line")
In CmakeLists.txt following the convoluted in-files processing, it appears as though TITLE_NAME, VERBOSE_NAME are redundant ? Can these be removed ? Also where is the plugin name appended with "_pi" (eg. racingplugin_pi) generated ? Ideally I want to get rid of hard-coded strings in my code so that I can do something like:
Code:
GetPluginDataDir(OCPN_PLUGIN_NAME);
instead of
GetPluginDataDir("racingplugin_pi");
Finally, I find the plugin manager ui very confusing, A checkbox bitmap ? I wonder how many giggles ui testers hiding behind one way mirrors are having as they watch users attempting to click on the checkbox bitmap and nothing happens ! Absurd to say the least. How about a cloud/download arrow icon for managed plugins and a disk drive/folder/download arrow for un-managed plugins. A minor nitpick "Dismiss" ? Buttons have (and should be) Yes/No, OK/Apply/Cancel, Open/Close. FFS....
Attached Thumbnails
Click image for larger version

Name:	error4.png
Views:	64
Size:	59.1 KB
ID:	219244   Click image for larger version

Name:	error5.png
Views:	57
Size:	7.9 KB
ID:	219245  

stevead is offline   Reply With Quote
Old 13-07-2020, 10:56   #2600
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

Quote:
Originally Posted by stevead View Post
set(VERBOSE_NAME "racingplugin")
set(COMMON_NAME "Race Start Display")
set(TITLE_NAME "racingplugin")

I wouldn't do that, leads to trouble, but you are welcome to try...
I also would like some definitive clarification of what all these names are for, and I wonder why we can't just have one or two?


I also have questions about all the options and settings that have found their way into sean's plugins, and I sometimes wonder if they do anything. I'd really like to clean that up.
rgleason is offline   Reply With Quote
Old 13-07-2020, 13:50   #2601
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,500
Re: Beta Test / Technical

steavad...
Thanks for the input.
A bit late for incorporation in OCPN 5.2.
Bring your ideas to the OpenCPN issues list, and we'll discuss for later versions.


Thanks
Dave
bdbcat is offline   Reply With Quote
Old 14-07-2020, 07:45   #2602
Registered User

Join Date: Mar 2011
Posts: 732
Re: Beta Test / Technical

The following is giving me satisfactory results for the Plugin Manager (with a human readable plugin name) and may be of use to other plugin developers. Thanks to Mike (once again) for pointing me in the right direction for the new Plugin Manager.

Code:
CMakeLists.txt
....
set(VERBOSE_NAME "Race_Start_Display")
set(COMMON_NAME "Race Start Display")
set(TITLE_NAME "RACESTARTDISPLAY")
set(PACKAGE_CONTACT "twocanplugin@hotmail.com")
set(PACKAGE "race_start_display")
set(SHORT_DESCRIPTION "Race Start Display, A simple tool for yacht racing")
set(LONG_DESCRIPTION "Race Start Display, A simple tool for yacht racing, Displays countdown timer, distance and time to start line") 
set(VERSION_MAJOR "1")
set(VERSION_MINOR "1")
set(VERSION_PATCH "0")
set(VERSION_TWEAK "0")
set(VERSION_DATE "14/07/2020")
set(OCPN_MIN_VERSION "ov50")
set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "16")
...
set(XML_SUMMARY ${SHORT_DESCRIPTION})
set(XML_DESCRIPTION ${LONG_DESCRIPTION})
....
Code:
version.h.in
#define PLUGIN_NAME ${PROJECT_NAME}
#define PLUGIN_CATALOG_NAME wxS("opencpn-${PACKAGE_NAME}")
#define PLUGIN_VERSION_MAJOR ${VERSION_MAJOR}
#define PLUGIN_VERSION_MINOR ${VERSION_MINOR}
#define PLUGIN_VERSION_PATCH ${VERSION_PATCH}
#define PLUGIN_VERSION_TWEAK ${VERSION_TWEAK}
#define PLUGIN_VERSION_DATE "${VERSION_DATE}"
#define PLUGIN_COMMON_NAME "${COMMON_NAME}"
#define PLUGIN_SHORT_DESCRIPTION "${SHORT_DESCRIPTION}"
#define PLUGIN_LONG_DESCRIPTION "${LONG_DESCRIPTION}"
#define PLUGIN_PACKAGE_NAME "${PACKAGE}_pi"
#define OCPN_API_VERSION_MAJOR ${OCPN_API_VERSION_MAJOR}
#define OCPN_API_VERSION_MINOR ${OCPN_API_VERSION_MINOR}
and in my source code
Code:
wxString iconFolder = GetPluginDataDir(PLUGIN_PACKAGE_NAME) + wxFileName::GetPathSeparator() + _T("data") + wxFileName::GetPathSeparator();
....
int RacingPlugin::GetAPIVersionMajor() {
    return OCPN_API_VERSION_MAJOR;
}
int RacingPlugin::GetAPIVersionMinor() {
    return OCPN_API_VERSION_MINOR;
}
int RacingPlugin::GetPlugInVersionMajor() {
    return PLUGIN_VERSION_MAJOR;
}
int RacingPlugin::GetPlugInVersionMinor() {
    return PLUGIN_VERSION_MINOR;
}
wxString RacingPlugin::GetCommonName() {
    return _T(PLUGIN_COMMON_NAME);
}
wxString RacingPlugin::GetShortDescription() {
    return _T(PLUGIN_SHORT_DESCRIPTION);
}
wxString RacingPlugin::GetLongDescription() {
    return _T(PLUGIN_LONG_DESCRIPTION);
}
Attached Thumbnails
Click image for larger version

Name:	racingplugin.png
Views:	61
Size:	52.9 KB
ID:	219323  
stevead is offline   Reply With Quote
Old 14-07-2020, 12:01   #2603
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

Steve, thanks. I am going to email this to Jon so he can include the short and long descriptions in frontend2.



Quote:
Originally Posted by stevead View Post
The following is giving me satisfactory results for the Plugin Manager (with a human readable plugin name) and may be of use to other plugin developers. Thanks to Mike (once again) for pointing me in the right direction for the new Plugin Manager.

Code:
CMakeLists.txt
....
set(VERBOSE_NAME "Race_Start_Display")
set(COMMON_NAME "Race Start Display")
set(TITLE_NAME "RACESTARTDISPLAY")
set(PACKAGE_CONTACT "twocanplugin@hotmail.com")
set(PACKAGE "race_start_display")
set(SHORT_DESCRIPTION "Race Start Display, A simple tool for yacht racing")
set(LONG_DESCRIPTION "Race Start Display, A simple tool for yacht racing, Displays countdown timer, distance and time to start line") 
set(VERSION_MAJOR "1")
set(VERSION_MINOR "1")
set(VERSION_PATCH "0")
set(VERSION_TWEAK "0")
set(VERSION_DATE "14/07/2020")
set(OCPN_MIN_VERSION "ov50")
set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "16")
...
set(XML_SUMMARY ${SHORT_DESCRIPTION})
set(XML_DESCRIPTION ${LONG_DESCRIPTION})
....
Code:
version.h.in
#define PLUGIN_NAME ${PROJECT_NAME}
#define PLUGIN_CATALOG_NAME wxS("opencpn-${PACKAGE_NAME}")
#define PLUGIN_VERSION_MAJOR ${VERSION_MAJOR}
#define PLUGIN_VERSION_MINOR ${VERSION_MINOR}
#define PLUGIN_VERSION_PATCH ${VERSION_PATCH}
#define PLUGIN_VERSION_TWEAK ${VERSION_TWEAK}
#define PLUGIN_VERSION_DATE "${VERSION_DATE}"
#define PLUGIN_COMMON_NAME "${COMMON_NAME}"
#define PLUGIN_SHORT_DESCRIPTION "${SHORT_DESCRIPTION}"
#define PLUGIN_LONG_DESCRIPTION "${LONG_DESCRIPTION}"
#define PLUGIN_PACKAGE_NAME "${PACKAGE}_pi"
#define OCPN_API_VERSION_MAJOR ${OCPN_API_VERSION_MAJOR}
#define OCPN_API_VERSION_MINOR ${OCPN_API_VERSION_MINOR}
and in my source code
Code:
wxString iconFolder = GetPluginDataDir(PLUGIN_PACKAGE_NAME) + wxFileName::GetPathSeparator() + _T("data") + wxFileName::GetPathSeparator();
....
int RacingPlugin::GetAPIVersionMajor() {
    return OCPN_API_VERSION_MAJOR;
}
int RacingPlugin::GetAPIVersionMinor() {
    return OCPN_API_VERSION_MINOR;
}
int RacingPlugin::GetPlugInVersionMajor() {
    return PLUGIN_VERSION_MAJOR;
}
int RacingPlugin::GetPlugInVersionMinor() {
    return PLUGIN_VERSION_MINOR;
}
wxString RacingPlugin::GetCommonName() {
    return _T(PLUGIN_COMMON_NAME);
}
wxString RacingPlugin::GetShortDescription() {
    return _T(PLUGIN_SHORT_DESCRIPTION);
}
wxString RacingPlugin::GetLongDescription() {
    return _T(PLUGIN_LONG_DESCRIPTION);
}
rgleason is offline   Reply With Quote
Old 28-07-2020, 08:03   #2604
Registered User

Join Date: Mar 2011
Posts: 732
Re: Beta Test / Technical

Trying to debug/understand some of the code in my plugin which uses a couple of threads.
Plugin creates Thread A which in turn creates Thread B.
When the plugin receives DeInit, it calls ->delete on Thread A, which calls ->delete on thread B.
The following is the sequence of events logged just using printf.
Code:
Main Starting
Main Creating Thread One
Thread One Constructor
Thread One Creating Thread Two
Thread Two Constructor
Thread One Starting Thread Two
Thread Two Start Entry
Thread Two Within Loop (0)
Main Starting Thread One
Thread One Start Entry
Thread One Within Loop (0)
Thread Two Within Loop (1)
Thread One Within Loop (1)
Thread Two Within Loop (2)
Thread Two Within Loop (3)
Thread One Within Loop (2)
Thread Two Within Loop (4)
Thread Two Within Loop (5)
Thread One Within Loop (3)
Thread Two Within Loop (6)
Thread Two Within Loop (7)
Thread One Within Loop (4)
Thread Two Within Loop (8)
Thread Two Within Loop (9)
Thread One Within Loop (5)
Thread Two Within Loop (10)
Thread Two Within Loop (11)
Thread One Within Loop (6)
Thread Two Within Loop (12)
Thread Two Within Loop (13)
Thread One Within Loop (7)
Thread Two Within Loop (14)
Thread Two Within Loop (15)
Thread One Within Loop (8)
Thread Two Within Loop (16)
Thread Two Within Loop (17)
Thread One Within Loop (9)
Thread Two Within Loop (18)
Thread Two Within Loop (19)
Main Destroying Thread One
Thread One End Entry
Thread One Beginning OnExit
Thread One Destroying Thread Two
Thread Two End Entry
Thread Two OnExit
Thread One Received Error Code 0 and Exit Code 10 from Thread Two (delete)
Thread One Waiting on Thread Two
Thread One Received Exit Code 10 from Thread Two(wait)
Thread One Deleting Thread Two
Thread Two Destructor
Thread One Ending OnExit
Main received error code 0 and exit code 0 from Thread One (delete)
Main Waiting on Thread One
Main received exit code 0 from Thread One (wait)
Main Deleting Thread One
Thread One Destructor
Main Exiting
If however I use wxLogMessage, clearly the main function buffers the logs entries and they are written out in the "wrong" order.
Code:
12:19:13 AM: Main Starting
12:19:13 AM: Main Creating Thread One
12:19:13 AM: Thread One Constructor
12:19:13 AM: Thread One Creating Thread Two
12:19:13 AM: Thread Two Constructor
12:19:13 AM: Thread One Starting Thread Two
12:19:13 AM: Main Starting Thread One
12:19:33 AM: Main Destroying Thread One
12:19:33 AM: Main received error code 0 and exit code 0 from Thread One (delete)
12:19:33 AM: Main Waiting on Thread One
12:19:33 AM: Main received exit code 0 from Thread One (wait)
12:19:33 AM: Main Deleting Thread One
12:19:33 AM: Thread One Destructor
12:19:33 AM: Main Exiting
12:19:13 AM: Thread Two Start Entry
12:19:13 AM: Thread Two Within Loop (0)
12:19:13 AM: Thread One Start Entry
12:19:13 AM: Thread One Within Loop (0)
12:19:14 AM: Thread Two Within Loop (1)
12:19:15 AM: Thread One Within Loop (1)
12:19:15 AM: Thread Two Within Loop (2)
12:19:16 AM: Thread Two Within Loop (3)
12:19:17 AM: Thread One Within Loop (2)
12:19:17 AM: Thread Two Within Loop (4)
12:19:18 AM: Thread Two Within Loop (5)
12:19:19 AM: Thread One Within Loop (3)
12:19:19 AM: Thread Two Within Loop (6)
12:19:20 AM: Thread Two Within Loop (7)
12:19:21 AM: Thread One Within Loop (4)
12:19:21 AM: Thread Two Within Loop (8)
12:19:22 AM: Thread Two Within Loop (9)
12:19:23 AM: Thread One Within Loop (5)
12:19:23 AM: Thread Two Within Loop (10)
12:19:24 AM: Thread Two Within Loop (11)
12:19:25 AM: Thread One Within Loop (6)
12:19:25 AM: Thread Two Within Loop (12)
12:19:26 AM: Thread Two Within Loop (13)
12:19:27 AM: Thread One Within Loop (7)
12:19:27 AM: Thread Two Within Loop (14)
12:19:28 AM: Thread Two Within Loop (15)
12:19:29 AM: Thread One Within Loop (8)
12:19:29 AM: Thread Two Within Loop (16)
12:19:30 AM: Thread Two Within Loop (17)
12:19:31 AM: Thread One Within Loop (9)
12:19:31 AM: Thread Two Within Loop (18)
12:19:32 AM: Thread Two Within Loop (19)
12:19:33 AM: Thread One End Entry
12:19:33 AM: Thread One Beginning OnExit
12:19:33 AM: Thread One Destroying Thread Two
12:19:33 AM: Thread Two End Entry
12:19:33 AM: Thread Two OnExit
12:19:33 AM: Thread One Received Error Code 0 and Exit Code 10 from Thread Two (delete)
12:19:33 AM: Thread One Waiting on Thread Two
12:19:33 AM: Thread One Received Exit Code 10 from Thread Two(wait)
12:19:33 AM: Thread One Deleting Thread Two
12:19:33 AM: Thread Two Destructor
Note the wxLogMessage time stamps!

Any thoughts as to how to flush the wxLogMessages correctly from a child thread ? It's very difficult to follow the plugin program logic when the logging is misleading.

Thanks.
stevead is offline   Reply With Quote
Old 28-07-2020, 14:41   #2605
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Beta Test / Technical

I my plugins I use a 'roll your own' approach that writes messages to the debug window. I don't know if this will help in your case but you could give it a try. You will find the code in testplugin_pi `https://github.com/jongough/testplugin_pi, look in the `include/testplugin_pi.h` file starting at line 32 through to line 121, put this in your main header file. To use it there are two methods:
  1. insert `DEBUGSL("whatever you want");` or `DEBUGSL(variable);`
  2. insert
    ```
    DEBUGST("whatever you want");
    DEBUGCONT("something else");
    ........
    DEBUGEND("Last part of line");
    ```
    This will insert a single line composed of multiple parts.
It does check if it is a debug build and will only generate code for it if that is the case, otherwise it will generate nothing.


I generally add these statements as needed to debug issues then remove them once the issue is sorted. By doing this I get targeted messages.
jongough is offline   Reply With Quote
Old 30-07-2020, 08:47   #2606
Registered User

Join Date: Sep 2016
Posts: 1
Re: Beta Test / Technical

Returning to OpenCPN updates after a long hiatus, downloaded 5.2.0 on my 17" MacBook Pro (2.8GHz Intel Core 2 Duo on OSX 10.10.5) and when I start it, it complains about a lock file not being there or deleting a stale one:

Deleted stale lock file '/Users/vaizki/Library/Preferences/opencpn/_OpenCPN_SILock'.

But then OpenCPN just dies with: illegal instruction: 4

This kind of message makes me think that the latest packages are compiled for a CPU feature set which are not supported on my (ancient) hardware. I am still under the impression that my setup SHOULD work?
vaizki is offline   Reply With Quote
Old 19-08-2020, 11:32   #2607
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

Sean's "Plots_pi" plugin is configured for Plugin Manager now, but there are now some undeclared identifiers in plots_pi.cpp which were not there when building for the earlier wxWidgets. I could use some help fixing this, after which I think it will work.
https://github.com/rgleason/plots_pi/tree/frontend2
rgleason is offline   Reply With Quote
Old 19-08-2020, 11:44   #2608
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

Verezano's AISradar has been configured for Plugin Manager, but there are essentially two errors in Tactics.cpp "not declared in this scope" that are holding up deployment. I need some help fixing this and would like to learn how to do it.
https://github.com/rgleason/AISradar_pi/tree/frontend2
rgleason is offline   Reply With Quote
Old 19-08-2020, 11:54   #2609
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

Sean's Celestial Navigation is prepared for Plugin Manager except there are undeclared identifiers in Sight.cpp that I need some help fixing.
https://github.com/rgleason/celestia...tree/frontend2


PR's fixing this would be appreciated.
rgleason is offline   Reply With Quote
Old 19-08-2020, 17:23   #2610
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,766
Images: 2
Re: Beta Test / Technical

Sean's Statusbar_pi requires the "Preferences" button to provide access to settings. Currently "Preferences" is greyed out, but it was working previously. I believe this problem is due to the new Plugin Manager structure which requires an icon in the toolbar, which has been disabled in this plugin to save space.


I will make a PR to remove this from the master catalog tomorrow.
The plugin currently builds for all environments and installs ok, but it does not work.

I would like to get this fixed and will gratefully accept a PR that repairs this problem.
https://github.com/rgleason/statusbar_pi/commits/master
rgleason 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
Beta Marine Diesel michaelmrc Engines and Propulsion Systems 48 23-03-2016 13:44
Need some technical advice....antennas. Just a Tinch Marine Electronics 15 01-12-2007 15:57
Blue Sea Systems Technical Brief GordMay Electrical: Batteries, Generators & Solar 0 16-03-2007 04:16
technical difficulties witchcraft The Sailor's Confessional 1 30-05-2005 14:09
Dow Corning Technical Manual GordMay The Library 0 12-04-2005 16:25

Advertise Here


All times are GMT -7. The time now is 02:41.


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.