Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 28-07-2017, 01:17   #76
Registered User

Join Date: Jul 2017
Posts: 5
Re: OpenCPN PlugIn Development

Hello, sorry for flood, just to give some more details - i'm still confused. As far as I understand, in DLL i have some dependencies which can not be found. But i try to explore some other DLL (with dependancy walker) in plugins folder which is working and see that they also have troubles with dependencies, but they work. Here is a snapshot of my cmake configuration and copy of log file from build in MS Visual Studio
Attached Thumbnails
Click image for larger version

Name:	ocpn_tmp.png
Views:	67
Size:	24.1 KB
ID:	152866  
Attached Files
File Type: doc vslog.doc (5.3 KB, 21 views)
__________________

xentia is offline   Reply With Quote
Old 28-07-2017, 05:33   #77
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 12,062
Re: OpenCPN PlugIn Development

xentia,

Have you looked through the Learning portion of the Developer Manual that [rasbats] created?

https://opencpn.org/wiki/dokuwiki/do...ugins:learning

It appears you have some skill, perhaps Private Message Mike R. [Rasbats] he may be able to help.
__________________

rgleason is online now   Reply With Quote
Old 28-07-2017, 06:05   #78
Registered User

Join Date: May 2012
Posts: 534
Re: OpenCPN PlugIn Development

xentia,

I think you should try building against wxWidgets 3.0.2. See the dokuwiki about 'Compiling - Windows'.

Mike
Rasbats is offline   Reply With Quote
Old 29-07-2017, 03:15   #79
Registered User

Join Date: Jul 2017
Posts: 5
Re: OpenCPN PlugIn Development

@Rasbats - thank you. I was try that - compile with 3.0.2 - same result Furthermore - there is not developer DLL for my version of Visual C++ for 3.0.2, max versions for that build is
wxMSW-3.0.2_vc120_x86_ReleaseDLL.msi
which couse version problem during build. But anyway - after compile I get same result Obviously i miss some detail

The last option i see is to compile openCPN from scratch on my computer with VisualStudio 2017 and try again.
xentia is offline   Reply With Quote
Old 12-06-2018, 05:04   #80
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Not sure if this is the right spot in the forum... but trying anyway. I am working a plugin for OpenCPN. I have a working toolchain with VS2013 and OpenCPN and can compile and debug OpenCPN as well as plugin code. I have also worked through the "learning" section in the OpenCPN developer guide. All good stuff, BTW. My question is related to the plugin GUI. I am working with OpenCPN 4.8.4 and wxWidgets 3.0.4. I want to use wxFormBuilder to help build the GUI but I am not sure how to make sure that wxFormBuilder does not use anything that is not supported by wxWidgets 3.0.4. By that, I mean if I use the latest version of wxFormBuilder, is there a way to constrain it to whats supported in wxWidgets 3.0.4 or maybe this is not even an issue?
cryptik is offline   Reply With Quote
Old 12-06-2018, 05:07   #81
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,763
Re: OpenCPN PlugIn Development

Quote:
Originally Posted by cryptik View Post
Not sure if this is the right spot in the forum... but trying anyway. I am working a plugin for OpenCPN. I have a working toolchain with VS2013 and OpenCPN and can compile and debug OpenCPN as well as plugin code. I have also worked through the "learning" section in the OpenCPN developer guide. All good stuff, BTW. My question is related to the plugin GUI. I am working with OpenCPN 4.8.4 and wxWidgets 3.0.4. I want to use wxFormBuilder to help build the GUI but I am not sure how to make sure that wxFormBuilder does not use anything that is not supported by wxWidgets 3.0.4. By that, I mean if I use the latest version of wxFormBuilder, is there a way to constrain it to whats supported in wxWidgets 3.0.4 or maybe this is not even an issue?
If the generated code used anything not supported by wx3.0, you would not be able to build it and thus noticed it immediately. But don't worry, this won't happen.

Pavel
nohal is offline   Reply With Quote
Old 17-07-2018, 13:06   #82
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Pavel, in this thread, you posted the following:

Quote:
Originally Posted by nohal View Post
...if you need to receive it [NMEA messages] from a sensor:
- set WANTS_NMEA_SENTENCES flag in the return value of yourplugin_pi::Init
- Implement SetNMEASentence method

If you want to send it out, just call PushNMEABuffer
If I have OpenCPN connected to my AIS and my plugin wants to send the AIS a command over the serial port, will PushNMEABuffer() send it out? When using this method, does it send out the string to a specific connection or all connections?

- thx
cryptik is offline   Reply With Quote
Old 17-07-2018, 14:34   #83
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,763
Re: OpenCPN PlugIn Development

Quote:
Originally Posted by cryptik View Post
Pavel, in this thread, you posted the following:



If I have OpenCPN connected to my AIS and my plugin wants to send the AIS a command over the serial port, will PushNMEABuffer() send it out? When using this method, does it send out the string to a specific connection or all connections?

- thx
To all connections set as output and not set to filter the sentence out.
nohal is offline   Reply With Quote
Old 18-07-2018, 14:56   #84
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Thanks Pavel, I seem to have everything working now except for one last item. I have a plugin dialog with a multi-line text box modeled almost identical to the one in ocpndebugger_pi except I don't have tabs. I can compile ocpndebugger_pi and it runs as expected (minus the SIGNALK stuff which I removed). The debugger displays NMEA sentences in the window coming in from my GPS. In my plugin, I have a similar window and have matched the code to ocpndebugger_pi almost identically. My problem is that when I run my plugin, and open the window, it will display exactly one GPS NMEA message and that's it. No exceptions and OpenCPN continues to run just fine... but my plugin text control is not updated. I don't see any kind of timer or refresh code in the ocpndebugger_pi code... so I am wondering if I am missing some kind of flag to continue to get strings from the NMEA stream? Does anything come to mind? I have gone over ocpndebugger_pi and my code and I don't see any substantial difference that would cause this behavior.

- thx
Ken
cryptik is offline   Reply With Quote
Old 18-07-2018, 17:24   #85
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,763
Re: OpenCPN PlugIn Development

Quote:
Originally Posted by cryptik View Post
Thanks Pavel, I seem to have everything working now except for one last item. I have a plugin dialog with a multi-line text box modeled almost identical to the one in ocpndebugger_pi except I don't have tabs. I can compile ocpndebugger_pi and it runs as expected (minus the SIGNALK stuff which I removed). The debugger displays NMEA sentences in the window coming in from my GPS. In my plugin, I have a similar window and have matched the code to ocpndebugger_pi almost identically. My problem is that when I run my plugin, and open the window, it will display exactly one GPS NMEA message and that's it. No exceptions and OpenCPN continues to run just fine... but my plugin text control is not updated. I don't see any kind of timer or refresh code in the ocpndebugger_pi code... so I am wondering if I am missing some kind of flag to continue to get strings from the NMEA stream? Does anything come to mind? I have gone over ocpndebugger_pi and my code and I don't see any substantial difference that would cause this behavior.

- thx
Ken
Ken...
You just crossed the line when it is completely impossible to figure out what you do and what is wrong with it. Please show us your code, otherwise we will not be able to help you any more.

Pavel
nohal is offline   Reply With Quote
Old 18-07-2018, 23:24   #86
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Quote:
Originally Posted by nohal View Post
Ken...
You just crossed the line when it is completely impossible to figure out what you do and what is wrong with it. Please show us your code, otherwise we will not be able to help you any more.

Pavel
LOL, I understand. Kind of hard to provide advice when you can't see the code. I have uploaded to project to GitHub. I did another compare and I can't figure out why it displays the first NMEA string but then it stops updating. I know that OpenCPN continues to function, because I can open the NMEA debug window in the OpenCPN connection setup dialog and it displays NMEA strings continuing to get processed. I must be missing something in my dialog panel or maybe it is crashing and not throwing an exception. Any ideas would be welcome.

Everything else seems to be working fine. It compiles and will run in both debug and release builds and the project will even build a working installer package. Just FYI, the only function currently hooked up in the plugin dialog is the multi-line text control receiving the NMEA sentences.


The repo is at https://github.com/cryptik/aismsg_pi

- Ken
cryptik is offline   Reply With Quote
Old 19-07-2018, 11:26   #87
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Does anybody know if there is a method for writing to the openCPN log from within a plugin? I looked through the API header file and I do not see a method. I wanted to print out some info while debugging a plugin.

- Ken
cryptik is offline   Reply With Quote
Old 19-07-2018, 12:12   #88
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Pavel,
Disregard my post regarding the NMEA sentence stream blocking in my program. I found the issue. I had the following code in my dialog handler:
Code:
	if( !m_tcMsgThread->GetValue() ) 
		m_tcMsgThread->AppendText(msg);
So it updates once, and then no more LOL. The OpenCPNDebugger code is 'similar' but IT is checking the state of a pause button...not the text control object.

- Thx
Ken
cryptik is offline   Reply With Quote
Old 19-07-2018, 14:41   #89
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 5,327
Re: OpenCPN PlugIn Development

cryptik...

The OpenCPN wxLog functions are defined application wide, including plugins.

So, wxLogMessage() works fine from a plugin.

Dave
bdbcat is offline   Reply With Quote
Old 25-07-2018, 17:43   #90
Registered User

Join Date: Jun 2018
Posts: 68
Re: OpenCPN PlugIn Development

Moving along with the plugin build... I have some questions regarding WANTS_NMEA_SENTENCES and WANTS_AIS_SENTENCES. I can see the Set functions that are called as a result of setting these flags, but I am not sure what the difference is between then. If I set WANTS_NMEA_SENTENCES, I get calls to SetNMEASentence() that includes sentences like $GGA $HDT, etc. as well as AVDO and AVDM. When I set the WANTS_AIS_SENTENCES flag and add the SetAISSentence() it does not appear to get called. Can anybody tell me the difference between those two methods?

Also, to make sure I have this correct... WANTS_NMEA_EVENTS results in calls to SetPositionFixEx() and WANTS_PLUGIN_MESSAGING results in calls to SetPluginMessage()?

Third question, how does one get access to the current mouse pointer position or the item that the user has clicked on (i.e. if they click on an AIS target, can I get a callback for that click or doubleclick?)

thx,
Ken
__________________

cryptik 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
New Marina Development in China GordMay Pacific & South China Sea 4 29-09-2009 05:33
New Battery Research & Development BlueSovereign Electrical: Batteries, Generators & Solar 7 31-07-2009 15:47
Nautical Development 39 (Morgan 39?) riptide Monohull Sailboats 1 22-07-2009 12:53
Turks and Caicos Development Petition Canibul Atlantic & the Caribbean 5 24-04-2008 19:15



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 21:49.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.