Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 10-01-2016, 09:07   #76
Registered User

Join Date: Sep 2012
Location: Baikal
Posts: 595
Re: Watchdog Plugin

Quote:
Originally Posted by Roel Smidt View Post
I have been working on the Watchdog documentation.
If there's anything you think I should add, change or delete, feel free to bark at me! (Just don't bite please...).

Roel
excellent work!
Baikal is offline   Reply With Quote
Old 10-01-2016, 10:25   #77
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,286
Re: Watchdog Plugin

Roel..
You really have been working and the result is both very informative and enjoyable. No barks but lots of tail wagging.
Håkan
Hakan is online now   Reply With Quote
Old 11-01-2016, 16:35   #78
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Watchdog Plugin

Roel,
Looking good. The dialog panel at step 4 (S-WDpi-21, S-WDpi-32, etc as well) has changed, it now is a vertical list as the horizontal one was not displaying properly on all devices. I hope the vertical one will.

In the Boundary alarm section you show the OD toolbar twice showing the same thing, I think you want to show Boundary and Boundary Point.

But this does explain how the WD works and gives good examples. Thanks very much!

Regards
Jon
jongough is offline   Reply With Quote
Old 12-01-2016, 04:20   #79
Registered User

Join Date: Nov 2014
Location: Netherlands
Posts: 219
Re: Watchdog Plugin

Quote:
Originally Posted by Roel Smidt View Post
I have been working on the Watchdog documentation.
If there's anything you think I should add, change or delete, feel free to bark at me! (Just don't bite please...).

Roel
Roel,

There are a few problems with links.
In the contents the alarm links (like Landfall Alarm) are linked to the extensive descriptions (eg LANDFALL ALARM ) in the html version.
For the export version however, as the link name is "Landfall Alarm"
it will link to the header with this text, which is the small description in the
Standard Action part.
If you want to link the contents to the extensive part in the export version
you have to name the link with the capital name LANDFALL ALARM or the export php code will not link it properly.

Regards,
Peter
ptulp is offline   Reply With Quote
Old 12-01-2016, 10:26   #80
Registered User

Join Date: Mar 2010
Location: Den Helder, the Netherlands
Boat: Drascombe Coaster (22ft) "Seanymph"
Posts: 136
Re: Watchdog Plugin

Jon, thx. I corrected those pics. Something else though. I suspect a bug in the WD Speed Alarm. When I set a speed and activate the alarm, I think WD only sees my own speed and not the set speed. Testing the speed alarm is a bit difficult as I have OpenCPN only on my Desktop-PC at home (and the speed of my house is -and should stay- somewhere around 0.0 knots).

Can anyone confirm that bug or is the problem on my side?

See the enclosed doc.

Roel
Attached Files
File Type: doc Watchdog-Speed Alarm.doc (171.0 KB, 84 views)
Roel Smidt is offline   Reply With Quote
Old 12-01-2016, 10:29   #81
Registered User

Join Date: Mar 2010
Location: Den Helder, the Netherlands
Boat: Drascombe Coaster (22ft) "Seanymph"
Posts: 136
Re: Watchdog Plugin

Peter, thanks.
I will look into this day after tomorrow. But I am a newbie at HTML and do not really understand what I have done or should do to fix it. Maybe I will need some help in Dutch.

Vriendelijke groet,
Roel
Roel Smidt is offline   Reply With Quote
Old 12-01-2016, 11:53   #82
Registered User

Join Date: Nov 2014
Location: Netherlands
Posts: 219
Re: Watchdog Plugin

Quote:
Originally Posted by Roel Smidt View Post
Peter, thanks.
I will look into this day after tomorrow. But I am a newbie at HTML and do not really understand what I have done or should do to fix it. Maybe I will need some help in Dutch.

Vriendelijke groet,
Roel
Roel,

The question is where you want the Contents links pointing to:

To the extended description or the short description?

Peter
ptulp is offline   Reply With Quote
Old 12-01-2016, 15:07   #83
Registered User

Join Date: Nov 2014
Location: Netherlands
Posts: 219
Re: Watchdog Plugin

Quote:
Originally Posted by Roel Smidt View Post
Jon, thx. I corrected those pics. Something else though. I suspect a bug in the WD Speed Alarm. When I set a speed and activate the alarm, I think WD only sees my own speed and not the set speed. Testing the speed alarm is a bit difficult as I have OpenCPN only on my Desktop-PC at home (and the speed of my house is -and should stay- somewhere around 0.0 knots).

Can anyone confirm that bug or is the problem on my side?

See the enclosed doc.

Roel
I can confirm that there is a bug in the code.

In the Test() function in the file Alarm.cpp for the SpeedAlarm, the test is between the same values, so this can not work.
Also the sog calculation in function watchdog_pi::OnTimer() in file watchdog_pi.cpp is not correct I think.
If using the watchdog plugin with a VDR run, the sog in the dashboard is not the same as shown in the watchdog window.

Peter
ptulp is offline   Reply With Quote
Old 13-01-2016, 09:19   #84
Registered User

Join Date: Mar 2010
Location: Den Helder, the Netherlands
Boat: Drascombe Coaster (22ft) "Seanymph"
Posts: 136
Re: Watchdog Plugin

OK, so it's not me. I have put it in Tracker/Flyspray.
Roel Smidt is offline   Reply With Quote
Old 13-01-2016, 12:55   #85
Registered User

Join Date: Mar 2010
Location: Den Helder, the Netherlands
Boat: Drascombe Coaster (22ft) "Seanymph"
Posts: 136
Re: Watchdog Plugin

Hi,
I discovered an interesting feature of Watchdog today and updated the Watchdog-document. Have a look at "How can WD alert me".
Roel
Roel Smidt is offline   Reply With Quote
Old 13-01-2016, 15:46   #86
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Watchdog Plugin

Peter,
I have just put up 1.9.020 to try and fix the error. Can you try and see if it works for you.

Thanks
Jon

Quote:
Originally Posted by ptulp View Post
I can confirm that there is a bug in the code.

In the Test() function in the file Alarm.cpp for the SpeedAlarm, the test is between the same values, so this can not work.
Also the sog calculation in function watchdog_pi::OnTimer() in file watchdog_pi.cpp is not correct I think.
If using the watchdog plugin with a VDR run, the sog in the dashboard is not the same as shown in the watchdog window.

Peter
jongough is offline   Reply With Quote
Old 14-01-2016, 00:11   #87
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,286
Re: Watchdog Plugin

Jon, Peter. Watchdog speed alarm
Now the presentation is correct i.e. displays SOG and Limit. And the alarm trig is also correct. But..
Initially Sean tried to filter the used SOG, by m_sog, in order to avoid instant low/high values caused by for example waves. I can't judge the effect of that filter. But "LastFix().Sog" will alarm for every wave if SOG is close to the limit.
We could use m_sog instead like this
Code:
private:
    double Knots() {
        if(isnan(g_watchdog_pi->LastFix().Sog)) return 0.;
        else return g_watchdog_pi->m_sog; // g_watchdog_pi->LastFix().Sog;
but there is something wrong with m_sog. The value is sometimes up to 200 Kn.

I'm thinking of some kind of median value of the last 10 SOG's the last 20 seconds or something.
Like this basic example, but corrected in a more prof way.
Code:
Median 11 values every other sec.
//decl
float sogdata[];
wxTime? sogtimer = now();
int SOGreadCount = 0;

//20 seconds median SOG value
float Knots(float LastValue)
{ 
    if now() > sogtimer + 2000 {
        if SOGreadCount > 10 {
            sogdata[SOGreadCount] = g_watchdog_pi->LastFix().Sog);
            SOGreadCount = 0;
            sogtimer = now();
            //Sort sogdata
            for (int i = 11; i < 0; --i) {
                for (int j = 0; j < i; ++j) {
                    if (sogdata[j] > sogdata[j+1]) {
                        double dTemp = sogdata[j];
                        sogdata[j] = sogdata[j+1];
                        sogdata[j+1] = dTemp;
                    }
                }
            }
            return sogdata[5];
        } else {
            sogdata[SOGreadCount] = g_watchdog_pi->LastFix().Sog);
            SOGreadCount++;
            sogtimer = now();
        }
    }
    return LastValue
}
Hakan is online now   Reply With Quote
Old 14-01-2016, 00:37   #88
Registered User

Join Date: May 2013
Location: NSW, Australia
Boat: Richter 42
Posts: 1,077
Re: Watchdog Plugin

Hi,
When working on the fix for this I could not get a stabilised SoG when using the calculations that Sean put in. It was almost as if the time slot was too coarse and the calculated SoG was going between 10 & 200 kn. I did get it to stabilise more, but I had to move the timer to go every 10seconds not 3 that he had. But still, it varied too much.

The changes I have put in are only to show that it works. If someone else wants to try and fine tune that to give a stabilised SoG I would welcome that. I am only really working on the WD plugin to show capability when used with OD. I think there could be much more put into this, but it does take time..... I am much more focused, currently, on sorting out the bugs in OD and making it play correctly with OCPN.

Jon
jongough is offline   Reply With Quote
Old 14-01-2016, 01:24   #89
Registered User

Join Date: Nov 2012
Location: Orust Sweden
Boat: Najad 34
Posts: 4,286
Re: Watchdog Plugin

Jon
Very good, I do understand.
I could try my idea for you and/or Sean to check.
Håkan
Hakan is online now   Reply With Quote
Old 14-01-2016, 03:31   #90
Registered User

Join Date: Nov 2014
Location: Netherlands
Posts: 219
Re: Watchdog Plugin

Quote:
Originally Posted by jongough View Post
Peter,
I have just put up 1.9.020 to try and fix the error. Can you try and see if it works for you.

Thanks
Jon
Jon,

The fix works, but I found another problem with the saving/loading of the speed alarms. In the LoadConfig function we need the exclamation marks at the strcasecmp and we need a break in the SaveConfig function.

Thanks,
Peter


void LoadConfig(TiXmlElement *e) {
const char *mode = e->Attribute("Mode");
if(!strcasecmp(mode, "Underspeed")) m_Mode = UNDERSPEED;
else if(!strcasecmp(mode, "Overspeed")) m_Mode = OVERSPEED;
else wxLogMessage(_T("Watchdog: ") + wxString(_("invalid Speed mode")) + _T(": ")
+ wxString::FromUTF8(mode));

e->Attribute("Speed", &m_Speed);
}

void SaveConfig(TiXmlElement *c) {
c->SetAttribute("Type", "Speed");
switch(m_Mode) {
case UNDERSPEED: c->SetAttribute("Mode", "Underspeed"); break;
case OVERSPEED: c->SetAttribute("Mode", "Overspeed");
}

c->SetDoubleAttribute("Speed", m_Speed);
}
ptulp is offline   Reply With Quote
Reply

Tags
plug


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin: DashBoard SethDart OpenCPN 650 12-08-2024 10:19
OpenCPN PlugIn Development bdbcat OpenCPN 161 04-09-2019 12:50
UncleMag Intro - Watchdog for World Cruisers ! UncleMag Meets & Greets 4 03-02-2011 00:47
Florida to Bahamas Watchdog countrybimm Atlantic & the Caribbean 54 20-04-2010 15:50

Advertise Here


All times are GMT -7. The time now is 01:33.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.