jongough / ocpn_draw_pi

OpenCPN general drawing plug in
7 stars 17 forks source link

Missing for Windows: Ocpn_Draw for 5.7.1- Also no icons #513

Closed rgleason closed 1 year ago

rgleason commented 1 year ago

Jon, I have not seen ocpn_draw in Beta or master. Also BeFree has not seen it and would like to use it to define weather routing boundaries. I wonder if it is getting jailed?

08:53:11.277 MESSAGE plugin_loader.cpp:255 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll
08:53:11.277 MESSAGE plugin_loader.cpp:1151 Plugin is compatible: false
08:53:11.277 MESSAGE plugin_loader.cpp:311 Incompatible plugin detected C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll
08:53:11.277   ERROR filefn.cpp:905 Failed to copy the file 'ocpn_draw_pi.dll' to 'ocpn_draw_pi.dll.jail' (error 2: The system cannot find the file specified.)
08:53:11.277   ERROR filefn.cpp:1029 File 'ocpn_draw_pi.dll' couldn't be renamed 'ocpn_draw_pi.dll.jail' (error 2: The system cannot find the file specified.)
08:53:11.277 MESSAGE plugin_loader.cpp:314 Jailing: ocpn_draw_pi.dll
08:53:11.277 MESSAGE plugin_loader.cpp:255 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\otcurrent_pi.dll
08:53:11.277 MESSAGE plugin_loader.cpp:1151 Plugin is compatible: false
rgleason commented 1 year ago

Jon, I gave it a try. There seems to be a problem with icons too. I find Icons in C:\Users\fcgle\AppData\Local\opencpn\plugins\otcurrent_pi\data

ocpn_draw.txt

Screenshot (323)

Screenshot (322)

jongough commented 1 year ago

I have seen this message yesterday on windows, but currently cannot build OCPN for the windows environment and have it work. There appears to be a pre-requirement to have OpenGL installed even though it is not a requirement for the installation. The application terminates during startup without OpenGL. Dave is aware of this now and is a potential problem for any windows user that does not have opengl installed or possibly installable. OCPN 5.6.x worked OK, 5.7.1 doesn't.

I am currently going through the pain of updating one of my virtual win 10 boxes in the hope I can build in visual studio a debug version and find what it is complaining about. I think the error is in (TP)(OD)icons.cpp, but until I can debug it to find out what it is complaining about I don't know how to go about fixing it.

With the error in OD does it display the icons and does the plugin basically work?

rgleason commented 1 year ago

As you can see Jon, in the screenshots, the icons are not displayed and you cannot create objects. No unfortunately the plugin doesn't work as far as creation, because the objects are not available.

Very sorry about the troubles. Would it help at all if I tried to build it?

jongough commented 1 year ago

Can you provide a screenshot or list of the icon directory so that I can see what has been provided. If you can build and run a vs2022 debug version of OCPN and OD then you should be able to see what it is looking for and that will help a lot. Otherwise I will have to continue to see if I can build a debug version that actually runs to the point needed. VS20** is not my favorite IDE, and I am having difficulty in getting the correct parameters into the build and a build that actually is debuggable.

rgleason commented 1 year ago

Jon, you can build with Visual Studio if you want too. Just use the 5.7.1 parameters. win32 and v143. I will try to build tomorrow, just got back from Chicago, time for bed.

Screenshot (325) Screenshot (324)

jongough commented 1 year ago

I need to debug it to find out why it is not finding the icons that are there. So I need to run it under windows as under linux, for me, it is working as expected.

rgleason commented 1 year ago

I've tried building ocpn_draw locally, and installing the .dll and .pdb in %localappdata%\opencpn\plugins and then runnning VS2022 and I get these kinds of screens. A message that says icons not found and yet the output says symbols loaded. Also the properties window is not resizeable and is too big.

Screenshot (326)

Screenshot (327)

Output

'opencpn.exe' (Win32): Unloaded 'C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins\dashboard_pi.dll'
'opencpn.exe' (Win32): Loaded 'C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins\grib_pi.dll'. 
'opencpn.exe' (Win32): Unloaded 'C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins\grib_pi.dll'
'opencpn.exe' (Win32): Loaded 'C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins\wmm_pi.dll'. 
'opencpn.exe' (Win32): Unloaded 'C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins\wmm_pi.dll'
'opencpn.exe' (Win32): Unloaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll'
The thread 0x11b0 has exited with code 0 (0x0).
The thread 0x427c has exited with code 0 (0x0).
The thread 0x1bc0 has exited with code 0 (0x0).
The thread 0x62d4 has exited with code 0 (0x0).
The thread 0x53fc has exited with code 0 (0x0).
The thread 0x41a0 has exited with code 0 (0x0).
'opencpn.exe' (Win32): Loaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll'. Symbols loaded.
The thread 0x4a20 has exited with code 0 (0x0).

ocpn_log.txt

rgleason commented 1 year ago

I was able to create new DR 3 objects without use of the object tool.

Screenshot (330)

'opencpn.exe' (Win32): Unloaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll' The thread 0x11b0 has exited with code 0 (0x0). The thread 0x427c has exited with code 0 (0x0). The thread 0x1bc0 has exited with code 0 (0x0). The thread 0x62d4 has exited with code 0 (0x0). The thread 0x53fc has exited with code 0 (0x0). The thread 0x41a0 has exited with code 0 (0x0). 'opencpn.exe' (Win32): Loaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll'. Symbols loaded. The thread 0x4a20 has exited with code 0 (0x0). The thread 0x6bb0 has exited with code 0 (0x0). The thread 0x6828 has exited with code 0 (0x0). The thread 0xae4 has exited with code 0 (0x0). The thread 0x625c has exited with code 0 (0x0). The thread 0x5d5c has exited with code 0 (0x0). The thread 0x230c has exited with code 0 (0x0). The thread 0x39b4 has exited with code 0 (0x0). The thread 0x4ef4 has exited with code 0 (0x0). The thread 0x5da4 has exited with code 0 (0x0). The thread 0x67dc has exited with code 0 (0x0). The thread 0x5c58 has exited with code 0 (0x0). The thread 0x5a8 has exited with code 0 (0x0). The thread 0x653c has exited with code 0 (0x0). The thread 0x6528 has exited with code 0 (0x0). The thread 0x6544 has exited with code 0 (0x0). 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ieframe.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winhttp.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msIso.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mshtml.dll'. The thread 0x68b4 has exited with code 0 (0x0). The thread 0x1a00 has exited with code 0 (0x0). The thread 0x1c0 has exited with code 0 (0x0). 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\srpapi.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wldp.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ieapfltr.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msimtf.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msls31.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d2d1.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\DWrite.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvdm.inf_amd64_c63abd20250c3bee\nvdlist.dll'. 'opencpn.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvdm.inf_amd64_c63abd20250c3bee\nvdlist.dll' 'opencpn.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\nvdm.inf_amd64_c63abd20250c3bee\nvdlist.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3d11.dll'. 'opencpn.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nvdm.inf_amd64_c63abd20250c3bee\nvdlist.dll' The thread 0x58f4 has exited with code 0 (0x0). 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\d3d10warp.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mlang.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\virtdisk.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\jscript9.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\OneCoreUAPCommonProxyStub.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\twinui.appcore.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usermgrcli.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\daxexec.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\container.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\LicenseManagerApi.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\capauthz.dll'. info: canDisableApps value is 0 (InitStoreAppsAreDisabled) info: Skipping license manager: PFN Microsoft.WindowsNotepad_11.2210.5.0_x64__8wekyb3d8bbwe (InvokeLicenseManagerRequired) 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\execmodelproxy.dll'. 'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\Windows.ApplicationModel.dll'. The thread 0x1dc8 has exited with code 0 (0x0). The thread 0x6944 has exited with code 0 (0x0). The thread 0xf98 has exited with code 0 (0x0). The thread 0x5748 has exited with code 0 (0x0). The thread 0x63e4 has exited with code 0 (0x0). The thread 0x669c has exited with code 0 (0x0). 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\mssprxy.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\PortableDeviceApi.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\Windows.Storage.Search.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\npmproxy.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\MMDevAPI.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\networkitemfactory.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\WcnApi.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\fundisc.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\fdProxy.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\dtsh.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\fwbase.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\fwpolicyiomgr.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\FirewallAPI.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\fdWCN.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\wpdshext.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\PlayToDevice.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\atl.dll' 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\fdWNet.dll' The thread 0x69bc has exited with code 0 (0x0). onecore\com\combase\objact\objact.cxx(4070)\combase.dll!768F8AA0: (caller: 768BFF69) ReturnHr(35) tid(2500) 80040154 Class not registered The thread 0x748 has exited with code 0 (0x0). The thread 0x3778 has exited with code 0 (0x0). The thread 0x2500 has exited with code 0 (0x0). The thread 0x1bb8 has exited with code 1 (0x1). 'opencpn.exe' (Win32): Unloaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\tactics_pi.dll' The thread 0x5b0c has exited with code 0 (0x0). The thread 0x1988 has exited with code 0 (0x0). The thread 0x3f34 has exited with code 0 (0x0). The thread 0x938 has exited with code 0 (0x0). The thread 0x5ff8 has exited with code 0 (0x0). 'opencpn.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\d3d10warp.dll' The thread 0x6c8 has exited with code 0 (0x0). The thread 0x1090 has exited with code 0 (0x0). The thread 0x3290 has exited with code 1 (0x1). The thread 0x65f0 has exited with code 0 (0x0). The thread 0x6428 has exited with code 0 (0x0). The thread 0x2660 has exited with code 0 (0x0). The thread 0x570 has exited with code 0 (0x0). The thread 0x2624 has exited with code 0 (0x0). The thread 0x687c has exited with code 0 (0x0). The thread 0x6a24 has exited with code 0 (0x0). The thread 0x5f2c has exited with code 0 (0x0). The thread 0x41e8 has exited with code 0 (0x0). The thread 0x67e0 has exited with code 0 (0x0). The thread 0x4834 has exited with code 0 (0x0). The thread 0x55b0 has exited with code 0 (0x0). The thread 0x4f10 has exited with code 0 (0x0). The thread 0x1f30 has exited with code 0 (0x0). The thread 0x3810 has exited with code 0 (0x0). The thread 0x512c has exited with code 0 (0x0). The thread 0x3028 has exited with code 0 (0x0). The program '[26736] opencpn.exe' has exited with code 0 (0x0).

rgleason commented 1 year ago

What should I do to help isolate the problem? The icons for both testplugin and ocpn_draw are not reading properly. Something seems to be missing.

rgleason commented 1 year ago

in ODicons.cpp you have

ifdef ODraw_USE_MUI

else

ifdef ODraw_USE_SVG

endif

endif

Which looks pretty well organized. Where are these triggered? In cmake somewhere?

Search "use_svg" (25 hits in 3 files of 57 searched) C:\Users\fcgle\source\ocpn_draw_pi\src\ocpn_draw_pi.cpp (17 hits) Line 560: #ifdef ODraw_USE_SVG Line 578: #ifdef ODraw_USE_SVG Line 587: #ifdef ODraw_USE_SVG Line 596: #ifdef ODraw_USE_SVG Line 605: #ifdef ODraw_USE_SVG Line 614: #ifdef ODraw_USE_SVG Line 623: #ifdef ODraw_USE_SVG Line 632: #ifdef ODraw_USE_SVG Line 642: #ifdef ODraw_USE_SVG Line 4503: #ifdef ODraw_USE_SVG Line 4521: #ifdef ODraw_USE_SVG Line 4539: #ifdef ODraw_USE_SVG Line 4558: #ifdef ODraw_USE_SVG Line 4579: #ifdef ODraw_USE_SVG Line 4598: #ifdef ODraw_USE_SVG Line 4617: #ifdef ODraw_USE_SVG Line 4637: #ifdef ODraw_USE_SVG C:\Users\fcgle\source\ocpn_draw_pi\src\ODicons.cpp (5 hits) Line 147: #ifdef ODraw_USE_SVG Line 273: #ifdef ODraw_USE_SVG Line 296: #endif // OD_USE_SVG Line 309: #ifdef ODraw_USE_SVG Line 357: #endif // OD_USE_SVG C:\Users\fcgle\source\ocpn_draw_pi\src\PointMan.cpp (3 hits) Line 264: #ifdef ODraw_USE_SVG Line 971: #ifdef ocpnUSE_SVG Line 992: #endif // ocpnUSE_SVG

C:\Users\fcgle\source\ocpn_draw_pi\build\CMakeCache.txt (2 hits) Line 234: OD_USE_SVG:BOOL=ON Line 249: PLUGIN_USE_SVG:BOOL=ON C:\Users\fcgle\source\ocpn_draw_pi\CMakeLists.txt (5 hits) Line 73: option(PLUGIN_USE_SVG "Use SVG graphics" ON) Line 315: option(OD_USE_SVG "Use SVG graphics" ON) Line 317: if(OD_USE_SVG) Line 319: add_definitions(-DODraw_USE_SVG) Line 320: endif(OD_USE_SVG)

C:\Users\fcgle\source\ocpn_draw_pi\extinclude\android-old\wx\setup.h (1 hit) Line 578: #define wxUSE_SVG 0 C:\Users\fcgle\source\ocpn_draw_pi\include\ODicons.h (1 hit) Line 103: #if defined ODraw_USE_SVG || defined ODraw_USE_MUI C:\Users\fcgle\source\ocpn_draw_pi\libs\ocpn-api\ocpn_plugin.h (2 hits) Line 54: #ifdef ocpnUSE_SVG Line 56: #endif // ocpnUSE_SVG C:\Users\fcgle\source\ocpn_draw_pi\src\ocpn_draw_pi.cpp (17 hits) Line 560: #ifdef ODraw_USE_SVG Line 578: #ifdef ODraw_USE_SVG Line 587: #ifdef ODraw_USE_SVG Line 596: #ifdef ODraw_USE_SVG Line 605: #ifdef ODraw_USE_SVG Line 614: #ifdef ODraw_USE_SVG Line 623: #ifdef ODraw_USE_SVG Line 632: #ifdef ODraw_USE_SVG Line 642: #ifdef ODraw_USE_SVG Line 4503: #ifdef ODraw_USE_SVG Line 4521: #ifdef ODraw_USE_SVG Line 4539: #ifdef ODraw_USE_SVG Line 4558: #ifdef ODraw_USE_SVG Line 4579: #ifdef ODraw_USE_SVG Line 4598: #ifdef ODraw_USE_SVG Line 4617: #ifdef ODraw_USE_SVG Line 4637: #ifdef ODraw_USE_SVG C:\Users\fcgle\source\ocpn_draw_pi\src\ODicons.cpp (5 hits) Line 147: #ifdef ODraw_USE_SVG Line 273: #ifdef ODraw_USE_SVG Line 296: #endif // OD_USE_SVG Line 309: #ifdef ODraw_USE_SVG Line 357: #endif // OD_USE_SVG C:\Users\fcgle\source\ocpn_draw_pi\src\PointMan.cpp (3 hits) Line 264: #ifdef ODraw_USE_SVG Line 971: #ifdef ocpnUSE_SVG Line 992: #endif // ocpnUSE

jongough commented 1 year ago

From your testing it looks like it is the OD toolbar icons that are not working, the object icons used for boundaries etc. do seem to be working.

I believe for current builds they should all be using "ODraw_USE_MUI" which is set in CMakeLists.txt for all environments except QT_ANDROID. This value is set because "OCPN_MIN_VERSION" is set at "50". So, OD includes three versions of the icons, png, svg and MUI_svg (svg but with a different "look"). I presume you are building this locally on your windows machine. If you look in the output from cmake you should see:

-- CMakeLists: SVG support enabled...
-- CMakeLists: Using O5 MUI
-- CMakeLists: Adding target link libraries to ocpn_draw_pi

and in the build part:

/D WIN32 /D _WINDOWS /D NDEBUG /D HAVE_SNPRINTF /D __MSVC__ /D _CRT_NONSTDC_NO_DEPRECATE /D _CRT_SECURE_NO_DEPRECATE /D ocpnUSE_GL /D WXUSINGDLL /D UNICODE /D _UNICODE /D USE_S57 /D OD_JSON_SCHEMA_VALIDATOR /D ODraw_USE_SVG /D ODraw_USE_MUI /D "CMAKE_INTDIR=\"Release\"" /Gm- /EHa /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"GDAL.dir\Release\\" /Fd"C:\project\ocpn_project\build\libs\gdal\Release\GDAL.pdb" /external:W0 /Gd /TP /analyze- /errorReport:queue  /external:I "C:/wxWidgets-3.2.1/lib/v

Note the /D ODraw_USE_SVG /D ODraw_USE_MUI items in the list. This should be there for every component built.

Part of the reason I need to get a debug build running on Windows is so that I can add a break point at line 58 in ODicons.cpp and then single step through to see what is going on. In particular if it takes the wrong path through the code or is looking in the wrong location for the files.

Doing some testing on it would appear that the icons are loaded and are available for the OCPN toolbar, but are not being displayed on the OD toolbar. I have checked changing a boundary icon to one supplied by OD and it works. On my windows 10 (with opengl) virtual machine I can see the 'icon location' on the OD toolbar changing when right clicking the mouse to select the correct tool. So there is something going on when populating the OD toolbar.

rgleason commented 1 year ago

This is the result of building:

ocpn-draw-build.txt output.txt Has many /D WIN32 /D _WINDOWS /D NDEBUG /D HAVE_SNPRINTF /D __MSVC__ /D _CRT_NONSTDC_NO_DEPRECATE /D _CRT_SECURE_NO_DEPRECATE /D

rgleason commented 1 year ago

So there is something going on when populating the OD toolbar.

I agree, particularly with "not being displayed on the OD Toolbar" ....your experiment proves it.

Is there some critical command, maybe wxWidgets command, that no longer is working as it used to work? Perhaps deprecated or dropped? What is different about the ways you display icons for boundary and OD ?

I have been building ocpn_draw separately from Opencpn and then using the results in VC2022. Would you put the Ocpn_Draw code in parallel to the internal plugins and then try building? To do this:

add a break point at line 58 in ODicons.cpp and then single step through to see what is going on. In particular if it takes the wrong path through the code or is looking in the wrong location for the files.

rgleason commented 1 year ago

I've copied my local ocpn_draw_pi folder to be next to grib_pi, wmm_pi, chartdownloader_pi, dashboard_pi into this C:\Users\fcgle\source\repos\plugins\ocpn_draw_pi copied all files and folders.

What else should be done? I have "cleaned" entire Opencpn and "Built" and there is one error now

Severity    Code    Description Project File    Line    Suppression State
Error   MSB3073 The command "setlocal
"C:\Program Files\CMake\bin\cmake.exe" -D TEST_TARGET=tests -D TEST_EXECUTABLE=C:/Users/fcgle/source/repos/OpenCPN/build/test/RelWithDebInfo/tests.exe -D TEST_EXECUTOR= -D TEST_WORKING_DIR=C:/Users/fcgle/source/repos/OpenCPN/build/test -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=tests_TESTS -D CTEST_FILE=C:/Users/fcgle/source/repos/OpenCPN/build/test/tests[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_XML_OUTPUT_DIR= -P "C:/Program Files/CMake/share/cmake-3.25/Modules/GoogleTestAddTests.cmake"
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd
:VCEnd" exited with code 1. tests   C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets   159 

Screenshot (331)

rgleason commented 1 year ago

Under output "debug"

The thread 0x5e8c has exited with code 0 (0x0).
'opencpn.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\iigd_dch.inf_amd64_ec48fba0e5cab6d2\igc32.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\umpdc.dll'. 
The thread 0x3430 has exited with code 1 (0x1).
The thread 0x5be0 has exited with code 1 (0x1).
The thread 0x5e48 has exited with code 1 (0x1).
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mswsock.dll'. 
The thread 0x5b1c has exited with code 1 (0x1).
The thread 0x5c14 has exited with code 1 (0x1).
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nsi.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dhcpcsvc6.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dhcpcsvc.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dnsapi.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptsp.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rsaenh.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll'. Symbols loaded.     <--------NOTE
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\TextShaping.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\tactics_pi.dll'. Module was built without symbols.
'opencpn.exe' (Win32): Loaded 'C:\Users\fcgle\AppData\Local\opencpn\plugins\vdr_pi.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\WindowsCodecs.dll'. 
jongough commented 1 year ago

Symbols are debugging information and not icons. So that message should be quite normal for any plugin built with debugging.

Good old windows has now replaced my VS2017 with VS2022, I was trying to keep both, on my windows 10 system. I am now fighting my way through the installation process for OCPN to build it with debugging, then I will try to open it in the IDE and see if I can capture the problem.

rgleason commented 1 year ago

Jon, how do I get "ocpn_draw_pi" to show in the Solutions Explorer Window? I have "cleaned" and "built" OpenCPN several times. How do I put a "break" on

add a break point at line 58 in ODicons.cpp and then single step through to see what is going on. In particular if it takes the wrong path through the code or is looking in the wrong location for the files.

jongough commented 1 year ago

I think you will net to be in the VS2022 IDE. You will need to install via OCPN the plugin, then stop the run. Now copy the OD dll file to the location that OCPN within the IDE is looking for the dll. Now restart OCPN and wait until it comes up. Now open OD\src\ODicons.cpp (you may well have to import the OD project {may even have to create it within VS IDE}) so that you and set a breakpoint at the line you want, 58? . Now you can deactivate the OD plugin and reactivate it and you should go through the error.

I am still having issues trying to build OCPN, the instructions on the page are wrong or incomplete:

https://opencpn-manuals.github.io/main/ocpn-dev-manual/0.1/od-compile-windows.html

It would appear that the whole OCPN build process has become more complex and fragile as far as windows is concerned. I had to hand install 7-zip and python before win_deps.bat would work. ci\appveyor.bat runs but fails to find widgets if you don't run cache\wx-config.bat . This whole thing is becoming an exercise in frustration. The fact that OCPN now requires OpenGL is problematic. It should be available, but it should not be a hard prerequisite. Virualisation does not like OpenGL and I am getting quite a few display 'issues'. It has also involved downloading >20GB of data on a slow internet link and windows does not do this gracefully.

rgleason commented 1 year ago

Jon, I am very sorry about these problems. Tonight Dave was on my windows machine via AD and we tried to debug ocpn_draw. We were having some trouble getting it to debug, and all the while I was learning too. The icon paths appear to be good, but the breakpoints weren't really working. After quite awhile of getting things working and straightened out, we decided to stop for the night and see if there are any other ways to check or get breakpoints working.

During the testing we found that there is a momentary "Create Boundary" in the Toolbar window which is hopeful, and means that the rollover is at least working, so it is something in the code before that. I was able to just catch it before it faded away, see below. Perhaps that gives you a clue? Anyway, perhaps we all will come up with something more concrete later.

Create-Boundary

rgleason commented 1 year ago
23:08:07.784 MESSAGE plugin_loader.cpp:304 Skipping not enabled candidate.
23:08:07.784 MESSAGE plugin_loader.cpp:255 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll
23:08:07.795 MESSAGE plugin_loader.cpp:1151 Plugin is compatible: true
23:08:07.795 MESSAGE plugin_loader.cpp:1226 PlugInManager: Loading PlugIn: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll
23:08:07.824 MESSAGE base_platform.cpp:383 Using private plugin dir: C:\Users\fcgle\AppData\Local\opencpn\plugins
23:08:07.824 MESSAGE base_platform.cpp:709 Using plugin data path: C:\Users\fcgle\AppData\Local\opencpn\plugins;C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins
23:08:07.824 MESSAGE base_platform.cpp:265 PlugInManager: Using data dirs from: C:\Users\fcgle\AppData\Local\opencpn\plugins;C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins
23:08:07.824 MESSAGE base_platform.cpp:277 PlugInManager: using data dir: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi
23:08:33.045 MESSAGE ODicons.cpp:63 ocpn_draw_pi data location: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi\data\
23:08:35.547 MESSAGE comm_bridge.cpp:190    ***GPS Watchdog timeout at Lat:45.6869   Lon: 13.5517
23:08:38.475    INFO plugin_loader.cpp:1394 PlugInManager:  C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi.dll
23:08:38.475    INFO plugin_loader.cpp:1395         Plugin common name: OCPN Draw
23:08:38.475    INFO plugin_loader.cpp:1397         API Version detected: 116
23:08:38.475    INFO plugin_loader.cpp:1398         PlugIn Version detected: 1.8
23:08:38.489 MESSAGE ODEventHandler.cpp:63 Finished constructor
23:08:38.498 MESSAGE ODConfig.cpp:248 Loading navobjects from C:\ProgramData\opencpn\plugins\ocpn_draw_pi\data\ODnavobj.xml
23:08:38.498 MESSAGE ODConfig.cpp:258 Done loading ODnavobjects
rgleason commented 1 year ago

line:21:23:28.167 MESSAGE ODicons.cpp:63 ocpn_draw_pi data location: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi\data\

rgleason commented 1 year ago

Jon, Dave got it to this point with odicons.cpp and a breakpoint

  1. Change the cmakelists.txt file line 86 to "RelWithDebInfo"

  2. Build the plugin with the standalone tools available. I use bash prompt and "bash ./bld.bat" batch file.

  3. Then copy the ocpn_draw_pi.dll and ocpn_draw_pi.pdb files

  1. Then start VS2022 run clean, and then build.
  2. Then in VS2022 "File > Open and browse to the src file.
  1. Then set the breakpoint at line 58 and try running it.

Set-Breakpoint

rgleason commented 1 year ago

Immediately after hitting "Continue" I get this message in Opencpn Failed to load all Ocpn_Draw Icons

Now I am wondering, are we just missing an icon?

odicons-line208 ocpn_draw_pi  cpp-line454

rgleason commented 1 year ago

I think the opening icon would be "ODmanager.png" so %localappdata%\opencpn\plugins\ocpn_draw_pi C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi\data has ODmanager.png

ODmanager-png

It appears that the icon exists, but it is not being found? Why?

rgleason commented 1 year ago

Opencpn.ini

9:03:27.013   ERROR htmlwin.cpp:586 Unable to open requested HTML document: file:///C:/Users/fcgle/source/repos/OpenCPN/build/RelWithDebInfo/license.html
09:03:27.013   ERROR htmlwin.cpp:586 Unable to open requested HTML document: file:///C:/Users/fcgle/source/repos/OpenCPN/build/RelWithDebInfo/authors.html
09:03:27.013   ERROR ffile.cpp:57 can't open file 'C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo**\/**opencpn.png' (error 2: The system cannot find the file specified.)
09:03:27.013   ERROR image.cpp:2678 Failed to load image from file "C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo**\/**opencpn.png".

What about the forward slash backward slash in the pathname? Does that have anything to do with the problem? I don't know why it is using opencp.png! I don't see that in the icon directory either. \/ ???? `

Perhaps this is another problem with the Opencpn icon?

rgleason commented 1 year ago

I figured out how to step and step into, but really don't know what I am doing. I got an error. In the output

'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wkscli.dll'. 
'opencpn.exe' (Win32): Loaded 'C:\Windows\SysWOW64\netutils.dll'. 
Exception thrown at 0x76FD7452 (KernelBase.dll) in opencpn.exe: 0x000006BA: The RPC server is unavailable.
onecore\vm\dv\storage\plan9\rdr\dll\util.cpp(99)\p9np.dll!59C6EBC3: (caller: 59C681B9) LogHr(1) tid(5594) C0000034     Msg:[瑎牃慥整楆敬☨敤楶散‬奓䍎剈乏婉ⱅ☠瑡牴扩瑵獥‬椦卯慴畴ⱳ渠汵灬牴‬䥆䕌䅟呔䥒啂䕔也剏䅍ⱌ⠠䥆䕌卟䅈䕒剟䅅⁄⁼䥆䕌卟䅈䕒坟䥒䕔簠䘠䱉彅䡓剁彅䕄䕌䕔Ⱙ䘠䱉彅偏久‬䥆䕌卟乙䡃佒低单䥟彏低䅎䕌呒‬畮汬瑰Ⱳ〠)] 
The thread 0x5594 has exited with code 0 (0x0).
Exception thrown at 0x76FD7452 (KernelBase.dll) in opencpn.exe: 0x000006BA: The RPC server is unavailable.
onecore\vm\dv\storage\plan9\rdr\dll\util.cpp(99)\p9np.dll!59C6EBC3: (caller: 59C681B9) LogHr(2) tid(1db4) C0000034     Msg:[瑎牃慥整楆敬☨敤楶散‬奓䍎剈乏婉ⱅ☠瑡牴扩瑵獥‬椦卯慴畴ⱳ渠汵灬牴‬䥆䕌䅟呔䥒啂䕔也剏䅍ⱌ⠠䥆䕌卟䅈䕒剟䅅⁄⁼䥆䕌卟䅈䕒坟䥒䕔簠䘠䱉彅䡓剁彅䕄䕌䕔Ⱙ䘠䱉彅偏久‬䥆䕌卟乙䡃佒低单䥟彏低䅎䕌呒‬畮汬瑰Ⱳ〠)] 
The thread 0x1db4 has exited with code 0 (0x0).

error-missing-icon

opencpn - Copy.log (2).txt

No idea if this is any help!

rgleason commented 1 year ago
9:20:05.450 MESSAGE base_platform.cpp:265 PlugInManager: Using data dirs from: C:\Users\fcgle\AppData\Local\opencpn\plugins;C:\Users\fcgle\source\repos\OpenCPN\build\RelWithDebInfo\plugins
09:20:05.450 MESSAGE base_platform.cpp:277 PlugInManager: using data dir: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi
09:21:47.269 MESSAGE ODicons.cpp:63 ocpn_draw_pi data location: C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi\data\

Line 62 and 63 of odicons.cpp

 wxString s = _("ocpn_draw_pi data location");
    wxLogMessage( wxT("%s: %s"), s.c_str(), fn.GetFullPath().c_str());
rgleason commented 1 year ago

These are the icons in the data directory
C:\Users\fcgle\AppData\Local\opencpn\plugins\ocpn_draw_pi\data\

Icons-in-data-directory

rgleason commented 1 year ago

Jon, can you just create some code for Windows that shows each of the toolset in the Toolset menu as "text"? "Boundary" "ODpoint" "TextPoint" "EBL" "DR" "GZ" "PIL" ?

Then maybe we can isolate the problem later?

Search "create boundary" (5 hits in 3 files of 57 searched)
  C:\Users\fcgle\source\ocpn_draw_pi\src\ODAPI.cpp (1 hit)
    Line 208:     // Create boundary
  C:\Users\fcgle\source\ocpn_draw_pi\src\ODJSON.cpp (2 hits)
    Line  820:                 wxLogMessage( wxS("Create Boundary Type not 'Request'") );
    Line  937:                 wxLogMessage( wxS("Create Boundary Point Type not 'Request'") );
  C:\Users\fcgle\source\ocpn_draw_pi\src\ODToolbarImpl.cpp (2 hits)
    Line 529:     m_toolBoundary = m_toolBarODToolbar->AddCheckTool( ID_MODE_BOUNDARY, _("Boundary"), *g_ocpn_draw_pi->m_pODicons->m_p_bm_ocpn_draw_boundary, wxNullBitmap, _("Create Boundary"), wxEmptyString );
    Line 530:     m_toolODPoint = m_toolBarODToolbar->AddCheckTool( ID_MODE_POINT, _("Boundary Point"),  *g_ocpn_draw_pi->m_pODicons->m_p_bm_ocpn_draw_point, wxNullBitmap, _("Create Boundary Point"), wxEmptyString );
rgleason commented 1 year ago

Is some wxWidget function not working? or is it not referenced or listed such that windows does not see it?

rgleason commented 1 year ago

Made the change suggested by Bdbcat, built it and copied the dll and pdb to %localappdata%\opencpn\plugins and started VS2022 and voila!

The icons are a bit small, but I can access all the toolbar now. Text is whacked out and looking uncomfortable in the yellow square, but it is working. Screenshot (366)

Screenshot (365)

Jon...

After some fiddling, I have got a working debug environment for ocpn_draw_pi on Windows.

The Icon load problem:

  1. SVG files do not contain inherent size information. The wxBitmap Bundle interface requires a specified size to create a bmp. So you will want to explicitly set the size required, probably here, overriding default parameters:

ODIcons.cpp:89

m_bm_ocpn_draw_pi_properties = LoadSVG( fn.GetFullPath() );

  1. This looks suspicious ODIcons.h: wxBitmap LoadSVG( const wxString filename, unsigned int width = -1, unsigned int height = -1 ); unsigned int width = -1 ?????

  2. Build fails with OD_USE_SVG Off. A stray LoadSVG() call, somewhere.

Good Luck

Dave

rgleason commented 1 year ago

Changed include\ODicons.h LINE 103 & 104

#if defined ODraw_USE_SVG || defined ODraw_USE_MUI
    wxBitmap    LoadSVG( const wxString filename, unsigned int width = 32, unsigned int height = 32 );
    wxBitmap    ScaleIcon( wxBitmap bitmap, const wxString filename, double sf );
rgleason commented 1 year ago

scale-factor-enabled-scaled-graphics

Draw-toolbar

EBL-Message

rgleason commented 1 year ago

Jon wrote:

For setting the size it all worked in previous versions of OCPN, so it must be something to do with the new wx32

Dave wrote:

Very definitely. The SVG handling on wx32 is very much different than on wx30/31, internally. But the API exposed in OCPN plugin header is not changed.

It appears the wx32 on Windows is not honoring the default size encoded into the SVG file, e.g.:

viewBox="0 0 18 18"

As I say, we never depend on that value in OCPN core, since this is "pixels", and that always needs tweaking for user specified UI scale factors, and especially for scaled displays.

We have found it better to ask for the bitmap size we want, rather than take a default and scale it up or down. Better graphics rendering...

Dave

Does this mean that we cannot expect wxWidgets to work the same way in different OS? I thought that was the whole idea? There are some other plugins that are kind of busted because of this scale issue.

jongough commented 1 year ago

The icons are all the same size. The problem comes when specifying a specific size and then having different resolutions of the screen. By setting the icon size to 32x32 on high res screens they will be way to small. For windows this is a work around to get them to show, but a real solution is needed. It seems to be something to do with windows/wx32/msvs2022 and the interactions. I 'think' I remember reading that windows limits the size of icons that are not 'windows' icons and therefore the issue occurs. When I get a working windows version of OCPN that I can debug I can chase it down.

rgleason commented 1 year ago

Good explanation. Thanks Jon. Perhaps it is not wxWidgets, but is partly Windows. How has the interpretation of "-1" changed in windows?
Are some additional brackets needed or something?

rgleason commented 1 year ago

https://docs.wxwidgets.org/latest/overview_high_dpi.html Automatic scaling is convenient, but doesn't really allow the application to use the extra pixels available on the display. Visually, this means that the scaled application appears blurry, in contrast to sharper applications using the full display resolution, so a better solution for interpreting pixel values on high DPI displays is needed: one which allows to scale some pixel values (e.g. the total window size), but not some other ones (e.g. those used for drawing, which should remain unscaled to use the full available resolution).

Thus, the first thing do when preparing your application for high DPI support is to stop using raw pixel values, as they mean different things under different platforms when DPI scaling is used. Actually, using any pixel values is not recommended and replacing them with the values based on the text metrics, i.e. obtained using wxWindow::GetTextExtent(), or expressing them in dialog units (see wxWindow::ConvertDialogToPixels()) is preferable

rgleason commented 1 year ago

Under platform specific MSW

The behaviour of the application when running on a high-DPI display depends on the values in its manifest. You may either use your own manifest, in which case you need to define the dpiAware (for compatibility with older OS versions) and dpiAwareness (for proper per-monitor DPI support) in it, or simply include wx/msw/wx.rc from your resource file to use the manifest provided by wxWidgets and predefine wxUSE_DPI_AWARE_MANIFEST to opt-in into high DPI support: define it as 1 for minimal DPI awareness and 2 for full, per-monitor DPI awareness supported by Windows 10 version 1703 or later.

rgleason commented 1 year ago

https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#dpiAware

https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#dpiAwareness

jongough commented 1 year ago

Good explanation. Thanks Jon. Perhaps it is not wxWidgets, but is partly Windows. How has the interpretation of "-1" changed in windows? Are some additional brackets needed or something?

No. -1 for unsigned int is 0-1 or 0xffffffff (just add the number of f's you need for the size of integers) which means it is the biggest number an unsigned integer can take on the particular platform. It does not rely on the setting of a variable, i.e UINT_MAX. This effect, I believe, is specified in the C/C++ definition and is not compiler dependant.

rgleason commented 1 year ago

...but a real solution is needed.

This is the real solution.

Provided that wxWidgets 3.2.1 is working right, it is going to make a big difference if this is followed for high res screens using DPI https://docs.wxwidgets.org/latest/overview_high_dpi.html

and it is going to eliminate a bunch of scaling issues.

jongough commented 1 year ago

Found the issue. It is with the change to wxWidgets 3.2.1 and the use of the wxBitmapBundle::FromSVGFile function not working with large default icon sizes within windows 10. I have raised an issue, #2922, on OCPN regarding the function and describing the issue.

There are work arounds, but... It would be better if OCPN validated the max size of the icon and applied a default setting if it is too big.

rgleason commented 1 year ago

Ocpn_Draw 1.8.20.0 issued to Beta Catalog