diff --git a/geography/opencpn-plugin-watchdog/Makefile b/geography/opencpn-plugin-watchdog/Makefile index 2ab007b9eaf5..bb86a8505008 100644 --- a/geography/opencpn-plugin-watchdog/Makefile +++ b/geography/opencpn-plugin-watchdog/Makefile @@ -1,14 +1,13 @@ -# $NetBSD: Makefile,v 1.15 2018/07/19 17:58:58 bouyer Exp $ +# $NetBSD: Makefile,v 1.16 2018/08/27 15:59:07 bouyer Exp $ # -VERSION= 20180405 +VERSION= 20180827 DISTNAME= watchdog_pi-${VERSION} PKGNAME= opencpn-plugin-watchdog-${VERSION} -PKGREVISION= 4 CATEGORIES= geography MASTER_SITES= ${MASTER_SITE_GITHUB:=seandepagnier/} GITHUB_PROJECT= watchdog_pi -GITHUB_TAG= 4e79fdba96ccd1a17b81166e6956571bf734597d +GITHUB_TAG= eea8cb97a5596868f99cff15176fd35b36780e28 MAINTAINER= bouyer@NetBSD.org HOMEPAGE= https://opencpn.org/OpenCPN/plugins/watchdog.html diff --git a/geography/opencpn-plugin-watchdog/PLIST b/geography/opencpn-plugin-watchdog/PLIST index afbc8f251631..403bc4db457e 100644 --- a/geography/opencpn-plugin-watchdog/PLIST +++ b/geography/opencpn-plugin-watchdog/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.3 2018/04/05 16:20:40 bouyer Exp $ +@comment $NetBSD: PLIST,v 1.4 2018/08/27 15:59:07 bouyer Exp $ lib/opencpn/libwatchdog_pi.so share/locale/ar_SA/LC_MESSAGES/opencpn-watchdog_pi.mo share/locale/ca_ES/LC_MESSAGES/opencpn-watchdog_pi.mo @@ -31,5 +31,3 @@ share/locale/tr_TR/LC_MESSAGES/opencpn-watchdog_pi.mo share/locale/vi_VN/LC_MESSAGES/opencpn-watchdog_pi.mo share/locale/zh_TW/LC_MESSAGES/opencpn-watchdog_pi.mo share/opencpn/plugins/watchdog_pi/data/watchdog_pi.svg -share/opencpn/plugins/watchdog_pi/data/watchdog_pi_rollover.svg -share/opencpn/plugins/watchdog_pi/data/watchdog_pi_toggled.svg diff --git a/geography/opencpn-plugin-watchdog/distinfo b/geography/opencpn-plugin-watchdog/distinfo index fa006633a673..59d44496fa43 100644 --- a/geography/opencpn-plugin-watchdog/distinfo +++ b/geography/opencpn-plugin-watchdog/distinfo @@ -1,10 +1,10 @@ -$NetBSD: distinfo,v 1.10 2018/07/03 15:14:15 bouyer Exp $ +$NetBSD: distinfo,v 1.11 2018/08/27 15:59:07 bouyer Exp $ -SHA1 (watchdog_pi-20180405-4e79fdba96ccd1a17b81166e6956571bf734597d.tar.gz) = e96b4390349488a41d8ca74203a3316512be84cb -RMD160 (watchdog_pi-20180405-4e79fdba96ccd1a17b81166e6956571bf734597d.tar.gz) = 033f0c65129a811b01ce24655c9bc4ec4435f3d8 -SHA512 (watchdog_pi-20180405-4e79fdba96ccd1a17b81166e6956571bf734597d.tar.gz) = 9398cc2663d5acee13022105a98a76eb1b2dc3cf67e7d49bb0554161488125276b181e9e5392654dea23413e167b95b0acfd4600d1f4ed1c72b678e622873c89 -Size (watchdog_pi-20180405-4e79fdba96ccd1a17b81166e6956571bf734597d.tar.gz) = 485682 bytes +SHA1 (watchdog_pi-20180827-eea8cb97a5596868f99cff15176fd35b36780e28.tar.gz) = d0d6bc7028fe0a3d3ecb36d87738e7c94a2b6f3b +RMD160 (watchdog_pi-20180827-eea8cb97a5596868f99cff15176fd35b36780e28.tar.gz) = 9684606e9f2097c233d97d6f2b14bba3933f0366 +SHA512 (watchdog_pi-20180827-eea8cb97a5596868f99cff15176fd35b36780e28.tar.gz) = c42bf342d1936d354ffda5476b0abd1fd1bc3252e0a5c20a80674197fafb7ccd432f0e5333b761c6db4f83167249c55dfa7839ab159d5e735b201311d9b2be2b +Size (watchdog_pi-20180827-eea8cb97a5596868f99cff15176fd35b36780e28.tar.gz) = 482981 bytes SHA1 (patch-cmake_PluginConfigure.cmake) = bc2d6409f95cffee145173280c33f9e7fe439864 -SHA1 (patch-src_Alarm.cpp) = 3eab8a83a2304c9378b1e21bfc367e41833b3973 -SHA1 (patch-src_watchdog_pi.cpp) = 8d8077490aa7a121fae82931ae0c8de89f82fbaf +SHA1 (patch-src_Alarm.cpp) = cb7f656692ced7c41b0177c27646defaeecab646 +SHA1 (patch-src_watchdog_pi.cpp) = b47afde07f9861d9290989ada590bbb0e82cf7a3 SHA1 (patch-src_wddc.cpp) = 3c43974da65dfe9a18a77f4b84595a4ab602cfd9 diff --git a/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp b/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp index 2ddb0b058c48..cd766639055d 100644 --- a/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp +++ b/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp @@ -1,89 +1,17 @@ -$NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ +$NetBSD: patch-src_Alarm.cpp,v 1.3 2018/08/27 15:59:07 bouyer Exp $ ---- src/Alarm.cpp.orig 2018-03-04 15:24:36.000000000 +0100 -+++ src/Alarm.cpp 2018-07-02 12:13:29.929855122 +0200 +--- src/Alarm.cpp.orig 2018-08-25 23:08:44.000000000 +0200 ++++ src/Alarm.cpp 2018-08-27 16:00:48.979962717 +0200 @@ -27,6 +27,7 @@ #include #include +#include - #include "wx28compat.h" #include "wddc.h" -@@ -81,7 +82,7 @@ - bool Test() { - PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); - -- if(isnan(lastfix.Lat)) -+ if(std::isnan(lastfix.Lat)) - return m_bNoData; - - double lat1 = lastfix.Lat, lon1 = lastfix.Lon, lat2, lon2; -@@ -96,7 +97,7 @@ - while(count < 10 && dist1 > 1e-6) { - PositionBearingDistanceMercator_Plugin - (lastfix.Lat, lastfix.Lon, lastfix.Cog, dist + dist1, &lat2, &lon2); -- if(!wxIsNaN(lat2) && PlugIn_GSHHS_CrossesLand(lat1, lon1, lat2, lon2)) { -+ if(!std::isnan(lat2) && PlugIn_GSHHS_CrossesLand(lat1, lon1, lat2, lon2)) { - if(dist1 < 1) { - m_LandFallTime = wxTimeSpan::Seconds(3600.0 * (dist + dist1) / lastfix.Sog); - m_crossinglat1 = lat1, m_crossinglon1 = lon1; -@@ -188,7 +189,7 @@ - - void Render(wdDC &dc, PlugIn_ViewPort &vp) { - PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); -- if(isnan(m_crossinglat1)) -+ if(std::isnan(m_crossinglat1)) - return; - - wxPoint r1, r2, r3, r4; -@@ -350,7 +351,7 @@ - bool Test() { - PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); - -- if(isnan(lastfix.Lat)) -+ if(std::isnan(lastfix.Lat)) - return m_bNoData; - - double lat, lon; -@@ -389,7 +390,7 @@ - - switch(m_Mode) { - case TIME: { -- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon) ||wxIsNaN(lastfix.Cog) || wxIsNaN(lastfix.Sog)) break; -+ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon) ||std::isnan(lastfix.Cog) || std::isnan(lastfix.Sog)) break; - if(ODVersionNewerThan( 1, 1, 1)) { - dist = lastfix.Sog * ( m_TimeMinutes / 60 ); - PositionBearingDistanceMercator_Plugin(lastfix.Lat, lastfix.Lon, lastfix.Cog, dist, &lat, &lon); -@@ -589,7 +590,7 @@ - break; - } - case DISTANCE: { -- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon)) break; -+ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon)) break; - // check OD version to see which lookup to use - if( ODVersionNewerThan( 1, 1, 1)) { - BoundaryCrossingList.clear(); -@@ -817,7 +818,7 @@ - break; - } - case ANCHOR: { -- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon)) break; -+ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon)) break; - if(m_BoundaryName == wxEmptyString) - m_BoundaryName = g_BoundaryName; - if(m_BoundaryDescription == wxEmptyString) -@@ -850,7 +851,7 @@ - break; - } - case GUARD: { -- if(wxIsNaN(g_AISTarget.m_dLat) || wxIsNaN(g_AISTarget.m_dLat)) break; -+ if(std::isnan(g_AISTarget.m_dLat) || std::isnan(g_AISTarget.m_dLat)) break; - wxJSONValue jMsg; - wxJSONWriter writer; - wxString MsgString; -@@ -1701,7 +1702,7 @@ - } + #include +@@ -70,7 +71,7 @@ + wxString Type() { return _("Anchor"); } bool Test() { - if(isnan(g_watchdog_pi->m_sog)) @@ -91,16 +19,24 @@ $NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ return m_bNoData; return Distance() > m_Radius; } -@@ -1718,7 +1719,7 @@ +@@ -87,7 +88,7 @@ double anchordist = Distance(); wxString s; - if(isnan(anchordist)) + if(std::isnan(anchordist)) - s = _T("N/A"); + s = "N/A"; else { - wxString fmt(_T("%.0f ")); -@@ -1782,7 +1783,7 @@ + wxString fmt("%.0f "); +@@ -106,6 +107,7 @@ + m_Radius/1853.0/60.0, + m_Longitude); + ++ dc.SetBrush(*wxTRANSPARENT_BRUSH); + if(m_bEnabled) { + if(m_bFired) + dc.SetPen(wxPen(*wxRED, 2)); +@@ -151,7 +152,7 @@ private: double Distance() { @@ -109,7 +45,7 @@ $NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ return NAN; PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); -@@ -1820,7 +1821,7 @@ +@@ -180,7 +181,7 @@ bool Test() { double error = CourseError(); @@ -118,16 +54,16 @@ $NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ return m_bNoData; return error > m_Tolerance; -@@ -1829,7 +1830,7 @@ +@@ -189,7 +190,7 @@ wxString GetStatus() { double courseerror = CourseError(); wxString s; - if(isnan(courseerror)) + if(std::isnan(courseerror)) - s = _T("N/A"); + s = "N/A"; else { - wxString fmt(_T("%.0f ")); -@@ -1850,7 +1851,7 @@ + wxString fmt("%.0f "); +@@ -210,7 +211,7 @@ double lat1 = lastfix.Lat, lon1 = lastfix.Lon, lat2, lon2, lat3, lon3; double dist = lastfix.Sog; @@ -136,16 +72,16 @@ $NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ return; PositionBearingDistanceMercator_Plugin(lat1, lon1, m_Course+m_Tolerance, -@@ -1949,7 +1950,7 @@ +@@ -301,7 +302,7 @@ wxString GetStatus() { wxString s; - if(isnan(g_watchdog_pi->m_sog)) + if(std::isnan(g_watchdog_pi->m_sog)) - s = _T("N/A"); + s = "N/A"; else { - wxString fmt(_T("%.1f")); -@@ -1983,7 +1984,7 @@ + wxString fmt("%.1f"); +@@ -335,7 +336,7 @@ bool Test() { double knots = Knots(); @@ -154,34 +90,49 @@ $NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ return m_bNoData; if(m_Mode == UNDERSPEED) -@@ -2038,7 +2039,7 @@ +@@ -390,7 +391,7 @@ { Alarm::OnTimer( tEvent ); double sog = g_watchdog_pi->LastFix().Sog; - if(!isnan(sog)) + if(!std::isnan(sog)) - m_SOGqueue.push_front(sog) ; - return; - } -@@ -2101,7 +2102,7 @@ - val = 360 - val; - } + m_SOGqueue.push_front(sog); + while((int)m_SOGqueue.size() > m_iAverageTime) + m_SOGqueue.pop_back(); +@@ -452,12 +453,12 @@ + switch(m_Mode) { + case UNDERSPEED: + case OVERSPEED: +- if(isnan(m_speed)) ++ if(std::isnan(m_speed)) + return "N/A"; + else + return wxString::Format(fmt + (m_Mode == UNDERSPEED ? " < " : " > ") + fmt, m_speed, m_dVal); + case DIRECTION: +- if(isnan(m_direction)) ++ if(std::isnan(m_direction)) + return "N/A"; + else + return wxString::Format(fmt + " < " + fmt + " < " + fmt, +@@ -470,7 +471,7 @@ + void Render(wdDC &dc, PlugIn_ViewPort &vp) { + if(m_Mode != DIRECTION) + return; +- if(isnan(m_direction)) ++ if(std::isnan(m_direction)) + return; + PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); -- if(isnan(val)) -+ if(std::isnan(val)) - s = _T("N/A"); - else { - wxString fmt(_T("%.1f")); -@@ -2300,7 +2301,7 @@ - s += _T(" "); +@@ -644,7 +645,7 @@ + s += " "; double val = Value(); - if(isnan(val)) + if(std::isnan(val)) - s += _T("N/A"); + s += "N/A"; else { - wxString fmt(_T("%.2f")); -@@ -2439,7 +2440,7 @@ + wxString fmt("%.2f"); +@@ -783,7 +784,7 @@ value = nmea.Mtw.Temperature; break; } @@ -190,3 +141,77 @@ $NetBSD: patch-src_Alarm.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ return; m_WeatherDataTime = wxDateTime::Now(); +@@ -965,7 +966,7 @@ + bool Test() { + PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); + +- if(isnan(lastfix.Lat)) ++ if(std::isnan(lastfix.Lat)) + return m_bNoData; + + double lat1 = lastfix.Lat, lon1 = lastfix.Lon, lat2, lon2; +@@ -980,7 +981,7 @@ + while(count < 10 && dist1 > 1e-6) { + PositionBearingDistanceMercator_Plugin + (lastfix.Lat, lastfix.Lon, lastfix.Cog, dist + dist1, &lat2, &lon2); +- if(!wxIsNaN(lat2) && PlugIn_GSHHS_CrossesLand(lat1, lon1, lat2, lon2)) { ++ if(!std::isnan(lat2) && PlugIn_GSHHS_CrossesLand(lat1, lon1, lat2, lon2)) { + if(dist1 < 1) { + m_LandFallTime = wxTimeSpan::Seconds(3600.0 * (dist + dist1) / lastfix.Sog); + m_crossinglat1 = lat1, m_crossinglon1 = lon1; +@@ -1072,7 +1073,7 @@ + + void Render(wdDC &dc, PlugIn_ViewPort &vp) { + PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); +- if(isnan(m_crossinglat1)) ++ if(std::isnan(m_crossinglat1)) + return; + + wxPoint r1, r2, r3, r4; +@@ -1234,7 +1235,7 @@ + bool Test() { + PlugIn_Position_Fix_Ex lastfix = g_watchdog_pi->LastFix(); + +- if(isnan(lastfix.Lat)) ++ if(std::isnan(lastfix.Lat)) + return m_bNoData; + + double lat, lon; +@@ -1273,7 +1274,7 @@ + + switch(m_Mode) { + case TIME: { +- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon) ||wxIsNaN(lastfix.Cog) || wxIsNaN(lastfix.Sog)) break; ++ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon) ||std::isnan(lastfix.Cog) || std::isnan(lastfix.Sog)) break; + if(ODVersionNewerThan( 1, 1, 1)) { + dist = lastfix.Sog * ( m_TimeMinutes / 60 ); + PositionBearingDistanceMercator_Plugin(lastfix.Lat, lastfix.Lon, lastfix.Cog, dist, &lat, &lon); +@@ -1472,7 +1473,7 @@ + break; + } + case DISTANCE: { +- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon)) break; ++ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon)) break; + // check OD version to see which lookup to use + if( ODVersionNewerThan( 1, 1, 1)) { + BoundaryCrossingList.clear(); +@@ -1700,7 +1701,7 @@ + break; + } + case ANCHOR: { +- if(wxIsNaN(lastfix.Lat) || wxIsNaN(lastfix.Lon)) break; ++ if(std::isnan(lastfix.Lat) || std::isnan(lastfix.Lon)) break; + if(m_BoundaryName == wxEmptyString) + m_BoundaryName = g_BoundaryName; + if(m_BoundaryDescription == wxEmptyString) +@@ -1731,7 +1732,7 @@ + break; + } + case GUARD: { +- if(wxIsNaN(g_AISTarget.m_dLat) || wxIsNaN(g_AISTarget.m_dLat)) break; ++ if(std::isnan(g_AISTarget.m_dLat) || std::isnan(g_AISTarget.m_dLat)) break; + Json::Value jMsg; + Json::FastWriter writer; + jMsg["Source"] = "WATCHDOG_PI"; +--- Alarm.cpp.orig 2018-08-27 16:54:18.043496648 +0200 ++++ Alarm.cpp 2018-08-27 16:54:21.910702531 +0200 diff --git a/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp b/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp index 8c564968ff76..3432cb2d6e38 100644 --- a/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp +++ b/geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp @@ -1,16 +1,16 @@ -$NetBSD: patch-src_watchdog_pi.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ +$NetBSD: patch-src_watchdog_pi.cpp,v 1.3 2018/08/27 15:59:07 bouyer Exp $ ---- src/watchdog_pi.cpp.orig 2018-03-04 15:24:36.000000000 +0100 -+++ src/watchdog_pi.cpp 2018-07-02 12:05:36.112240381 +0200 +--- src/watchdog_pi.cpp.orig 2018-08-25 23:08:44.000000000 +0200 ++++ src/watchdog_pi.cpp 2018-08-27 15:58:48.263716962 +0200 @@ -26,6 +26,7 @@ #include #include +#include - #include "wxJSON/jsonreader.h" - #include "wxJSON/jsonwriter.h" -@@ -345,14 +346,14 @@ + #include "json/json.h" + +@@ -343,14 +344,14 @@ { /* calculate course and speed over ground from gps */ double dt = m_lastfix.FixTime - m_lasttimerfix.FixTime; @@ -26,4 +26,4 @@ $NetBSD: patch-src_watchdog_pi.cpp,v 1.2 2018/07/03 15:14:16 bouyer Exp $ + if(std::isnan(m_cog)) m_cog = cog, m_sog = sog; else { - m_cog = .25*cog + .75*m_cog; + cog = heading_resolve(cog, m_cog);