Version 4.5 and 4.6 feedback

122 views
Skip to first unread message

bell...@gmail.com

unread,
Aug 23, 2021, 7:25:26 PM8/23/21
to weewx-development
I've been experimenting with using ApexCharts to create charts and Bootstrap to manage the responsive layout. I am using the series support that is introduced in 4.5 and the internationalization support in 4.6. One pretty cool thing, the html that is generated needs no AJAX calls, so it can be loaded directly from the filesystem into a browser.

It's modeled after the Seasons skin and inspired by the neowx-material skin. I've been focused on making it 'highly configurable' and less on the aesthetics. It can be seen here, http://bellrichm.great-site.net. That's a free hosting site, so I have no idea what the reliabilty/availability will be.

Like everthing WeeWX, the series and internationalizatio support is, intuitive, easy to use, and 'just works'. Again my thanks to everyone that has contributed.
rich

Tom Keffer

unread,
Aug 23, 2021, 8:02:01 PM8/23/21
to bell...@gmail.com, weewx-development
It is this sort of experimentation that I was hoping to encourage by writing these extensions! Glad they are working for you.

Make sure you are using the 4.6 beta, and not the alpha versions. The structure of the locale files has changed.

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/21fa8969-d56c-4e5c-beb4-630e232cef87n%40googlegroups.com.

bell...@gmail.com

unread,
Aug 24, 2021, 5:01:35 PM8/24/21
to weewx-development

I've upgraded my development environment from 4.6 a4 to 4.6 b1 and had to make no changes to get it to work. Comparing the releases I see the elimination of 'page' sections in the 'lang' files and other restructuring. I see no code changes that would require any update to my skin.
Net all good from my perspective.
rich

Vince Skahan

unread,
Aug 24, 2021, 6:29:11 PM8/24/21
to weewx-development
Rich can you explain a bit about what exactly you did to leverage the new features ?   Any github repo or the like we can surf to see what's under the hood ?

bell...@gmail.com

unread,
Aug 24, 2021, 7:50:46 PM8/24/21
to weewx-development
So for translation, I am leveraging features in 4.6, so I can’t easily link to that.
I am creating json using the series support introduced in 4.5.  See,   https://github.com/weewx/weewx/wiki/Tags-for-series
That repo has a working skin - very beta… But it should install. I’ll have a beta release soon. 
Basically I use the series support to create json that I ‘put’ into a javascript variable (via cheetah). I then use the json variable to feed ApexCharts. 
I put it into a javascript variable because I think I will be able to reuse the data for multiple charts.  So, less generation time….
Having cheetah capabilities, a huge design goal is to not need AJAX calls. If you go down that path you might as well create a web app to query the db… :)
As I look at what I have done, it is highly configurable. But I think that will limit how ‘pretty’ it can be made. So it might end up being a skin for people to learn with. 
I think that is the mini intro.  I’m more than happy to answer additional questions. 
rich

Tom Keffer

unread,
Aug 24, 2021, 8:16:38 PM8/24/21
to bell...@gmail.com, weewx-development
That's right: the locale files are all flat now. However, the code is still there to make use of subsections, and occasionally they can be useful. An example is "altitude". While in English the same word is used to mean "height above sea level" and "angle to the horizon," apparently that's not so in all languages. So, we use subsections to differentiate. But, subsections for different pages should be avoided, as it makes maintenance much more difficult. Levels of indirection should also be avoided. For example, don't just use "Title" as the key. Use the full English description. This way, if a translator forgets a translation, at least a readable English phrase will be substituted.

-tk

bell...@gmail.com

unread,
Aug 25, 2021, 3:10:03 PM8/25/21
to weewx-development
Tom, thanks for the confirmation. I had come to essentially the same conclusion. 
Currently I have pages for 'time periods' such as day, week, month, year, etc. Because most of the page is common 'boilerplate', I am using include files to 'generate' the pages. So I am using things like $gettext[$page + '_title']. 
As I have been developing, I also have found it helpful to use a descriptive variable name such as an entry of, 'forecast_title = Forecast'. This way when I run report and I see forecast_title in the display I know I need to add an entry to the 'language' file. I try to make the variable provide the context of where the text is.. Hopefully if someone wants to translate the skin, this won't make it too difficult.
But I think the complexity and indirection I have added to make it highly configurable might doom this experiment. 
But its been a blast diving in and learning how to create WeeWX reports! 
rich
Reply all
Reply to author
Forward
0 new messages