It is currently April 28th, 2024, 4:29 pm

Fast changing PNG's with transparencies

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

kanine wrote:For some reason MeasureRadarLocation is getting set to :<RadarLocation>IDR023</RadarLocation>

So the URLs for the background images aren't resolving
[MeasureRadarConfig]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=60
Url=file://#@#Scripts\bomWeather-calculations.txt
RegExp="(?siU)<RadarLocation>(.*)</RadarLocation>"
StringIndex=1

[MeasureRadarLocation]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRadarConfig]
String=1
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

Code: Select all

[MeasureRadarConfig]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=60
Url=file://#@#Scripts\bomWeather-calculations.txt
RegExp="(?siU)<RadarLocation>(.*)</RadarLocation>"
String=1

[MeasureRadarLocation]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureRadarConfig]

See attached screenie. I think I'm just getting too tired...
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

What is String=1? There is no such option. Do you mean StringIndex=1?
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote:What is String=1? There is no such option. Do you mean StringIndex=1?
Yeah... I'm an idiot... I finally got it derr.

Anyway now I'm getting a Matching Error on MeasureAniImages, probably related. The section looks like this now

Code: Select all

[MeasureRadarLocation]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=60
Url=file://#@#Scripts\bomWeather-calculations.txt
RegExp="(?siU)<RadarLocation>(.*)</RadarLocation>"
StringIndex=1

[MeasureAniImages]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/[MeasureRadarLocation].loop.shtml
RegExp="(?siU)theImageNames =.*\[0\] = "(.*)".*\[1\] = "(.*)".*\[2\] = "(.*)".*\[3\] = "(.*)".*\[4\] = "(.*)".*\[5\] = "(.*)""
UpdateRate=1200
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

I don't know... When I connect to http://www.bom.gov.au/products/IDR023.loop.shtml (based on what you said before IDR023 should be the code returned by the earlier WebParser maeasure) and use your RegExp option in RainRegExp I get:
7-3-2012 10-36-26 AM.jpg
That "matching error" message you get means it is not able to parse the information with the RegExp you are using. I'm not sure why you are using all these local text files instead of just parsing everything from the site, but something is wrong somewhere. Somehow that URL= is not being set to http://www.bom.gov.au/products/IDR023.loop.shtml in your skin.
You do not have the required permissions to view the files attached to this post.
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote:That "matching error" message you get means it is not able to parse the information with the RegExp you are using. I'm not sure why you are using all these local text files instead of just parsing everything from the site, but something is wrong somewhere. Somehow that URL= is not being set to http://www.bom.gov.au/products/IDR023.loop.shtml in your skin.
If I hardcode the Radar Location in the example below, it works fine, but I'd prefer to substitute in the Radar Location like on the images.

Here is the section I'm still struggling with now (in Bold)

Url=http://www.bom.gov.au/products/IDR023.loop.shtml

Code: Select all

[MeasureRadarLocation]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=60
Url=file://#@#Scripts\bomWeather-calculations.txt
RegExp="(?siU)<RadarLocation>(.*)</RadarLocation>"
StringIndex=1

[MeasureAniImages]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/IDR023.loop.shtml
RegExp="(?siU)theImageNames =.*\[0\] = "(.*)".*\[1\] = "(.*)".*\[2\] = "(.*)".*\[3\] = "(.*)".*\[4\] = "(.*)".*\[5\] = "(.*)""
UpdateRate=1200

... I hard coded the above reference but later on a substitution works just fine

[MeasureBackImage]
Measure=Plugin
Plugin=WebParser
Url=http://www.bom.gov.au/products/radar_transparencies[MeasureRadarLocation].background.png
StringIndex=1
Download=1

The main reason I parse this way is because the weather format changes throughout the day, and frankly my RegExp or Lua skills just aren't up to the challenge yet. I've only been doing this since Friday.
Last edited by kanine on July 3rd, 2012, 2:49 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

Without the local files you are creating, there is only so much I can do to look for the issue. If you want to .zip up your entire skin folder and post it on http://mediafire.com and put a link here I may be able to spot something.
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote:Without the local files you are creating, there is only so much I can do to look for the issue. If you want to .zip up your entire skin folder and post it on http://mediafire.com and put a link here I may be able to spot something.
This is the only local file referenced from the skin:

FileName = bomWeather-calculations.txt
Location = @Resources\Scripts

Contents

Code: Select all

<StationAt>Melbourne at 00:35</StationAt>
<CurrentTemp>10.0°C</CurrentTemp>
<ObservedMaxTempTime>10.2° @ 00:00</ObservedMaxTempTime>
<CurrentPressure>1026.8</CurrentPressure>
<CurrentRelHumidity>74</CurrentRelHumidity>
<CurrentRainfall>1.2</CurrentRainfall>
<CurrentForecastText>Partly cloudy. Scattered showers. Winds south to southwesterly 10 to 20 km/h.</CurrentForecastText>
<CurrentForecastShortText>the rest of Tuesday </CurrentForecastShortText>
<CurrentForecastImage>45.png</CurrentForecastImage>
<Day1ForecastImage>39.png</Day1ForecastImage>
<Day1ShortCapName>WED</Day1ShortCapName>
<Day1HighLow>13°/8°</Day1HighLow>
<Day1Forecast>Partly cloudy. Scattered showers. Winds south to southwesterly up to 20 km/h.</Day1Forecast>
<Day2ForecastImage>39.png</Day2ForecastImage>
<Day2ShortCapName>THU</Day2ShortCapName>
<Day2HighLow>13°/6°</Day2HighLow>
<Day2Forecast>Partly cloudy. Isolated showers. Light winds.</Day2Forecast>
<Day3ForecastImage>39.png</Day3ForecastImage>
<Day3ShortCapName>FRI</Day3ShortCapName>
<Day3HighLow>14°/5°</Day3HighLow>
<Day3Forecast>Partly cloudy. Isolated showers during the morning. Light winds.</Day3Forecast>
<Day4ForecastImage>32.png</Day4ForecastImage>
<Day4ShortCapName>SAT</Day4ShortCapName>
<Day4HighLow>14°/4°</Day4HighLow>
<Day4Forecast>Sunny. Areas of morning frost inland. Winds north to northeasterly and light.</Day4Forecast>
<Day5ForecastImage>30.png</Day5ForecastImage>
<Day5ShortCapName>SUN</Day5ShortCapName>
<Day5HighLow>15°/4°</Day5HighLow>
<Day5Forecast>Mostly sunny. Areas of morning frost inland. Winds northerly 15 to 25 km/h.</Day5Forecast>
<Day6ForecastImage>39.png</Day6ForecastImage>
<Day6ShortCapName>MON</Day6ShortCapName>
<Day6HighLow>15°/8°</Day6HighLow>
<Day6Forecast>Cloudy. Isolated showers later in the day. Winds northerly 20 to 25 km/h, increasing to 30 to 40 km/h during the morning.</Day6Forecast>
<RadarLocation>IDR023</RadarLocation>
<LastUpdate>4/07/2012 12:44:27 AM</LastUpdate>
I put my latest skin file into the zip , as well as the file.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Fast changing PNG's with transparencies

Post by jsmorley »

The problem (I'm pretty sure) is that using a [MeasureName] as part of the URL= option of a WebParser measure only works if the measure using it is a "child" measure that is going to use a StringIndex number from a "parent" measure, and not when used when the measure is itself a "parent" measure (one that has a RegExp on it and is itself collecting StringIndex numbers). So you are probably going to need to find an alternative way to pass that IDR023 value to that [MeasureAniImages] measure, or hard code it in some way.

Going to be a little tricky to make it dynamic, as WebParser measures do not allow DynamicVariables, so you can just set a variable and put URL=http://blah.com/#SomeVar#.shtml, and you can't use !SetOption to set the URL= value of a WebParser measure for the same reason...
User avatar
kanine
Posts: 62
Joined: June 29th, 2012, 9:09 am

Re: Fast changing PNG's with transparencies

Post by kanine »

jsmorley wrote:... and not when used when the measure is itself a "parent" measure (one that has a RegExp on it and is itself collecting StringIndex numbers). So you are probably going to need to find an alternative way to pass that IDR023 value to that [MeasureAniImages] measure, or hard code it in some way.
Well at least I wasn't going mad last night, just bleary eyed.

I'm pretty sure I should be able to work around it, I'll keep an eye on release notes for any relevant changes in the future. I guess it's like the Dynamic=1 scenario?