Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 871

Help: Rainmeter Skins • Variable CPU data but fixed BAR width ... and a 2nd problem

$
0
0
I have such a small? (mathematical) problem with my new CPU skin, and I need your expertise again.

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:

[Rainmeter]Update=500AccurateText=1;==================================================;=== VARIABLES & STYLES ===========================;==================================================[VARIABLES];==================================================;=== VARIABLES FONTFACE - SIZE - COLORS ===========;==================================================Images1=#@#images\Images2=#@#Images\apps\FontFace=Courier Prime SansFontWeight=700MinMaxWidth=55W=635H=320FS1=16FS2=14FS3=10FS4=8Alpha0=1Alpha1=70Alpha2=130Alpha3=255Color0=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=90TDP=105BaseClock=3800BoostClock=4700;--- STYLES CPU GRAPHICS/LABELS/WARNING ETC -------[StCPU_BG]ImageName=#Images1#bg_cpu.pngImageAlpha=#Alpha3#AntiAlias=1UpdateDivider=-1Container=CONTAINER_CPUW=140H=140;--- STYLES CURRENT CPU USAGE (Average) -----------[StCPUUSAGEAVLABEL]Padding=-1,-5,-1,-9SolidColor=#Color0##Alpha0#FontColor=#Color7##Alpha3#FontFace=#FontFace#StringAlign=LEFTStringCase=UPPERFontWeight=#FontWeight#FontSize=#FS2#Text=CDUAntiAlias=1UpdateDivider=-1Container=CONTAINER_CPU[StCPUCAUTIONUsage]ImageName=#Images1#caution.pngImageAlpha=[mCPUAVWa]ImageTint=#Color3##Alpha3#AntiAlias=1UpdateDivider=1DynamicVariables=1CONTAINER=CONTAINER_CPUW=20H=18[StCPUUsageCur]Padding=-1,-2,-1,-6SolidColor=#Color0##Alpha0#FontColor=#Color7##Alpha3#FontFace=#FontFace#StringAlign=RIGHTFontSize=#FS2#Text=[mCPU_AV:2]%AntiAlias=1DynamicVariables=1CONTAINER=CONTAINER_CPUGroup=CPU_AV[StCPUUsageMIN]Padding=1,-3,1,-5SolidColor=#Color0##Alpha0#FontColor=#Color8##Alpha3#FontFace=#FontFace#StringAlign=RIGHTFontSize=#FS3#Text=[mCPUUsageMIN:2]%AntiAlias=1DynamicVariables=1W=#MinMaxWidth#Container=CONTAINER_CPUGroup=CPU_AV[StCPUUsageMAX]Padding=1,-3,1,-5SolidColor=#Color0##Alpha0#FontColor=#Color2##Alpha3#FontFace=#FontFace#StringAlign=RIGHTFontSize=#FS3#Text=[mCPUUsageMAX:2]%AntiAlias=1DynamicVariables=1W=#MinMaxWidth#Container=CONTAINER_CPUGroup=CPU_AV;=== MEASURES CPU-AVERAGE =========================[mCPU_AV]Measure=PLUGINPlugin=UsageMonitorCategory="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 >= 100IfTrueAction3=[!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=CALCFormula=( 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=CALCFormula=( 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=CALCFormula=(1-mCPUAVWa)Substitute="0":"0","1":"255"Disabled=1;==================================================;=== CONTAINERS FOR CPU-METER =====================;==================================================[CONTAINER_CPU]Meter=IMAGESolidColor=#Color1##Alpha3#W=#W#H=#H#X=0Y=0UpdateDivider=-1;==================================================;=== BACKGROUND/GRAPHIC ELEM. & CPU VENDOR/MODEL ==;==================================================;=== MAIN BACKGROUND ==============================[BG_MAIN]Meter=IMAGEMeterStyle=StBG_MAINX=0Y=0;=== BACKGROUND FRAME ELEMENTS ====================[CPU_BG_FRAMES]Meter=SHAPEX=0Y=0Shape  =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 LINEShape4 =Line      210,105,254,105 | Extend CPUSShape5 =Line      258,105,302,105 | Extend CPUNShape6 =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 BarBGShape9 =Line      361,311,590,311 | StrokeWidth 1 | Stroke Color [mTASKMGRCheck]Shape10=Rectangle 90 ,60 ,109,238 | Extend FrameShape11=Rectangle 91 ,61 ,107,236 | Extend BarBGCPUS =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=1DynamicVariables=1CONTAINER=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=SHAPEX=390Y=38Shape =Rectangle  37                                    ,22 , 82                                    ,17 | Extend USAGBG Shape2=Line       0                                     ,50 , 93                                    ,50 | Extend BAR_BGShape3=Line       93                                    ,50 , 119                                   ,50 | Extend BARTMAShape4=Line       0                                     ,50 ,(Round (0 + (0.92 * [mCPU_AV:0])))     ,50 | Extend BAR_AVShape5=Line      (Round (0 + (0.92 * [mCPU_AV:0])))     ,43 ,(Round (1 + (0.92 * [mCPU_AV:0])))     ,43 | Extend TRI_AVShape6=Line      (Round (0 + (0.92 * [mCPUUsageMIN:0]))),57 ,(Round (1 + (0.92 * [mCPUUsageMIN:0]))),57 | Extend TRIMINShape7=Line      (Round (0 + (0.92 * [mCPUUsageMAX:0]))),57 ,(Round (1 + (0.92 * [mCPUUsageMAX:0]))),57 | Extend TRIMAXUSAGBG=StrokeWidth 0  | Fill   Color #Color1##Alpha1#BAR_BG=StrokeWidth 10 | Stroke Color #Color4##Alpha2# | StrokeDashes 0.2,0.1BARTMA=StrokeWidth 10 | Stroke Color #Color3##Alpha2# | StrokeDashes 0.2,0.1BAR_AV=StrokeWidth 10 | Stroke Color #Color1##Alpha2# | StrokeDashes 0.2,0.1TRI_AV=StrokeWidth 11 | Stroke Color #Color7##Alpha3# | StrokeEndCap   Triangle | Rotate 90TRIMIN=StrokeWidth 11 | Stroke Color #Color8##Alpha2# | StrokeStartCap Triangle | Rotate 90TRIMAX=StrokeWidth 11 | Stroke Color #Color2##Alpha2# | StrokeStartCap Triangle | Rotate 90UpdateDivider=1DynamicVariables=1CONTAINER=CONTAINER_CPUGroup=CPU_AV;=== CPU/CCD CURRENT USAGE AVERAGE LABEL & STATS ==[CPU_USAGE_AV_LABEL]Meter=STRINGMeterStyle=StCPUUSAGEAVLABELX=-1rY=25r[CPU_CAUTION_USAGE]Meter=IMAGEMeterStyle=StCPUCAUTIONUsageX=-27rY=-3r[CPUUsageCur]Meter=STRINGMeterStyle=StCPUUsageCurX=144rY=r[CPUUsageMIN]Meter=STRINGMeterStyle=StCPUUsageMINX=81rY=4r[CPUUsageMAX]Meter=STRINGMeterStyle=StCPUUsageMAXX=rY=15r
So I hope I have copied in all the parts for the "Usage Average" part.
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 ^.^;
Ryzen-CPU-Meter_Youkai1977_2024.png

Statistics: Posted by Youkai1977 — Yesterday, 11:33 pm — Replies 0 — Views 43



Viewing all articles
Browse latest Browse all 871

Trending Articles