It is currently February 25th, 2021, 9:26 pm

Debugging

Help with creating, editing & fixing problems with skins
User avatar
sa1nt4ch
Posts: 33
Joined: December 16th, 2020, 8:30 am
Location: Switzerland

Re: Debugging

Post by sa1nt4ch »

I seem to hit a problem.
QW DW.png
The String is correctly substituted.
But not correctly displayed

Code: Select all

[calcVRAMQW]
Measure=Calc
Substitute="4":"QW"
RegExpSubstitute=0

[calcVRAMDW]
Measure=Calc
Substitute="3.99902":"DW"
RegExpSubstitute=0

[MetergetVRAMDW]
Meter=String
MeterStyle=AllStyle | AlignStyle
MeasureName=calcVRAMDW
X=250
Y=183
AutoScale=0
Text=%1 GB
NumOfDecimals=0
DynamicVariables=1

[MetergetVRAMQW]
Meter=String
MeterStyle=AllStyle | AlignStyle
MeasureName=calcVRAMQW
X=250
Y=197
AutoScale=0
Text=%1 GB
NumOfDecimals=0
DynamicVariables=1
I made 2 Meters so its better visible, the same happends when I make just one Meter.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Debugging

Post by balala »

sa1nt4ch wrote: December 30th, 2020, 5:19 pm I seem to hit a problem.
I have to admit I didn't follow closely this topic today, so I suppose now there you have something I missed. I have no such measures as [calcVRAMQW] or [calcVRAMDW], nor meters like [MetergetVRAMDW] or [MetergetVRAMQW]. If I add them, none of those measures have Formula options, so what should be substituted? Nothing are and accordingly both measures are returning 0.
Could you please post the current content of the Fox\GPU FOX\GPU Fox.ini skin?
User avatar
sa1nt4ch
Posts: 33
Joined: December 16th, 2020, 8:30 am
Location: Switzerland

Re: Debugging

Post by sa1nt4ch »

I just have the problem that I tryed to substitute and in one meter it works and the same code in the other it does not. but the funny thing is as you can see in the screen shot that the string is changed but on the skin it does not show.

how can the same code work in one meter but not in the other.
GPU Fox(1).ini
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Debugging

Post by balala »

sa1nt4ch wrote: December 30th, 2020, 8:11 pm how can the same code work in one meter but not in the other.
How have you set the values of the measures? I suppose the value of the [calcVRAMQW] measure is not exactly 4, but a decimal number, which is shown rounded as 4. But such in a case the substitution is not applied. There are other possibilities as well, that's why would be important to show us the code which are you using.
User avatar
sa1nt4ch
Posts: 33
Joined: December 16th, 2020, 8:30 am
Location: Switzerland

Re: Debugging

Post by sa1nt4ch »

aaaa things like that drive me crazy. but I solved it. the decimal value of the testet value must be equal to the displayed decimal or it wont work.

so in order that Substitute="3.99902" works correktly in the Meter the meter needs to show 5 decimals if the decamials are not the same, the string is not correctly displayed.
User avatar
Alex88
Posts: 81
Joined: July 18th, 2020, 1:23 am
Location: California

Re: Debugging

Post by Alex88 »

sa1nt4ch wrote: December 30th, 2020, 11:24 pm aaaa things like that drive me crazy. but I solved it. the decimal value of the testet value must be equal to the displayed decimal or it wont work.

so in order that Substitute="3.99902" works correktly in the Meter the meter needs to show 5 decimals if the decamials are not the same, the string is not correctly displayed.
Depending on what you're trying it to, if you want to capture a slightly variable number (3.99902, 3.998, 4.065, etc.), it's better to use IfCondition like a compound inequality, for example:

Code: Select all

[calcVRAMDW]
Measure=Calc
IfCondition= (3.9 < SomeMeasure) && (SomeMeasure < 4.1)
IfTrueAction=[!SetOption SomeMeter Text "SomeText"][!UpdateMeter SomeMeter][!Redraw]
Substitute is better for replacing discrete/fixed/'straightforward' values that do not have any variation between different systems (0, -20, 4.5, etc.).
User avatar
sa1nt4ch
Posts: 33
Joined: December 16th, 2020, 8:30 am
Location: Switzerland

Re: Debugging

Post by sa1nt4ch »

well the value would be fixed, if less then 4 GB are installed the DWord would be less then 4 GB but if 4 or more are installed, the DWord would be it max Value of 3.99902 GB

But I think I finde a solution, its not elegant but it works. It should now display the right VRAM value even if there are less then 4 GB
GPU Fox.ini
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Debugging

Post by balala »

sa1nt4ch wrote: December 30th, 2020, 11:24 pm aaaa things like that drive me crazy. but I solved it. the decimal value of the testet value must be equal to the displayed decimal or it wont work.
The question is still the same: how the [calcVRAMQW] and [calcVRAMDW] measures get their values (formulas).
Note that by default a String meter shows the values returned by measures (Calc measure for instance) with no decimals, rounded, let's say. If you add a NumOfDecimals option to the String meter, you can specify the number of decimals which are shown on the meter. So if for example the [calcVRAMQW] measure is returning 3.99902, a String meter with a MeasureName=calcVRAMQW option, shows by default 4, but if you add a NumOfDecimals=5 option for instance, it shows 3.99902.
User avatar
sa1nt4ch
Posts: 33
Joined: December 16th, 2020, 8:30 am
Location: Switzerland

Re: Debugging

Post by sa1nt4ch »

its dificult to explain what I mean, so I made a test ini.
Substitute Test.ini

Code: Select all

[calcVRAM]
Measure=Calc
Formula=4293918720/1073741824
Substitute="3.99902":"Substituted"
RegExpSubstitute=0


[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,200,50 | Fill Color 0,0,0 

[MetergetVRAMDW]
Meter=String
MeasureName=calcVRAM
FontColor=255,255,255,255
FontFace=Segoe UI
FontSize=17
X=10
Y=10
W=100
H=200
AutoScale=0
Text=%1 
NumOfDecimals=5
DynamicVariables=1
If you change the NumOfDecimals=5 to less then 5 it will display the Number and more then 5 it will ad numbers.
Since the Value was, 3.9990....... i would need at least 4 Decimals to work which dos not fit the design so its usles for my purpos.

Thats why I changed to an other method. Did you try the GPU Fox it should display your VRAM correktly now.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Debugging

Post by balala »

sa1nt4ch wrote: December 31st, 2020, 11:41 am Did you try the GPU Fox it should display your VRAM correktly now.
Why? The Fox\GPU FOX\GPU Fox.ini skin is still in its original form, I didn't change anything on it. It shows correctly the GPU usage, but the GPU RAM is on 0 GB.