Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

id/menu item naming in Chart Compiler

Discussion of the Cumulusutils tool and website generator.

Moderator: HansR

Post Reply
packman2008
Posts: 88
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

id/menu item naming in Chart Compiler

Post by packman2008 »

I'm starting to experiment with the Chart Compiler and it's a very clever bit of code :-)

One difference between a compiled drop down menu and and the default CU menus seems to be that the chart id is used for the menu name. The id doesn't seem to allow spaces in it, or at least the compile fails if I include a space. So where a default drop down menu can have an item "Space Here" with a compiled chart you could only call it "SpaceHere". If I'm wrong about this then can you please suggest what I'm doing wrong?

If it's correct that an id can't have a space in it, then would it be possible to make a change to the code to allow conversion of another character found in an id into a space, e.g. if the underscore character was the character to be converted an id of "Extra_Space" would be added to the menu as "Extra Space"?
Chris

https://blackpool.weather-watch.com/
CMX build 4018 ● CU 7.0.0b1 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
HansR
Posts: 6029
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: id/menu item naming in Chart Compiler

Post by HansR »

Hi Chris,
packman2008 wrote: Tue 09 Jan 2024 4:13 pm I'm starting to experiment with the Chart Compiler and it's a very clever bit of code
Thanks! :D

About the spaced chart id: Barry (@nossis) made the same remark to which I replied:
As you will have noticed: the space is the separator character in the CDL definition. That makes it tricky - not impossible - to use a space in those labels. I understand the n eed for that space in the labels though. I'll put it on the ToDo list (low). NOTE: it may be impossible because of javascript variable limitations but I have to look into that.
I haven't looked into that any further at the moment, so that is where it is: on the ToDo list.

I will take the idea of e.g. an underscore to convert to a space for the menu text with me as a possibility for the texts which are visual to the users. But again: no promise yet ;)
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
packman2008
Posts: 88
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

Re: id/menu item naming in Chart Compiler

Post by packman2008 »

Barry (@nossis) made the same remark to which I replied:
I tried looking for the answer first but didn't find that comment. I'm still very much learning CMX, CU and CC so part of asking is just in case I've missed something. None of my suggestions are essential or urgent...I have plenty to experiment and tinker with at the moment!
Chris

https://blackpool.weather-watch.com/
CMX build 4018 ● CU 7.0.0b1 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
mcrossley
Posts: 12905
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: id/menu item naming in Chart Compiler

Post by mcrossley »

Can you enable "useHTML" in the title and then use a name like "Something Spaced" or "Something Spaced"?

No idea how CUtils would cope with that though!
packman2008
Posts: 88
Joined: Fri 30 Dec 2022 5:33 pm
Weather Station: Davis VP2 + WLL
Operating System: Windows 11
Location: Blackpool, UK
Contact:

Re: id/menu item naming in Chart Compiler

Post by packman2008 »

I just did a quick test.

The good news is that CUtils happily added the string containing   to the .txt file, and the menu entry had a space where it didn't before.

The bad news is that the   seems to have messed up a lot of stuff generated by CUtils below the point where it was included in the .def file, i.e. none of the graphs were generated.
Chris

https://blackpool.weather-watch.com/
CMX build 4018 ● CU 7.0.0b1 ● Davis VP2+WLL & Ecowitt GW1100 ● Core i5 Mini PC ● Windows 11 ● .Net 8.0.3
User avatar
HansR
Posts: 6029
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: id/menu item naming in Chart Compiler

Post by HansR »

mcrossley wrote: Wed 10 Jan 2024 3:29 pm Can you enable "useHTML" in the title and then use a name like "Something Spaced" or "Something Spaced"?

No idea how CUtils would cope with that though!
You mean something like this:

Code: Select all

title: {
    useHTML: true,
    text: "<p>Some text with spaces</p>",
  },
Maybe possible, maybe I solve it another way.
Anyway, first step would be to have the parser of the ChartsCompiler accept the space which - as I said above - is not accepted in my definition language as a character so that for a start requires some thinking.
packman2008 wrote: Wed 10 Jan 2024 4:42 pm The good news is that CUtils happily added the string containing &nbsp; to the .txt file, and the menu entry had a space where it didn't before.

The bad news is that the &nbsp; seems to have messed up a lot of stuff generated by CUtils below the point where it was included in the .def file, i.e. none of the graphs were generated.
The last part was what I more or less predicted. Nice experiment though.

In summary: I don't think users can solve this.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
Post Reply