Page 2 of 3

Re: The new 3.6.0 'WindRose' release

Posted: Tue 19 May 2020 2:48 pm
by sutne
What's odd about Norwegian systems file naming then?
I do not think there is a Norwegian system. It is a Raspberry PI running Buster with locale set to en-GB because CumuluxMX could not run on Raspbian with norwegian locale in the beginning.

Latest version of CumulusUtils runs on the system without problems. And the webUI presents data with norwegian text and according to norwegian locale.
:clap:

Re: The new 3.6.0 'WindRose' release

Posted: Tue 19 May 2020 2:50 pm
by HansR
mcrossley wrote: Tue 19 May 2020 2:36 pm
HansR wrote: Tue 19 May 2020 11:59 am Thought of that, but I ask for

Code: Select all

 MonthfileList = Directory.GetFiles("data/", "*log.txt");
Getfiles does not support regular expressions, any suggestion for an alternative? From what I can find that is not all that simple and besides there is the performance penalty for using regex although that is not too big in this relatively small array/list.
Ah, yes, you'd have to use a ".Where(path => regex)" as well. Can't see it being much of a overhead though, especially weighed against creating a new list, removing items, converting to array, then saving again.
Well with a small list like this one I could see some optimisations in a method extension using an array copy method. But anyway, too detailed for this place and apart from that I am not a great fan of regex if I can avoid it . I think that counts too ;)
mcrossley wrote: Tue 19 May 2020 2:36 pm What's odd about Norwegian systems file naming then?
In the end there wasn't and it was just a plain algorithmic error on my side which I did not see.
But i gave it a thought at some point :?

Anyway, all is well that ends well.
It was a nice exercise... :groan:

Re: The new 3.6.0 'WindRose' release

Posted: Tue 19 May 2020 2:54 pm
by freddie
HansR wrote: Tue 19 May 2020 2:17 pm Removing an entry moves up the list effectively skipping an entry if you don't adjust the index.

So, slight modification:

Code: Select all

foos.RemoveAt(i--);
If you do that then you will remove the wrong element, yes? You've just found the element you are looking for at index i so you need to remove that one. The list doesn't change until you have actually done the remove. If you find a subsequent match after you have done a removal then you will run into problems.

I'm Java not C#, but can't you you just iterate over all elements without using the index and flag the ones you don't need. Then do the deletes once you've finished the loop where you are identifiying what to delete?

Re: The new 3.6.0 'WindRose' release

Posted: Tue 19 May 2020 4:24 pm
by HansR
freddie wrote: Tue 19 May 2020 2:54 pm If you do that then you will remove the wrong element, yes?
Not if you use the postfix decrement as I do.
freddie wrote: Tue 19 May 2020 2:54 pm [...]but can't you you just[...]
Well, no doubt there are many ways leading to Rome but I started with an array (output of Getfiles) and you can't just loop over an array and delete entries. C# is great, but this was slightly awkward. Walk through can be done , I'll look at an optimisation sometime. For now I just want it to work :lol:

Re: The new 3.6.0 'WindRose' release

Posted: Tue 19 May 2020 4:52 pm
by freddie
HansR wrote: Tue 19 May 2020 4:24 pm
freddie wrote: Tue 19 May 2020 2:54 pm If you do that then you will remove the wrong element, yes?
Not if you use the postfix decrement as I do.
Ah yes, apologies - I misread your code.
HansR wrote: Tue 19 May 2020 4:24 pm
freddie wrote: Tue 19 May 2020 2:54 pm [...]but can't you you just[...]
Well, no doubt there are many ways leading to Rome but I started with an array (output of Getfiles) and you can't just loop over an array and delete entries. C# is great, but this was slightly awkward. Walk through can be done , I'll look at an optimisation sometime. For now I just want it to work :lol:
The first optimisation I would make would be to not change an array that I was midway through iterating over. It is inherently unsafe to do this. But each to his own....

Re: The new 3.6.0 'WindRose' release

Posted: Tue 19 May 2020 7:41 pm
by sutne
Version 3.6.5 looks very good.
The WindRose works well on my station now.

I also like the Thrifty function, to have only the minimum uploaded each night. :clap:

I will see tomorrow if sufficient files were uploaded.

Re: The new 3.6.0 'WindRose' release

Posted: Wed 20 May 2020 12:00 pm
by HansR
sutne wrote: Tue 19 May 2020 7:41 pm Version 3.6.5 looks very good.
The WindRose works well on my station now.
Looks good from here as well.
sutne wrote: Tue 19 May 2020 7:41 pm I also like the Thrifty function, to have only the minimum uploaded each night. :clap:
Thanks, hope it serves well :)
sutne wrote: Tue 19 May 2020 7:41 pm I will see tomorrow if sufficient files were uploaded.
And did it function correctly?

I see that you generate some modules independently (I see because the footers are generated on e.g. records). That should not be required, if you do 'thrifty website' the updating of the files should be automatically according to the manual advice e.g. Yadr will only send its 2020 files.

Re: The new 3.6.0 'WindRose' release

Posted: Wed 20 May 2020 2:36 pm
by sutne
And did it function correctly?
Yes, only few and necessary files were uploaded after midnight.
I see that you generate some modules independently (I see because the footers are generated on e.g. records). That should not be required, if you do 'thrifty website' the updating of the files should be automatically according to the manual advice e.g. Yadr will only send its 2020 files.
No, I only run ‘Thrifty All’ after midnight.
But last night after installation of latest version, I generated Website and after that tried Thrifty All before editing the run of External programs in CumulusMX.

Re: The new 3.6.0 'WindRose' release

Posted: Wed 20 May 2020 7:12 pm
by essair
Hello Hans
Windrose works for me: https://meteo-st-bonnet-le-troncy.fr/cu ... ndrose.php
Nice job. :clap:

Stephane (essair)

Edit: Little bug to the cardinal point (NNO -> NNE).
Thx

Re: The new 3.6.0 'WindRose' release

Posted: Thu 21 May 2020 10:23 am
by HansR
@sutne:
Thanks for the feedback.
sutne wrote: Wed 20 May 2020 2:36 pm Yes, only few and necessary files were uploaded after midnight.
Great! As there are no requests for other weather related functionalities and I have some ideas about the Thrifty qualifier, I may work on an even more efficient bandwidth saving system. Up to the point it won't send anything at all if not needed. I think that is possible. I'm getting the hang of it. 8-)
sutne wrote: Wed 20 May 2020 2:36 pm No, I only run ‘Thrifty All’ after midnight.
But last night after installation of latest version, I generated Website and after that tried Thrifty All before editing the run of External programs in CumulusMX.
Well, OK, users choice of course, but I think in your case thrifty website is better, effectively the same plus it will send the index.html (the base for the website).

@essair:
Thanks! And great...good see it is also used in the modular method! :D
essair wrote: Wed 20 May 2020 7:12 pm Edit: Little bug to the cardinal point (NNO -> NNE).
I do not quite understand what the bug here is :?


@All: We found there still appear to be issues with the monthly logfiles in time series longer than 10 years with the datafiles in the original status. I am studying this, will report back if any result. Monthly logfiles from version 1.9.4 (Cumulus 1) and later should have no problem. If any error message found in the log, please notify me. NOTE: in most cases, the WindRose will be produced anyway without a noticable message. So please, check your logfiles at least once!!

Re: The new 3.6.0 'WindRose' release

Posted: Thu 21 May 2020 12:00 pm
by essair
I do not quite understand what the bug here is
Tiny tiny bug , easy to modify in: CUstringsEN.ini, CompassSectors.

Image

Re: The new 3.6.0 'WindRose' release

Posted: Thu 21 May 2020 1:25 pm
by HansR
essair wrote: Thu 21 May 2020 12:00 pm
I do not quite understand what the bug here is
Tiny tiny bug , easy to modify in: CUstringsEN.ini, CompassSectors.
Ah, thanks.
No, no change in the CUstringsEN.ini (although that works very good :) ) but in the default I set in the code.
Done!

Re: The new 3.6.0 'WindRose' release

Posted: Wed 10 Jun 2020 3:02 am
by BeaumarisWX
Hi Hans,
Just wondering if it is easy to reverse the Windrose (legend/display).
Reason, I've always displayed them with highest wind on the outer, as there are fewer of them and you can visualise them better, rather than current crammed up in centre of rose.
Like this : https://www.highcharts.com/demo/polar-wind-rose
Kind Regards,

Re: The new 3.6.0 'WindRose' release

Posted: Wed 10 Jun 2020 5:38 am
by HansR
Hi Tony,
I don't think it's a problem. I put it in the list here.
Hans

Re: The new 3.6.0 'WindRose' release

Posted: Wed 10 Jun 2020 8:21 am
by BeaumarisWX
Hi Hans,
Thanks for looking into the Windrose adjustment.
Also, is it possible to add an additional (timer) window.onload function to the cumuluscharts so that it refreshes every (say 5 mins or whatever is set in upload time) so that the index page not only updates the ajax stuff, but also the charts (when left on Home page) rather than have to click the Home Button to refresh chart/s.
Just get's me know and then when page is left onscreen and all realtime data is current but chart is old, have to reload the page to update the chart/s.
Not a biggy, just a nice to have. https://beaumaris-weather.com/data/index.html
Kindest Regards,