It is currently April 18th, 2024, 2:28 pm

Using a Line graph with Measure=PhysicalMemory

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using a Line graph with Measure=PhysicalMemory

Post by Yincognito »

Ok, so if you want to restrict the range from 45 to 85 Celsius, you should do something like (MSI Afterburner plugin used for GPU temperature here, replace with your desired plugin if needed):

Code: Select all

[MeasureGPUTemp]
Measure=Plugin
Plugin=MSIAfterburner.dll
DataSource=GPU temperature

[MeasureGPUTemp45To85]
Measure=Calc
Formula=Abs(MeasureGPUTemp-45)

[MeasureAverageLast64Values1]
Measure=Calc
Formula=MeasureGPUTemp45To85
AverageSize=64

[MeasureAverageLast64Values2]
Measure=Calc
Formula=MeasureAverageLast64Values1
AverageSize=64

[MeasureAverageLast64Values3]
Measure=Calc
Formula=MeasureAverageLast64Values2
AverageSize=64
MinValue=0
MaxValue=40
...and replace AutoScale=1 with Scale=1 in the Line meter from your skin code, so that the values are multiplied by 1 when shown in the meter, making the graph "fixed" instead of always adapting to the greatest occuring value in the data (like it does when AutoScale=1 is present).

Basically, you would draw the (MeasureGPUTemp-45) values in the graph (hence the additional Calc measure named MeasureGPUTemp45To85). 45 Celsius will be drawn at 0 in the graph and 85 Celsius will be drawn at 40, thus a MinValue=0 and MaxValue=40 is good to have in MeasureAverageLast64Values3 (i.e. the measure you will actually use as a "data source" for the Line meter, just like in the previous case), in order to instruct Rainmeter to see 40 as the 100% point when drawing the graph line.

NOTE: You can replace the MeasureGPUTemp45To85 formula with Clamp((MeasureGPUTemp-45), 0, 40) so that the measure's value doesn't exceed 40 right from the start. Of course, the Line meter will draw the values that exceed the maximum at the 100% point anyway, as far as I know ... but, well, it doesn't hurt to set things right from the beginning.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Using a Line graph with Measure=PhysicalMemory

Post by Mor3bane »

yincognito, you are a great person. thanks for all of the excellent descriptions and advice - it all went together very satisfactorily :rosegift:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Yincognito
Rainmeter Sage
Posts: 7120
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Using a Line graph with Measure=PhysicalMemory

Post by Yincognito »

Mor3bane wrote: February 8th, 2019, 4:01 pm yincognito, you are a great person. thanks for all of the excellent descriptions and advice - it all went together very satisfactorily :rosegift:
Thanks and you're welcome. Don't forget to put a marker (e.g. a text label) somewhere near the graph to make you (or potential users of your skin) aware that the 0% point is actually 45 Celsius and the 100% point is 85 Celsius - if you want to go that road, of course.

EDIT: By the way, once you've achieved the sinusoidal "zoomed" looking for your graph using the Calc measures, you can always use TransformationMatrix to "shrink" or "enlarge" the graph, as explained by eclectic-tech - that won't change the sinusoidal look, it will only make it wider/narrower/shorter/higher, depending on the TransformationMatrix parameters. If you ever think about doing it, be aware that TransformationMatrix, if used without much thinking, can also change the position of the graph, not only its width/height. Eclectic-Tech, however, is aware of that thing and he can advise you very well on the matter. I actually used one of his mini-tutorials to correctly shrink a large number of graphs and make them "horizontally adaptive" on a fork of another skin.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth