It is currently March 28th, 2024, 7:05 pm

⭐ Converting Existing Weather Skins Tip

Tips and Tricks from the Rainmeter Community
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

⭐ Converting Existing Weather Skins Tip

Post by eclectic-tech »

I have been converting weather skins to use the include files developed by XXenium and JSMorley.

In the process, I wanted to share a tip to simplify getting any existing weather skins working again.

The process of adding files and @include statements is readily available in other posts, so this is a tip on repairing original skins using those techniques. You can read JSMorley's help on those include files here.

Once you have the files in '@Resources' and added the @include statements, now you need to get that information into the old skin.

That is the daunting part, but can be made much easier with the process described here.

TIP
1.) The skin already has a main weather webparser measure that must be removed or commented out.

Note: The child weather measures are being used by the skin, DO NOT REMOVE THE CHILD MEASURES! The child measures can be modified to return correct values; which is all that is usually needed to get the skin working again.

2.) Change all the webparser child measures to STRING measures, and set the 'String=value' to the corresponding Section Variable from the included weather measures file. Because we are using Section Variables, you will need to add 'DynamicVariables=1' to the measures. Replace only the lines that relate to the parent Webparser measure; other lines such as 'Substitute=', 'IfMatch=...', etc. should not be changed. Determining what value the old child measures should return is usually pretty straight forward if the original author named them in a logical way.

Here's and example original Child measure

Code: Select all

[MeasureTemp]
Measure=Plugin
Plugin=Webparser.dll
Parent=[MainWeather]
StringIndex=7
Substitute="":"na"
And when edited becomes

Code: Select all

[MeasureTemp]
Measure=String
String=[MeasureTemperature]
DynamicVariables=1
Substitute="":"na"
Once you have the child measures converted to String measures, you can save the skin and refresh and test to see the results.

Because you used the old child measures, very little else should be needed to have a working weather skin.

Feel free to comment or show me another method. 8-)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Converting Existing Weather Skins Tip

Post by jsmorley »

Just be sure you don't create duplicate measure names. The names in my @Include files are meant to be descriptive and logical, but I may not have been the first person to think of a particular name. You can't have two [MeasureTemperature] measures in a skin. Well, you can, but only the first one will be recognized.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Converting Existing Weather Skins Tip

Post by eclectic-tech »

jsmorley wrote: January 20th, 2020, 11:04 pm Just be sure you don't duplicate measure names. You can't have two [MeasureTemp] measures in a skin. Well, you can, but only the first one will be recognized.
If you use this method, you don't add any new measures, you convert the original child webparser measures to string measures.
So unless there were duplicates to begin with, that is not a problem. :)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Converting Existing Weather Skins Tip

Post by jsmorley »

eclectic-tech wrote: January 20th, 2020, 11:09 pm If you use this method, you don't add any new measures, you convert the original child webparser measures to string measures.
So unless there were duplicates to begin with, that is not a problem. :)
My point is, if there is a measure in the old skin called [MeasureCurrentTemp], this will cause problems, as there is also a measure called [MeasureCurrentTemp] in the @Include files. All the measures in the @Include files are added to the skin, so in point of fact, you DO add LOTS of new measures.

For the most part, this is easy enough if you just pay attention. You don't want to end up with

Code: Select all

[MeasureCurrentTemp]
Measure=String
String=[MeasureCurrentTemp]
DynamicVariables=1
That would be... bad...

MeasureWind, MeasureSunrise, these are examples of names that are very likely to already exist.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Converting Existing Weather Skins Tip

Post by jsmorley »

If I had thought this through as well as you have, I would have used a unique naming convention in the @Include files.

[@CurrentTemperature]
[@Sunrise]

I may change those yet... Yeah, I'm warming up to that idea by the second.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Converting Existing Weather Skins Tip

Post by eclectic-tech »

Yeah, that is an issue that may come up, completely overlooked that.

Yes, we are adding all the new weather measure sections...
Hopefully the included weather measures names are unique enough that duplicate section names are limited.

I may edit all the includes measure sections by preceding them all with 'TWC_' or some other unique identifier.

Thanks for catching my oversight. Again! ;-)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Converting Existing Weather Skins Tip

Post by jsmorley »

eclectic-tech wrote: January 20th, 2020, 11:30 pm Yeah, that is an issue that may come up, completely overlooked that.

Yes, we are adding all the new weather measure sections...
Hopefully the included weather measures names are unique enough that duplicate section names are limited.

I may edit all the includes measure sections by preceding them all with 'TWC_' or some other unique identifier.

Thanks for catching my oversight. Again! ;-)
I'm going with:

[@CurrentTemperature]
[@Sunrise]

Just remove the "Measure" and replace it with "@". I like that it is a hint that it is in the @Include file(s).
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Converting Existing Weather Skins Tip

Post by eclectic-tech »

Warming up my "FindAndReplace" as we speak! :lol:

I will go with replacing 'Measure' with '@' also.

I changed several section names from your version:
  • one misspelling of 'visiblity'
  • added the relative parent to most as in [MeasureTemperature] became [MeasureCurrentTemperature] and full words (Temperature instead of Temp)
    That made it easier (for me) to remember the section names based on which parent I was using while editing older skins.
  • added a 'FinishAction=' to all of the super parents measures, so actions could be easily added once the data is available.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Converting Existing Weather Skins Tip

Post by jsmorley »

eclectic-tech wrote: January 20th, 2020, 11:47 pm Warming up my "FindAndReplace" as we speak! :lol:

I will go with replacing 'Measure' with '@' also.

I changed several section names from your version:
  • one misspelling of 'visiblity'
  • added the relative parent to most as in [MeasureTemperature] became [MeasureCurrentTemperature] and full words (Temperature instead of Temp)
    That made it easier (for me) to remember the section names based on which parent I was using while editing older skins.
  • added a 'FinishAction=' to all of the super parents measures, so actions could be easily added once the data is available.
I decided against ever changing the @Include files on a per-skin basis, as that just seems cleaner to me. I did the following to simulate a FinishAction in the skin:

Code: Select all

[MeasureGotTheData]
Measure=String
String=[@CurrentLocationName]
DynamicVariables=1
IfMatch=^$
IfNotMatchAction=[!HideMeter MeterReticulatingSplines][!ShowMeterGroup AllMeters][!Update]
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Converting Existing Weather Skins Tip

Post by eclectic-tech »

That is a better practice, as usual from you :great:

FinishActions removed here too :p