i was trying to change the colors of the bar depending on the percentage of storage in that drive like green for above 50% and yellow for below 50% but above 15% and red for below 15%. I really think i have made a small mistake somewhere but I just cant find it
Alloutofmercy wrote: ↑October 6th, 2022, 2:33 pm
I forgot to put the 2 in the formula for the calc measure to caluclate the percentage !
I don't know what 2 have you forget, but I doubt you got the code properly work, because there still are some issues.
For instance the IfCondition and IfCondition3 are correct, however IfCondition2 is not. If there are more conditions into one single IfCondition, the conditions have to be included into parenthesis. My advice is to always include all conditions into parenthesis, but this is not absolutely mandatory. However at least the ones which can't work without parenthesis, for sure have to be included.
Here is what am I talking about:
As said the paranthesis in the IfCondition and IfConditioon3 are optional (but recommended), as well as the first and last parenteses of IfCondition2 (the green ones here: IfCondition2=((HDD1Calc<50) && (HDD1Calc>15))). The red ones are mandatory.
Alloutofmercy wrote: ↑October 6th, 2022, 3:37 pm
Hmm i did that now and renamed the measures a little bit but it is still stuck on green
What 70.5 GB is (from your screenshot)? It's the free- or the used space? Please post the whole code if you want us to can help.
However, I believe you've made a mistake in the posted code: if in the Formula option of the [MeasureUsedDiskPercentual] measure you're dividing the used disk space ([MeasureUsedDiskSpace]) by the total ([MeasureTotalDiskSpace:]), you get the percent of used space (obviously). In my opinion the color should be set to green when the FREE disk space is above 50%, to yellow below this and finally to red when this percent is below 15%. But since your measure calculates the percent of used disk space, this is done exactly opposite: the color is set to green when the drive has a greater used space than 50%, to yellow, between 50% and 15% and finally to red below 15%. I think you've mixed a little bit the conditions and the corresponding color settings. Please check.
Alloutofmercy wrote: ↑October 7th, 2022, 8:01 am
but 70gb of 75 gb is far greater than 50%
Believe me, Rainmeter (as well as a programming language, any of them) doesn't fail in calculations of this type. If the value of the [MeasureUsedDiskPercentual] measure is greater than 50%, the Bclr variable is set to #green# for sure.
So, post please the code of the [MeasureUsedDiskSpace] and [MeasureTotalDiskSpace] measures, because you didn't post them. Yep, I know you did post the [UsedHDD1Measure], [FreeHDD1Measure] and [TotalHDD1Measure] measures, but in meantime you've changed the names of measures, so could be useful to see the measures as you're using them.
Alloutofmercy wrote: ↑October 7th, 2022, 8:01 am
but 70gb of 75 gb is far greater than 50%
Now taking a look at the posted codes of all those measures, meters and variables, I'm not sure anymore what is the problem. You have a used space of 70.5 GB from a total of 75.9 GB. This is far above 50%. Accordingly, the Bclr variable is set to #green#, as the IfCondition / IfTrueAction options state this. So, what is the problem?