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

CPU skin displays nonexistent Cores' loads

Get help with creating, editing & fixing problems with skins
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

CPU skin displays nonexistent Cores' loads

Post by pul53dr1v3r »

Hi all. Here is an issue with the CPU skin that shows loads for cores I don't have. As a matter of fact, it's showing the loads of Total CPU usage, as you can see in the video below. My CPU's got 2 Cores 4 Threads, the package's got skins for 2,4, etc Cores, but I simply want it not to display any activity for the Cores-Threads that doesn't exist, so that a user can take notice of wrong skin selection. In the video, Core 5,6,7 and 8 don't exist at all, but the Bar and percentage have been working showing the values of the Total CPU Usage.

Here is the code of the Total Core usage and Core # 1.

Code: Select all

[Rainmeter]
Update=1000


[Variables]
colorBar=255,140,0,200
barHeight=1
barWidth=90

;_______________________________________________________________Total
[TotalCPUUsageText]
Meter=STRING
X=10
Y=40
Text="Total:"
StringStyle=NORMAL
FontColor=255, 255, 255, 255
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUTotalBarGraphUsage]
Meter=BAR
MeasureName=MCLOADTOTAL
X=10
Y=52
W=190
H=#barHeight#
BarColor=[CPUBARWARNT]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[TotalCPUUsagePercent]
Meter=String
MeasureName=CPUPERCENTCALC
X=200
Y=40
FontColor=255, 255, 255
StringStyle=NORMAL
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

[MCLOADTOTAL]
Measure=CPU
Processor=0

[CPUPERCENTCALC]
Measure=Calc
Formula=MCLOADTOTAL * 1

[CPUBARWARNT]
Measure=Calc
Formula=CPUPERCENTCALC> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"


;_______________________________________________________________CORE1
[Core1UsageText]
Meter=STRING
X=15
Y=57
Text="Core1:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore1BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE1
X=50
Y=64
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN1]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[CPU1UsagePercent]
Meter=String
MeasureName=CPU1PercentCalc
X=200
Y=52
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

[MCLOADCORE1]
Measure=CPU
Processor=1

[CPU1PercentCalc]
Measure=Calc
Formula=MCLOADCORE1 * 1

[CPUBARWARN1]
Measure=Calc
Formula=CPU1PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

VIDEO Example of the issue:

https://youtu.be/4u9g7XlWdao
Last edited by pul53dr1v3r on October 9th, 2017, 11:14 am, edited 3 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CPU skin displays nonexistent Cores' loads

Post by balala »

For a such task, you have to read the number of cores / threads and show / hide the appropriate meters accordingly. Here is a description of how to do this: https://superuser.com/questions/226552/how-to-tell-how-many-cpus-cores-you-have-on-windows-7 (read the "You don't need other programs. Just run this in the command prompt" section).
So, add the following measure to your code:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=WMIC CPU Get NumberOfLogicalProcessors
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\n":"","NumberOfLogicalProcessors":""
IfCondition=([#CURRENTSECTION#]=1)
IfTrueAction=[!ShowMeter "Core1UsageText"][!ShowMeter "CPUCore1BarGraphUsage"][!ShowMeter "CPU1UsagePercent"][!HideMeter "Core2UsageText"][!HideMeter "CPUCore2BarGraphUsage"][!HideMeter "CPU2UsagePercent"][!HideMeter "Core3UsageText"][!HideMeter "CPUCore3BarGraphUsage"][!HideMeter "CPU3UsagePercent"][!HideMeter "Core4UsageText"][!HideMeter "CPUCore4BarGraphUsage"][!HideMeter "CPU4UsagePercent"][!HideMeter "Core5UsageText"][!HideMeter "CPUCore5BarGraphUsage"][!HideMeter "CPU5UsagePercent"][!HideMeter "Core6UsageText"][!HideMeter "CPUCore6BarGraphUsage"][!HideMeter "CPU6UsagePercent"][!HideMeter "Core7UsageText"][!HideMeter "CPUCore7BarGraphUsage"][!HideMeter "CPU7UsagePercent"][!HideMeter "Core8UsageText"][!HideMeter "CPUCore8BarGraphUsage"][!HideMeter "CPU8UsagePercent"]
IfCondition2=([#CURRENTSECTION#]=2)
IfTrueAction2=[!ShowMeter "Core1UsageText"][!ShowMeter "CPUCore1BarGraphUsage"][!ShowMeter "CPU1UsagePercent"][!ShowMeter "Core2UsageText"][!ShowMeter "CPUCore2BarGraphUsage"][!ShowMeter "CPU2UsagePercent"][!HideMeter "Core3UsageText"][!HideMeter "CPUCore3BarGraphUsage"][!HideMeter "CPU3UsagePercent"][!HideMeter "Core4UsageText"][!HideMeter "CPUCore4BarGraphUsage"][!HideMeter "CPU4UsagePercent"][!HideMeter "Core5UsageText"][!HideMeter "CPUCore5BarGraphUsage"][!HideMeter "CPU5UsagePercent"][!HideMeter "Core6UsageText"][!HideMeter "CPUCore6BarGraphUsage"][!HideMeter "CPU6UsagePercent"][!HideMeter "Core7UsageText"][!HideMeter "CPUCore7BarGraphUsage"][!HideMeter "CPU7UsagePercent"][!HideMeter "Core8UsageText"][!HideMeter "CPUCore8BarGraphUsage"][!HideMeter "CPU8UsagePercent"]
IfCondition3=([#CURRENTSECTION#]=4)
IfTrueAction3=[!ShowMeter "Core1UsageText"][!ShowMeter "CPUCore1BarGraphUsage"][!ShowMeter "CPU1UsagePercent"][!ShowMeter "Core2UsageText"][!ShowMeter "CPUCore2BarGraphUsage"][!ShowMeter "CPU2UsagePercent"][!ShowMeter "Core3UsageText"][!ShowMeter "CPUCore3BarGraphUsage"][!ShowMeter "CPU3UsagePercent"][!ShowMeter "Core4UsageText"][!ShowMeter "CPUCore4BarGraphUsage"][!ShowMeter "CPU4UsagePercent"][!HideMeter "Core5UsageText"][!HideMeter "CPUCore5BarGraphUsage"][!HideMeter "CPU5UsagePercent"][!HideMeter "Core6UsageText"][!HideMeter "CPUCore6BarGraphUsage"][!HideMeter "CPU6UsagePercent"][!HideMeter "Core7UsageText"][!HideMeter "CPUCore7BarGraphUsage"][!HideMeter "CPU7UsagePercent"][!HideMeter "Core8UsageText"][!HideMeter "CPUCore8BarGraphUsage"][!HideMeter "CPU8UsagePercent"]
IfCondition4=([#CURRENTSECTION#]=6)
IfTrueAction4=[!ShowMeter "Core1UsageText"][!ShowMeter "CPUCore1BarGraphUsage"][!ShowMeter "CPU1UsagePercent"][!ShowMeter "Core2UsageText"][!ShowMeter "CPUCore2BarGraphUsage"][!ShowMeter "CPU2UsagePercent"][!ShowMeter "Core3UsageText"][!ShowMeter "CPUCore3BarGraphUsage"][!ShowMeter "CPU3UsagePercent"][!ShowMeter "Core4UsageText"][!ShowMeter "CPUCore4BarGraphUsage"][!ShowMeter "CPU4UsagePercent"][!ShowMeter "Core5UsageText"][!ShowMeter "CPUCore5BarGraphUsage"][!ShowMeter "CPU5UsagePercent"][!ShowMeter "Core6UsageText"][!ShowMeter "CPUCore6BarGraphUsage"][!ShowMeter "CPU6UsagePercent"][!HideMeter "Core7UsageText"][!HideMeter "CPUCore7BarGraphUsage"][!HideMeter "CPU7UsagePercent"][!HideMeter "Core8UsageText"][!HideMeter "CPUCore8BarGraphUsage"][!HideMeter "CPU8UsagePercent"]
IfCondition5=([#CURRENTSECTION#]=8)
IfTrueAction5=[!ShowMeter "Core1UsageText"][!ShowMeter "CPUCore1BarGraphUsage"][!ShowMeter "CPU1UsagePercent"][!ShowMeter "Core2UsageText"][!ShowMeter "CPUCore2BarGraphUsage"][!ShowMeter "CPU2UsagePercent"][!ShowMeter "Core3UsageText"][!ShowMeter "CPUCore3BarGraphUsage"][!ShowMeter "CPU3UsagePercent"][!ShowMeter "Core4UsageText"][!ShowMeter "CPUCore4BarGraphUsage"][!ShowMeter "CPU4UsagePercent"][!ShowMeter "Core5UsageText"][!ShowMeter "CPUCore5BarGraphUsage"][!ShowMeter "CPU5UsagePercent"][!ShowMeter "Core6UsageText"][!ShowMeter "CPUCore6BarGraphUsage"][!ShowMeter "CPU6UsagePercent"][!ShowMeter "Core7UsageText"][!ShowMeter "CPUCore7BarGraphUsage"][!ShowMeter "CPU7UsagePercent"][!ShowMeter "Core8UsageText"][!ShowMeter "CPUCore8BarGraphUsage"][!ShowMeter "CPU8UsagePercent"]
DynamicVariables=1
The Parameter option of this measure will read the number of cores, returning the appropriate number. The IfCondition / IfTrueAction options will show / hide the appropriate number of meters.
As you didn't post the whole code of your skin (which would have been a good idea!) I just concluded how the appropriate meters are named. If I was wrong, you have to change their names accordingly.
This Plugin measure has to be run only once, when the skin is loaded. To do this, you also have to add the following option to the [Rainmeter] section: OnRefreshAction=[!CommandMeasure "MeasureRun" "Run"].
Another good idea would be to create groups of meters, one for each core. This would shorten the above IfTrueAction options. Let me know if you don1t know how to do this, but in this case also post please the whole code.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: CPU skin displays nonexistent Cores' loads

Post by pul53dr1v3r »

Before I try it, here is the whole code:

Edit: just to say that I've made separate skins for 2,4,6,8... cores. This one is with 8 Core. Generally, the method you have posted is a much better option, but have to make the skin to auto-resize depending of the number of the cores. I could do with your help about grouping as well, if you have time.

Code: Select all

;READ THE [Variables] SECTION BELOW FOR SETUP INFORMATION

[Rainmeter]
AppVersion=v1.1
Update=1000

Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,15

[Variables]

;CPU Name or Title for widget/gadget
CPUName=cpu-ram


FontFace=Trebuchet MS
textSize=8
colorBar=255,140,0,200
colorText=255,255,255,205

barHeight=1
barWidth=90

;=========================
;CPU AND RAM INFO
;=========================
[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#FontFace#
FontSize=10
AntiAlias=1
ClipString=1

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text="#CPUNAME#"


;___________________________________________________________________CPU TEMP
[CPUTotalTemp]
Meter=STRING
x=100
Y=40
W=1
H=1
MeasureName=MCPUTemp
Text="%1°C"
FontColor=[MCPUTempCalc]
StringStyle=BOLD
FontSize=8
NumofDecimals=0
FontFace=#FontFace#
StringAlign=CENTER
AntiAlias=1
DynamicVariables=1

[MCPUTemp]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.TCPU

[MCPUTempCalc]
Measure=Calc
Formula=MCPUTemp< 25 ? -1 : (MCPUTemp < 40 ? -2 : (MCPUTemp < 50 ? -3 : (MCPUTemp < 60 ? -4 : -5)))
Substitute="-1":"255,255,255","-2":"255,255,102","-3":"255,153,51","-4":"255,0,0","-5":"204,0,0"




;___________________________________________________________________CPU USAGE
[TotalCPUUsageText]
Meter=STRING
X=10
Y=40
Text="Total:"
StringStyle=NORMAL
FontColor=255, 255, 255, 255
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUTotalBarGraphUsage]
Meter=BAR
MeasureName=MCLOADTOTAL
X=10
Y=52
W=190
H=#barHeight#
BarColor=[CPUBARWARNT]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[TotalCPUUsagePercent]
Meter=String
MeasureName=CPUPERCENTCALC
X=200
Y=40
FontColor=255, 255, 255
StringStyle=NORMAL
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 1 INFO]

[Core1UsageText]
Meter=STRING
X=15
Y=57
Text="Core1:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore1BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE1
X=50
Y=64
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN1]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[CPU1UsagePercent]
Meter=String
MeasureName=CPU1PercentCalc
X=200
Y=52
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 2 INFO]

[Core2UsageText]
Meter=STRING
X=15
Y=([Core1UsageText:Y]+12)
Text="Core2:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore2BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE2
X=50
Y=([CPUCore1BarGraphUsage:Y]+12)
W=150
w=#barWidth#
h=#barHeight#
BarColor=[CPUBARWARN2]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1


[CPU2UsagePercent]
Meter=String
MeasureName=CPU2PERCENTCALC
X=200
Y=([CPU1UsagePercent:Y] + 12)
FontColor=255, 255, 255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"


;[CPU CORE 3 INFO]

[Core3UsageText]
Meter=STRING
X=15
Y=([Core2UsageText:Y]+12)
Text="Core3:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore3BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE3
X=50
Y=([CPUCore2BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN3]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[CPU3UsagePercent]
Meter=String
MeasureName=CPU3PercentCalc
X=200
Y=([CPU2UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 4 INFO]

[Core4UsageText]
Meter=STRING
X=15
Y=([Core3UsageText:Y]+12)
Text="Core4:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore4BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE4
X=50
Y=([CPUCore3BarGraphUsage:Y]+12)
W=150
w=#barWidth#
h=#barHeight#
BarColor=[CPUBARWARN4]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1


[CPU4UsagePercent]
Meter=String
MeasureName=CPU4PERCENTCALC
X=200
Y=([CPU3UsagePercent:Y] + 12)
FontColor=255, 255, 255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 5 INFO]

[Core5UsageText]
Meter=STRING
X=15
Y=([Core4UsageText:Y]+12)
Text="Core5:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore5BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE5
X=50
Y=([CPUCore4BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN5]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[CPU5UsagePercent]
Meter=String
MeasureName=CPU5PercentCalc
X=200
Y=([CPU4UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 6 INFO]

[Core6UsageText]
Meter=STRING
X=15
Y=([Core5UsageText:Y]+12)
Text="Core6:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore6BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE6
X=50
Y=([CPUCore5BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN6]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[CPU6UsagePercent]
Meter=String
MeasureName=CPU6PercentCalc
X=200
Y=([CPU5UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 7 INFO]

[Core7UsageText]
Meter=STRING
X=15
Y=([Core6UsageText:Y]+12)
Text="Core7:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore7BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE7
X=50
Y=([CPUCore6BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN7]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[CPU7UsagePercent]
Meter=String
MeasureName=CPU7PercentCalc
X=200
Y=([CPU6UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 8 INFO]

[Core8UsageText]
Meter=STRING
X=15
Y=([Core7UsageText:Y]+12)
Text="Core8:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUCore8BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE8
X=50
Y=([CPUCore7BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN8]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[CPU8UsagePercent]
Meter=String
MeasureName=CPU8PercentCalc
X=200
Y=([CPU7UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;Total CPU Usage Measures
[MCLOADTOTAL]
Measure=CPU
Processor=0

[CPUPERCENTCALC]
Measure=Calc
Formula=MCLOADTOTAL * 1

;Individual Core Measures
[MCLOADCORE1]
Measure=CPU
Processor=1

[CPU1PercentCalc]
Measure=Calc
Formula=MCLOADCORE1 * 1

[MCLOADCORE2]
Measure=CPU
Processor=2

[CPU2PercentCalc]
Measure=Calc
Formula=MCLOADCORE2 * 1

[MCLOADCORE3]
Measure=CPU
Processor=3

[CPU3PercentCalc]
Measure=Calc
Formula=MCLOADCORE3 * 1

[MCLOADCORE4]
Measure=CPU
Processor=4

[CPU4PercentCalc]
Measure=Calc
Formula=MCLOADCORE4 * 1

[MCLOADCORE5]
Measure=CPU
Processor=5

[CPU5PercentCalc]
Measure=Calc
Formula=MCLOADCORE5 * 1

[MCLOADCORE6]
Measure=CPU
Processor=6

[CPU6PercentCalc]
Measure=Calc
Formula=MCLOADCORE6 * 1

[MCLOADCORE7]
Measure=CPU
Processor=7

[CPU7PercentCalc]
Measure=Calc
Formula=MCLOADCORE7 * 1

[MCLOADCORE8]
Measure=CPU
Processor=8

[CPU8PercentCalc]
Measure=Calc
Formula=MCLOADCORE8 * 1

;_________________CPU USAGE BAR WARN
[CPUBARWARNT]
Measure=Calc
Formula=CPUPERCENTCALC> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN1]
Measure=Calc
Formula=CPU1PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN2]
Measure=Calc
Formula=CPU2PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN3]
Measure=Calc
Formula=CPU3PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN4]
Measure=Calc
Formula=CPU4PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN5]
Measure=Calc
Formula=CPU5PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN6]
Measure=Calc
Formula=CPU6PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN7]
Measure=Calc
Formula=CPU7PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN8]
Measure=Calc
Formula=CPU8PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

;___________________________________________________________________CPU CLOCK
[MCLOCK]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.SCPUCLK

[MeterMHz]
Meter=STRING
MeasureName=MCLOCK
X=10
Y=([Core8UsageText:Y])+14 
FontColor=255,255,255,170
FontSize=8
StringStyle=NORMAL
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Text="CLOCK: %1 MHz"


;___________________________________________________________________CPU FAN RPM
[CPUFanText]
Meter=STRING
MeasureName=cpufan0
X=200
Y=r
Text="FAN: %1rpm"
StringStyle=NORMAL
FontColor=255, 255, 255,170
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1

[CPUFAN0]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.FCPU


;____________________________________________________________________RAM
[MeasureRAMTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=600

[MeasureRAMUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasureRAMFree]
Measure=PhysicalMemory
InvertMeasure=1


[RAMUsageLabel]
Meter=String
x=10
y=20r
Text="RAM:"
StringStyle=NORMAL
FontColor=255, 255, 255, 255
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[RAMUsage]
Meter=BAR
MeasureName=MeasureRAMUsed
X=10
Y=-1R
W=190
w=#barWidth#
H=#barHeight#
BarColor=[RAMWarn]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1

[RAMUsedGB]
Meter=STRING
StringStyle=Normal
X=95
Y=[RAMUsageLabel:y]
W=1
H=1
MeasureName=MeasureRAMTotal
MeasureName2=MeasureRAMUsed
MeasureName3=MeasureRAMFree
Text="%2B/%1B"
FontColor=255, 255, 255, 100
FontSize=8
StringAlign=Center
NumofDecimals=1
FontFace=#FontFace#
AntiAlias=1
Autoscale=1
UpdateDivider=2

[RAMUsagePercent]
Meter=STRING
MeasureName=MeasureRAMUsed
X=200
Y=r
W=145
H=14
StringAlign=RIGHT
FontFace=#FontFace#
FontColor=#colorText#
FontSize=8
StringStyle=BOLD
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Percentual=1
UpdateDivider=2


;____________________________________________________________________RAM Warning
[measureRAMGBCalc]
Measure=Calc
Formula=MeasureRAMUsed * 100 / MeasureRAMTotal

[measureRAMGBCalc2]
Measure=Calc
Formula=measureRAMGBCalc
MinValue=0
MaxValue=100
Percentual=1

[RAMWarn]
Measure=Calc
Formula=measureRAMGBCalc2> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CPU skin displays nonexistent Cores' loads

Post by balala »

Pul53dr1v3r wrote:Generally, the method you have posted is a much better option, but have to make the skin to auto-resize depending of the number of the cores. I could do with your help about grouping as well, if you have time.
I've created some groups of meters and named them Core1, Core2 and so on, up to Core8.
(Eg, [Core1UsageText], [CPUCore1BarGraphUsage] and [CPU1UsagePercent] belong to Core1 group, [Core2UsageText], [CPUCore2BarGraphUsage] and [CPU2UsagePercent] to Core2 and so on). Now it's much easier to show or hide these meters, because we can do this by groups.
I also made a few more small changes. The new code uses the same background and resizes it accordingly to the number of cores.

Code: Select all

;READ THE [Variables] SECTION BELOW FOR SETUP INFORMATION

[Rainmeter]
AppVersion=v1.1
Update=1000
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,15

[Variables]
;CPU Name or Title for widget/gadget
CPUName=cpu-ram
FontFace=Trebuchet MS
textSize=8
colorBar=255,140,0,200
colorText=255,255,255,205
barHeight=1
barWidth=90

;=========================
;CPU AND RAM INFO
;=========================

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

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text="#CPUNAME#"

;___________________________________________________________________CPU TEMP

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=WMIC CPU Get NumberOfLogicalProcessors
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\n":"","NumberOfLogicalProcessors":""
IfCondition=([#CURRENTSECTION#]=1)
IfTrueAction=[!ShowMeterGroup "Core1"][!HideMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition2=([#CURRENTSECTION#]=2)
IfTrueAction2=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition3=([#CURRENTSECTION#]=4)
IfTrueAction3=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition4=([#CURRENTSECTION#]=6)
IfTrueAction4=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition5=([#CURRENTSECTION#]=8)
IfTrueAction5=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!ShowMeterGroup "Core7"][!ShowMeterGroup "Core8"]
DynamicVariables=1

[CPUTotalTemp]
Meter=STRING
x=100
Y=40
W=1
H=1
MeasureName=MCPUTemp
Text="%1°C"
FontColor=[MCPUTempCalc]
StringStyle=BOLD
FontSize=8
NumofDecimals=0
FontFace=#FontFace#
StringAlign=CENTER
AntiAlias=1
DynamicVariables=1

[MCPUTemp]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.TCPU

[MCPUTempCalc]
Measure=Calc
Formula=MCPUTemp< 25 ? -1 : (MCPUTemp < 40 ? -2 : (MCPUTemp < 50 ? -3 : (MCPUTemp < 60 ? -4 : -5)))
Substitute="-1":"255,255,255","-2":"255,255,102","-3":"255,153,51","-4":"255,0,0","-5":"204,0,0"

;___________________________________________________________________CPU USAGE

[TotalCPUUsageText]
Meter=STRING
X=10
Y=40
Text="Total:"
StringStyle=NORMAL
FontColor=255, 255, 255, 255
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[CPUTotalBarGraphUsage]
Meter=BAR
MeasureName=MCLOADTOTAL
X=10
Y=52
W=190
H=#barHeight#
BarColor=[CPUBARWARNT]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1

[TotalCPUUsagePercent]
Meter=String
MeasureName=CPUPERCENTCALC
X=200
Y=40
FontColor=255, 255, 255
StringStyle=NORMAL
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1
NumofDecimals=1
Text="[%1%]"

;[CPU CORE 1 INFO]

[Core1UsageText]
Meter=STRING
X=15
Y=57
Text="Core1:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core1

[CPUCore1BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE1
X=50
Y=64
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN1]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core1

[CPU1UsagePercent]
Meter=String
MeasureName=CPU1PercentCalc
X=200
Y=52
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core1

;[CPU CORE 2 INFO]

[Core2UsageText]
Meter=STRING
X=15
Y=([Core1UsageText:Y]+12)
Text="Core2:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core2

[CPUCore2BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE2
X=50
Y=([CPUCore1BarGraphUsage:Y]+12)
W=150
w=#barWidth#
h=#barHeight#
BarColor=[CPUBARWARN2]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core2

[CPU2UsagePercent]
Meter=String
MeasureName=CPU2PERCENTCALC
X=200
Y=([CPU1UsagePercent:Y] + 12)
FontColor=255, 255, 255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core2

;[CPU CORE 3 INFO]

[Core3UsageText]
Meter=STRING
X=15
Y=([Core2UsageText:Y]+12)
Text="Core3:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core3

[CPUCore3BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE3
X=50
Y=([CPUCore2BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN3]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core3

[CPU3UsagePercent]
Meter=String
MeasureName=CPU3PercentCalc
X=200
Y=([CPU2UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core3

;[CPU CORE 4 INFO]

[Core4UsageText]
Meter=STRING
X=15
Y=([Core3UsageText:Y]+12)
Text="Core4:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core4

[CPUCore4BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE4
X=50
Y=([CPUCore3BarGraphUsage:Y]+12)
W=150
w=#barWidth#
h=#barHeight#
BarColor=[CPUBARWARN4]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core4

[CPU4UsagePercent]
Meter=String
MeasureName=CPU4PERCENTCALC
X=200
Y=([CPU3UsagePercent:Y] + 12)
FontColor=255, 255, 255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core4

;[CPU CORE 5 INFO]

[Core5UsageText]
Meter=STRING
X=15
Y=([Core4UsageText:Y]+12)
Text="Core5:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core5

[CPUCore5BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE5
X=50
Y=([CPUCore4BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN5]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core5

[CPU5UsagePercent]
Meter=String
MeasureName=CPU5PercentCalc
X=200
Y=([CPU4UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core5

;[CPU CORE 6 INFO]

[Core6UsageText]
Meter=STRING
X=15
Y=([Core5UsageText:Y]+12)
Text="Core6:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core6

[CPUCore6BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE6
X=50
Y=([CPUCore5BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN6]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core6

[CPU6UsagePercent]
Meter=String
MeasureName=CPU6PercentCalc
X=200
Y=([CPU5UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core6

;[CPU CORE 7 INFO]

[Core7UsageText]
Meter=STRING
X=15
Y=([Core6UsageText:Y]+12)
Text="Core7:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core7

[CPUCore7BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE7
X=50
Y=([CPUCore6BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN7]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core7

[CPU7UsagePercent]
Meter=String
MeasureName=CPU7PercentCalc
X=200
Y=([CPU6UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core7

;[CPU CORE 8 INFO]

[Core8UsageText]
Meter=STRING
X=15
Y=([Core7UsageText:Y]+12)
Text="Core8:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core8

[CPUCore8BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE8
X=50
Y=([CPUCore7BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN8]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core8

[CPU8UsagePercent]
Meter=String
MeasureName=CPU8PercentCalc
X=200
Y=([CPU7UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core8

;Total CPU Usage Measures
[MCLOADTOTAL]
Measure=CPU
Processor=0

[CPUPERCENTCALC]
Measure=Calc
Formula=MCLOADTOTAL * 1

;Individual Core Measures
[MCLOADCORE1]
Measure=CPU
Processor=1

[CPU1PercentCalc]
Measure=Calc
Formula=MCLOADCORE1 * 1

[MCLOADCORE2]
Measure=CPU
Processor=2

[CPU2PercentCalc]
Measure=Calc
Formula=MCLOADCORE2 * 1

[MCLOADCORE3]
Measure=CPU
Processor=3

[CPU3PercentCalc]
Measure=Calc
Formula=MCLOADCORE3 * 1

[MCLOADCORE4]
Measure=CPU
Processor=4

[CPU4PercentCalc]
Measure=Calc
Formula=MCLOADCORE4 * 1

[MCLOADCORE5]
Measure=CPU
Processor=5

[CPU5PercentCalc]
Measure=Calc
Formula=MCLOADCORE5 * 1

[MCLOADCORE6]
Measure=CPU
Processor=6

[CPU6PercentCalc]
Measure=Calc
Formula=MCLOADCORE6 * 1

[MCLOADCORE7]
Measure=CPU
Processor=7

[CPU7PercentCalc]
Measure=Calc
Formula=MCLOADCORE7 * 1

[MCLOADCORE8]
Measure=CPU
Processor=8

[CPU8PercentCalc]
Measure=Calc
Formula=MCLOADCORE8 * 1

;_________________CPU USAGE BAR WARN

[CPUBARWARNT]
Measure=Calc
Formula=CPUPERCENTCALC> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN1]
Measure=Calc
Formula=CPU1PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN2]
Measure=Calc
Formula=CPU2PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN3]
Measure=Calc
Formula=CPU3PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN4]
Measure=Calc
Formula=CPU4PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN5]
Measure=Calc
Formula=CPU5PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN6]
Measure=Calc
Formula=CPU6PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN7]
Measure=Calc
Formula=CPU7PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

[CPUBARWARN8]
Measure=Calc
Formula=CPU8PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"

;___________________________________________________________________CPU CLOCK

[MCLOCK]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.SCPUCLK

[MeasureNumCores]
Measure=Calc
Formula=[MeasureRun]
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!SetOption MeterMHz Y "([Core1UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition2=(#CURRENTSECTION#=2)
IfTrueAction2=[!SetOption MeterMHz Y "([Core2UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition3=(#CURRENTSECTION#=4)
IfTrueAction3=[!SetOption MeterMHz Y "([Core4UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition4=(#CURRENTSECTION#=6)
IfTrueAction4=[!SetOption MeterMHz Y "([Core6UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition5=(#CURRENTSECTION#=8)
IfTrueAction5=[!SetOption MeterMHz Y "([Core8UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
DynamicVariables=1

[MeterMHz]
Meter=STRING
MeasureName=MCLOCK
X=10
;Y=([Core8UsageText:Y])+14
FontColor=255,255,255,170
FontSize=8
StringStyle=NORMAL
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Text="CLOCK: %1 MHz"

;___________________________________________________________________CPU FAN RPM

[CPUFanText]
Meter=STRING
MeasureName=cpufan0
X=200
Y=r
Text="FAN: %1rpm"
StringStyle=NORMAL
FontColor=255, 255, 255,170
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1

[CPUFAN0]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.FCPU

;____________________________________________________________________RAM

[MeasureRAMTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=600

[MeasureRAMUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasureRAMFree]
Measure=PhysicalMemory
InvertMeasure=1

[RAMUsageLabel]
Meter=String
x=10
y=20r
Text="RAM:"
StringStyle=NORMAL
FontColor=255, 255, 255, 255
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[RAMUsage]
Meter=BAR
MeasureName=MeasureRAMUsed
X=10
Y=-1R
W=190
w=#barWidth#
H=#barHeight#
BarColor=[RAMWarn]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1

[RAMUsedGB]
Meter=STRING
StringStyle=Normal
X=95
Y=[RAMUsageLabel:y]
W=1
H=1
MeasureName=MeasureRAMTotal
MeasureName2=MeasureRAMUsed
MeasureName3=MeasureRAMFree
Text="%2B/%1B"
FontColor=255, 255, 255, 100
FontSize=8
StringAlign=Center
NumofDecimals=1
FontFace=#FontFace#
AntiAlias=1
Autoscale=1
UpdateDivider=2
DynamicVariables=1

[RAMUsagePercent]
Meter=STRING
MeasureName=MeasureRAMUsed
X=200
Y=r
W=145
H=14
StringAlign=RIGHT
FontFace=#FontFace#
FontColor=#colorText#
FontSize=8
StringStyle=BOLD
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Percentual=1
UpdateDivider=2

;____________________________________________________________________RAM Warning

[measureRAMGBCalc]
Measure=Calc
Formula=MeasureRAMUsed * 100 / MeasureRAMTotal

[measureRAMGBCalc2]
Measure=Calc
Formula=measureRAMGBCalc
MinValue=0
MaxValue=100
Percentual=1

[RAMWarn]
Measure=Calc
Formula=measureRAMGBCalc2> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
Be careful that you've forgot to add a DynamicVariables=1 option to the [RAMUsedGB] meter. This meter uses a section variable (in its Y option) and because the option is missing, the meter is not placed properly. I fixed this issue.
Please check the above code and let me know what you think about it.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: CPU skin displays nonexistent Cores' loads

Post by pul53dr1v3r »

got you, but sth is wrong with the code. Just tried it and here is how it looks like:

https://ibb.co/c7M8KQ

The part of code you posted yesterday working well as far as Core hidding is concerned.
EDIT: Solved. Testing....
User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CPU skin displays nonexistent Cores' loads

Post by balala »

Pul53dr1v3r wrote:got you, but sth is wrong with the code.
Yeah, you're right. When I worked with the code finally I messed up something. The only missing option belongs to the [Rainmeter] section. Add there the OnRefreshAction=[!CommandMeasure "MeasureRun" "Run"] option and refresh.
Sorry...
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: CPU skin displays nonexistent Cores' loads

Post by pul53dr1v3r »

tested again with a single core CPU and the bottom space of the skin still won't fit. If I see well, there is not any high H measure to cause it.

https://ibb.co/jpvo3k
User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CPU skin displays nonexistent Cores' loads

Post by balala »

Pul53dr1v3r wrote:tested again with a single core CPU and the bottom space of the skin still won't fit. If I see well, there is not any high H measure to cause it.

https://ibb.co/jpvo3k
Ok, but for more cores does it fit well?
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: CPU skin displays nonexistent Cores' loads

Post by pul53dr1v3r »

not for 2. The bottom free space of the skin is even little bit longer for 4 core version than before(for 1-2mm).

2 Core:
https://ibb.co/dmQub5

4Core:
https://ibb.co/eyASw5

Compared height of the bottom part of the skin between bottom edge and RAm Bar(left skin is from yday, right is with the latest code):
https://ibb.co/f7xJ3k

The bottom edges of the skin are alligned.
User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: CPU skin displays nonexistent Cores' loads

Post by balala »

The problem is caused by the fact that even if hidden, the meters of all cores are in their own location, so they need place where to sit. You have to move the hidden meters, do don't take space. For this have to set the positions of those meters according to existing the number of cores. Replace the IfTrueAction options of the [MeasureRun] measure, as it follows:

Code: Select all

[MeasureRun]
...
IfCondition=([#CURRENTSECTION#]=1)
IfTrueAction=[!ShowMeterGroup "Core1"][!HideMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOptionGroup Core2 Y "0"][!SetOptionGroup Core3 Y "0"][!SetOptionGroup Core4 Y "0"][!SetOptionGroup Core5 Y "0"][!SetOptionGroup Core6 Y "0"][!SetOptionGroup Core7 Y "0"][!SetOptionGroup Core8 Y "0"]
IfCondition2=([#CURRENTSECTION#]=2)
IfTrueAction2=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOptionGroup Core3 Y "0"][!SetOptionGroup Core4 Y "0"][!SetOptionGroup Core5 Y "0"][!SetOptionGroup Core6 Y "0"][!SetOptionGroup Core7 Y "0"][!SetOptionGroup Core8 Y "0"]
IfCondition3=([#CURRENTSECTION#]=4)
IfTrueAction3=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOptionGroup Core5 Y "0"][!SetOptionGroup Core6 Y "0"][!SetOptionGroup Core7 Y "0"][!SetOptionGroup Core8 Y "0"]
IfCondition4=([#CURRENTSECTION#]=6)
IfTrueAction4=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOptionGroup Core7 Y "0"][!SetOptionGroup Core8 Y "0"]
IfCondition5=([#CURRENTSECTION#]=8)
IfTrueAction5=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!ShowMeterGroup "Core7"][!ShowMeterGroup "Core8"]
Leave untouched all other options of the measure.