It is currently December 12th, 2019, 8:34 pm

shapes and average

Help with creating, editing & fixing problems with skins
ItsJustRyan
Posts: 37
Joined: October 25th, 2019, 1:20 am

shapes and average

ItsJustRyan » December 4th, 2019, 6:30 am

Hi! Right now im playing around with the core temp thing. First thing, I'm not sure why it cant calculate out the average. The other thing is that when i try rotate and scaling the shape, I'm unable to make the width of the bar increase in the other direction. What do i do?

Code: Select all

[Rainmeter]
Update=16

;[MeasureCore1]
;Measure=Plugin
;Plugin=CoreTemp
;CoreTempType=Temperature
;CoreTempIndex=0

;[MeasureCore2]
;Measure=Plugin
;Plugin=CoreTemp
;CoreTempType=Temperature
;CoreTempIndex=1

;[MeasureCore3]
;Measure=Plugin
;Plugin=CoreTemp
;CoreTempType=Temperature
;CoreTempIndex=2

;[MeasureCore4]
;Measure=Plugin
;Plugin=CoreTemp
;CoreTempType=Temperature
;CoreTempIndex=3

[MeasureMax]
Measure=Plugin
Plugin=CoreTemp
CoreTempType=MaxTemperature

;[Average]
;Measure=calc
;Formula=([MeasureCore1]+[MeasureCore2]+[MeasureCore3]+[MeasureCore4])/4

;[Stringtemp]
;Meter=string
;Text=[MeasureMax]
;Dynamicvariables=1

[Back]
Meter=shape
Shape=rectangle 0,0,1000,100 | Fill Color 255,255,255,100 | Strokewidth 0

[Tempbar]
Meter=shape
Shape=rectangle 50,50,[MeasureMax],5 | Fill Color 255,0,0 | Strokewidth 0 | Rotate 180
Shape2=rectangle 50,0,[MeasureMax],5 | Fill Color 255,0,0 | Strokewidth 0 | Rotate 0
Dynamicvariables=1

[code]
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: shapes and average

mak_kawa » December 4th, 2019, 7:43 am

You mean the [Average] measure doesn't calculate average value when removed all ";" characters from beginning of the lines? If so, you have to add DynamicVariables=1 option to the measure.
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: shapes and average

mak_kawa » December 4th, 2019, 7:59 am

I am not sure about the shape rotation...But, the Rotate=180 transform modifier rotates the bar 180 degree around the center of the bar? If so, "before rortation" and "after rotation" shapes are equal in appearance??
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: shapes and average

mak_kawa » December 4th, 2019, 8:57 am

Maybe I was missing what you said as "make the width of the bar increase in the other direction"...

You possibly have to set AnchorX, AnchorY for Rotate= modifier as Rotate 45,0,0. This option makes the bar stretching from fixed top left point to lower right direction.
ItsJustRyan
Posts: 37
Joined: October 25th, 2019, 1:20 am

Re: shapes and average

ItsJustRyan » December 4th, 2019, 10:22 am

I tried the dynamic variables thing but it didnt work. Also i tried the rotain thing. If it rotates from the centre if would have probably worked. What I meant in terms of rotating it so that instead of the left side being the base and it increasing to the right, i want it to increase to the left and anchored to the right. [like a mirror]
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: shapes and average

mak_kawa » December 4th, 2019, 11:22 am

As for "average", I have not CoreTemp, so I tested your code using dummy random measures. It does work fine as attached image.
test2.gif

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192,192

[MeasureCore1]
Measure=Calc
Formula=Random
LowBound=0
HighBound=100
DynamicVariables=1

[MeasureCore2]
Measure=Calc
Formula=Random
LowBound=0
HighBound=100
DynamicVariables=1

[MeasureCore3]
Measure=Calc
Formula=Random
LowBound=0
HighBound=100
DynamicVariables=1

[MeasureCore4]
Measure=Calc
Formula=Random
LowBound=0
HighBound=100
DynamicVariables=1

[Average]
Measure=calc
Formula=([MeasureCore1]+[MeasureCore2]+[MeasureCore3]+[MeasureCore4])/4
DynamicVariables=1

[meterValue]
Meter=String
MeasureName=MeasureCore1
MeasureName2=MeasureCore2
MeasureName3=MeasureCore3
MeasureName4=MeasureCore4
MeasureName5=Average
X=5
Y=5
Text=Core1: %1#CRLF#Core2: %2#CRLF#Core3: %3#CRLF#Core4: %4#CRLF#Average: %5
Update ratio in your original code is 16(msec). Are you sure?? In above code, I have set it to Update=1000.
You do not have the required permissions to view the files attached to this post.
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: shapes and average

mak_kawa » December 4th, 2019, 11:44 am

I am not entirely sure about "rotation"...But anyway, is this what you want??
test3.gif

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192,192
SkinWidth=100
SkinHeight=30

[Variables]
RightX=100

[MeasureMax]
Measure=Calc
Formula=Random
LowBound=0
HighBound=100
DynamicVariables=1

[Tempbar]
Meter=shape
Shape=rectangle (#RightX#-[MeasureMax]),10,#RightX#,5 | Fill Color 255,0,0 | Strokewidth 0
Dynamicvariables=1
Variable RightX means the X position of the right anchor point.
You do not have the required permissions to view the files attached to this post.
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: shapes and average

mak_kawa » December 4th, 2019, 12:03 pm

I forgot...in fact, I have CoreTemp in my PC. :-) So, I actually tested your code using CoreTemp plugin. This code does work fine.
test.gif

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192,192

[MeasureCore1]
Measure=Plugin
Plugin=CoreTemp
CoreTempType=Temperature
CoreTempIndex=0

[MeasureCore2]
Measure=Plugin
Plugin=CoreTemp
CoreTempType=Temperature
CoreTempIndex=1

[MeasureCore3]
Measure=Plugin
Plugin=CoreTemp
CoreTempType=Temperature
CoreTempIndex=2

[MeasureCore4]
Measure=Plugin
Plugin=CoreTemp
CoreTempType=Temperature
CoreTempIndex=3

[Average]
Measure=calc
Formula=([MeasureCore1]+[MeasureCore2]+[MeasureCore3]+[MeasureCore4])/4
DynamicVariables=1

[meterValue]
Meter=String
MeasureName=MeasureCore1
MeasureName2=MeasureCore2
MeasureName3=MeasureCore3
MeasureName4=MeasureCore4
MeasureName5=Average
X=5
Y=5
Text=Core1: %1#CRLF#Core2: %2#CRLF#Core3: %3#CRLF#Core4: %4#CRLF#Average: %5
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 9258
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: shapes and average

balala » December 4th, 2019, 1:07 pm

There is no need to use the [MeasureCore1] - [MeasureCore4] measures as section variables in the Formula option of the [Average] measure. Using them simply also has the advantage that you can remove the DynamicVariables=1 option as well:

Code: Select all

[Average]
Measure=Calc
Formula=(( MeasureCore1 + MeasureCore2 + MeasureCore3 + MeasureCore4 ) / 4 )
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: shapes and average

mak_kawa » December 4th, 2019, 1:13 pm

As for "stretch-left bar", I have tested using Shape rotation as you have said first, like this.
test.gif

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192,192
SkinWidth=100
SkinHeight=20

[Variables]
RightX=100

[MeasureMax]
Measure=Calc
Formula=Random
LowBound=0
HighBound=100
DynamicVariables=1

[Tempbar]
Meter=shape
Shape=rectangle #RightX#,10,[MeasureMax],5 | Fill Color 255,0,0 | Strokewidth 0 | Rotate 180,0,0
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.