It is currently February 16th, 2019, 2:13 am

Coding help requested for modifying Skin

Help with creating, editing & fixing problems with skins
Zer0Bit
Posts: 5
Joined: January 31st, 2019, 1:43 am

Coding help requested for modifying Skin

Zer0Bit » January 31st, 2019, 1:51 am

I'm trying to modify a skin so that it will change the CPU Core Meter Bar color based on the current Temp of the core and am using several variables as the set points for each color change. Ideally it would start as green, then change to yellow at first set point, then orange then red. These is the portions of the code I have so far that are relevant to what i'm trying to achieve:

Code: Select all

[Variables] 

Green=0, 255, 0, 255
Yellow=255,255,0,255
Orange=255,155,0,255
Red=255,0,0,255
WarningTemp=33
WarningTemp2=40
HotTemp=65


[MeasureCPUTemp]
Measure=Plugin
Plugin=Plugins\SpeedFanPlugin.dll
SpeedFanType=TEMPERATURE
SpeedFanNumber=#SpeedFanIndex#

[MeasureCPUTemp2]
Measure=Calc
Formula=MeasureCPUTemp-25
MinValue=0
MaxValue=100

[TempBarColor]
Measure=Calc
Formula=MeasureCPUTemp2 < #WarningTemp# ? 0 : ((MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#) ? 1 : ((MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#) ? 2 : 3))

[TempBar]
Meter=Bar
MeasureName=MeasureCPUTemp2
X=247
Y=41
W=90
H=5
BarColor= [TempBarColor] = 0 ? #Red# : ([TempBarColor] = 1 ? #Yellow# : ([TempBarColor] = 2 ? #Orange# : ([TempBarColor] = 3 ? #Red#)))
BarOrientation=HORIZONTAL
Scale=100
Updatedivider=3
Any assistance in correcting the code would be much appreciated.

It doesn't show any syntax errors in the error log, but it makes the bar black, I'm guessing due to TempBarColor value being 0
Last edited by eclectic-tech on January 31st, 2019, 4:15 am, edited 1 time in total.
Reason: Please use code tags.
mak_kawa
Posts: 220
Joined: December 30th, 2015, 9:47 am

Re: Coding help requested for modifying Skin

mak_kawa » January 31st, 2019, 2:42 am

Maybe you missed DynamicVariables=1 option in your 2 calc measures.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3197
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Coding help requested for modifying Skin

eclectic-tech » January 31st, 2019, 4:58 am

Mathematical formulas must be entirely enclosed in (parentheses) to alert Rainmeter that it is a formula, unless they are being used in the Formula option of a Calc measure or in a IfCondition option, where the function is always assumed to be a formula, and the enclosing parentheses are optional.

When you enclose the conditional statement in the BarColor of [TempBar] meter, the Log will tell you there is a calc error in [TempBar] BarColor formula.

The error is caused by the fact conditional statements can only use number values; the color variables resolve to comma separated number 'strings' that cannot be use in conditional statements. You might be able to correct the statement, but rather than comparing temps to generate numbers, then comparing numbers to select colors, IfCondition can do this in one step and one measure.

It would be best to use IfCondition statements directly in the [MeasureTemp2] section to set the bar color in [TempBar] meter, update the meter, and redraw.

Here is one way to do it:

Code: Select all

[Variables] 

Green=0, 255, 0, 255
Yellow=255,255,0,255
Orange=255,155,0,255
Red=255,0,0,255
WarningTemp=33
WarningTemp2=40
HotTemp=65
SpeedFanIndex=0

[MeasureCPUTemp]
Measure=Plugin
Plugin=Plugins\SpeedFanPlugin.dll
SpeedFanType=TEMPERATURE
SpeedFanNumber=#SpeedFanIndex#

[MeasureCPUTemp2]
Measure=Calc
Formula=MeasureCPUTemp-25
MinValue=0
MaxValue=100

IfCondition=(MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#)
IfTrueAction=[!SetOption TempBar BarColor #Yellow#][!UpdateMeter TempBar][!Redraw]
IfFalseAction=[!SetOption TempBar BarColor #Green#][!UpdateMeter TempBar][!Redraw]
IfCondition2=(MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#)
IfTrueAction2=[!SetOption TempBar BarColor #Orange#][!UpdateMeter TempBar][!Redraw]
IfCondition3=(MeasureCPUTemp2 >= #HotTemp#)
IfTrueAction3=[!SetOption TempBar BarColor #Red#][!UpdateMeter TempBar][!Redraw]

; [TempBarColor]
; Measure=Calc
; Formula=MeasureCPUTemp2 < #WarningTemp# ? 0 : ((MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#) ? 1 : ((MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#) ? 2 : 3))

[TempBar]
Meter=Bar
MeasureName=MeasureCPUTemp2
X=247
Y=41
W=90
H=5
BarColor=#Green#
BarOrientation=HORIZONTAL
Scale=100
Updatedivider=3
User avatar
balala
Rainmeter Sage
Posts: 7628
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Coding help requested for modifying Skin

balala » January 31st, 2019, 9:35 pm

mak_kawa wrote:
January 31st, 2019, 2:42 am
Maybe you missed DynamicVariables=1 option in your 2 calc measures.
In the Calc measures you don't have to set the dynamic variables (and don't have to use section variables). But in the [TempBar] meter, where [TempBarColor] is used as a section variable, the DynamicVariables=1 option would absolutely required.
But as eclectic-tech said, in conditional statements only numeric values can be used. Plus note that even if would be possible to use color codes, in the BarColor option of the [TempBar] meter you have an error. The last conditional operation isn't closed. You had posted this:
BarColor= [TempBarColor] = 0 ? #Red# : ([TempBarColor] = 1 ? #Yellow# : ([TempBarColor] = 2 ? #Orange# : ([TempBarColor] = 3 ? #Red#)))
A colon and the appropriate value, which should have to be returned when the condition is false are missing. Due to this, the color of the bar meter wouldn't be set, even if there could be used color codes.

Eclectic-tech's solution is far the best in such cases, however alternatives exist. For example, if you'd separate the four elements of the color codes:

Code: Select all

[Variables]
GreenR=0
GreenG=255
GreenB=0
GreenA=255
YellowR=255
YellowG=255
YellowB=0
YellowA=255
OrangeR=255
OrangeG=155
OrangeB=0
OrangeA=255
RedR=255
RedG=0
RedB=0
RedA=255
WarningTemp=33
WarningTemp2=40
HotTemp=65
then four distinct formulas could be used into the BarColor option of the [TempBar] meter. Something like this:

Code: Select all

[TempBar]
...
BarColor=(([TempBarColor]=0)?#RedR#:(([TempBarColor]=1)?#YellowR#:(([TempBarColor]=2)?#OrangeR#:(([TempBarColor]=3)?#RedR#:#YellowR#)))),(([TempBarColor]=0)?#RedG#:(([TempBarColor]=1)?#YellowG#:(([TempBarColor]=2)?#OrangeG#:(([TempBarColor]=3)?#RedG#:#YellowG#)))),(([TempBarColor]=0)?#RedB#:(([TempBarColor]=1)?#YellowB#:(([TempBarColor]=2)?#OrangeB#:(([TempBarColor]=3)?#RedB#:#YellowB#)))),(([TempBarColor]=0)?#RedA#:(([TempBarColor]=1)?#YellowA#:(([TempBarColor]=2)?#OrangeA#:(([TempBarColor]=3)?#RedA#:#YellowA#))))
DynamicVariables=1
I also added the absolutely required DynamicVariables=1 option.
Zer0Bit
Posts: 5
Joined: January 31st, 2019, 1:43 am

Re: Coding help requested for modifying Skin

Zer0Bit » February 1st, 2019, 12:59 am

Thank u guys so much for your help, I went with eclectic-tech's suggestion of If statements in the MeasureCpuTemp2 section and it does change the bar color once it hits those points, however it does not change to a lower temp color when the temp lowers. It also doesn't seem to scale to the full length of the bar. Am I missing something?

I was able to switch it back to green start color which seems to work, by doing additional false statements:

Code: Select all

[MeasureCPUTemp2]
Measure=Calc
Formula=MeasureCPUTemp-25
MinValue=0
MaxValue=100
IfCondition=(MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#)
IfTrueAction=[!SetOption TempBar BarColor #Yellow#][!UpdateMeter TempBar][!Redraw]
IfFalseAction=[!SetOption TempBar BarColor #Green#][!UpdateMeter TempBar][!Redraw]
IfCondition2=(MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#)
IfTrueAction2=[!SetOption TempBar BarColor #Orange#][!UpdateMeter TempBar][!Redraw]
IfFalseAction2=[!SetOption TempBar BarColor #Green#][!UpdateMeter TempBar][!Redraw]
IfCondition3=(MeasureCPUTemp2 >= #HotTemp#)
IfTrueAction3=[!SetOption TempBar BarColor #Red#][!UpdateMeter TempBar][!Redraw]
IfFalseAction3=[!SetOption TempBar BarColor #Green#][!UpdateMeter TempBar][!Redraw]
Idk if there is an easier way to correct the issue, I am still experiencing an issue with the bar meter not filling up as much of the bar as it should. It looks like it fills the bar about 1/2 of what it should.
User avatar
balala
Rainmeter Sage
Posts: 7628
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Coding help requested for modifying Skin

balala » February 1st, 2019, 12:01 pm

Zer0Bit wrote:
February 1st, 2019, 12:59 am
I went with eclectic-tech's suggestion of If statements in the MeasureCpuTemp2 section
Yes, that's much simpler and easier to understand.
Zer0Bit wrote:
February 1st, 2019, 12:59 am
and it does change the bar color once it hits those points, however it does not change to a lower temp color when the temp lowers.
eclectic-tech have copied your color codes, using them in his code. But he missed a small detail: in the Green variable some spaces are used. Due to this, you can't set simply this color for the bar, through a [!SetOption TempBar BarColor #Green#] bang (IfFalseAction option of the [MeasureCPUTemp2] measure), because the spaces make the bang not to work. The !SetOption bang will set the BarColor option not to #Green#, but to 0,, which is the part of the #Green# variable from its beginning, up to the first space.
Possible solutions:
  • Remove the spaces from the Green variable within the [Variables] section.
  • Quote the values which have to be set by a !SetOption or !SetVariable bang.
Alternatively you can use both solutions and this would be the best possibility. It's a good practice to get used to always use the quotations when needed. Details: https://forum.rainmeter.net/viewtopic.php?f=5&t=26350&p=137628&hilit=quote+enclose+option#p137628
According to the above recommendations, the updates of eclectic-tech's code are the following ones:

Code: Select all

[Variables] 
Green=0,255,0,255
...

...

[MeasureCPUTemp2]
...
IfCondition=(MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#)
IfTrueAction=[!SetOption TempBar BarColor "#Yellow#"][!UpdateMeter "TempBar"][!Redraw]
IfFalseAction=[!SetOption TempBar BarColor "#Green#"][!UpdateMeter "TempBar"][!Redraw]
IfCondition2=(MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#)
IfTrueAction2=[!SetOption TempBar BarColor "#Orange#"][!UpdateMeter "TempBar"][!Redraw]
IfCondition3=(MeasureCPUTemp2 >= #HotTemp#)
IfTrueAction3=[!SetOption TempBar BarColor "#Red#"][!UpdateMeter "TempBar"][!Redraw]
See the modified Green variable and the added quotations into both the !SetOption and the !UpdateMeter bangs.
Just as a side note, keep in mind that the Log is a good friend of users, there you can discover a lot of errors, committed into code.
Zer0Bit
Posts: 5
Joined: January 31st, 2019, 1:43 am

Re: Coding help requested for modifying Skin

Zer0Bit » February 2nd, 2019, 2:06 am

Thank you for the quote suggestion balala it cleaned up the code well and performs good for the bar color changes. I also added an if statement for a true condition to make the bar green as well as well as some bangs to change the degree text color. The issue of the bar not filling completely is still occurring. What I noticed is that it doesn't have any meter bar if the core is 25 degrees C or less (probably due to the function in the [MeasuerCPUTemp2], That is there from the original author) but additionally even at 68 degrees C it only fills the bar about 1/3 of the way across. Any suggestions on how to fix that issue?
Here are the pertinent parts of the code:

Code: Select all

[Variables]
Core=1
SpeedFanIndex=20
BarColor=34,95,142,255
BarColor2=139,207,255,255
FontName=hooge 05_53
FontHeight=8
FontHeight2=11
FontColor=139,207,255,255
Horizontal=HORIZONTAL
GraphColor1=89,190,255,255
GraphColor2=77,183,255,255
Green=0,255,0,255
Yellow=255,255,0,255
Orange=255,155,0,255
Red=255,0,0,255
WarningTemp=45-24
WarningTemp2=50-24
HotTemp=65-24
;// Temp values are 24 degrees less than actual //

;////////////////////////////////////////
; STYLES
;////////////////////////////////////////

[styleText]
StringCase=UPPER
StringStyle=BOLD
FontColor=#FontColor#
FontFace=#FontName#
FontSize=#FontHeight#
AntiAlias=1
ClipString=1

[MeasureCPUTemp]
Measure=Plugin
Plugin=Plugins\SpeedFanPlugin.dll
SpeedFanType=TEMPERATURE
SpeedFanNumber=#SpeedFanIndex#

[MeasureCPUTemp2]
Measure=Calc
Formula=MeasureCPUTemp-25
MinValue=0
MaxValue=100

IfCondition=(MeasureCPUTemp2 < #WarningTemp#)
IfTrueAction=[!SetOption TempBar BarColor "#Green#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Green#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition2=(MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#)
IfTrueAction2=[!SetOption TempBar BarColor "#Yellow#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Yellow#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition3=(MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#)
IfTrueAction3=[!SetOption TempBar BarColor "#Orange#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Orange#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition4=(MeasureCPUTemp2 >= #HotTemp#)
IfTrueAction4=[!SetOption TempBar BarColor "#Red#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Red#"][!UpdateMeter "CPUTempString"][!Redraw]

[TempBar]
Meter=Bar
MeasureName=MeasureCPUTemp2
X=247
Y=41
W=90
H=5
BarOrientation=HORIZONTAL
Scale=100
Updatedivider=1

[TempHeader]
Meter=STRING
MeterStyle=styleText
X=247
Y=28
Text="TEMP"

[CPUTempString]
Meter=STRING
MeterStyle=styleText
MeasureName=MeasureCPUTemp
X=295
Y=28
Postfix= ' °C'
NumOfDecimals=0
Updatedivider=1
Zer0Bit
Posts: 5
Joined: January 31st, 2019, 1:43 am

Re: Coding help requested for modifying Skin

Zer0Bit » February 2nd, 2019, 4:03 am

Finally got it sorted, here is the modified code I used, not quite sure why the -24 was in the MeasureCPUTemp2 formula to begin with though:

Code: Select all

[Variables]

Core=1
SpeedFanIndex=20
BarColor=34,95,142,255
BarColor2=139,207,255,255
FontName=hooge 05_53
FontHeight=8
FontHeight2=11
FontColor=139,207,255,255
Horizontal=HORIZONTAL
GraphColor1=89,190,255,255
GraphColor2=77,183,255,255
Green=0,255,0,255
Yellow=255,255,0,255
Orange=255,155,0,255
Red=255,0,0,255
WarningTemp=45
WarningTemp2=50
HotTemp=65

;////////////////////////////////////////
; STYLES
;////////////////////////////////////////

[styleText]
StringCase=UPPER
StringStyle=BOLD
FontColor=#FontColor#
FontFace=#FontName#
FontSize=#FontHeight#
AntiAlias=1
ClipString=1

[MeasureCPUTemp]
Measure=Plugin
Plugin=Plugins\SpeedFanPlugin.dll
SpeedFanType=TEMPERATURE
SpeedFanNumber=#SpeedFanIndex#

[MeasureCPUTemp2]
Measure=Calc
Formula=MeasureCPUTemp *1
MinValue=0
MaxValue=75

IfCondition=(MeasureCPUTemp2 < #WarningTemp#)
IfTrueAction=[!SetOption TempBar BarColor "#Green#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Green#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition2=(MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#)
IfTrueAction2=[!SetOption TempBar BarColor "#Yellow#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Yellow#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition3=(MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#)
IfTrueAction3=[!SetOption TempBar BarColor "#Orange#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Orange#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition4=(MeasureCPUTemp2 >= #HotTemp#)
IfTrueAction4=[!SetOption TempBar BarColor "#Red#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Red#"][!UpdateMeter "CPUTempString"][!Redraw]

[TempBar]
Meter=Bar
MeasureName=MeasureCPUTemp2
X=247
Y=41
W=90
H=5
BarOrientation=HORIZONTAL
Scale=100
Updatedivider=1

[TempHeader]
Meter=STRING
MeterStyle=styleText
X=247
Y=28
Text="TEMP"

[CPUTempString]
Meter=STRING
MeterStyle=styleText
MeasureName=MeasureCPUTemp
X=295
Y=28
Postfix= ' °C'
NumOfDecimals=0
Updatedivider=1
User avatar
balala
Rainmeter Sage
Posts: 7628
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Coding help requested for modifying Skin

balala » February 2nd, 2019, 2:13 pm

Zer0Bit wrote:
February 2nd, 2019, 4:03 am
Finally got it sorted, here is the modified code I used, not quite sure why the -24 was in the MeasureCPUTemp2 formula to begin with though:
Yep, neither for me was not clear enough why was it added (extracted?). So, now is the code alright?
Zer0Bit
Posts: 5
Joined: January 31st, 2019, 1:43 am

Re: Coding help requested for modifying Skin

Zer0Bit » February 3rd, 2019, 12:30 am

balala wrote:
February 2nd, 2019, 2:13 pm
Yep, neither for me was not clear enough why was it added (extracted?). So, now is the code alright?
I have no idea why it was included in the original code doesn't make a difference on the temp readings though, so all is good and removing it corrected the bar showing nothing until temp was above 24 C, and I was able to adjust the 100% scale of the bar by setting the max value to 75 instead of 100.

Thanks a lot for your help with this, I definitely understand the rainmeter coding better.

The skin is the BlueVision V0.2 CPU Complete, if anyone wants to use the modified code here it is with the changes I made. And a thank you to the original author g3xter for creating one of my favorite skins.

Code: Select all

;#####################################################################################
;#####################################################################################
;#####################################################################################

[Rainmeter]

Author=g3xter ;Mods by Zer0
Update=1000

;////////////////////////////////////////
;  CPU
;////////////////////////////////////////

[Variables]
;CORENUMBER, 0 is total

Core=1

;SPEEDFAN INDEX
;Launch SpeedFan and look for the desired Core.
;The indexing starts from 0 so if your first Core is e.g. the second temperature use SpeedFanIndex=1.
;The default for quadcore systems is SpeedFanIndex=5 for the first Core and 12 for the 8th.

SpeedFanIndex=20

BarColor=34,95,142,255
BarColor2=139,207,255,255
FontName=hooge 05_53
FontHeight=8
FontHeight2=11
FontColor=139,207,255,255
Horizontal=HORIZONTAL
GraphColor1=89,190,255,255
GraphColor2=77,183,255,255
Green=0,255,0,255
Yellow=255,255,0,255
Orange=255,155,0,255
Red=255,0,0,255
WarningTemp=45
WarningTemp2=50
HotTemp=65

;////////////////////////////////////////
; STYLES
;////////////////////////////////////////

[styleText]
StringCase=UPPER
StringStyle=BOLD
FontColor=#FontColor#
FontFace=#FontName#
FontSize=#FontHeight#
AntiAlias=1
ClipString=1

;////////////////////////////////////////
;  BACKGROUNDS
;////////////////////////////////////////

[Background]
Meter=Image
ImageName=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\CPU INTERFACE.png
W=225
H=88
X=0
Y=0

[CPUStringInfoBackground]
Meter=Image
ImageName=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\CPU INFO PANEL.png
W=114
H=51
X=229
Y=0

[TempGraphBackground]
Meter=Image
ImageName=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\CPU TEMPERATURE GRAPH.png
W=98
H=23
X=243
Y=59

;////////////////////////////////////////
;  CPU MEASURE
;////////////////////////////////////////

[MeasureCPU]
Measure=CPU
Processor=#Core#

[MeasureCPUCalc]
Measure=Calc
Formula=MeasureCPU + 100
Substitute="100":"000","101":"001","102":"002","103":"003","104":"004","105":"005","106":"006","107":"007","108":"008","109":"009","109":"009","110":"010","111":"011","112":"012","113":"013","114":"014","115":"015","116":"016","117":"017","118":"018","119":"019","120":"020","121":"021","122":"022","123":"023","124":"024","125":"025","126":"026","127":"027","128":"028","129":"029","130":"030","131":"031","132":"032","133":"033","134":"034","135":"035","136":"036","137":"037","138":"038","139":"039","140":"040","141":"041","142":"042","143":"043","144":"044","145":"045","146":"046","147":"047","148":"048","149":"049","150":"050","151":"051","152":"052","153":"053","154":"054","155":"055","156":"056","157":"057","158":"058","159":"059","160":"060","161":"061","162":"062","163":"063","164":"064","165":"065","166":"066","167":"067","168":"068","169":"069","170":"070","171":"071","172":"072","173":"073","174":"074","175":"075","176":"076","177":"077","178":"078","179":"079","180":"080","181":"081","182":"082","183":"083","184":"084","185":"085","186":"086","187":"087","188":"088","189":"089","190":"090","191":"091","192":"092","193":"093","194":"094","195":"095","196":"096","197":"097","198":"098","199":"099","200":"100"
MinValue=100
MaxValue=200

[MeasureCPUTemp]
Measure=Plugin
Plugin=Plugins\SpeedFanPlugin.dll
SpeedFanType=TEMPERATURE
SpeedFanNumber=#SpeedFanIndex#

[MeasureCPUTemp2]
Measure=Calc
Formula=MeasureCPUTemp *1
MinValue=0
MaxValue=75

IfCondition=(MeasureCPUTemp2 < #WarningTemp#)
IfTrueAction=[!SetOption TempBar BarColor "#Green#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Green#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition2=(MeasureCPUTemp2 >= #WarningTemp#) && (MeasureCPUTemp2 < #WarningTemp2#)
IfTrueAction2=[!SetOption TempBar BarColor "#Yellow#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Yellow#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition3=(MeasureCPUTemp2 >= #WarningTemp2#) && (MeasureCPUTemp2 < #HotTemp#)
IfTrueAction3=[!SetOption TempBar BarColor "#Orange#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Orange#"][!UpdateMeter "CPUTempString"][!Redraw]
IfCondition4=(MeasureCPUTemp2 >= #HotTemp#)
IfTrueAction4=[!SetOption TempBar BarColor "#Red#"][!UpdateMeter "TempBar"][!SetOption CPUTempString FontColor "#Red#"][!UpdateMeter "CPUTempString"][!Redraw]

;////////////////////////////////////////
;  BUTTONS
;////////////////////////////////////////

[ButtonHideCPUInfo]
Meter=Button
X=219
Y=-1
ButtonImage=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\HIDE CPU INFO.png
ButtonCommand=!Execute [!RainmeterHideMeter CPUTempGraph] [!RainmeterHideMeter TempGraphBackground] [!RainmeterHideMeter ButtonHideGraph] [!RainmeterHideMeter ButtonShowGraph] [!RainmeterHideMeter CPUPercentString] [!RainmeterHideMeter TempHeader] [!RainmeterHideMeter TempBar] [!RainmeterHideMeter TempBarBackground] [!RainmeterHideMeter CPUHeader2] [!RainmeterHideMeter CPUTempString] [!RainmeterHideMeter CPUPercentStringSymbol] [!RainmeterHideMeter CPUStringInfoBackground] [!RainmeterHideMeter ButtonHideCPUInfo] [!RainmeterShowMeter ButtonShowCPUInfo]
RightMouseUpAction=!Execute ["taskmgr.exe"]

[ButtonShowCPUInfo]
Meter=Button
X=219
Y=-1
ButtonImage=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\SHOW CPU INFO.png
ButtonCommand=!Execute [!RainmeterShowMeter CPUTempGraph] [!RainmeterShowMeter TempGraphBackground] [!RainmeterShowMeter ButtonHideGraph] [!RainmeterShowMeter CPUPercentString] [!RainmeterShowMeter TempHeader] [!RainmeterShowMeter TempBar] [!RainmeterShowMeter TempBarBackground] [!RainmeterShowMeter CPUHeader2] [!RainmeterShowMeter CPUTempString] [!RainmeterShowMeter CPUPercentStringSymbol] [!RainmeterShowMeter CPUStringInfoBackground] [!RainmeterHideMeter ButtonShowCPUInfo] [!RainmeterShowMeter ButtonHideCPUInfo]
Hidden=1

[ButtonHideAllTemps]
Meter=Button
X=219
Y=28
ButtonImage=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\HIDE ALL TEMPS.png
ButtonCommand=!Execute [!RainmeterHideMeter CPUTempGraph] [!RainmeterHideMeter TempGraphBackground] [!RainmeterHideMeter ButtonHideGraph] [!RainmeterHideMeter ButtonShowGraph] [!RainmeterHideMeter CPUTempString] [!RainmeterHideMeter TempHeader] [!RainmeterHideMeter TempBar] [!RainmeterHideMeter TempBarBackground] [!RainmeterHideMeter ButtonHideAllTemps] [!RainmeterShowMeter ButtonShowAllTemps]

[ButtonShowAllTemps]
Meter=Button
X=219
Y=28
ButtonImage=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\SHOW ALL TEMPS.png
ButtonCommand=!Execute [!RainmeterShowMeter CPUTempGraph] [!RainmeterShowMeter TempGraphBackground] [!RainmeterShowMeter ButtonHideGraph] [!RainmeterShowMeter CPUTempString] [!RainmeterShowMeter TempHeader] [!RainmeterShowMeter TempBar] [!RainmeterShowMeter TempBarBackground] [!RainmeterHideMeter ButtonShowAllTemps] [!RainmeterShowMeter ButtonHideAllTemps]
Hidden=1

[ButtonHideGraph]
Meter=Button
X=242
Y=50
ButtonImage=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\HIDE TEMP GRAPH.png
ButtonCommand=!Execute [!RainmeterHideMeter CPUTempGraph] [!RainmeterHideMeter TempGraphBackground] [!RainmeterHideMeter ButtonHideGraph] [!RainmeterShowMeter ButtonShowGraph]

[ButtonShowGraph]
Meter=Button
X=242
Y=50
ButtonImage=#SKINSPATH#\BlueVision V0.2\CPU\CPU RESOURCES\SHOW TEMP GRAPH.png
ButtonCommand=!Execute [!RainmeterShowMeter CPUTempGraph] [!RainmeterShowMeter TempGraphBackground] [!RainmeterHideMeter ButtonShowGraph] [!RainmeterShowMeter ButtonHideGraph] 
Hidden=1

;////////////////////////////////////////
;  CPU GRAPH
;////////////////////////////////////////

[CPUGraphLine]
Meter=Line
MeasureName=MeasureCPU
X=4
Y=1
H=50
W=215
LineCount=1
LineColor=#GraphColor1#
AntiAlias=1

[CPUGraphHistogram]
Meter=HISTOGRAM
MeasureName=MeasureCPU
X=4
Y=1
H=49
W=215
PrimaryColor=#GraphColor2#
AntiAlias=1

;////////////////////////////////////////
;  CPU BAR
;////////////////////////////////////////

[CPUBarBackground]
Meter=Image
X=2
Y=57
W=218
H=6
SolidColor=#BarColor#

[CPUBar]
Meter=Bar
MeasureName=MeasureCPUCalc
X=2
Y=57
W=218
H=6
BarColor=#BarColor2#
BarOrientation=#Horizontal#

;////////////////////////////////////////
;  HEADERS
;////////////////////////////////////////

[CPUHeader1]
Meter=STRING
MeterStyle=styleText
X=3
Y=0
Text="CPU CORE # #Core#"

[CPUHeader2]
Meter=STRING
MeterStyle=styleText
X=248
Y=2
Text="USAGE"

[CPUPercentStringSymbol]
Meter=STRING
MeterStyle=styleText
X=274
Y=13
FontSize=#FontHeight2#
Text="%"

;////////////////////////////////////////
;  CPU STRING
;////////////////////////////////////////

[CPUPercentString]
Meter=STRING
MeterStyle=styleText
MeasureName=MeasureCPUCalc
X=246
Y=13
FontSize=#FontHeight2#

;////////////////////////////////////////
;  CPU TEMPERATURE
;////////////////////////////////////////

[TempBarBackground]
Meter=Image
X=247
Y=41
W=90
H=5
SolidColor=#BarColor#

[TempBar]
Meter=Bar
MeasureName=MeasureCPUTemp2
X=247
Y=41
W=90
H=5
BarOrientation=HORIZONTAL
Scale=100
Updatedivider=1

[TempHeader]
Meter=STRING
MeterStyle=styleText
X=247
Y=28
Text="TEMP"

[CPUTempString]
Meter=STRING
MeterStyle=styleText
MeasureName=MeasureCPUTemp
X=295
Y=28
Postfix= ' °C'
NumOfDecimals=0
Updatedivider=1

;////////////////////////////////////////
;  CPU TEMPERATURE GRAPH
;////////////////////////////////////////

[CPUTempGraph]
Meter=Line
MeasureName=MeasureCPUTemp2
X=243
Y=71
H=11
W=97
LineCount=1
LineColor=#GraphColor1#
AntiAlias=1
UpdateDivider=3

;#####################################################################################
;#####################################################################################
;#####################################################################################