Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brgdist #33

Closed
wants to merge 7 commits into from
Closed

Brgdist #33

wants to merge 7 commits into from

Conversation

brianalex
Copy link

This pull adds 'bearing/distance to cursor from ownship'. Only the dashboard is affected. There are no references to the core program. The bearingdistance mercator is duplicated. This feature allows one to duplicate info from the status bar into the dashboard. With the Status Bar off, vertical screen space is increased, especially important in 600 pixel netbook screens.

@SethDart
Copy link
Collaborator

Hi Alex,

There's another pull request for that feature: #10

If you read comments there, you'll see that it's decided to postpone such changes until the API is expanded with the required functions (DistanceBearingMercator here)

Your code looks nice but I'd suggest a few changes:
You add some variables to dashboard_pi (mlat, mlon) and you do the computation there before sending the result to your instrument (you created two new sentences in instrument.h for that purpose). IMHO, you should request ship position (LAT & LON) and cursor position (PLA & PLO) in your instrument and do the math there. It should be enough. That would remove all the changes to SetPositionFix and SetCursorLatLon so they stay as generic as possible.

Please comment ;-)

@brianalex
Copy link
Author

Hi
I should have checked out the pull request you mention. My bad. I will cancel my pull request and continue to use the feature for my own use until you implement this feature later.
Thanks for the coding suggestions. If I can figure out how to do it, I will make the changes you mentioned. I am new to C++ so your suggestions are very much appreciated.
Thanks
Brian

@brianalex brianalex closed this Oct 15, 2012
@SethDart
Copy link
Collaborator

You can keep this open, the other one is based on previous dashboard while your's is working on our latest version.

Here are the proposed changes:

in brgdist.cpp change constructor to

DashboardInstrument_BrgDist::DashboardInstrument_BrgDist(wxWindow *pparent, wxWindowID id, wxString title)
:DashboardInstrument(pparent, id, title, OCPN_DBP_STC_LAT|OCPN_DBP_STC_LON|OCPN_DBP_STC_PLA|OCPN_DBP_STC_PLO)

You can remove all m_cap_flag1 and m_cap_flag2 they are static for this instrument, IE not to be set in dashboard_pi (or the instrument would not work)

You'll need to store lat, lon, cursor lat and cursor long. In SetData you'll receive the 4 sentences. One received, you can compute brg & rng and store it for later display.

@brianalex
Copy link
Author

Okay. I'll reopen the pull request as is, and update when the proposed changes are completed. Is this the proper way to do it on GitHub? Thanks for the help.

@brianalex brianalex reopened this Oct 15, 2012
@brianalex brianalex closed this Nov 7, 2012
@SethDart
Copy link
Collaborator

SethDart commented Nov 7, 2012

As you may have noticed, the plugin API was updated with appropriate georef functions.
See this commit for reference: 388f061

Would you mind to update your changes and reopen this pull request?

@brianalex
Copy link
Author

Hi
As a novice, I need help accessing the the georef functions from the new plugin API.
I keep getting
error LNK2019: unresolved external symbol _DistanceBearingMercator referenced .....

What do I need in the plugin file to access

extern "C" void DistanceBearingMercator(double lat0, double lon0, double lat1, double lon1, double *brg, double *dist);

from ocpn_plugin.h ???
Thanks for the help.
BrianBrian----- Original Message -----

From: SethDart
To: OpenCPN/OpenCPN
Cc: Brian Alexander
Sent: Wednesday, November 07, 2012 5:26 PM
Subject: Re: [OpenCPN] Brgdist (#33)

As you may have noticed, the plugin API was updated with appropriate georef functions.
See this commit for reference: 388f061

Would you mind to update your changes and reopen this pull request?


Reply to this email directly or view it on GitHub.

did-g pushed a commit to did-g/OpenCPN that referenced this pull request Oct 25, 2017
did-g pushed a commit to did-g/OpenCPN that referenced this pull request Oct 25, 2017
po_updates ca, es, fi, fr, nl, pt
did-g added a commit to did-g/OpenCPN that referenced this pull request Apr 1, 2018
60bc11e replace isnan with wxIsNaN c++11 madness
0fbdf42 On windows use a private name for our bzip static library
abc27a9 tidier layout, first try
e68b2e2 bump version for release
b5fc690 Merge pull request OpenCPN#34 from Hakansv/po
08a96fd Translations 2018-03
5362621 Add build to gitignore
5038d23 Merge pull request OpenCPN#33 from stelian42/fix-units-crash-and-translations
f36c80e Fix crash due to missing unit names in global table
8e0614e Fix units combobox translations
5d234dd Merge pull request OpenCPN#32 from nohal/master
5d008e4 Return .${VERSION_PATCH} to version number
b586557 Fix tr translation to compile
3a4802a CI
5e03179 Translations
212da14 Update the translation template
1d31871 Allow forcing the used wxWidgets version.
31dd96e Merge pull request OpenCPN#31 from nohal/master
6e81867 Update the compilation flags
b831f9b Merge branch 'master' of github.com:seandepagnier/climatology_pi
5c29c8b implement better precipitation units
3d12762 Merge pull request OpenCPN#28 from nohal/master
396a1ab Implement SVG icons for improved high resolution display support. Also fix macOS build and packaging.
ae8abd7 Merge pull request OpenCPN#27 from nohal/master
da3a5a9 Fix in-the-tree build on macOS, fix window order on macOS, improve missing data dialog layout.
REVERT: e1c0dd3 On windows use a private name for our bzip static library
REVERT: 9559d93 tidier layout, first try

git-subtree-dir: plugins/climatology_pi
git-subtree-split: 60bc11e11c2c1dff12724d3f51ecdc8512bc6763
@jongough jongough mentioned this pull request Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants