It is currently April 28th, 2024, 6:48 am

Recording a Max Temp

General topics related to Rainmeter.
mahbagel
Posts: 5
Joined: June 1st, 2011, 8:35 pm

Recording a Max Temp

Post by mahbagel »

Hello all,

I'm writing a System Monitor and I'm stuck. I want to display the current temperature and then next to it have the max temperature the processor has hit. what would be the best way to go about this? I've thought about IfAbove lines, but then it won't continue to register the max once the current one is exceeded. The second problem I ran into while doing it this was is that I couldn't figure out what variable the current temperature is saved as. It can be outputted with the %1, but what would go in the blank/does this even work:
IfAboveAction=(HighTemp=________)

Any help is appreciated, and if you need more information just ask! thanks
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Recording a Max Temp

Post by poiru »

Something like this, perhaps:

Code: Select all

[mCurTemp]
; add code to return current temp here

[mMaxTemp]
Measure=Calc
Formula=(mCurTemp > mMaxTemp) ? mCurTemp : mMaxTemp
The Formula line in pseudo code: If mCurTemp is higher than mMaxTemp return mCurTemp as the value of the measure (i.e. mMaxTemp). Otherwise, return mMaxTemp.
mahbagel
Posts: 5
Joined: June 1st, 2011, 8:35 pm

Re: Recording a Max Temp

Post by mahbagel »

poiru wrote:Something like this, perhaps:

Code: Select all

[mCurTemp]
; add code to return current temp here

[mMaxTemp]
Measure=Calc
Formula=(mCurTemp > mMaxTemp) ? mCurTemp : mMaxTemp
The Formula line in pseudo code: If mCurTemp is higher than mMaxTemp return mCurTemp as the value of the measure (i.e. mMaxTemp). Otherwise, return mMaxTemp.
This makes sense, but when I put it in my skin i got an error saying MeterDisplayMaxTemp couldn't be bound with MeasureMaxTemp. This is what i got goin so far:

Code: Select all

[MeasureAvgTemp]
Measure=Plugin
Plugin=Plugins\CoreTemp.dll
CoreTempType=Temperature
CoreTempIndex=0

[MeasureMaxTemp]
Meaure=Calc
Formula=(MeasureAvgTemp>MeasureMaxTemp)? MeasureAvgTemp : MeasureMaxTemp

[MeterDisplayTemp]
Meter=String
MeasureName=MeasureAvgTemp
X=5
Y=3R
W=150
H=17
FontColor=#Color2#
StringStyle=BOLD
Text="Temp: %1°C"
AntiAlias=1

[MeterDisplayMaxTempText]
Meter=String
X=90
Y=-17R
W=40
H=17
FontColor=#Color2#
StringStyle=BOLD
Text="Max: "
AntiAlias=1

[MeterDisplayMaxTemp] 
Meter=String
MeasureName=MeasureMaxTemp
X=33r
Y=-17R
W=20
H=17
FontColor=#Color2#
StringStyle=BOLD
;IfAboveValue=#HighestTemp#
;IfAboveAction=HighestTemp=%1
PostFix="°C"
AntiAlias=1
Thank!!
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Recording a Max Temp

Post by poiru »

It's Measure=Calc, not Meaure=Calc ;)

This works fine here (cleaned up the code a bit, too):

Code: Select all

[MeasureAvgTemp]
Measure=Plugin
Plugin=Plugins\CoreTemp.dll
CoreTempType=Temperature
CoreTempIndex=0

[MeasureMaxTemp]
Measure=Calc
Formula=(MeasureAvgTemp > MeasureMaxTemp) ? MeasureAvgTemp : MeasureMaxTemp

[MeterDisplayTemp]
Meter=String
MeasureName=MeasureAvgTemp
X=5
Y=3R
W=150
H=17
FontColor=#Color2#
StringStyle=BOLD
Text="Temp: %1°C"
AntiAlias=1

[MeterDisplayMaxTemp]
Meter=String
MeasureName=MeasureMaxTemp
X=90
Y=0r
W=40
H=17
FontColor=#Color2#
StringStyle=BOLD
Text="Max: %1°C"
AntiAlias=1
FYI, IfActions can only be used in measures -- not meters. Also, what you tried to do with them is not possible. Read the manual for more info.
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: Recording a Max Temp

Post by Seahorse »

I use Speedfan, this is a truncated version, you have some unnecessary measures I think:

Code: Select all

[MeasureTemp]
Measure=Plugin
Plugin=Plugins\speedfanplugin.dll
SpeedFanNumber=10
SpeedFanType=TEMPERATURE

[MeasureMaxTemp]
Measure=Calc
Formula=(MeasureTemp > MeasureMaxTemp) ? MeasureTemp : MeasureMaxTemp

[MeterDisplayTemp]
Meter=String
MeasureName=MeasureTemp
X=5
Y=3
Text="Temp: %1°C"

[MeterDisplayMaxTemp]
Meter=String
MeasureName=MeasureMaxTemp
X=90
Y=r
Text="Max: %1°C"
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

mahbagel
Posts: 5
Joined: June 1st, 2011, 8:35 pm

Re: Recording a Max Temp

Post by mahbagel »

poiru wrote:It's Measure=Calc, not Meaure=Calc ;)
ohh god, that's so dumb, should have proof-read better. Thanks for the help!