Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Rate Thread Display Modes
Old 27-04-2016, 10:22   #16
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Plugin Development Help

May we see your code?
Why do you want to create the objects? Their purpose is to transfer the information from core to your plugin so you should never need/have to create them yourself, just read the values you receive in them for example when the core calls your SetPositionFix and RenderOverlay method.

Pavel
__________________

__________________
nohal is online now   Reply With Quote
Old 27-04-2016, 13:18   #17
Registered User

Join Date: Apr 2016
Posts: 19
Re: Plugin Development Help

Ah ok, I guess I wasn't 100% sure that that's how it works.

I am working off of launcher_pi and added RenderOverlay() and SetCurrentViewPort() methods to the launcher_pi class but they weren't being called by the core so wasn't sure what I had to do. Just figured it out though, I just had to add the associated PlugIn Capabilites flag in Init().

Sigh.. spent way too much time trying to figure that out lol

Appreciate the quick reply btw!
__________________

__________________
THEMuffinMan7 is offline   Reply With Quote
Old 28-04-2016, 16:47   #18
Registered User

Join Date: Apr 2016
Posts: 19
Re: Plugin Development Help

I am trying to figure out the best way to draw many (potentially 10's of thousands) of lines on the map. This simplest way I thought of was to keep a list of all the lat/long points of each line and then using GetCanvasPixLL() and wxDC.Drawline() to render them all. but this seems very inefficient since it would re-render all the lines every-time renderoverlay() was called and it creates noticeable lag when manipulating the screen.

Could I instead use wxMemory to draw lines to a bitmap which is kept in memory, then scaling / overlaying the bitmap on the map? This should allow me to add lines as needed but not have constantly re-render them all. Would this work or is there a better solution?
__________________
THEMuffinMan7 is offline   Reply With Quote
Old 28-04-2016, 16:53   #19
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Plugin Development Help

You can do whatever, how it is going to work depends on your *exact* needs. You may have a look at the implementation of drawing tracks in the core of OpenCPN and the weather routing plugin.
Your expectation that the simplest/dumbest approach is unusable for this quantity of information is certainly correct.

Pavel
__________________
nohal is online now   Reply With Quote
Old 01-05-2016, 21:11   #20
Registered User

Join Date: Apr 2016
Posts: 19
Re: Plugin Development Help

PS: @Rasbats. You mentioned you were getting crashes when using "zoom to" on your survey app.. I was having the same issue. Setting the current ViewPort.bvalid to false right after using jumptoposition() worked for me.. Not sure if its the same issue or not. Honestly that feature seemed to work for me when I ran it.
__________________
THEMuffinMan7 is offline   Reply With Quote
Old 02-05-2016, 01:12   #21
Registered User

Join Date: May 2012
Posts: 405
Re: Plugin Development Help

Chris,

Thanks. Noted.

Mike
__________________
Rasbats is offline   Reply With Quote
Old 20-05-2016, 11:01   #22
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Plugin Development Help

Hi!
I am in the process of starting up with work on my plugin for the Garmin xHD radar plugin again. I have done the fallowing.
Installation:
1) MSVS 2013 Update 5.
2) Git 2.8.2
3) Cmake 3.5.2
4) Poedit 1.8.7
5) wxWidgets 3.0.2

Compiled wxWidget without errors.

Got OpenCPN 4.0.2 source code with git. Built it from command line without errors.
I have not yet included any plugins. Built just OpenCPN.
When I try to start opencpn under build\debug I get an error.
It says the program could not be started correct. Error 0xc000007b
Any ideas ?
__________________
hasse_A is offline   Reply With Quote
Old 20-05-2016, 11:09   #23
Registered User

Join Date: Apr 2016
Posts: 19
Re: Plugin Development Help

See Section 6 "Running OpenCPN From the Build Directory"

Compiling - Windows | Official OpenCPN Homepage

Did you follow those steps?
__________________
THEMuffinMan7 is offline   Reply With Quote
Old 20-05-2016, 11:25   #24
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Plugin Development Help

Quote:
Originally Posted by THEMuffinMan7 View Post
Well, that's the document i tried to go by to the best of my knowledge.

/Hans
__________________
hasse_A is offline   Reply With Quote
Old 20-05-2016, 19:37   #25
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 9,320
Re: Plugin Development Help

hasse A
You appear to have the prerequisites.
Have you followed
2.1 Compiling from the command line (recommended)

and
2.3 Add wxWidgets to your PATH

What is your path (post it here please)

3. Get the OpenCPN source

I assume you have done this. Sometimes it is corrupted, and you should remove it and start over.

3.1 Get the binary dependencies

This one is very important. Download unzip and place them properly.

4. Build OpenCPN

Should be easy to do.

4.1a – Configuring the build from command line (recommended):

I use this one all the time from the command prompt.

------
Computers are dumb, they only do what you tell them to do!
That is the beauty, you have complete control. It is entirely your baby. What other job/ part of life is like that..?
You have to be stubborn and proud and persistent enough to make it work for you too!
__________________
rgleason is offline   Reply With Quote
Old 20-05-2016, 19:53   #26
Registered User
 
boat_alexandra's Avatar

Join Date: Aug 2009
Location: Masachusetts
Boat: bristol 27
Posts: 2,803
Re: Plugin Development Help

Quote:
Originally Posted by nohal View Post
You can do whatever, how it is going to work depends on your *exact* needs. You may have a look at the implementation of drawing tracks in the core of OpenCPN and the weather routing plugin.
Pavel
For drawing millions of line segments quickly, you really should check my tracks branch:
https://github.com/OpenCPN/OpenCPN/pull/638
__________________
boat_alexandra is offline   Reply With Quote
Old 21-05-2016, 23:21   #27
Registered User

Join Date: Feb 2013
Location: Kourou, French Guyana
Boat: Allegro 33
Posts: 245
Re: Plugin Development Help

Quote:
Originally Posted by rgleason View Post
hasse A
You appear to have the prerequisites.
Have you followed ...
We will be out of reach to WiFi for a couple of days but will come back later.
__________________
hasse_A is offline   Reply With Quote
Old 26-05-2016, 13:06   #28
Registered User

Join Date: Apr 2016
Posts: 19
Re: Plugin Development Help

My plugin is mostly working. I honestly don't know much about navigation though. I am getting lat/lon from GPS. Do I need to apply offsets to this data depending on what UTM Zone I'm in? If so is there an easy way to do this?

Also, what is openCPNs PlugInChartBase used for? I'm unsure if I should be doing something with this. I intend to use charts..

Thanks for any info!
__________________
THEMuffinMan7 is offline   Reply With Quote
Old 26-05-2016, 17:32   #29
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,016
Re: Plugin Development Help

If your GPS is a normal GPS, you should not have to do anything as the coordinates should be WGS84, the rest of your question is impossible to answer at all as we don't know what exactly you are trying to do.


Sent from my iPhone using Cruisers Sailing Forum
__________________
nohal is online now   Reply With Quote
Old 27-05-2016, 11:08   #30
Registered User

Join Date: Apr 2016
Posts: 19
Re: Plugin Development Help

Apologies for being ambiguous. I just want whatever I draw on the screen to be as accurate as possible when viewed with or without charts. My understanding is that charts are a more accurate view of an area so I thought they might vary a bit from the default coordinate system in opencpn and in the opencpn_plugin chart base I see things like getchartskew, latlong_to_chartpix, etc. I don't know when one would use these functions or if there is any benefit for me to use them instead of say GetCanvasPixLL. If the gps data is WGS84 and globally accurate to 2cm and I don't have to adjust for chart skews or anything like that then perfect, I just wasn't sure.
__________________

__________________
THEMuffinMan7 is offline   Reply With Quote
Reply

Tags
men, plug

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCPN PlugIn Development bdbcat OpenCPN 78 29-07-2017 03:15
Accessing waypoints from plugin development Cags OpenCPN 16 22-10-2015 11:05
APRS Plugin Development alawatsakima OpenCPN 8 21-09-2015 13:21
Plugin Development Question pelle2004 OpenCPN 3 04-07-2012 02:00
New Plugin Development on Linux globalkeith OpenCPN 5 03-05-2012 08:16



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 18:10.


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.