Page 1 of 3

Web tag parameters

Posted: Wed 15 Dec 2010 11:21 am
by steve
I have just noticed that the web tag parser allows for parameters! This means that specifying the format for the date and/or time tags would be possible, e.g <#YearTempHT format=hh:mm:ss>, and Cumulus could generate the time in whatever format was specified. I was proposing to allow the format of web tag dates and times to be configurable in Cumulus, but this way is more flexible and probably easier to implement.

Does anyone have any other ideas for parameters for existing web tags, other than the date and time ones?

Re: Web tag parameters

Posted: Wed 15 Dec 2010 11:37 am
by beteljuice
For those that want it - could it cope with eg.
<#YearTempHT format=hh:mm ' on ' dd mmm> ?

What (if any) sort of parsing would be available for 'string' output ?

Might become a bit of a headache !

Re: Web tag parameters

Posted: Wed 15 Dec 2010 11:42 am
by steve
beteljuice wrote:For those that want it - could it cope with eg.
<#YearTempHT format=hh:mm ' on ' dd mmm> ?
Yes, but with spaces, it would just have to be enclosed in quotes:

<#YearTempHT format="hh:mm on dd mmm">

I'd just use the standard Delphi date/time format strings, which allow for any non-formatting text to be included.
What (if any) sort of parsing would be available for 'string' output ?
Do you have something specific in mind?

Re: Web tag parameters

Posted: Wed 15 Dec 2010 11:59 am
by captzero
So Steve, would last rain rain tip be something like <#LastRainTipISO format="hh:mm dd mmm yyyy"> ????

I like it.

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:06 pm
by nitrx
I really don't like the words on and at in webtags because these can't be translated.

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:09 pm
by steve
captzero wrote:So Steve, would last rain rain tip be something like <#LastRainTipISO format=hh:mm ' on ' dd mmm yyyy> ????
Yes, but again, the whole parameter value would need to be in double quotes as it contains spaces:

<#LastRainTipISO format="hh:mm on dd mmm yyyy">

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:10 pm
by captzero
nitrx wrote:I really don't like the words on and at in webtags because these can't be translated
I thought the same once I looked at it and edited my post

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:10 pm
by steve
nitrx wrote:I really don't like the words on and at in webtags because these can't be translated.
Well, yes, that's the whole point. You put whatever you want in the parameter.

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:13 pm
by captzero
Sounds good, I'd use it. It allows more flexibility.

I suppose PPL may also use it to display their long and lat in decimal degrees ie <#longitude=27.0004.....>

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:21 pm
by nitrx
steve wrote:
nitrx wrote:I really don't like the words on and at in webtags because these can't be translated.
Well, yes, that's the whole point. You put whatever you want in the parameter.
Oh sorry I misunderstood I thougt the string was fixed :oops:

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:27 pm
by beteljuice
Captzero - don't edit posts that have been answered - It doesn't make sense to the reader !

Steve - presumeably this can only be applied to <#webtags> that contain a single item of data ?
eg. a timestamp
... and could not be applied to something that is already a formatted construct ?

eg. "7.4 C" could NOT become "7.4 Celcius" NOR "7 C" ?

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:38 pm
by captzero
beteljuice wrote:Captzero - don't edit posts that have been answered - It doesn't make sense to the reader !
:D Sometimes you are all just too fast for my very bad typing skills. (that took me 5 mins to type)

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:41 pm
by steve
beteljuice wrote:eg. "7.4 C" could NOT become "7.4 Celcius" NOR "7 C" ?
I don't think there are many that are like that? The all-time record dates have 'on' and 'at' in them, and cloudbase always has ' ft' or ' m' on the end. These could become the defaults, and if a parameter was supplied, that could override the default. For example:

<#cloudbase> would give: 1020 ft
but
<#cloudbase displayunits=n> would give: 1020

You could also override the units for the data. So, if you were using Celsius in Cumulus

<#temp> would give 5.4
but
<#temp units=F> would give 41.7

Hmmm. I'm making a lot of work for myself here :bash:

Re: Web tag parameters

Posted: Wed 15 Dec 2010 12:44 pm
by captzero
captzero wrote:Hmmm. I'm making a lot of work for myself here
Yeah... and what about wind...knots, m/s, kph, mph.

You are a glutton for punishment.

Re: Web tag parameters

Posted: Tue 21 Dec 2010 5:56 pm
by laulau
Hi Steve,
should the new "format" option work in all time records :?:
I just unsuccesfully try this : <#TtempH format="à hh:nn le dd mmmm yyyy"> in recordT file :oops: