I started putting in some of the code you (balala) suggested, and while it technically works, it does look
a bit off in the log…
Code: Select all
[DetectCores]
Measure=Plugin
Plugin=RunCommand
Parameter=WMIC CPU Get NumberOfLogicalProcessors
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\n":"","\s":"",".*(\d{1,2})":"\1"
IfCondition=([#CURRENTSECTION#]=2)
IfTrueAction=[!ShowMeterGroup "Ring1"][!Log "Core 2"]
IfCondition2=([#CURRENTSECTION#]=4)
IfTrueAction2=[!ShowMeterGroup "Ring1"][!ShowMeterGroup "Ring2"][!Log "Core 4"]
IfCondition3=([#CURRENTSECTION#]=6)
IfTrueAction3=[!ShowMeterGroup "Ring1"][!ShowMeterGroup "Ring2"][!ShowMeterGroup "Ring3"][!Log "Core 6"]
IfCondition4=([#CURRENTSECTION#]=8)
IfTrueAction4=[!ShowMeterGroup "Ring1"][!ShowMeterGroup "Ring2"][!ShowMeterGroup "Ring3"][!ShowMeterGroup "Ring4"][!Log "Core 8"]
DynamicVariables=1
By adding
Hidden =1 to each core, and I added a
Group=Ringx to each Core pair, the number of Bangs required can be considerably reduced; one Bang per pair.
However, the log results do look a bit off;
Code: Select all
Notice: Refreshing skin (RoundCPUMeter\RoundCPU8Meter.ini)
Warning: CPU: Processor=5 is not valid (RoundCPUMeter\RoundCPU8Meter.ini - [MeasureCPU5])
… similarly for CPUs 6 through 8
Error: Extra operation: IfCondition=(=2) (RoundCPUMeter\RoundCPU8Meter.ini - [DetectCores])
… similarly for the next 3 conditions
Notice: Core 4 (RoundCPUMeter\RoundCPU8Meter.ini)
The warnings are obvious, the cores are not there, so they cannot be polled. Can a measure be turned off?
The errors in the log suggest that the section is completing before
[#CURRENTSECTION#] is evaluated, and then the section is running again when
[#CURRENTSECTION#] is evaluated and the message "Core 4" appears as it is attached to the true condition of the second test.
Rainmeter's core code probably has an internal reference to the number of cores. If this was available as an accessible system variable (like #CPUCORECOUNT#), the above logic would probably run smoother, without the need to call an external executable and fetch the result.
My first impression is that Core number detection process needs a wait status for the results from the external shell call to avoid the error conditions.