It is currently April 24th, 2024, 5:45 pm

Rainmeter 4: how to show all cores plus HT?

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter 4: how to show all cores plus HT?

Post by balala »

Take a look at the following code:

Code: Select all

; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Author=poiru
AppVersion=2003000
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
; Contains basic information of the skin.
Description=Displays basic system stats.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
Color1=255,242,0
Color2=0,211,122
Color3=255,0,0
Color4=25,63,209

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

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

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[LineStyle]
W=88
H=40
LineCount=1
LineColor=#Color1#
AntiAlias=1
HorizontalLines=1

[LabelStyle]
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
FontSize=10
FontFace=Calibri
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
DynamicVariables=1

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[MeasureCore1]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\0
RegValue=~MHz

[MeasureCore2]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\1
RegValue=~MHz

[MeasureCore3]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\2
RegValue=~MHz

[MeasureCore4]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\3
RegValue=~MHz

[MeasureCore5]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\4
RegValue=~MHz

[MeasureCore6]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\5
RegValue=~MHz

[MeasureCore7]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\6
RegValue=~MHz

[MeasureCore8]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\7
RegValue=~MHz

[MeasureNumberOfCores]
Measure=Calc
Formula=(( MeasureCore1 > 0 ) + ( MeasureCore2 > 0 ) + ( MeasureCore3 > 0 ) + ( MeasureCore4 > 0 ) + ( MeasureCore5 > 0 ) + ( MeasureCore6 > 0 ) + ( MeasureCore7 > 0 ) + ( MeasureCore8 > 0 ))
IfCondition=(MeasureNumberOfCores=1)
IfTrueAction=[!ShowMeterGroup "Core1"][!HideMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition2=(MeasureNumberOfCores=2)
IfTrueAction2=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition3=(MeasureNumberOfCores=4)
IfTrueAction3=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition4=(MeasureNumberOfCores=6)
IfTrueAction4=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition5=(MeasureNumberOfCores=8)
IfTrueAction5=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!ShowMeterGroup "Core7"][!ShowMeterGroup "Core8"]

[MeasureCPU1]
Measure=CPU
Processor=1

[MeasureCPU2]
Measure=CPU
Processor=2

[MeasureCPU3]
Measure=CPU
Processor=3

[MeasureCPU4]
Measure=CPU
Processor=4

[MeasureCPU5]
Measure=CPU
Processor=5

[MeasureCPU6]
Measure=CPU
Processor=6

[MeasureCPU7]
Measure=CPU
Processor=7

[MeasureCPU8]
Measure=CPU
Processor=8

[measureRAM]
; Returns the amount of RAM used in bytes.
Measure=PhysicalMemory
UpdateDivider=20
; UpdateDivider sets the rate at which the value of the measure is updated. It is
; calculated as follows: UpdateDivider x Update. In this case, Update is set to
; 1000 milliseconds (in the [Rainmeter] section). 1000 x 20 = 20000 ms or 20 seconds.

[measureSWAP]
; Returns the amount of SWAP (pagefile) used in bytes.
Measure=SWAPMemory
UpdateDivider=20

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[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="System"
; Even though the text is set to System, Rainmeter will display
; it as SYSTEM, because styleTitle contains StringCase=UPPER.
LeftMouseUpAction=!Execute ["taskmgr.exe"]
; Left-clicking this meter will launch taskmgr.exe (the Task Manager).
ToolTipText="Open Task Manager"
; Hovering over this meter will display a tooltip with the text above.

[MeterCore1Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore1:X]+[MeterCore1:W])
Y=[MeterCore1:Y]
W=[MeterCore1:W]
H=[MeterCore1:H]
Text=1
Group=Core1

[MeterCore2Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore2:X]+[MeterCore2:W])
Y=[MeterCore2:Y]
W=[MeterCore2:W]
H=[MeterCore2:H]
Text=2
Group=Core2

[MeterCore3Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore3:X]+[MeterCore3:W])
Y=[MeterCore3:Y]
W=[MeterCore3:W]
H=[MeterCore3:H]
Text=3
Group=Core3

[MeterCore4Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore4:X]+[MeterCore4:W])
Y=[MeterCore4:Y]
W=[MeterCore4:W]
H=[MeterCore4:H]
Text=4
Group=Core4

[MeterCore5Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore5:X]+[MeterCore5:W])
Y=[MeterCore5:Y]
W=[MeterCore5:W]
H=[MeterCore5:H]
Text=5
Group=Core5

[MeterCore6Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore6:X]+[MeterCore6:W])
Y=[MeterCore6:Y]
W=[MeterCore6:W]
H=[MeterCore6:H]
Text=6
Group=Core6

[MeterCore7Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore7:X]+[MeterCore7:W])
Y=[MeterCore7:Y]
W=[MeterCore7:W]
H=[MeterCore7:H]
Text=7
Group=Core7

[MeterCore8Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore8:X]+[MeterCore8:W])
Y=[MeterCore8:Y]
W=[MeterCore8:W]
H=[MeterCore8:H]
Text=8
Group=Core8

[MeterCore1]
Meter=LINE
MeasureName=MeasureCPU1
MeterStyle=LineStyle
X=12
Y=30
Group=Core1

[MeterCore2]
Meter=LINE
MeasureName=MeasureCPU2
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core2

[MeterCore3]
Meter=LINE
MeasureName=MeasureCPU3
MeterStyle=LineStyle
X=12
Y=0R
Group=Core3

[MeterCore4]
Meter=LINE
MeasureName=MeasureCPU4
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core4

[MeterCore5]
Meter=LINE
MeasureName=MeasureCPU5
MeterStyle=LineStyle
X=12
Y=0R
Group=Core5

[MeterCore6]
Meter=LINE
MeasureName=MeasureCPU6
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core6

[MeterCore7]
Meter=LINE
MeasureName=MeasureCPU7
MeterStyle=LineStyle
X=12
Y=0R
Group=Core7

[MeterCore8]
Meter=LINE
MeasureName=MeasureCPU8
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core8
The [MeasureCore1] - [MeasureCore8] measures read a registry key for each of the eight possible cores. If a core don't exists, the appropriate value is 0, otherwise it is greater than 0. So, the total number of cores is equal with the number of read none-zero values. The number of shown line meters must be in accord with this number. This is done by the IfCondition / IfTrueAction options of the [MeasureNumberOfCores] measure.
In this code I rearranged again the meters, to have the dates of the first two cores on the first line, the third and fourth core on the second line and so on. I did this because when exist just let's say, two cores, wouldn't look good to have the two line meters one below the other.
Please let me know if this code works as it should.
anbr07
Posts: 82
Joined: July 17th, 2016, 12:19 pm

Re: Rainmeter 4: how to show all cores plus HT?

Post by anbr07 »

I have it like following now:

Code: Select all

; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Author=poiru
AppVersion=2003000
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
; Contains basic information of the skin.
Description=Displays basic system stats.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
Color1=0,255,0
Color2=0,211,122
Color3=0,255,0
Color4=25,63,209

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

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

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[LineStyle]
W=88
H=20
LineCount=1
LineColor=#Color1#
AntiAlias=1
HorizontalLines=1

[LabelStyle]
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
FontSize=10
FontFace=Calibri
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
DynamicVariables=1

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[MeasureCore1]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\0
RegValue=~MHz

[MeasureCore2]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\1
RegValue=~MHz

[MeasureCore3]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\2
RegValue=~MHz

[MeasureCore4]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\3
RegValue=~MHz

[MeasureCore5]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\4
RegValue=~MHz

[MeasureCore6]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\5
RegValue=~MHz

[MeasureCore7]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\6
RegValue=~MHz

[MeasureCore8]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\7
RegValue=~MHz

[MeasureNumberOfCores]
Measure=Calc
Formula=(( MeasureCore1 > 0 ) + ( MeasureCore2 > 0 ) + ( MeasureCore3 > 0 ) + ( MeasureCore4 > 0 ) + ( MeasureCore5 > 0 ) + ( MeasureCore6 > 0 ) + ( MeasureCore7 > 0 ) + ( MeasureCore8 > 0 ))
IfCondition=(MeasureNumberOfCores=1)
IfTrueAction=[!ShowMeterGroup "Core1"][!HideMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition2=(MeasureNumberOfCores=2)
IfTrueAction2=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition3=(MeasureNumberOfCores=4)
IfTrueAction3=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition4=(MeasureNumberOfCores=6)
IfTrueAction4=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition5=(MeasureNumberOfCores=8)
IfTrueAction5=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!ShowMeterGroup "Core7"][!ShowMeterGroup "Core8"]

[MeasureCPU1]
Measure=CPU
Processor=1

[MeasureCPU2]
Measure=CPU
Processor=2

[MeasureCPU3]
Measure=CPU
Processor=3

[MeasureCPU4]
Measure=CPU
Processor=4

[MeasureCPU5]
Measure=CPU
Processor=5

[MeasureCPU6]
Measure=CPU
Processor=6

[MeasureCPU7]
Measure=CPU
Processor=7

[MeasureCPU8]
Measure=CPU
Processor=8

[measureRAM]
; Returns the amount of RAM used in bytes.
Measure=PhysicalMemory
UpdateDivider=20
; UpdateDivider sets the rate at which the value of the measure is updated. It is
; calculated as follows: UpdateDivider x Update. In this case, Update is set to
; 1000 milliseconds (in the [Rainmeter] section). 1000 x 20 = 20000 ms or 20 seconds.

[measureSWAP]
; Returns the amount of SWAP (pagefile) used in bytes.
Measure=SWAPMemory
UpdateDivider=20

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[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="System"
; Even though the text is set to System, Rainmeter will display
; it as SYSTEM, because styleTitle contains StringCase=UPPER.
LeftMouseUpAction=!Execute ["taskmgr.exe"]
; Left-clicking this meter will launch taskmgr.exe (the Task Manager).
ToolTipText="Open Task Manager"
; Hovering over this meter will display a tooltip with the text above.

[MeterCore1Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore1:X]+[MeterCore1:W])
Y=[MeterCore1:Y]
W=[MeterCore1:W]
H=[MeterCore1:H]
Text=1
Group=Core1

[MeterCore2Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore2:X]+[MeterCore2:W])
Y=[MeterCore2:Y]
W=[MeterCore2:W]
H=[MeterCore2:H]
Text=2
Group=Core2

[MeterCore3Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore3:X]+[MeterCore3:W])
Y=[MeterCore3:Y]
W=[MeterCore3:W]
H=[MeterCore3:H]
Text=3
Group=Core3

[MeterCore4Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore4:X]+[MeterCore4:W])
Y=[MeterCore4:Y]
W=[MeterCore4:W]
H=[MeterCore4:H]
Text=4
Group=Core4

[MeterCore5Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore5:X]+[MeterCore5:W])
Y=[MeterCore5:Y]
W=[MeterCore5:W]
H=[MeterCore5:H]
Text=5
Group=Core5

[MeterCore6Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore6:X]+[MeterCore6:W])
Y=[MeterCore6:Y]
W=[MeterCore6:W]
H=[MeterCore6:H]
Text=6
Group=Core6

[MeterCore7Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore7:X]+[MeterCore7:W])
Y=[MeterCore7:Y]
W=[MeterCore7:W]
H=[MeterCore7:H]
Text=7
Group=Core7

[MeterCore8Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore8:X]+[MeterCore8:W])
Y=[MeterCore8:Y]
W=[MeterCore8:W]
H=[MeterCore8:H]
Text=8
Group=Core8

[MeterCore1]
Meter=LINE
MeasureName=MeasureCPU1
MeterStyle=LineStyle
X=12
Y=30
Group=Core1

[MeterCore2]
Meter=LINE
MeasureName=MeasureCPU2
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core2

[MeterCore3]
Meter=LINE
MeasureName=MeasureCPU3
MeterStyle=LineStyle
X=12
Y=0R
Group=Core3

[MeterCore4]
Meter=LINE
MeasureName=MeasureCPU4
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core4

[MeterCore5]
Meter=LINE
MeasureName=MeasureCPU5
MeterStyle=LineStyle
X=12
Y=0R
Group=Core5

[MeterCore6]
Meter=LINE
MeasureName=MeasureCPU6
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core6

[MeterCore7]
Meter=LINE
MeasureName=MeasureCPU7
MeterStyle=LineStyle
X=12
Y=0R
Group=Core7

[MeterCore8]
Meter=LINE
MeasureName=MeasureCPU8
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core8

[meterLabelRAM]
; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Meter=String
MeterStyle=styleLeftText
X=10
Y=130
W=180
H=14
Text=RAM Usage

[meterValueRAM]
Meter=String
MeterStyle=styleRightText
MeasureName=measureRAM
X=200
Y=0r
W=180
H=14
Text=%1%
Percentual=1
; Percentual=1 needs to be added her because measureRAM returns the amount
; of RAM used in bytes. Using Percentual=1 will convert that into a percentual value.

[meterBarRAM]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureRAM
X=10
Y=12r
W=180
H=1

[LabelStyle]
FontColor=0,255,0
FontEffectColor=0,0,0
StringEffect=Shadow
FontSize=8
FontFace=Arial
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
DynamicVariables=1
Works great, thanks again. Nice, that it will adapt to the number of cores. Looking forward to try it out soon. :)
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter 4: how to show all cores plus HT?

Post by balala »

anbr07 wrote:Works great, thanks again. Nice, that it will adapt to the number of cores. Looking forward to try it out soon. :)
No, it don't work great!
The code has a problem: the [meterLabelRAM] meter is placed to Y=130. This means that the meters related to the RAM usage will be placed in the same place, no matter how many cores are present and that's not ok. If we adapted the number of line meters according to the number of cores, we also should move the RAM usage meters as well. Theoretically replacing its Y option with Y=6R would fix this and usually it indeed does, except the situation when there is only one single core. In this case, because the meters of the second core will be hidden, the meters of the RAM usage will overlap the line meter of the first core. I found one single possibility to fix that: setting the Y option of the [meterLabelRAM] meter with some !SetOption bangs. So, I added the following bangs: [!SetOption meterLabelRAM Y "26r"][!UpdateMeter "meterLabelRAM"][!Redraw] to the IfTrueAction (when the number of cores is odd) option of the [MeasureNumberOfCores] measure (beside the existing bangs) and [!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw] to the IfTrueAction2 - IfTrueAction5 (when the number of cores is even):

Code: Select all

[MeasureNumberOfCores]
Measure=Calc
Formula=(( MeasureCore1 > 0 ) + ( MeasureCore2 > 0 ) + ( MeasureCore3 > 0 ) + ( MeasureCore4 > 0 ) + ( MeasureCore5 > 0 ) + ( MeasureCore6 > 0 ) + ( MeasureCore7 > 0 ) + ( MeasureCore8 > 0 ))
IfCondition=(MeasureNumberOfCores=1)
IfTrueAction=[!ShowMeterGroup "Core1"][!HideMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "26r"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition2=(MeasureNumberOfCores=2)
IfTrueAction2=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition3=(MeasureNumberOfCores=4)
IfTrueAction3=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition4=(MeasureNumberOfCores=6)
IfTrueAction4=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition5=(MeasureNumberOfCores=8)
IfTrueAction5=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!ShowMeterGroup "Core7"][!ShowMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]
In parallel with this, you can remove the Y option of the [meterLabelRAM] meter.
Now I hope this code indeed is finalized.
anbr07
Posts: 82
Joined: July 17th, 2016, 12:19 pm

Re: Rainmeter 4: how to show all cores plus HT?

Post by anbr07 »

I tried the new code, but the graph was misplaced, and the label missing. I will investigate later, if i made some mistake. Could be, that i have removed the wrong "Y" code? I will report back.
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter 4: how to show all cores plus HT?

Post by balala »

anbr07 wrote:I tried the new code, but the graph was misplaced, and the label missing. I will investigate later, if i made some mistake. Could be, that i have removed the wrong "Y" code? I will report back.

Code: Select all

; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Author=poiru
AppVersion=2003000
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
; Contains basic information of the skin.
Description=Displays basic system stats.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
Color1=0,255,0
Color2=0,211,122
Color3=0,255,0
Color4=25,63,209

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

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

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[LineStyle]
W=88
H=20
LineCount=1
LineColor=#Color1#
AntiAlias=1
HorizontalLines=1

[LabelStyle]
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
FontSize=10
FontFace=Calibri
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
DynamicVariables=1

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[MeasureCore1]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\0
RegValue=~MHz

[MeasureCore2]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\1
RegValue=~MHz

[MeasureCore3]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\2
RegValue=~MHz

[MeasureCore4]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\3
RegValue=~MHz

[MeasureCore5]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\4
RegValue=~MHz

[MeasureCore6]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\5
RegValue=~MHz

[MeasureCore7]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\6
RegValue=~MHz

[MeasureCore8]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=HARDWARE\DESCRIPTION\System\CentralProcessor\7
RegValue=~MHz

[MeasureNumberOfCores]
Measure=Calc
Formula=(( MeasureCore1 > 0 ) + ( MeasureCore2 > 0 ) + ( MeasureCore3 > 0 ) + ( MeasureCore4 > 0 ) + ( MeasureCore5 > 0 ) + ( MeasureCore6 > 0 ) + ( MeasureCore7 > 0 ) + ( MeasureCore8 > 0 ))
IfCondition=(MeasureNumberOfCores=1)
IfTrueAction=[!ShowMeterGroup "Core1"][!HideMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "26r"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition2=(MeasureNumberOfCores=2)
IfTrueAction2=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition3=(MeasureNumberOfCores=4)
IfTrueAction3=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition4=(MeasureNumberOfCores=6)
IfTrueAction4=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]
IfCondition5=(MeasureNumberOfCores=8)
IfTrueAction5=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!ShowMeterGroup "Core7"][!ShowMeterGroup "Core8"][!SetOption meterLabelRAM Y "6R"][!UpdateMeter "meterLabelRAM"][!Redraw]

[MeasureCPU1]
Measure=CPU
Processor=1

[MeasureCPU2]
Measure=CPU
Processor=2

[MeasureCPU3]
Measure=CPU
Processor=3

[MeasureCPU4]
Measure=CPU
Processor=4

[MeasureCPU5]
Measure=CPU
Processor=5

[MeasureCPU6]
Measure=CPU
Processor=6

[MeasureCPU7]
Measure=CPU
Processor=7

[MeasureCPU8]
Measure=CPU
Processor=8

[measureRAM]
; Returns the amount of RAM used in bytes.
Measure=PhysicalMemory
UpdateDivider=20
; UpdateDivider sets the rate at which the value of the measure is updated. It is
; calculated as follows: UpdateDivider x Update. In this case, Update is set to
; 1000 milliseconds (in the [Rainmeter] section). 1000 x 20 = 20000 ms or 20 seconds.

[measureSWAP]
; Returns the amount of SWAP (pagefile) used in bytes.
Measure=SWAPMemory
UpdateDivider=20

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[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="System"
; Even though the text is set to System, Rainmeter will display
; it as SYSTEM, because styleTitle contains StringCase=UPPER.
LeftMouseUpAction=!Execute ["taskmgr.exe"]
; Left-clicking this meter will launch taskmgr.exe (the Task Manager).
ToolTipText="Open Task Manager"
; Hovering over this meter will display a tooltip with the text above.

[MeterCore1Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore1:X]+[MeterCore1:W])
Y=[MeterCore1:Y]
W=[MeterCore1:W]
H=[MeterCore1:H]
Text=1
Group=Core1

[MeterCore2Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore2:X]+[MeterCore2:W])
Y=[MeterCore2:Y]
W=[MeterCore2:W]
H=[MeterCore2:H]
Text=2
Group=Core2

[MeterCore3Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore3:X]+[MeterCore3:W])
Y=[MeterCore3:Y]
W=[MeterCore3:W]
H=[MeterCore3:H]
Text=3
Group=Core3

[MeterCore4Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore4:X]+[MeterCore4:W])
Y=[MeterCore4:Y]
W=[MeterCore4:W]
H=[MeterCore4:H]
Text=4
Group=Core4

[MeterCore5Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore5:X]+[MeterCore5:W])
Y=[MeterCore5:Y]
W=[MeterCore5:W]
H=[MeterCore5:H]
Text=5
Group=Core5

[MeterCore6Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore6:X]+[MeterCore6:W])
Y=[MeterCore6:Y]
W=[MeterCore6:W]
H=[MeterCore6:H]
Text=6
Group=Core6

[MeterCore7Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore7:X]+[MeterCore7:W])
Y=[MeterCore7:Y]
W=[MeterCore7:W]
H=[MeterCore7:H]
Text=7
Group=Core7

[MeterCore8Label]
Meter=STRING
MeterStyle=LabelStyle
X=([MeterCore8:X]+[MeterCore8:W])
Y=[MeterCore8:Y]
W=[MeterCore8:W]
H=[MeterCore8:H]
Text=8
Group=Core8

[MeterCore1]
Meter=LINE
MeasureName=MeasureCPU1
MeterStyle=LineStyle
X=12
Y=30
Group=Core1

[MeterCore2]
Meter=LINE
MeasureName=MeasureCPU2
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core2

[MeterCore3]
Meter=LINE
MeasureName=MeasureCPU3
MeterStyle=LineStyle
X=12
Y=0R
Group=Core3

[MeterCore4]
Meter=LINE
MeasureName=MeasureCPU4
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core4

[MeterCore5]
Meter=LINE
MeasureName=MeasureCPU5
MeterStyle=LineStyle
X=12
Y=0R
Group=Core5

[MeterCore6]
Meter=LINE
MeasureName=MeasureCPU6
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core6

[MeterCore7]
Meter=LINE
MeasureName=MeasureCPU7
MeterStyle=LineStyle
X=12
Y=0R
Group=Core7

[MeterCore8]
Meter=LINE
MeasureName=MeasureCPU8
MeterStyle=LineStyle
X=6R
Y=0r
Group=Core8

[meterLabelRAM]
; >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Meter=String
MeterStyle=styleLeftText
X=10
;Y=130
W=180
H=14
Text=RAM Usage

[meterValueRAM]
Meter=String
MeterStyle=styleRightText
MeasureName=measureRAM
X=200
Y=0r
W=180
H=14
Text=%1%
Percentual=1
; Percentual=1 needs to be added her because measureRAM returns the amount
; of RAM used in bytes. Using Percentual=1 will convert that into a percentual value.

[meterBarRAM]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureRAM
X=10
Y=12r
W=180
H=1

[LabelStyle]
FontColor=0,255,0
FontEffectColor=0,0,0
StringEffect=Shadow
FontSize=8
FontFace=Arial
StringStyle=BOLD
StringAlign=RIGHT
AntiAlias=1
DynamicVariables=1
This code is working well for me. The graphs are well placed and I also can see the labels. Please tell me if you have problems with it.
anbr07
Posts: 82
Joined: July 17th, 2016, 12:19 pm

Re: Rainmeter 4: how to show all cores plus HT?

Post by anbr07 »

No, now it appears to be perfect. Maybe the word "SYSTEM" could go, because i have it covered by the browser window anyway, making it even e bit mor compact. Otherwise, now i have exactly what i wanted. Thanks a lot, great work! :great:
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter 4: how to show all cores plus HT?

Post by balala »

anbr07 wrote:Maybe the word "SYSTEM" could go, because i have it covered by the browser window anyway, making it even e bit mor compact.
For this you'll have to remove the [meterTitle] meter. Also in this case, maybe you could reduce the Y value of the [MeterCore1] (Eg Y=10)
anbr07
Posts: 82
Joined: July 17th, 2016, 12:19 pm

Re: Rainmeter 4: how to show all cores plus HT?

Post by anbr07 »

Perfect! Thanks again!
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter 4: how to show all cores plus HT?

Post by balala »

You're welcome.
anbr07
Posts: 82
Joined: July 17th, 2016, 12:19 pm

Re: Rainmeter 4: how to show all cores plus HT?

Post by anbr07 »

Once more, thanks! The code runs as intended on some other machine with less cores. :)