It is currently April 19th, 2024, 4:51 pm

UpdateDivider lower than Update rate possible ?

General topics related to Rainmeter.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

UpdateDivider lower than Update rate possible ?

Post by kyriakos876 »

So I had a problem and the easiest way to solve it is by updating a measure twice or more in every cycle.
For example

Code: Select all

[Rainmeter]
Update=1000

[SomeMeasure]
Measure=...
UpdateDivider=(1/2)
Or
UpdateDivider=(2^(-1))
But none of these work and it just acts like it's UpdateDivider=1 I read in the docs that the program calculates the update rate of a measure by doin (Update*UpdateDivider) so I assume only valid numbers are -1,1,2,3...n right? If that is the case, is there any way to make a measure update faster than the other skin?
Thanks.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UpdateDivider lower than Update rate possible ?

Post by jsmorley »

No. The Update option in [Rainmeter] is the driver. It must be a positive whole number or -1, which has a special meaning of "only once".

The way it works is that you set Update to the "fastest" thing you need regularly updated in the skin, and then set UpdateDivider on each measure / meter that doesn't need to be that fast, or use DefaultUpdateDivider and then set UpdateDivider=1 on just the "fast" ones. In any case, nothing can ever have a normal update cycle faster than the value of Update in [Rainmeter].
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: UpdateDivider lower than Update rate possible ?

Post by kyriakos876 »

jsmorley wrote:No. The Update option in [Rainmeter] is the driver. It must be a positive whole number or -1, which has a special meaning of "only once".

The way it works is that you set Update to the "fastest" thing you need regularly updated in the skin, and then set UpdateDivider on each measure / meter that doesn't need to be that fast, or use DefaultUpdateDivider and then set UpdateDivider=1 on just the "fast" ones. In any case, nothing can ever have a normal update cycle faster than the value of Update in [Rainmeter].
Ok so will set a lower update in rainmeter and add UpdateDivider to every other measure exept the one I want to update faster.
One more thing. How does Rainmeter as a program executes bangs? Say I have

Code: Select all

[SomeMeter]
Meter=Button
....
LeftMouseUpAction=[!Bang1][!Refresh][!Bang2]
Does it read the whole line and then executes all of them or it executes them when it reads? Would anything after the [!Refresh] happen or would it refresh as it reads the command making any other bag after completely useless?
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: UpdateDivider lower than Update rate possible ?

Post by balala »

kyriakos876 wrote:But none of these work and it just acts like it's UpdateDivider=1 I read in the docs that the program calculates the update rate of a measure by doin (Update*UpdateDivider) so I assume only valid numbers are -1,1,2,3...n right? If that is the case, is there any way to make a measure update faster than the other skin?
Thanks.
The value of the UpdateDivider must be integer, but there could be another approach. Reduce the value of Update (into the [Rainmeter] section) to half of the initial value (to have the duble update frequency, eg using Update=500, instead of the default Update=1000). Then add to the same [Rainmeter] section, an appropriate DefaultUpdateDivider value (in the above example, add DefaultUpdateDivider=2). This way, the meters and measures will be updated on each Update*DefaultUpdateDivider period, so once per second.
Now add an UpdateDivider=1 option to the "incriminated" section. This option will override the default update set with the DefaultUpdateDivider option, having almost the same result as if you'd use subunitary UpdateDivider value on the section.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UpdateDivider lower than Update rate possible ?

Post by jsmorley »

kyriakos876 wrote:Ok so will set a lower update in rainmeter and add UpdateDivider to every other measure exept the one I want to update faster.
One more thing. How does Rainmeter as a program executes bangs? Say I have

Code: Select all

[SomeMeter]
Meter=Button
....
LeftMouseUpAction=[!Bang1][!Refresh][!Bang2]
Does it read the whole line and then executes all of them or it executes them when it reads? Would anything after the [!Refresh] happen or would it refresh as it reads the command making any other bag after completely useless?
Both bangs would be executed. The entire line is "parsed" and everything is executed in it.

LeftMouseUpAction=[!Log "1"][!DeactivateConfig][!Log "2"]

Even with that, both !Log bangs would happen, even though the skin is unloaded between them.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: UpdateDivider lower than Update rate possible ?

Post by kyriakos876 »

balala wrote:The value of the UpdateDivider must be integer, but there could be another approach. Reduce the value of Update (into the [Rainmeter] section) to half of the initial value (to have the duble update frequency, eg using Update=500, instead of the default Update=1000). Then add to the same [Rainmeter] section, an appropriate DefaultUpdateDivider value (in the above example, add DefaultUpdateDivider=2). This way, the meters and measures will be updated on each Update*DefaultUpdateDivider period, so once per second.
Now add an UpdateDivider=1 option to the "incriminated" section. This option will override the default update set with the DefaultUpdateDivider option, having almost the same result as if you'd use subunitary UpdateDivider value on the section.
Oh I was going to add everywhere UpdateDivider=2 except the one I wanted but your solution sounds better and less lame!
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: UpdateDivider lower than Update rate possible ?

Post by kyriakos876 »

jsmorley wrote:Both bangs would be executed.
Great. Thanks again! Really appreciate how fast you answer.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UpdateDivider lower than Update rate possible ?

Post by jsmorley »

kyriakos876 wrote:Oh I was going to add everywhere UpdateDivider=2 except the one I wanted but your solution sounds better and less lame!
Right, I did point that out in my first answer. It's a question of which is less work for you.
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: UpdateDivider lower than Update rate possible ?

Post by kyriakos876 »

jsmorley wrote:Right, I did point that out in my first answer. It's a question of which is less work for you.
Uh... I misunderstood your first reply and thought you said something else. Now I see it's the same :P
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: UpdateDivider lower than Update rate possible ?

Post by kyriakos876 »

jsmorley wrote:Both bangs would be executed. The entire line is "parsed" and everything is executed in it.

LeftMouseUpAction=[!Log "1"][!DeactivateConfig][!Log "2"]

Even with that, both !Log bangs would happen, even though the skin is unloaded between them.
So, I have

Code: Select all

LeftMouseUpAction=[!ShowMeter SomeMeter][!Refresh][!ShowMeter SomeOtherMeter]
Evetytome a refresh happens it restores every Set bang in the skin but here what's gonn happen if both meters have Hidden=1? Show both meters refresh and then hide them again or show one meter refresh and show the other after the refresh?