It is currently March 28th, 2024, 2:07 pm

Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by CodeCode »

Hello, I have a Parent Measure:

Code: Select all

[MeasureBinSize]
Measure=RecycleManager
RecycleType=Size
DynamicVariables=1
And a !SetOption bang setting the Value of a Text Value:

Code: Select all

MouseOverAction=[!SetOption "MeterUnderText" "Text" "Volume: [MeasureBinSize:/100000,2] MB"][!Update]
MouseLeaveAction=[!SetOption "MeterUnderText" "Text" ""][!Update]
The Problem is actually three different end Values for the text string.
Using the above two i get "Volume: 0.15 MB". I have to put the "MB" in there since AutoScale isn't supplying the suffix as it seems to say in the manual as 'should happen automatically'.

Then I try this way;

Code: Select all

[MeterUnderText]
Meter=String
MeasureName=MeasureBinSize
AutoScale=2k
...
Text=" "
Used with this line format:

Code: Select all

MouseOverAction=[!SetOption "MeterUnderText" "Text" "Volume: %1b"][!Update]

EDIT: I forgot the reason for all this to start with. Using the section variable in simple form "[SectionMeasure]" produces a long integer of 5 numbers and no decimal value, but it also does not add the quantifier, MB, GB, kB, etc are not showing.
The output then looks like this: "Volume: 15.0 kB". The issue with this form is that when !SetOption is used again: MouseLeaveAction=[!SetOption "MeterUnderText" "Text" ""][!Update] the %1 value persists without the 'Volume" string before it. I have no idea why, but that happens...

Ok I will skip the third form since it is moot.

Ideally, on mouse over the Recycle Volume in scaled 2 decimal precision reads correctly, and completely is gone after mouse leave.

Here is the whole skin:
DrivesHub_1.xx.rmskin
(1.99 MiB) Downloaded 7 times
I hope I packed it right... :oops:

EDIT: I forgot the reason for all of this to start with. Using the "[MeasureName]" was producing an unscaled long integer and no suffix.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by death.crafter »

We do a little hacking.
DrivesMngr_1.rmskin
(1.99 MiB) Downloaded 9 times
Check the mentioned sections and around them.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by CodeCode »

death.crafter wrote: July 23rd, 2021, 5:42 am We do a little hacking.

DrivesMngr_1.rmskin

Check the mentioned sections and around them.
Man, o, man. Yodabytes - okay...

So you saw the thing I was trying to corner my code on? Something got left out of the output each way I tried - this or that every time.

I guess lua was the only rational solution, then.

Could it be done in just RM Script, or basically - no way?

Thanks for that, it looks exactly how I hoped.

By the by, is that AutoScale called with parameters that might apply elsewhere, I mean in a practical way of course. Reusable..?
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm
Contact:

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by death.crafter »

CodeCode wrote: July 23rd, 2021, 8:05 am Man, o, man. Yodabytes - okay...

So you saw the thing I was trying to corner my code on? Something got left out of the output each way I tried - this or that every time.

I guess lua was the only rational solution, then.

Could it be done in just RM Script, or basically - no way?

Thanks for that, it looks exactly how I hoped.

By the by, is that AutoScale called with parameters that might apply elsewhere, I mean in a practical way of course. Reusable..?
Of course it is reusable.

And also use parent child for PowershellRM.

https://khanhas.gitbook.io/powershellrm/
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by CodeCode »

If I release this skin for sharing, will I need to include PowerShellRM in the dll list?

I cant be sure since I had it already. I dont exactly know how to get the most out of it, but ya, I have it. :confused:
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by CodeCode »

CodeCode wrote: July 23rd, 2021, 10:21 am If I release this skin for sharing, will I need to include PowerShellRM in the dll list?

I cant be sure since I had it already. I dont exactly know how to get the most out of it, but ya, I have it. :confused:
I can answer that for me. -->> Yes, I need to include it for those who dont have it already - it is how we get the drive, bus, and media values! :D
User avatar
Yincognito
Rainmeter Sage
Posts: 7022
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by Yincognito »

CodeCode wrote: July 23rd, 2021, 4:33 am Hello, I have a Parent Measure:

Code: Select all

[MeasureBinSize]
Measure=RecycleManager
RecycleType=Size
DynamicVariables=1
And a !SetOption bang setting the Value of a Text Value:

Code: Select all

MouseOverAction=[!SetOption "MeterUnderText" "Text" "Volume: [MeasureBinSize:/100000,2] MB"][!Update]
MouseLeaveAction=[!SetOption "MeterUnderText" "Text" ""][!Update]
The Problem is actually three different end Values for the text string.
Using the above two i get "Volume: 0.15 MB". I have to put the "MB" in there since AutoScale isn't supplying the suffix as it seems to say in the manual as 'should happen automatically'.

Then I try this way;

Code: Select all

[MeterUnderText]
Meter=String
MeasureName=MeasureBinSize
AutoScale=2k
...
Text=" "
Used with this line format:

Code: Select all

MouseOverAction=[!SetOption "MeterUnderText" "Text" "Volume: %1b"][!Update]

EDIT: I forgot the reason for all this to start with. Using the section variable in simple form "[SectionMeasure]" produces a long integer of 5 numbers and no decimal value, but it also does not add the quantifier, MB, GB, kB, etc are not showing.
The output then looks like this: "Volume: 15.0 kB". The issue with this form is that when !SetOption is used again: MouseLeaveAction=[!SetOption "MeterUnderText" "Text" ""][!Update] the %1 value persists without the 'Volume" string before it. I have no idea why, but that happens...

Ok I will skip the third form since it is moot.

Ideally, on mouse over the Recycle Volume in scaled 2 decimal precision reads correctly, and completely is gone after mouse leave.

Here is the whole skin:
DrivesHub_1.xx.rmskin
I hope I packed it right... :oops:

EDIT: I forgot the reason for all of this to start with. Using the "[MeasureName]" was producing an unscaled long integer and no suffix.
This will do - no Lua, no PowershellRM, at least not for this:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[MeasureBinSize]
Measure=Calc
Formula=15700000
DynamicVariables=1

---Meters---

[B]
Meter=Image
W=200
H=50
SolidColor=255,0,0,255

[MeterUnderText]
Meter=STRING
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
NumOfDecimals=2
AutoScale=2
Text=
MouseOverAction=[!SetOption MeterUnderText MeasureName "MeasureBinSize"][!SetOption MeterUnderText Text "Volume: %1B"][!Update]
MouseLeaveAction=[!SetOption MeterUnderText MeasureName ""][!SetOption MeterUnderText Text ""][!Update]
DynamicVariables=1
Bottom line, only when using MeasureName the measure value is "AUTO" scaled, otherwise in section variables only "fixed" scaling is done by the given integer divisor. Regarding "clearing up" the meter in this case, you also have to "erase" the MeasureName option, not just the Text option's value. Then, everything will work as expected.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by CodeCode »

Hi Yincognito.

That is one thing I havent tried yet. That is to say I did not try using SetOption on the MeasureName. I have used it in the past, so I have no idea why I did not try it this time.

Then clearing the MeasureName would have made perfect sense. I was trying to clear the Text Option, which did not work, in this case.

I am going to plug these into the skin now, but just thought I'd comment since it is really too obvious, once it is pointed out. :oops:

EDIT: I think there is something that makes this solution not work. I need the MeasureName intact for other Meters to use, it was just in this once case where the section variable was not producing the correct results.
Yea, i think that is the case.
User avatar
Yincognito
Rainmeter Sage
Posts: 7022
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using a Section Variable To Show a Value in a !SetOption "Value" (3 little ones)

Post by Yincognito »

CodeCode wrote: July 24th, 2021, 1:19 am EDIT: I think there is something that makes this solution not work. I need the MeasureName intact for other Meters to use, it was just in this once case where the section variable was not producing the correct results.
Yea, i think that is the case.
I don't follow... First, the solution will work, you probably meant that it wasn't suited for your case there, which is an entirely different thing. Second, the MeasureName option is entirely meter specific, you can't possibly need it to be "intact for OTHER METERS to use", since changing it has no impact whatsoever on other meters than this one.

Anyway, it's up to you if you use it or not. I just wanted to make these two points clear.
Post Reply