Page 1 of 1

Recent History

Posted: Tue 10 Nov 2015 1:15 am
by BCJKiwi
FYI
There appears to be a change in behaviour from C1 to MX for recent history times.

On re-reading the C1 Wiki on the webtags Recent History topic, some parameters were being used in a manner that was probably not intended but did work in C1 but do not work in MX

There is one tag file which included;

Code: Select all

$w31 = "<#RecentWindAvgDir m=350>";   // wind 10 min average direction from 350mins ago  #RecentWindAvgDir m=350
$w32 = "<#RecentWindAvgDir m=360>";   // wind 10 min average direction from 360mins ago  #RecentWindAvgDir m=360
$w33 = "<#RecentWindAvgDir m=370>";   // wind 10 min average direction from 370mins ago  #RecentWindAvgDir m=370
These tags all return "0" in MX.
They have been updated to;

Code: Select all

$w31 = "<#RecentWindAvgDir h=2 m=50>";   // wind 10 min average direction from 350mins ago  #RecentWindAvgDir m=350
$w32 = "<#RecentWindAvgDir h=3>";   // wind 10 min average direction from 360mins ago  #RecentWindAvgDir m=360
$w33 = "<#RecentWindAvgDir h=3 m=10>";   // wind 10 min average direction from 370mins ago  #RecentWindAvgDir m=370
which return the intended results.

This post is intended as information - certainly not suggesting anything in MX should be changed, rather that this is a salutary lesson in using the features as intended - saves heartache later ;) .

Re: Recent History

Posted: Tue 10 Nov 2015 7:35 am
by steve
There is no similarity between the code in Cumulus 1 and MX, they are written in different languages and use different runtimes. They achieve things in different ways. So while the intention is to make MX as compatible as possible with Cumulus 1, there will inevitably be slight differences.

Having said that, it was not my intention to make <#RecentWindAvgDir m=350>, for example, invalid and I even expected that it might be used in this way. The first thing the code does is to convert the supplied parameter to a number of minutes, and then subtract that from the current time. So it's not clear why it apparently doesn't work. I'll do some experimenting to see if I can see what's going on.

I don't understand your replacements, though. 350 minutes is 5h 50m, not 2h 50m. Perhaps the recorded values for your original times were actually zero?

Re: Recent History

Posted: Tue 10 Nov 2015 11:06 am
by BCJKiwi
I just assumed that the way the calculation was done meant the minutes component would not handle minutes greater than 60 so hours and minutes would work where just minutes > 60 would not.

As I said, I did not expect you to change anything as there is no requirement to specify it that way, however that is obviously for you to decide.

Have made the necessary changes to the tag file and don't intend to change it back.

Thanks