seandepagnier / watchdog_pi

watchdog plugin for opencpn
GNU General Public License v3.0
10 stars 19 forks source link

Wx312 #102

Closed did-g closed 5 years ago

did-g commented 5 years ago

Hi, Update travis OSX and appveyor with O 5.0 and wx 3.12, 100% untested but it compiles.

Regards Ddidier

rgleason commented 5 years ago

Hi did-g thanks for making this. I've tested it this morning and there is a problem when you https://ci.appveyor.com/project/seandepagnier/watchdog-pi/builds/22616521/artifacts

  1. Setup alarms and use Watchdog - its ok.
  2. Close OpenCPN.
  3. Re open OpenCPN
  4. Immediate Crash.
  5. Delete or rename the watchdogconfiguration.xml file in C:\ProgramData\opencpn\plugins\watchdog 6, Re start Opencpn
  6. You have to setup all the alarms again for each reuse!

I believe the watchdogconfiguration.xml file is properly formatted but it is not being read successfully so Opencpn crashes.

This has been a consistent issue since f79fdef and probably before as I have tested each appveyer compile back to f79fdef.

Please see https://github.com/seandepagnier/watchdog_pi/issues/101 O crash on Enable, after Commit Sept 5 2018 - Correct logic error - f79fdef #101

[WatchdogConfiguration.xml.txt](https://github.com/seandepagnier/watchdog_pi/files/2901044 watchdog-close-delete-xml-start-over watchdog-dual-canvas watchdog-works

/WatchdogConfiguration.xml.txt) WatchdogConfiguration-old1.xml.txt WatchdogConfiguration-old2.xml.txt opencpn - current.ini.txt opencpn.log

BIG Problem. It just does not read the watchdogconfiguration.xml file once OpenCPN is closed. Actually it is working with 3 alarms now. I can close the plugin and open it and also close opencpn and open the plugin again with no crash.

screenshot 52

I think I added two more alarms and the last one failed when I opened Opencpn immediately. When a plugin fails why should Opencpn fail? Shouldn't just the plugin fail?

WatchdogConfiguration.old4.xml.txt

I think the problem is with Barometer

YES Barometer is the problem.

screenshot 53

seandepagnier commented 5 years ago

Rick,

Could you elaborate on how barometer is the problem?

If you comment line 484 on src/watchdog_pi.cpp does it fix the crash?

rgleason commented 5 years ago
  1. When I create a Barometer alarm, it seems to be accepted. I have not tested it however.
  2. Then if I close the plugin with Barometer still as an alarm. and open it, it opens ok.
  3. The if I close the plugin with Barometer still and alarm, and close Opencpn, then OpenCPN crashes.
  4. If I remove the barometer with a text editor from the xml file, Opencpn loads.

Yes I could comment out the line on 484 and it would fix the crash.

rgleason commented 5 years ago

Have made a PR

    } else if(message_id == "AIS") {
        if(!reader.parse( (std::string)message_body, root )) {
line484 >            wxLogMessage(wxString("watchdog_pi: Error parsing AIS JSON message: ") + reader.getFormattedErrorMessages() + " : " + message_body );
            return;
}

The compile fails https://ci.appveyor.com/project/seandepagnier/watchdog-pi/builds/22644778 "C:\project\watchdog_pi\build\package.vcxproj" (default target) (1) -> "C:\project\watchdog_pi\build\ALL_BUILD.vcxproj" (default target) (3) -> "C:\project\watchdog_pi\build\watchdog_pi.vcxproj" (default target) (4) -> (ClCompile target) -> C:\project\watchdog_pi\src\watchdog_pi.cpp(484): fatal error C1021: invalid preprocessor command 'wxLogMessage' [C:\project\watchdog_pi\build\watchdog_pi.vcxproj] 3 Warning(s) 1 Error(s)

rgleason commented 5 years ago

Why not comment out the alarm itself? Maybe just get rid of it? Like some thing at line 637 of Alarm.cpp to where?