My skin has several BARS (Shape) in 120px width.
So, the respective values of my CPU, which these bars should represent, are variable.
Example: 1.225V, or CoreUsage = 100%, TDP 105W and so on
I have the bars running so far. But I think that the formulas to get the respective values calculated up/down to the 120px width (especially in view of the fact that I might want to make the finished skin available to others with other CPUs and correspondingly different values) are a "I'm not Mr. Einstein" knot in my brain.
Especially because for one of the values (for CPU voltage (volts)) I used the "Formula: Division by 0: (1 + (120/0.00))" - thing does not go away. (Not part of the following code snippet.)
Let me upload a part of the code: "The CPU Average USage"-Part.
The complete skin (maybe even now as *.rmskin file) is too late for me tonight.
But I will gladly and of course make it available to you if needed.
PART: CPU AVERAGE USAGE
Code: Select all
[Rainmeter]
Update=500
AccurateText=1
;==================================================
;=== VARIABLES & STYLES ===========================
;==================================================
[VARIABLES]
;==================================================
;=== VARIABLES FONTFACE - SIZE - COLORS ===========
;==================================================
Images1=#@#images\
Images2=#@#Images\apps\
FontFace=Courier Prime Sans
FontWeight=700
MinMaxWidth=55
W=635
H=320
FS1=16
FS2=14
FS3=10
FS4=8
Alpha0=1
Alpha1=70
Alpha2=130
Alpha3=255
Color0=0,0,0,
Color1=255,255,255,
Color2=253,193,0,
Color3=200,0,0,
Color4=64,64,64,
Color5=255,104,67,
Color6=0,255,0,
Color7=192,192,192,
Color8=15,255,168,
Color9=100,100,100,
;==================================================
Tmax=90
TDP=105
BaseClock=3800
BoostClock=4700
;--- STYLES CPU GRAPHICS/LABELS/WARNING ETC -------
[StCPU_BG]
ImageName=#Images1#bg_cpu.png
ImageAlpha=#Alpha3#
AntiAlias=1
UpdateDivider=-1
Container=CONTAINER_CPU
W=140
H=140
;--- STYLES CURRENT CPU USAGE (Average) -----------
[StCPUUSAGEAVLABEL]
Padding=-1,-5,-1,-9
SolidColor=#Color0##Alpha0#
FontColor=#Color7##Alpha3#
FontFace=#FontFace#
StringAlign=LEFT
StringCase=UPPER
FontWeight=#FontWeight#
FontSize=#FS2#
Text=CDU
AntiAlias=1
UpdateDivider=-1
Container=CONTAINER_CPU
[StCPUCAUTIONUsage]
ImageName=#Images1#caution.png
ImageAlpha=[mCPUAVWa]
ImageTint=#Color3##Alpha3#
AntiAlias=1
UpdateDivider=1
DynamicVariables=1
CONTAINER=CONTAINER_CPU
W=20
H=18
[StCPUUsageCur]
Padding=-1,-2,-1,-6
SolidColor=#Color0##Alpha0#
FontColor=#Color7##Alpha3#
FontFace=#FontFace#
StringAlign=RIGHT
FontSize=#FS2#
Text=[mCPU_AV:2]%
AntiAlias=1
DynamicVariables=1
CONTAINER=CONTAINER_CPU
Group=CPU_AV
[StCPUUsageMIN]
Padding=1,-3,1,-5
SolidColor=#Color0##Alpha0#
FontColor=#Color8##Alpha3#
FontFace=#FontFace#
StringAlign=RIGHT
FontSize=#FS3#
Text=[mCPUUsageMIN:2]%
AntiAlias=1
DynamicVariables=1
W=#MinMaxWidth#
Container=CONTAINER_CPU
Group=CPU_AV
[StCPUUsageMAX]
Padding=1,-3,1,-5
SolidColor=#Color0##Alpha0#
FontColor=#Color2##Alpha3#
FontFace=#FontFace#
StringAlign=RIGHT
FontSize=#FS3#
Text=[mCPUUsageMAX:2]%
AntiAlias=1
DynamicVariables=1
W=#MinMaxWidth#
Container=CONTAINER_CPU
Group=CPU_AV
;=== MEASURES CPU-AVERAGE =========================
[mCPU_AV]
Measure=PLUGIN
Plugin=UsageMonitor
Category="Processor Information"
Counter="% Processor Utility"
Name="0,_Total"
IfCondition= (mCPU_AV >= 0 ) && (mCPU_AV <=70)
IfTrueAction= [!DisableMeasure mCPUAVWa][!SetOption CPUUsageCur FontColor #Color6##Alpha3#][!HideMeter CPU_CAUTION_USAGE][!SetOption CPU_USAGE_AV_BAR TRI_AV "StrokeWidth 11 | Stroke Color #Color6##Alpha3# | StrokeEndCap Triangle | Rotate 90"][!UpdateMeterGroup CPU_AV][!Redraw]
IfCondition2=(mCPU_AV >= 71) && (mCPU_AV <= 99)
IfTrueAction2=[!EnableMeasure mCPUAVWa][!SetOption CPUUsageCur FontColor #Color5##Alpha3#][!ShowMeter CPU_CAUTION_USAGE][!SetOption CPU_USAGE_AV_BAR TRI_AV "StrokeWidth 11 | Stroke Color #Color5##Alpha3# | StrokeEndCap Triangle | Rotate 90"][!UpdateMeterGroup CPU_AV][!Redraw]
IfCondition3=mCPU_AV >= 100
IfTrueAction3=[!EnableMeasure mCPUAVWa][!SetOption CPUUsageCur FontColor #Color3##Alpha3#][!ShowMeter CPU_CAUTION_USAGE][!SetOption CPU_USAGE_AV_BAR TRI_AV "StrokeWidth 11 | Stroke Color #Color3##Alpha3# | StrokeEndCap Triangle | Rotate 90"][!UpdateMeterGroup CPU_AV][!Redraw]
OnChangeAction=[!SetOption mCPUUsageMIN Formula "(Min(mCPU_AV,mCPUUsageMIN))"][!SetOption mCPUUsageMAX Formula "(Max(mCPU_AV,mCPUUsageMAX))"]
[mCPUUsageMIN]
Measure=CALC
Formula=( Min ( mCPU_AV, 100 ))
OnChangeAction=[!SetOption CPUUsageMIN SolidColor "#Color3##Alpha2#"][!SetOption CPU_USAGE_AV_BAR TRIMIN "StrokeWidth 11 | Stroke Color #Color3##Alpha2# | StrokeStartCap Triangle | Rotate 90"][!UpdateMeterGroup CPU_AV][!Redraw][!Delay 400][!SetOption CPUUsageMIN SolidColor "#Color0##Alpha0#"][!SetOption CPU_USAGE_AV_BAR TRIMIN "StrokeWidth 11 | Stroke Color #Color8##Alpha2# | StrokeStartCap Triangle | Rotate 90"][!UpdateMeterGroup TEMP][!Redraw]
[mCPUUsageMAX]
Measure=CALC
Formula=( Max ( mCPU_AV, 0 ))
OnChangeAction=[!SetOption CPUUsageMAX SolidColor "#Color3##Alpha2#"][!SetOption CPU_USAGE_AV_BAR TRIMAX "StrokeWidth 11 | Stroke Color #Color3##Alpha2# | StrokeStartCap Triangle | Rotate 90"][!UpdateMeterGroup CPU_AV][!Redraw][!Delay 400][!SetOption CPUUsageMAX SolidColor "#Color0##Alpha0#"][!SetOption CPU_USAGE_AV_BAR TRIMAX "StrokeWidth 11 | Stroke Color #Color2##Alpha2# | StrokeStartCap Triangle | Rotate 90"][!UpdateMeterGroup CPU_AV][!Redraw]
[mCPUAVWa]
Measure=CALC
Formula=(1-mCPUAVWa)
Substitute="0":"0","1":"255"
Disabled=1
;==================================================
;=== CONTAINERS FOR CPU-METER =====================
;==================================================
[CONTAINER_CPU]
Meter=IMAGE
SolidColor=#Color1##Alpha3#
W=#W#
H=#H#
X=0
Y=0
UpdateDivider=-1
;==================================================
;=== BACKGROUND/GRAPHIC ELEM. & CPU VENDOR/MODEL ==
;==================================================
;=== MAIN BACKGROUND ==============================
[BG_MAIN]
Meter=IMAGE
MeterStyle=StBG_MAIN
X=0
Y=0
;=== BACKGROUND FRAME ELEMENTS ====================
[CPU_BG_FRAMES]
Meter=SHAPE
X=0
Y=0
Shape =Line 0 ,42 ,70 ,42 | StrokeWidth 1 | Stroke Color [mHWINFOCheck]
Shape2 =Line 0 ,100,70 ,100 | StrokeWidth 1 | Stroke Color [mTASKMGRCheck]
Shape3 =Line 210,263,590,263 | Extend LINE
Shape4 =Line 210,105,254,105 | Extend CPUS
Shape5 =Line 258,105,302,105 | Extend CPUN
Shape6 =Line 306,105,350,105 | Extend CPUO
Shape7 =Line 361,268,590,268 | StrokeWidth 1 | Stroke Color [mTASKMGRCheck]
Shape8 =Rectangle 361,269,229,41 | Extend BarBG
Shape9 =Line 361,311,590,311 | StrokeWidth 1 | Stroke Color [mTASKMGRCheck]
Shape10=Rectangle 90 ,60 ,109,238 | Extend Frame
Shape11=Rectangle 91 ,61 ,107,236 | Extend BarBG
CPUS =StrokeWidth 3 | Stroke Color #Color4##Alpha1#
CPUN =StrokeWidth 3 | Stroke Color #Color4##Alpha1#
CPUO =StrokeWidth 3 | Stroke Color #Color4##Alpha1#
LINE =StrokeWidth 1 | Stroke Color #Color9##Alpha1#
BarBG=StrokeWidth 0 | Fill Color #Color0##Alpha1#
Frame=StrokeWidth 2 | Stroke Color #Color4##Alpha3# | Fill Color #Color0##Alpha0#
UpdateDivider=1
DynamicVariables=1
CONTAINER=CONTAINER_CPU
;------------------------------------------------------------------------------------------------
;NOTICE: The Multiplier 0.92 is for MAX Average Usage 130%
; When your need more than 130%, you must change the Multiplier -> 0,92
;------------------------------------------------------------------------------------------------
[CPU_USAGE_AV_BAR]
Meter=SHAPE
X=390
Y=38
Shape =Rectangle 37 ,22 , 82 ,17 | Extend USAGBG
Shape2=Line 0 ,50 , 93 ,50 | Extend BAR_BG
Shape3=Line 93 ,50 , 119 ,50 | Extend BARTMA
Shape4=Line 0 ,50 ,(Round (0 + (0.92 * [mCPU_AV:0]))) ,50 | Extend BAR_AV
Shape5=Line (Round (0 + (0.92 * [mCPU_AV:0]))) ,43 ,(Round (1 + (0.92 * [mCPU_AV:0]))) ,43 | Extend TRI_AV
Shape6=Line (Round (0 + (0.92 * [mCPUUsageMIN:0]))),57 ,(Round (1 + (0.92 * [mCPUUsageMIN:0]))),57 | Extend TRIMIN
Shape7=Line (Round (0 + (0.92 * [mCPUUsageMAX:0]))),57 ,(Round (1 + (0.92 * [mCPUUsageMAX:0]))),57 | Extend TRIMAX
USAGBG=StrokeWidth 0 | Fill Color #Color1##Alpha1#
BAR_BG=StrokeWidth 10 | Stroke Color #Color4##Alpha2# | StrokeDashes 0.2,0.1
BARTMA=StrokeWidth 10 | Stroke Color #Color3##Alpha2# | StrokeDashes 0.2,0.1
BAR_AV=StrokeWidth 10 | Stroke Color #Color1##Alpha2# | StrokeDashes 0.2,0.1
TRI_AV=StrokeWidth 11 | Stroke Color #Color7##Alpha3# | StrokeEndCap Triangle | Rotate 90
TRIMIN=StrokeWidth 11 | Stroke Color #Color8##Alpha2# | StrokeStartCap Triangle | Rotate 90
TRIMAX=StrokeWidth 11 | Stroke Color #Color2##Alpha2# | StrokeStartCap Triangle | Rotate 90
UpdateDivider=1
DynamicVariables=1
CONTAINER=CONTAINER_CPU
Group=CPU_AV
;=== CPU/CCD CURRENT USAGE AVERAGE LABEL & STATS ==
[CPU_USAGE_AV_LABEL]
Meter=STRING
MeterStyle=StCPUUSAGEAVLABEL
X=-1r
Y=25r
[CPU_CAUTION_USAGE]
Meter=IMAGE
MeterStyle=StCPUCAUTIONUsage
X=-27r
Y=-3r
[CPUUsageCur]
Meter=STRING
MeterStyle=StCPUUsageCur
X=144r
Y=r
[CPUUsageMIN]
Meter=STRING
MeterStyle=StCPUUsageMIN
X=81r
Y=4r
[CPUUsageMAX]
Meter=STRING
MeterStyle=StCPUUsageMAX
X=r
Y=15r
In addition to the BAR width, I still have the problem that I ALWAYS remain at 0.00% for the min/max values. For all other values (Volt, Speed etc) it works.
Here is a screenshot of the (almost) finished skin. So that you can get an idea of the BARS (shapes) until I have uploaded the complete code/skin.
But now I'm going to bed ^.^;