;===========================================
;  Rainmeter 
;===========================================

[Rainmeter]
Author=SergofaneS
Update=50

;===========================================
;  Gloss Battery Meter
;===========================================

[Variables]

fontColor.Text=3,173,243
Percent.Text=3,173,243
FontName=Neuropol
FontHeight=7
AntiAlias=1
;--------------------------------------------------------------------------

[MeasureAc]
Measure=Plugin
PlugIn=PlugIns\PowerPlugin.dll
PowerState=ACLINE
Substitute="0":"питание от батареи","1":"питание от сети"

[MeasurePowerStatus]
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=STATUS
Substitute="0":"средний уровень","1":"заряжается","2":"критический уровень","3":"низкий уровень","4":"полный уровень"
UpdateDivider=5

[PowerAction]
Measure=Calc
Formula=MeasureAc
IfAboveValue=0
IfAboveAction=!execute [!RainmeterHideMeter MeterBat][!RainmeterShowMeter MeterACLine]
IfAboveValue=1
IfEqualAction=!execute [!RainmeterShowMeter MeterBat][!RainmeterHideMeter MeterACLine]


[PowerAction2]
Measure=Calc
Formula=MeasureAc
IfAboveValue=0
IfAboveAction=!execute [!RainmeterHideMeter MeterBat][!RainmeterShowMeter MeterStatus]
IfAboveValue=1
IfEqualAction=!execute [!RainmeterShowMeter MeterBat][!RainmeterHideMeter MeterStatus]


;==============================================================================================

[MeasurePercent]
Measure=Plugin
PlugIn=PlugIns\PowerPlugin.dll
PowerState=PERCENT
UpdateDivider=12


[MeasurePercent.high]
Measure=Plugin
PlugIn=PlugIns\PowerPlugin.dll
PowerState=PERCENT
UpdateDivider=10
IfAboveValue=140
IfAboveAction=!execute [!RainmeterShowMeter BatBar.High][!RainmeterHideMeter BatBar.Medium][!RainmeterHideMeter BatBar.Low]

[MeasurePercent.medium]
Measure=Plugin
PlugIn=PlugIns\PowerPlugin.dll
PowerState=PERCENT
UpdateDivider=10
IfAboveValue=50
IfAboveAction=!execute [!RainmeterShowMeter BatBar.Medium][!RainmeterHideMeter BatBar.Low][!RainmeterHideMeter BatBar.High]

[MeasurePercent.low]
Measure=Plugin
PlugIn=PlugIns\PowerPlugin.dll
PowerState=PERCENT
UpdateDivider=10
IfAboveValue=30
IfAboveAction=!execute [!RainmeterShowMeter BatBar.Low][!RainmeterHideMeter BatBar.Medium][!RainmeterHideMeter BatBar.High]

;===================================================================================

[MeterStatus]
Meter=IMAGE
X=8
Y=10
W=140
H=23
ImageName=Charge to batteries\[ImageNumberCalc].png
DynamicVariables=1
Hidden=1

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 85


[BatBar.Medium]
MeasureName=MeasurePercent
Meter=BAR
X=6
Y=10
W=140
H=28
BarOrientation=HORIZONTAL
BarColor=0, 0, 255,0
flip=0
UpdateDivider=10
Hidden=1

[BatBar.Low]
MeasureName=MeasurePercent
Meter=BAR
X=6
Y=10
W=140
H=28
BarOrientation=HORIZONTAL
BarColor=0, 0, 255,50
flip=0
UpdateDivider=10
Hidden=1

[BatBar.High]
MeasureName=MeasurePercent
Meter=BAR
X=6
Y=10
W=140
H=28
BarOrientation=HORIZONTAL
BarColor=255,0,255,50
flip=0
UpdateDivider=10
Hidden=1

[Background]
Meter=IMAGE
X=0
Y=3
W=162
H=40
ImageName=Battery.png
Hidden=0


[MeterACLine]
Meter=IMAGE
ImageName=power_ac.png
X=7
Y=5
W=150
H=40
Hidden=1

[MeterBat]
Meter=IMAGE
X=0
Y=3
W=162
H=40
ImageName=Feeding from battery\[ImageNumberCalc].png
DynamicVariables=1
Hidden=1

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 40


[MeterACLine2]
Meter=STRING
MeasureName=MeasureAc
X=78
Y=0
StringAlign=CENTER
FontColor=#fontColor.Text#
FontSize=#FontHeight#
FontFace=#FontName#
StringEffect=BORDER
AntiAlias=1
Hidden=0

[MeterPercent]
Meter=STRING
MeasureName=MeasurePercent
MeasureName2=MeasurePowerStatus
X=78
Y=40
StringAlign=CENTER
FontColor=#Percent.Text#
FontSize=#FontHeight#
FontFace=#FontName#
StringEffect=BORDER
AntiAlias=1
Text=%2 %1%

