It is currently April 23rd, 2024, 6:03 pm

Bar Meter Not Hiding Without Bang

Get help with creating, editing & fixing problems with skins
andy99000
Posts: 11
Joined: March 12th, 2017, 4:15 pm

Bar Meter Not Hiding Without Bang

Post by andy99000 »

Hello,

I am creating a basic network panel for myself and have gotten pretty far with it. However, I have a bar meter that doesn't hide, even when I set the "Hidden=1". In other words, it starts off showing when I want it to be hidden at first. What could be the issue?

The bar meter in question...

Code: Select all

[MeterNetworkSignalBar]
Meter=Bar
MeasureName=MeasureNetworkSignal
BarColor=#Red#
BarOrientation=Horizontal
SolidColor=25,25,25,50
x=5R
y=2r
W=300
H=27
Hidden=#hideMeters#
DynamicVariables=1
The variable #hideMeters# is set to 1. I change the variable with a bang so I can show and hide certain meters at the same time

Keep in mind that this meter CAN hide if I use a bang to hide it (e.g: !ToggleMeter, !HideMeter, etc..)
If I didn't say it, thank you for the help, and your cooperation. Greatly Appreciated! :thumbup:
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Bar Meter Not Hiding Without Bang

Post by jsmorley »

You must have some other action on a measure or something that is setting hideMeters to 0, or is otherwise unhiding that meter. I assure you that if you have

[Variables]
hideMeters=1

...

[MeterNetworkSignalBar]
Meter=Bar
MeasureName=MeasureNetworkSignal
BarColor=#Red#
BarOrientation=Horizontal
SolidColor=25,25,25,50
x=5R
y=2r
W=300
H=27
Hidden=#hideMeters#
DynamicVariables=1

That meter will be hidden...
andy99000
Posts: 11
Joined: March 12th, 2017, 4:15 pm

Re: Bar Meter Not Hiding Without Bang

Post by andy99000 »

i found the problem (of course I find it when I post a problem, happens every time anywhere else).

So here is the thing: I have a measure that hides the bar meter if I have Ethernet plugged in (it would be pointless to have a signal bar if connected directly to it.) Looks like this:

Code: Select all

Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
IfMatch=Ethernet
IfMatchAction=[!SetOption MeterNetworkSignalValue Text "Ethernet"][!SetOption MeterNetworkSignalValue X 304r][!HideMeter MeterNetworkSignalBar]
IfNotMatchAction=[!ShowMeter MeterNetworkSignalBar]
DynamicVariables=1
It is the "IfNotMatchAction" that is causing the problem. Of course, if for some reason I take the cable out, I want the bar meter to show back up. I am sure it is a simple solution, but how would I go about doing this? If needed I can provide all the code to make life easier and for you guys to test on your PCs

So here is ALL the code:

Code: Select all

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

[Metadata]
Name=Network Panel
Author=Andy99000
Information=This is my second attempt at a network Panel
Version=1.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]
White=255,255,255,255
Red=255,0,0,255
Black=0,0,0,255
NetDownloadMaxValue=8550000
NetUploadMaxValue=4560000
hideMeters=1

;---------------
;Styles
;---------------
[StyleLabels]
FontColor=#Black#
FontSize=20
x=-497r
y=40r
Hidden=#hideMeters#
DynamicVariables=1

[StyleValues]
FontColor=#Black#
StringAlign=Right
FontSize=20
x=497r
y=0r
Hidden=#hideMeters#
DynamicVariables=1

;---------------
;MEASURES
;---------------
[MeasureSSID]
Measure=Plugin
Plugin=WiFiStatus
WifiInfoType=SSID
Substitute="-1":"Not Connected"
IfMatch=Not Connected
IfMatchAction=[!SetOption MeterGatewayIPValue Text "Not Connected"][!UpdateMeter MeterGatewayIPValue]
IfNotMatchAction=[!SetOption MeterGatewayIPValue Text ""][!UpdateMeter MeterGatewayIPValue]

[MeasureConnectivityType]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
IfMatch=Ethernet
IfMatchAction=[!SetOption MeterNetworkSignalValue Text "Ethernet"][!SetOption MeterNetworkSignalValue X 304r][!HideMeter MeterNetworkSignalBar]
IfNotMatchAction=[!ShowMeter MeterNetworkSignalBar]
DynamicVariables=1

[MeasureNetworkSignal]
Measure=Plugin
Plugin=WifiStatus
WifiInfoType=Quality
MaxValue=100

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoData=Best
SysInfoType=IP_ADDRESS
Substitute="127.0.0.1":"Not Connected", "":"Not Connected"

[MeasureGatewayIP]
Measure=Plugin
Plugin=SysInfo
SysInfoData=Best
SysInfoType=GATEWAY_ADDRESS
Substitute="0.0.0.0":"No Gateway Found"

[MeasureDownload]
Measure=NetIn
MaxValue=#NetDownloadMaxValue#
;Change this value in the variables

[MeasureUpload]
Measure=NetOut
MaxValue=#NetUploadMaxValue#
;Like above, change in variables

[MeasureNetworkTraffic]
Measure=NetTotal
MaxValue=(#NetDownloadMaxValue#+#NetUploadMaxValue#)
;adds up the values for the total possible network traffic

;---------------
;METERS
;---------------
[MeterSkinTab]
Meter=Image
ImageName=#@#Background Tab.png

[MeterBackground]
Meter=Image
ImageName=#@#Background.png
Hidden=1

[MeterMinimizeSkin]
Meter=Button
ButtonImage=#@#Minimize.png
x=374
y=0
ButtonCommand=[!SetVariable hideMeters 1][!HideMeter MeterBackground][!Redraw]
ToolTipText=Minimize This Skin

[MeterMaximizeSkin]
Meter=Button
ButtonImage=#@#Maximize.png
x=419
y=0
ButtonCommand=[!ShowMeter MeterBackground][!SetVariable hideMeters 0][!Redraw]
ToolTipText=Maximize this skin

[MeterUnloadSkin]
Meter=Button
ButtonImage=#@#CloseButton.png
x=464
y=0
ButtonCommand=[!DeactivateConfig]
ToolTipText=Close this skin

[MeterTitle]
Meter=String
MeterStyle=StyleLabels
StringAlign=Center
Text=Network Information
x=(505/2)
y=3
Hidden=0

[MeterSSIDLabel]
Meter=String
MeterStyle=StyleLabels
Text=SSID:
x=3

[MeterSSIDValue]
Meter=String
MeasureName=MeasureSSID
MeterStyle=StyleValues
Text=%1

[MeterConnectivityTypeLabel]
Meter=String
MeterStyle=StyleLabels
Text=Connection Type:

[MeterConnectivityTypeValue]
Meter=String
MeterStyle=StyleValues
MeasureName=MeasureConnectivityType
Text=%1

[MeterNetworkSignalLabel]
Meter=String
MeterStyle=StyleLabels
Text=Signal Strength:

[MeterNetworkSignalBar]
Meter=Bar
MeasureName=MeasureNetworkSignal
BarColor=#Red#
BarOrientation=Horizontal
SolidColor=25,25,25,50
x=5R
y=2r
W=300
H=27
Hidden=#hideMeters#
DynamicVariables=1

[MeterNetworkSignalValue]
Meter=String
MeasureName=MeasureNetworkSignal
MeterStyle=StyleValues
Text=%1%
x=497

[MeterLANIPLabel]
Meter=String
MeterStyle=StyleLabels
Text=LAN IP:
X=3

[MeterLANIPValue]
Meter=String
MeasureName=MeasureLANIP
MeterStyle=StyleValues
Text=%1

[MeterGatewayIPLabel]
Meter=String
MeterStyle=StyleLabels
Text=Gateway IP:

[MeterGatewayIPValue]
Meter=String
MeterStyle=StyleValues
MeasureName=MeasureGatewayIP
Text=%1

[MeterUploadArrowPicture]
Meter=Image
ImageName=#@#Network\Arrow.png
X=3
Y=306
ImageFlip=Horizontal
Hidden=#hideMeters#
DynamicVariables=1

[MeterUploadArrowFill]
Meter=Bar
MeasureName=MeasureUpload
BarImage=#@#Network\Sending Arrow Filled.png
x=0r
y=0r
BarOrientation=Horizontal
Flip=1
ToolTipText=Upload
Hidden=#hideMeters#
DynamicVariables=1

[MeterMiddleArrowPicture]
Meter=Image
ImageName=#@#Network\Send & Receive Arrow.png
X=195
Y=306
Hidden=#hideMeters#
DynamicVariables=1

[MeterMiddleArrowFill]
Meter=Bar
MeasureName=MeasureNetworkTraffic
BarImage=#@#Network\Send & Receive Arrow Filled .png
X=0r
Y=0r
BarOrientation=Vertical
ToolTipText=Upload and Download Total
Hidden=#hideMeters#
DynamicVariables=1

[MeterDownloadArrowPicture]
Meter=Image
ImageName=#@#Network\Arrow.png
X=380
Y=0r
Hidden=#hideMeters#
DynamicVariables=1

[MeterDownloadArrowFill]
Meter=Bar
MeasureName=MeasureDownload
BarImage=#@#Network\Receiving Arrow Filled.png
X=0r
Y=0r
BarOrientation=Horizontal
ToolTipText=Download
Hidden=#hideMeters#
DynamicVariables=1

[MeterDownloadText]
Meter=String
MeasureName=MeasureDownload
FontColor=#White#
Text=%1B
AutoScale=1
x=75
y=306
Hidden=#hideMeters#
DynamicVariables=1

[MeterNetworkTotalText]
Meter=String
MeasureName=MeasureNetworkTraffic
FontColor=#White#
Text=%1B
AutoScale=1
X=200
y=306
Hidden=#hideMeters#
DynamicVariables=1

[MeterUploadText]
Meter=String
MeasureName=MeasureUpload
FontColor=#White#
Text=%1B
AutoScale=1
x=380
y=306
Hidden=#hideMeters#
DynamicVariables=1
If I didn't say it, thank you for the help, and your cooperation. Greatly Appreciated! :thumbup:
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Bar Meter Not Hiding Without Bang

Post by jsmorley »

Seems to me you have a conflict between the #hideMeters# variable you are using on the meter, and the !ShowMeter you are using in the bang. The minute you unhide the meter with the bang, the meter is updated on the next skin update and obeys the current value of #hideMeters# and is hidden.

What you might want to do is use !SetOption to set the value of Hidden on that meter to either "0" or "#*hideMeters*#" as needed, so you avoid the conflict.
andy99000
Posts: 11
Joined: March 12th, 2017, 4:15 pm

Re: Bar Meter Not Hiding Without Bang

Post by andy99000 »

Okay, so I fixed the problem with the bar. I just took out the "IfNotMatchAction" that was causing the problem. Only thing now is that when I go from ethernet to wireless, The signal strength value Stays at "ethernet" and the bar stays hidden

Again, referring to this particular code:

Code: Select all

[MeasureConnectivityType]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
IfMatch=Ethernet
IfMatchAction=[!SetOption MeterNetworkSignalValue Text "Ethernet"][!SetOption MeterNetworkSignalValue X 304r][!HideMeter MeterNetworkSignalBar]
DynamicVariables=1

[MeterNetworkSignalBar]
Meter=Bar
MeasureName=MeasureNetworkSignal
BarColor=#Red#
BarOrientation=Horizontal
SolidColor=25,25,25,50
x=5R
y=2r
W=300
H=27
Hidden=#hideMeters#
DynamicVariables=1

[MeterNetworkSignalValue]
Meter=String
MeasureName=MeasureNetworkSignal
MeterStyle=StyleValues
Text=%1%
x=497
The meter [MeterNetworkSignalValue] is never updated (and I just tried a IfNotMatchAction=[!UpdateMeter MeterNetworkSignalValue] with it), and the bar never shows back up.

i.e: Everything is working fine with wireless, I plug in the ethernet cord and everything still works fine, but when I go back to wireless, the connectivity value changes, but the signal strength does not (stays at "Ethernet"), and the bar stays hidden. How can I go about making the bar and value show back up?
If I didn't say it, thank you for the help, and your cooperation. Greatly Appreciated! :thumbup:
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Bar Meter Not Hiding Without Bang

Post by jsmorley »

Same conflict as before... Try something like this:

[MeasureConnectivityType]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
IfMatch=Ethernet
IfMatchAction=[!SetOption MeterNetworkSignalValue Text "Ethernet"][!SetOption MeterNetworkSignalValue X 304r][!SetOption MeterNetworkSignalBar Hidden "#*hideMeters*#"][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterNetworkSignalBar Hidden "0"][!UpdateMeter *][!Redraw]
DynamicVariables=1
andy99000
Posts: 11
Joined: March 12th, 2017, 4:15 pm

Re: Bar Meter Not Hiding Without Bang

Post by andy99000 »

That didn't work the way you think it did. Now the bar never goes away. The #hideMeters# variable only changes when I click the minimize or maximize buttons. They hide (hideMeters=1) when I minimize, and show up (hideMeters = 0) when I maximize:

Code: Select all

[MeterMinimizeSkin]
Meter=Button
ButtonImage=#@#Minimize.png
x=374
y=0
ButtonCommand=[!SetVariable hideMeters 1][!Delay 1000][!HideMeter MeterBackground][!Redraw]
ToolTipText=Minimize This Skin

[MeterMaximizeSkin]
Meter=Button
ButtonImage=#@#Maximize.png
x=419
y=0
ButtonCommand=[!ShowMeter MeterBackground][!SetVariable hideMeters 0][!Redraw]
ToolTipText=Maximize this skin
I am close to getting it the way I want it, so here is the new code for that specific measure:

Code: Select all

[MeasureConnectivityType]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_TYPE
SysInfoData=Best
IfMatch=Ethernet
IfMatchAction=[!SetOption MeterNetworkSignalValue Text "Direct Connection"][!SetOption MeterNetworkSignalValue X 304r][!ToggleMeter MeterNetworkSignalBar][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterNetworkSignalValue Text "[*MeasureNetworkSignal*]%"][!UpdateMeter *][!Redraw]
DynamicVariables=1
Only problem is getting the bar to show back up without showing initially.
E:Except change the !ToggleMeter to !HideMeter
If I didn't say it, thank you for the help, and your cooperation. Greatly Appreciated! :thumbup:
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Bar Meter Not Hiding Without Bang

Post by jsmorley »

My point is that using both #hideMeters# on the meters and !ShowMeter in actions are a certain conflict. As soon as you show a meter, the variable causes it to be hidden.

You need to settle on one approach, either use the #hideMeters# variable on the meters in question and use a bang to change the value of the variable, or use !SetOption and / or !SetOptionGroup to set the value of the Hidden option on meter(s) as you want. I don't think you want to use both.

In any case, STOP using !ShowMeter / !HideMeter. Those are the wrong way to come at this. They conflict with the way you are setting Hidden on the meters.
andy99000
Posts: 11
Joined: March 12th, 2017, 4:15 pm

Re: Bar Meter Not Hiding Without Bang

Post by andy99000 »

I got it. I took out the !ShowMeter, !HideMeter (Like you suggested) and just put OnChangeAction=[!ToggleMeter MeterNetworkSignalBar,probably not exactly what you would have liked, but it gets the job done.
If I didn't say it, thank you for the help, and your cooperation. Greatly Appreciated! :thumbup: