nohal / dashboardsk_pi

SignalK based dashboard plugin for OpenCPN
GNU General Public License v3.0
3 stars 3 forks source link

Win: OCPN crash on mouse event when DashboardSK is active #67

Closed Hakansv closed 8 months ago

Hakansv commented 8 months ago

Describe the bug When a SignalK connection and DashboardSK are active. Right click on Canvas gives an OCPN crash on MouseEvents

To Reproduce Steps to reproduce the behavior:

  1. Have at least one SignalK connection enabled
  2. Don't use DashboardSK . Right click Canvas or Target - Menu is shown
  3. Start DashboardSK by a click on the Tools icon.
  4. Right click on Canvas - OCPN crash

Desktop (please complete the following information if applicable):

Debug It breaks here. See shot below.

Call stack:

    wxmsw32u_core_vc14x.dll!7009b645()  Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for wxmsw32u_core_vc14x.dll]   
    [External Code] 
    [Inline Frame] opencpn.exe!wxRect::Contains(const wxPoint &) Line 844   C++
    opencpn.exe!MyFrame::GetCanvasUnderMouse() Line 1354    C++
    [External Code] 
>   opencpn.exe!PlugInManager::SendMouseEventToPlugins(wxMouseEvent & event) Line 1632  C++
    opencpn.exe!ChartCanvas::MouseEventSetup(wxMouseEvent & event, bool b_handle_dclick) Line 7174  C++
    opencpn.exe!ChartCanvas::MouseEvent(wxMouseEvent & event) Line 9532 C++
    [External Code] 
    opencpn.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 738  C++
    [External Code] 

In g_pi_manager:
-       m_listener_SignalK  {key="signalK" listener=0x0667ec30 {evt_ais_json_listener={key={...} listener=0x0667ec30 {...} ev_type=...} ...} ...}   ObservableListener

Note: I'm not saying this is the cause but an observation FWIW: After commit: ced28650bc "Enable multiple signalK network comm sources" I had to, in Dashboard, change a "find" string since the key have changed from "SignalK" to "signalK" Compare the key="signalK" above.

Debug brake: bild

nohal commented 8 months ago

Can't reproduce

nohal commented 8 months ago

I also think I do not understand

I had to, in Dashboard, change a "find" string since the key have changed from "SignalK" to "signalK" Compare the key="signalK" above.

Did something stop working in this plugin?

Hakansv commented 8 months ago

Yes. This function didn't found SignalK since it was changed to signalK so I made the easy "hack" to look for "ignal"

std::vector<std::string> PriorityIDs = GetActivePriorityIdentifiers();
// Get current satellite priority identifier = item 4
std::string satID = PriorityIDs[4];
if (satID.find("nmea0183") != std::string::npos)
  mPriSatStatus = 3;  // GSV
else if (satID.find("ignal") != std::string::npos)
  mPriSatStatus = 2;  // SignalK
else if (satID.find("nmea2000") != std::string::npos) {
nohal commented 8 months ago

Ah, you speak about the old dashboard plugin in OpenCPN, not DashboardSK. now I understand...

Hakansv commented 8 months ago

I tried the same set-up on another Win and it works as it should. So I uninstalled D-SK from the Win where it crashed. Then installed it again. Then by the usual eagerness made two steps on the same. :( I also redefined my instruments. Now it's working wo crash but I can't say if the crash was due to the instruments or solved by a reinstall. Phuu. Anyway, it's working. Thanks for listening. btw: Did you remember to extend the value "watchdog" timer range to allow up ~900 seconds for next update?

nohal commented 8 months ago

Yes, in 10a5573