douwefokkema / AutoTrackRaymarine_pi

Follow a route on OpenCPN using a Raymarine Evolution pilot
GNU General Public License v3.0
14 stars 6 forks source link

AutoTrackRaymarine 1.18.10.0 fails in Opencpn #25

Closed rgleason closed 1 year ago

rgleason commented 1 year ago

Douwe, the version 1.18.10.0 in my repos, (I believe I made a PR back to your repos) fails in Opencpn. I believe it is related to the icon. I have compared weather_routing_pi.cpp with autotrackraymarine.cpp to see if I could find the problem but I could not. I have tried running the plugin in MSVC 2022 and there appears to be no icon (it is a black square), and I will attached various screenshots so you can see.

If you can fix this, we can get the plugin out to all but android! Screenshot (1628)

Screenshot (1629)

Screenshot (1630)

Screenshot (1631)

Screenshot (1632)

Screenshot (1633)

Screenshot (1634)

rgleason commented 1 year ago

I have done a WinMerge Compare between "master" and "new" (n2k) and really do not see anything that would cause this. I am not going drop working on this as it is a complete waste of time. Someone else has to fix it.

rgleason commented 1 year ago

Douwe, I have removed it from the master catalog. Would it be easier if I pushed it up to the Beta Catalog so we could test it?

LATER: I am going to push it up to the Beta Catalog, since we arent sure it works.

Also I am trying to learn how I could test it when I am not on a boat with an autopilot. Does Marco Bergman's AIS-Simulator work somehow? See https://github.com/marcobergman/ais_simulation/issues/10 we were using that to test autopilot_route_pi which is very different. What we did was start ais-simulator make a UDP connection using my computer's IP number as connected to the router with the port he suggests. Then I could control the boat speed and direction from his little program., and you can see the nmea0183 data streaming in his prompt and also in Opencpn Nmea Debug window and compare the input and the outup. Then you make a route nearby and activate it and the boat would head towards the route and follow it (depending on how good the autopilot plugin was acting).

Your plugin may be a bit different, and since it does n2k as well that would not work with his ais-simulator, but perhaps using Nmea0183 it is possible?

I have been trying it in MSVC 2022 and the nav menu appears and MSVC 2022 does not seem to object to it. This is very weird. I wanted to get some debugging code for you.

Going to push the plugin up to the BETA catalog.

rgleason commented 1 year ago

Have pushed 18 metadata files to Beta catalog https://github.com/OpenCPN/plugins/pull/968 Dave needs to merge the PR.

rgleason commented 1 year ago

Have git cloned douwe's "new" branch and compared with mine. Found two files in my version that aren't in Douwe's serial\visual_studio.gitignore and serial\visual_studio\travis.yml <--Did msvc2022 make these? I will delete them.

In src/autotrackraymarine_pi,cpp starting at line 151-159 there was some small difference, but they looked exactly the same. I copied douwe's version over to mine.

I found TexFont.cpp and TexFont.h were missing from src. Copied them to my version. I will need to change some lines in CMakeLists.txt I expect too.

I will try this again. Sorry about the problems.

rgleason commented 1 year ago

Also I found that the current ocpn-api/msvc/ocpn_plugin.h and opencpn.lib in mine (from the most current version of OpenCPN master) were not the same as Douwe's, so I copied douwe's versions over to mine.

rgleason commented 1 year ago

The two files msvc/win_deps.bat are different. Douwe's has the older version I believe. So I am keeping the one in mine.

win_deps.bat-Rick.txt win_deps.bat.douwe.txt

rgleason commented 1 year ago

Made the changes and committed after a bad try. Hope it builds.

rgleason commented 1 year ago

See this. https://app.circleci.com/pipelines/github/rgleason/AutoTrackRaymarine_pi/77/workflows/cff9934a-a576-4025-a073-2a8dd15d994f/jobs/1027

https://app.circleci.com/pipelines/github/rgleason/AutoTrackRaymarine_pi/77/workflows/cff9934a-a576-4025-a073-2a8dd15d994f/jobs/1027

This is a bad version of API I am told by bdbcat. Douwe your version has bad files. I am going to reverse these files and try again; If I were a robot I would not... If I were I robot I would not.. If

 jsonwriter.cpp
     Creating library C:/Users/circleci.PACKER-64CA886C/project/build/RelWithDebInfo/AutoTrackRaymarine_pi.lib and object C:/Users/circleci.PACKER-64CA886C/project/build/RelWithDebInfo/AutoTrackRaymarine_pi.exp
AutoTrackRaymarine_pi.obj : error LNK2019: unresolved external symbol "public: __thiscall opencpn_plugin_118::opencpn_plugin_118(void *)" (??0opencpn_plugin_118@@QAE@PAX@Z) referenced in function "public: __thiscall AutoTrackRaymarine_pi::AutoTrackRaymarine_pi(void *)" (??0AutoTrackRaymarine_pi@@QAE@PAX@Z) [C:\Users\circleci.PACKER-64CA886C\project\build\AutoTrackRaymarine_pi.vcxproj]
AutoTrackRaymarine_pi.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall opencpn_plugin_118::RenderGLOverlayMultiCanvas(class wxGLContext *,class PlugIn_ViewPort *,int,int)" (?RenderGLOverlayMultiCanvas@opencpn_plugin_118@@UAE_NPAVwxGLContext@@PAVPlugIn_ViewPort@@HH@Z) [C:\Users\circleci.PACKER-64CA886C\project\build\AutoTrackRaymarine_pi.vcxproj]
PreferencesDialog.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall opencpn_plugin_118::RenderGLOverlayMultiCanvas(class wxGLContext *,class PlugIn_ViewPort *,int,int)" (?RenderGLOverlayMultiCanvas@opencpn_plugin_118@@UAE_NPAVwxGLContext@@PAVPlugIn_ViewPort@@HH@Z) [C:\Users\circleci.PACKER-64CA886C\project\build\AutoTrackRaymarine_pi.vcxproj]
Info.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall opencpn_plugin_118::RenderGLOverlayMultiCanvas(class wxGLContext *,class PlugIn_ViewPort *,int,int)" (?RenderGLOverlayMultiCanvas@opencpn_plugin_118@@UAE_NPAVwxGLContext@@PAVPlugIn_ViewPort@@HH@Z) [C:\Users\circleci.PACKER-64CA886C\project\build\AutoTrackRaymarine_pi.vcxproj]
icons.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall opencpn_plugin_118::RenderGLOverlayMultiCanvas(class wxGLContext *,class PlugIn_ViewPort *,int,int)" (?RenderGLOverlayMultiCanvas@opencpn_plugin_118@@UAE_NPAVwxGLContext@@PAVPlugIn_ViewPort@@HH@Z) [C:\Users\circleci.PACKER-64CA886C\project\build\AutoTrackRaymarine_pi.vcxproj]
AutoTrackRaymarine_pi.obj : error LNK2001: unresolved external symbol "publ
rgleason commented 1 year ago

I am just going to use the most current version of Opencpn Master branch, just as I did before. I don't care if they are wrong as long as they work.

using C:\Users\fcgle\source\repos\OpenCPN\include\ocpn-plugin.h and C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\opencpn.lib

I really do hope this is right as I am very tired of this.

https://github.com/rgleason/AutoTrackRaymarine_pi/tree/new

rgleason commented 1 year ago

Well testing 1.18.13.0 in Windows. I cleaned out %localappdata%/opencpn/plugins/ of all autotrackraymarine The restarted Opencpn, initially the preferences menu worked afterwards it did not. The icon was a black square and then later became a green puzzle. There is something definitely wrong with initialization although I did not spot any out of place lines. I wonder if the svg icon has been corrupted perhaps. https://github.com/rgleason/AutoTrackRaymarine_pi/tree/new

Anyway it opens and closes and the menu shows and opencpn seems to accept it after turning it on and off a number of thimes and pressing on the menu keys etc. Other than the preferences menu and the icon it appears to be working, but I don't know about communication. Someone else will have to test that.

I would use this version as the base to make corrections, it is most like Douwe"s. Only android did not build. I do not know if the msvc (wx312) version will work, I don't think O5.6.4 supported API118! Let me know if I should disable building that.

https://cloudsmith.io/~opencpn/repos/autotrackraymarine-beta/packages/?q=msvc+1.18.13+tarball

rgleason commented 1 year ago

https://github.com/OpenCPN/plugins/pull/969

Here are the tarballs. https://cloudsmith.io/~opencpn/repos/autotrackraymarine-beta/packages/?q=1.18.13+tarball

rgleason commented 1 year ago

I checked the svg icons and they are fine. Something has changed in the code and I can't find the change. Its beyond my ability. Problems I know about

  1. Black and Green Puzzle svg Icons.
  2. Preferences not working all the time.

Windows with OpenCPN 5.8.4

rgleason commented 1 year ago

I think I just found the problems.
In your current autotrackraymarine_pi.cpp at line 219 -236 you have

// wxBitmap* AutoTrackRaymarine_pi::GetPlugInBitmap() { return m_pdeficon; }
wxString AutoTrackRaymarine_pi::GetCommonName() { return wxT("AutotrackRaymarine_pi"); }
wxString AutoTrackRaymarine_pi::GetShortDescription() { return _("Route following for Raymarine EV-1 autopilots"); }
int AutoTrackRaymarine_pi::GetAPIVersionMajor() { return MY_API_VERSION_MAJOR; }
int AutoTrackRaymarine_pi::GetAPIVersionMinor() { return MY_API_VERSION_MINOR; }
wxString AutoTrackRaymarine_pi::GetLongDescription()
{
    return _("Route following for Raymarine EV pilots")
        + wxT("\n") /*+ wxT(PLUGIN_VERSION_WITH_DATE)*/;
}
// wxBitmap *AutoTrackRaymarine_pi::GetPlugInBitmap() { return m_pdeficon; }

Whereas, in the version of autotrackraymarine_pi.cpp that I had modified for you, these values for MY_API_VERSION_MAJOR were changed to point to the CMakeLIsts.txt.

Also there is something different going on with the icon and I have to do more file compares.

I wonder if this is coming from your later shipdriver version.

I think this is the reason we have a phantom version 1.0.0 sometimes. I've got to get this changed back now.

rgleason commented 1 year ago

I guess I have to compare my earlier working version to this one. I wish you had told me about this.

rgleason commented 1 year ago

So now that leads me to the question. Which version are you going to go with now? Shipdriver or Testplugin? If it is Shipdriver, when are you going to test and release? Very puzzled by this development process as I have spent some time on it.

rgleason commented 1 year ago

I have removed all of the Autotrackraymarine plugins as they are not correct. Please advise.

rgleason commented 1 year ago

1.18.13.0 pushed to Beta.