summaryrefslogtreecommitdiff
path: root/geography/opencpn-plugin-watchdog/patches
diff options
context:
space:
mode:
authorbouyer <bouyer@pkgsrc.org>2018-08-27 15:59:07 +0000
committerbouyer <bouyer@pkgsrc.org>2018-08-27 15:59:07 +0000
commit61d6944a34660b51d842183652caf18ac23617fd (patch)
treef00d97f4550677128e17f7fc5921891e39c96850 /geography/opencpn-plugin-watchdog/patches
parentc1d35a6caa4b1efbed8afa1dc66d40b611aef33b (diff)
downloadpkgsrc-61d6944a34660b51d842183652caf18ac23617fd.tar.gz
Update to 20180827. Changes since 20180405:
display alarm counts add pypilot alarm simplify ui using context menu fix sog for speed alarm fix course alarm near north correct wind panel fix wind alarms Various bug fixes pkgsrc fix for gtk3: set brush to transparent for anchor alarm circle
Diffstat (limited to 'geography/opencpn-plugin-watchdog/patches')
-rw-r--r--geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp241
-rw-r--r--geography/opencpn-plugin-watchdog/patches/patch-src_watchdog_pi.cpp14
2 files changed, 140 insertions, 115 deletions
diff --git a/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp b/geography/opencpn-plugin-watchdog/patches/patch-src_Alarm.cpp
index 2ddb0b058c4..cd766639055 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 <map>
#include <wx/wx.h>
+#include <cmath>
- #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 <wx/process.h>
+@@ -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 8c564968ff7..3432cb2d6e3 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 <wx/wx.h>
#include <wx/stdpaths.h>
+#include <cmath>
- #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);