Page 1 of 2

Disk Drive Bar Color while no Drive connected

Posted: September 19th, 2017, 11:34 am
by pul53dr1v3r
Hi all. Here is an issue about Disk Drive Bar color when a letter isn't assigned to a disk drive (it's (F:) in this case). The color turns orange for used space, grey for free. So, it's supposed to be completely grey when there is no drive for the letter instead of orange as the skin turns. On the video you can see how does it work in the practice. Just a visual issue, but the same state of the bar should only be when is no more free space on a drive.

My guess is that some "IfValue..." instructions need to be inserted.

A part of the code related to the Bar:

Code: Select all

[Rainmeter]
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14
Update=1000

[Variables]
colorBar=255,140,0,200
HD1=F:

[measureUsedHD1]
Measure=FreeDiskSpace
Drive=#HD1#
InvertMeasure=1
;UpdateDivider=10
IgnoreRemovable=0

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[meterBarHD1]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureUsedHD1
X=10
Y=52
W=190
H=1

VIDEO EXAMPLE OF THE ISSUE:
https://youtu.be/8PaFsXMgKqE

Re: Disk Drive Bar Color while no Drive connected

Posted: September 19th, 2017, 12:24 pm
by mak_kawa

Code: Select all

[measureUsedHD1]
Measure=FreeDiskSpace
Drive=#HD1#
InvertMeasure=1
IgnoreRemovable=0
IfCondition=measureUsedHD1=0
IfTrueAction=[!SetVariable colorBar 255,255,255,15]
IfFalseAction=[!SetVariable colorBar 255,140,0,200]
And...

Code: Select all

[meterBarHD1]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureUsedHD1
X=10
Y=52
W=190
H=1
DynamicVariables=1

Re: Disk Drive Bar Color while no Drive connected

Posted: September 19th, 2017, 5:26 pm
by pul53dr1v3r
Thank you, it is doing the job!

Re: Disk Drive Bar Color while no Drive connected

Posted: October 9th, 2017, 8:39 pm
by pul53dr1v3r
Just noticed that the empty bar color changes for approx +15 of transparency when I connect and disconnect the drive. Looks like the color is doubled for some reason.

https://youtu.be/KnbSMh3W2_s

Code: Select all

[Rainmeter]

Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14
Update=1000
AccurateText=0


[Metadata]
; Contains basic information of the skin.
Description=Displays disk usage.


[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=255,140,0,200
ColorR=255,140,0,200
colorText=255,255,255,205
HD1=F:
; UpdateInterval is set to divide update time of Disk Drive Label, Used and Total space
UpdateInterval=2

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[measureTotalHD1]
; This measure returns the total disk space
Measure=FreeDiskSpace
Drive=#HD1#
Total=1
IgnoreRemovable=0
UpdateDivider=#UpdateInterval#

[measureUsedHD1]
; Returns inverted value of free disk space (i.e. used disk space)
Measure=FreeDiskSpace
Drive=#HD1#
InvertMeasure=1
IgnoreRemovable=0
IfCondition=measureUsedHD1=0
IfTrueAction=[!SetVariable "colorBar" "255,255,255,15"]
IfFalseAction=[!SetVariable "colorBar" "255,140,0,200"]
UpdateDivider=#UpdateInterval#

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
;StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
MeasureName=MeasureDiskLabel
X=104
Y=12
W=197
H=48
Text=%1(#HD1#)
LeftMouseUpAction=[#HD1#]
MouseOverAction= [!SetOption "meterTitle" "FontColor" "#ColorR#"][!SetOption "meterTitle" "Text" "OPEN"] [!UpdateMeter "meterTitle"][!Redraw]
MouseLeaveAction= [!SetOption "meterTitle" "FontColor" "#colorText#"][!SetOption "meterTitle" "Text"  "%1(#HD1#)"] [!UpdateMeter "meterTitle"][!Redraw]
DynamicVariables=1

;ToolTipText=Open The Disk
; Even though the text is set to Disks, Rainmeter will display
; it as DISKS, because styleTitle contains StringCase=UPPER.


[meterLabelHD1]
Meter=STRING
MeterStyle=styleLeftText
MeasureName=MeasureDiskLabel
MeasureName2=measureUsedHD1
X=10
Y=40
W=90
H=14
Text="Used: %2B"
Hidden=0
NumOfDecimals=1
Autoscale=1

[MeasureDiskLabel]
Measure=FreeDiskSpace
Drive=#HD1#
Label=1
IgnoreRemovable=0
UpdateDivider=#UpdateInterval#

[meterValueHD1]
Meter=STRING
MeterStyle=styleRightText
MeasureName=measureUsedHD1
MeasureName2=measureTotalHD1
X=200
Y=0r
H=14
Text="Total: %2B"
NumOfDecimals=1
AutoScale=1


[meterBarHD1]
Meter=BAR
MeterStyle=styleBar
MeasureName=measureUsedHD1
X=10
Y=52
W=190
H=1
DynamicVariables=1

;_____________________________________________Reads

;For the graph
[MeasureHD1DiskReads]
Measure=Plugin
Plugin=PerfMon
PerfMonObject=LogicalDisk
PerfMonCounter="Disk Reads/sec"
PerfMonInstance="#HD1#"
PerfMonDifference=1
Interface=#Interface#
IfEqualValue=0
IfEqualAction=[!SetOption meterReadCircle1 ImageTint 255,255,255,100][!SetOption meterReadCircle2 ImageTint 255,255,255,100]
IfAboveValue=0
IfAboveAction=[!SetOption meterReadCircle1 ImageTint 204,0,0,255][!SetOption meterReadCircle2 ImageTint 204,0,0,255]

;for the string
[MeasureHD1DiskReadsSec]
Measure=Plugin
Plugin=PerfMon
PerfMonObject=LogicalDisk
PerfMonCounter="Disk Read Bytes/sec"
PerfMonInstance=#HD1#



[MeterHD1ReadSpeedLabel]
Meter=String
X=68
Y=58
MeterStyle=StringStyle
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=255,255,255,50
FontFace=#fontName#
FontSize=#textSize#
StringAlign=RIGHT
AntiAlias=1
ClipString=1
AlwaysOnTop=1
Text="Read:"

[MeterHD1ReadSpeed]
Meter=String
MeasureName=MeasureHD1DiskReadsSec
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=255,255,255,50
FontFace=#fontName#
FontSize=#textSize#
StringAlign=RIGHT
AntiAlias=1
ClipString=1
X=199
Y=r
Autoscale=1
MeterStyle=StringStyle
FontColor=255,255,255,255

[MeterReadLine]
Meter=Histogram
MeasureName=MeasureHD1DiskReads
GraphStart=Left
X=37
Y=60
W=160
H=25
Autoscale=1
Antialias=1
Flip=0
PrimaryColor=176,196,222,150
SolidColor=255,255,255,15

;_____________________________________________Writes


;For the graph
[MeasureHD1DiskWrites]
Measure=Plugin
Plugin=PerfMon
PerfMonObject=LogicalDisk
PerfMonCounter="Disk Writes/sec"
PerfMonInstance="#HD1#"
PerfMonDifference=1
Interface=#Interface#
IfEqualValue=0
IfEqualAction=[!SetOption meterWriteCircle1 ImageTint 255,255,255,100][!SetOption meterWriteCircle2 ImageTint 255,255,255,100]
IfAboveValue=0
IfAboveAction=[!SetOption meterWriteCircle1 ImageTint 204,0,0,255][!SetOption meterWriteCircle2 ImageTint 255,0,0,255]


;for the string
[MeasureHD1DiskWritesSec]
Measure=Plugin
Plugin=PerfMon
PerfMonObject=LogicalDisk
PerfMonCounter="Disk Write Bytes/sec"
PerfMonInstance=#HD1#

[MeterHD1WritesSpeedLabel]
Meter=String
X=72
Y=84
MeterStyle=StringStyle
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=255,255,255,50
FontFace=#fontName#
FontSize=#textSize#
StringAlign=RIGHT
AntiAlias=1
ClipString=1
AlwaysOnTop=1
Text="Write:"

[MeterHD1WritesSpeed]
Meter=String
MeasureName=MeasureHD1DiskWritesSec
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=255,255,255,50
FontFace=#fontName#
FontSize=#textSize#
StringAlign=RIGHT
AntiAlias=1
ClipString=1
X=199
Y=r
Autoscale=1
MeterStyle=StringStyle
FontColor=255,255,255,255

[MeterWriteLine]
Meter=Histogram
MeasureName=MeasureHD1DiskWrites
GraphStart=Left
LineWidth=1
X=37
Y=86
W=160
H=25
Flip=0
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
SolidColor=255,255,255,15

;_____________________________________________Indicators

[meterReadCircle1]
Meter=image
ImageName=#@#Images\Arrow.png
X=16
Y=67

[meterWriteCircle1]
Meter=image
ImageName=#@#Images\Arrow.png
X=r
Y=21r
ImageFlip=VERTICAL
The issue can be masked changing the colorBar transparency to 0, but that method just hides the real issue even thought it works ok so.

Code: Select all

[measureUsedHD1]
.
.
.
IfTrueAction=[!SetVariable "colorBar" "255,255,255,0"]

Re: Disk Drive Bar Color while no Drive connected

Posted: October 10th, 2017, 8:27 am
by mak_kawa
I am not sure about cause of the issue, but it is possibly that "BarColor=255,255,255,15" and "SolidColor=255,255,255,15" are doubled for the bar rendering. I think, your workaround that changes to #colorBar# to "255,255,255,0" (or "0,0,0,0") is an exact fix?

Re: Disk Drive Bar Color while no Drive connected

Posted: October 10th, 2017, 12:31 pm
by balala
Pul53dr1v3r wrote:Just noticed that the empty bar color changes for approx +15 of transparency when I connect and disconnect the drive. Looks like the color is doubled for some reason.
I can't replicate the issue, everything seem working well.
However, a first fix I'd try, would be to add some bangs to update the Bar meter, each time its color is changed by the IfCondition of the [measureUsedHD1] measure. Add the following bangs to these options:

Code: Select all

[measureUsedHD1]
...
IfTrueAction=[!SetVariable "colorBar" "255,255,255,15"][!UpdateMeter "meterBarHD1"][!Redraw]
IfFalseAction=[!SetVariable "colorBar" "255,140,0,200"][!UpdateMeter "meterBarHD1"][!Redraw]
Don't touch the other options.

Another observation related to the skin is that the colorBar variable, as it is defined in the [Variables] section is useless. I'd remove it. It's not needed because the value of this variable is set up by the above IfTrueAction, respectively IfFalseAction options.

If the above solution didn't help, please pack your config and upload it, to can check. The code doesn't seem enough, because as I said, I can't replicate the issue.

Re: Disk Drive Bar Color while no Drive connected

Posted: October 10th, 2017, 3:48 pm
by pul53dr1v3r
mak_kawa wrote:I am not sure about cause of the issue, but it is possibly that "BarColor=255,255,255,15" and "SolidColor=255,255,255,15" are doubled for the bar rendering. I think, your workaround that changes to #colorBar# to "255,255,255,0" (or "0,0,0,0") is an exact fix?
yes it works well when I change "colorBar" color with "IfTrueAction" to either 255,255,255,0 or 0,0,0,0 (blanks) and what it does is completely hiding colorBar color so we only see the background color of the bar, as desired.
Just not sure is it the best way for the issue.
balala wrote:
no mate, it does nothing.

This is from my point of view:

BarColor=#colorBar# (that's ORANGE (255,140,0,200)),
SolidColor=255,255,255,15 (very transparent GREY).

When the measureUsedHD1=1, both of the colors have been showed. Orange to measure used HDD space,
grey is the background color of the bar and it's always there.

When the measureUsedHD1=0, both of the colors are still there, but the BarColor is showed along the whole bar(think this is Rainmeter's mistake) even thought it isn't supposed to be. So we've made "If" Options to solve the BarColor (Orange in this case) issue. Our "IfTrueAction" option changes the BarColor from orange when no drive connected, to the same grey(like SolidColor), but as it is a transparent color, the background under is also visible (SolidColor). So we see the double 255,255,255,15 colors, as the both of them (SolidColor and the one from IfTrueAction) are the same.

So, it would be best if there is a way just to hide BarColor color when measureUsedHD1=0,not to change it, and desired GREY would be staying, no adding any other options.

ttt_.rmskin

Re: Disk Drive Bar Color while no Drive connected

Posted: October 10th, 2017, 5:49 pm
by balala
Are you sure the skin included into this package has the issue? I'm surprised, because I still can't see it, the bar appears orange, no green color, not even for one update cycle. I don't know what to say...
Pul53dr1v3r wrote:So, it would be best if there is a way just to hide BarColor color when measureUsedHD1=0,not to change it, and desired GREY would be staying, no adding any other options.
But if this would be your wish, it's not too hard to be done: first add the following meter, IMMEDIATELY (very important!) after the [meterBarHD1] meter:

Code: Select all

[meterBarEmptyHD1]
Meter=Image
SolidColor=#EmptyBarColor#
X=0r
Y=0r
W=190
H=1
Hidden=1
This meter will be shown when [measureUsedHD1] is zero. While this is show, the bar meter will be hidden.
Now replace the IfTrueAction and IfFalseAction options of the [measureUsedHD1] measure, with the following ones:

Code: Select all

[measureUsedHD1]
...
IfTrueAction=[!HideMeter "meterBarHD1"][!ShowMeter "meterBarEmptyHD1"]
IfFalseAction=[!ShowMeter "meterBarHD1"][!HideMeter "meterBarEmptyHD1"]
These options will show / hide the appropriate meters, discussed above.
Does this trick fixes your issue?
But I'm still confused why I can't see it, not even on your packaged skin. What Rainmeter version do you use?

Re: Disk Drive Bar Color while no Drive connected

Posted: October 10th, 2017, 6:07 pm
by pul53dr1v3r
balala wrote:Are you sure the skin included into this package has the issue?
Sorry, wrong upload but only one thing have to be changed in that skin:

Line 96 and SolidColor, just set it to 255,255,255,15.

Code: Select all

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15
I've reuploaded the skin above.

Re: Disk Drive Bar Color while no Drive connected

Posted: October 10th, 2017, 6:26 pm
by balala
Pul53dr1v3r wrote:I've reuploaded the skin above.
I'm sorry, but I still don't see the issue. :o
If that is the only wrong option, try to follow my above advice, let's see if it helps. The only different thing, due to the new option of the [styleBar] section is to replace the SolidColor of the [meterBarEmptyHD1] meter, with the following one: SolidColor=255,255,255,15 (this color must match the solid color of the bar meter).