It is currently April 26th, 2024, 4:45 am

problem show me the active Cores/Threads from CPU

Get help with creating, editing & fixing problems with skins
Sebbel
Posts: 6
Joined: April 8th, 2015, 10:37 pm

problem show me the active Cores/Threads from CPU

Post by Sebbel »

hello,
sorry, but my english is not so good.

i use rainmeter 3.2.1 r2386 64bit at Win 7 64bit
i have a 6 Core CPU with 12 Threads.
because not all Threads are active (parking), I would like an indication of how many are active like this: "6/12 aktiv"

current i use this way for each Thread, but i dont like it
[MeasureCPUCore1]
Measure=CPU
Processor=1
UpdateDivider=10

[MeasureCore1Temp]
Measure=Plugin
Plugin=CoreTemp
CoreTempType=Temperature
CoreTempIndex=0
UpdateDivider=10

[meterLabelCPUCore1]
Meter=STRING
FontColor=255,255,255,220
Fontsize=10
StringStyle=bold
X=25r
Y=10r
W=190
H=14
Text="1"

[meterValueCPUCore1]
Meter=STRING
MeterStyle=styleCenterText
MeasureName=measureCPUCore1
X=6r
Y=15r
W=190
H=14
Text="%1%"

[MeterCore1Temp]
Meter=String
MeasureName=MeasureCore1Temp
X=0r
Y=10r
W=190
H=14
MeterStyle=styleCenterText
Text="%1°C"
get it on "IfCondition=MeasureCPUCore1 >= 1"
Although 'read' whether the core 1 (Thread 1) greater than / equal to 1% load, has only how do I do next? would like to have a variable as "a = 1". for the next core / thread then variable b, etc.
the circuit can add the variables and, depending on the result the "2/12 active"

i hope you understand what I mean?
or how can we implement it easier to see how how many cores / threads are active? a display for each I do not want to have ...
Last edited by Sebbel on April 10th, 2015, 9:27 am, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: problem show me the active Cores/Threads from CPU

Post by balala »

I'm not sure I understood what you'd like, but if I'm not wrong, here's a solution:
First of all, you have to add more CPU measures, one for each core / thread:

Code: Select all

[MeasureCPUCore1]
Measure=CPU
Processor=1
UpdateDivider=10

[MeasureCPUCore2]
Measure=CPU
Processor=2
UpdateDivider=10

... (up to 12)
(I mention, that I'd not use the UpdateDivider=10 option on these measures, I'd leave the default UpdateDivider=1).
Next step would be to add to each of these measures, one IfCondition:

Code: Select all

[MeasureCPUCore1]
Measure=CPU
Processor=1
IfCondition=(MeasureCPUCore1>1)
IfTrueAction=[!SetVariable Proc1 "1"]
IfFalseAction=[!SetVariable Proc1 "0"]

[MeasureCPUCore2]
Measure=CPU
Processor=2
IfCondition=(MeasureCPUCore2>1)
IfTrueAction=[!SetVariable Proc2 "1"]
IfFalseAction=[!SetVariable Proc2 "0"]

... (up to 12)
For every core, the Proc1, Proc2, ... variable will be equal with 1 if the core is active and 0 otherwise.
One calc measure determines the number of active cores:

Code: Select all

[MeasureActiveCores]
Measure=Calc
Formula=( #Proc1# + #Proc2# + #Proc3# + #Proc4# + #Proc5# + #Proc6# + #Proc7# + #Proc8# + #Proc9# + #Proc10# + #Proc11# + #Proc12# )
DynamicVariables=1
(don't forget here the DynamicVariables=1 option, because you set the variables with the !SetVariable bang.)
Finaly you have to show this number:

Code: Select all

[MeterCPUCores]
Meter=STRING
MeterStyle=styleCenterText
MeasureName=MeasureActiveCores
X=6r
Y=15r
W=190
H=14
Text="%1/12 active cores"
I hope this is what you'd like. If not, please let me know.
Sebbel
Posts: 6
Joined: April 8th, 2015, 10:37 pm

Re: problem show me the active Cores/Threads from CPU

Post by Sebbel »

great, thats what i mean, thank you very much
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: problem show me the active Cores/Threads from CPU

Post by balala »

Glad to help.