It is currently October 1st, 2020, 4:03 am

How to have a button that interacts with multi skins

Help with creating, editing & fixing problems with skins
User avatar
krakoukas
Posts: 73
Joined: December 11th, 2018, 5:56 pm
Location: France

How to have a button that interacts with multi skins

Post by krakoukas »

Hi Friends,

I've made a whole stuff 1920x1080 with 22 skins full of visual effects. See below if interested.
http://krakoukas.com/informatique/logiciel/rainmeter/vis-ma-vie-ordinateur-a-hublot/
UpdateDivider are 1 second, 5 seconds and 120 seconds, according to the skin accuracy

This whole stuff is taking 15 to 20% CPU (only for Rainmeter) with my poor i5.

I would like to add a special button.
When pressed, this button would send a "relax" message to all skins and Updatedivider would be downgraded to 30-30-120 from 1-5-120
I hope CPU usage for Rainmeter could slow down 5% this way insdtead of 15-20%

Do you see any easy and clean way to do that ?

Thanks a lot for help

David
User avatar
balala
Rainmeter Sage
Posts: 11458
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to have a button that interacts with multi skins

Post by balala »

krakoukas wrote: October 8th, 2019, 6:57 pm Do you see any easy and clean way to do that ?
You mean you have more meters / measures with UpdateDivider set some to 1, some to 5 and the others to 120? If so, you have to create three variables, let's name them as Divider1, Divider2 and Divider3. Declare them into a file which will be included into all skins, through a @IncludeDividers=#@#Dividers.inc option (supposing the Dividers.inc file is placed into the @Resources folder), added to the [Variables] section of all skins:

Code: Select all

[Variables]
Divider1=1
Divider2=5
Divider3=120
Modify the UpdateDivider options everywhere to have them set with these variables. This means that you have to replace all UpdateDivider=1 options with UpdateDivider=#Divider1#, all UpdateDivider=5 options with UpdateDivider=#Divider2# and finally all UpdateDivider=120 options with UpdateDivider=#Divider3#. Also add a DynamicVariables=1 option to all meters and measures using these options (if they are not already added).
Include all skins into a group, adding a Group=MyGroup option to the [Rainmeter] section of all skins.
Now you can create the button which sets the new update dividers, with the following bang: [!SetVariableGroup Divider1 "30" "MyGroup"][!SetVariableGroup Divider2 "30" "MyGroup"][!SetVariableGroup Divider3 "120" "MyGroup"].
User avatar
krakoukas
Posts: 73
Joined: December 11th, 2018, 5:56 pm
Location: France

Re: How to have a button that interacts with multi skins

Post by krakoukas »

Thank you Balala !

Almost :

Image

Green button : 1-5-120 sec Updatedividers
Orange button : 30-30-120 sec Updatedividers
Green button : 120-120-120 sec Updatedividers

Note that Mygroup works. But graphical parts, temperatures and usages continue to refresh every second. I do not understand
mak_kawa
Posts: 878
Joined: December 30th, 2015, 9:47 am

Re: How to have a button that interacts with multi skins

Post by mak_kawa »

I saw the value/graph fluctuations in the animation you posted even though when you set UpdateDivider=120 (= 2 min.). It should be not-updated ("freezed") for 2 min.

So just a possibility I guess, you have changed variables for UpdateDivider using "MyGroup method" suggested by balala, but not added UpdateDivider=#Divider1# (and so on) and DynamicVariables=1 (if not exist) to the "every" concerned meters and measures in all skins?

Sorry if my speculation was wrong. I often made misreading/misunderstanding in this forum...
User avatar
balala
Rainmeter Sage
Posts: 11458
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to have a button that interacts with multi skins

Post by balala »

krakoukas wrote: October 8th, 2019, 11:38 pm But graphical parts, temperatures and usages continue to refresh every second.
I agree with mak_kawa.
You probably forgot to add either an UpdateDivider=#DividerX#, either a DynamicVariables=1 option to the incriminated sections. Not knowing the codes, it is impossible to tell which sections have you forgot to modify / add the options, especially that I suppose there are extremely many sections, in, I suppose, more skins, but you have to check your codes.
User avatar
krakoukas
Posts: 73
Joined: December 11th, 2018, 5:56 pm
Location: France

Re: How to have a button that interacts with multi skins

Post by krakoukas »

That works well finally. Thanks a lot

Graphics and data are refreshing every 1sec or every 20sec
User avatar
balala
Rainmeter Sage
Posts: 11458
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to have a button that interacts with multi skins

Post by balala »

krakoukas wrote: October 9th, 2019, 12:18 pm Graphics and data are refreshing every 1sec or every 20sec
Not refreshing, updating. It's not the same thing.
Did you find the issue?
User avatar
krakoukas
Posts: 73
Joined: December 11th, 2018, 5:56 pm
Location: France

Re: How to have a button that interacts with multi skins

Post by krakoukas »

Yes I was re-using #Divider1#, #Divider2# and #Divider3# with others variables in all skins such as :

Code: Select all

MyUpdate1 = #Divider1#
MyUpdate2 = #Divider3#
And #MyUpdate# variables didn't change dynamically. Now that works great but that was not a good idea : CPU usage is not more or less than before, with flat 30sec refresh graphics parts.

I wonder what make my Rainmeter system more than 20% CPU with a i5-7400. Maybe CPU itself. I tried to isolate each skin. It seems to be a global problem. I have seen it on a i9. It's 1.5% CPU

Thanks for your help

Image
User avatar
balala
Rainmeter Sage
Posts: 11458
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to have a button that interacts with multi skins

Post by balala »

krakoukas wrote: October 9th, 2019, 1:43 pm And #MyUpdate# variables didn't change dynamically.
If the MyUpdateX variables are declared into the [Variables] section, this is normal, because this section (as well as [Metadata] or [Rainmeter]) is not dynamic. The MyUpdateX variables don't follow the dynamic change of the DividerX variables. This isn't possible. You have to change them directly with !SetVariable bangs, adding beside the bangs changing the DividerX variables, ones to change the MyUpdateX variables as well. But doesn't worth, in my opinion.
User avatar
jsmorley
Developer
Posts: 21398
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to have a button that interacts with multi skins

Post by jsmorley »

krakoukas wrote: October 9th, 2019, 1:43 pm I wonder what make my Rainmeter system more than 20% CPU with a i5-7400. Maybe CPU itself. I tried to isolate each skin. It seems to be a global problem. I have seen it on a i9. It's 1.5% CPU
I wouldn't expect the difference between an Intel i5 and i9 to make that great a difference, but I could be wrong. I'd be more suspicious that your i9 machine also has a powerful GPU, which is sharing the load with the CPU. (assuming you have "Use hardware acceleration" / HWA turned on in the Rainmeter Settings.) Perhaps the i5 computer has a much less powerful GPU, or perhaps you don't have HWA turned on there.