It is currently April 18th, 2024, 10:08 am

Y value for dynamic meter positions in "If" command

Get help with creating, editing & fixing problems with skins
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Y value for dynamic meter positions in "If" command

Post by pul53dr1v3r »

I tried to make it possible to move the histogram and its buttons up-down depending on the number of cores the skin counts with collapse-expand option, but no success. Tried using [!SetOption "___Histogram" "Y" "([MeterMHz:Y]+__)"] in [MeasureSkinState] but seems it's nothing but mistake. Also tried some other imaginations but nothing of it worked. Hadn't been bringing face to face with this earlier.

part#1

Code: Select all

[MeterMHz]
Meter=STRING
MeasureName=MCLOCK
X=10
;Y=([Core8UsageText:Y])+14
Y=-40
FontColor=255,255,255,170
FontSize=8
StringStyle=NORMAL
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Text="CLOCK: %1 MHz"


[RelativeBottomPartPosition]
Measure=Calc
Formula=[MeasureRun]
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!SetOption MeterMHz Y "([Core1UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition2=(#CURRENTSECTION#=2)
IfTrueAction2=[!SetOption MeterMHz Y "([Core2UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition3=(#CURRENTSECTION#=4)
IfTrueAction3=[!SetOption MeterMHz Y "([Core4UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition4=(#CURRENTSECTION#=6)
IfTrueAction4=[!SetOption MeterMHz Y "([Core6UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition5=(#CURRENTSECTION#=8)
IfTrueAction5=[!SetOption MeterMHz Y "([Core8UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition6=(#CURRENTSECTION#=10)
IfTrueAction6=[!SetOption MeterMHz Y "([Core10UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition7=(#CURRENTSECTION#=12)
IfTrueAction7=[!SetOption MeterMHz Y "([Core12UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition8=(#CURRENTSECTION#=14)
IfTrueAction8=[!SetOption MeterMHz Y "([Core14UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition9=(#CURRENTSECTION#=16)
IfTrueAction9=[!SetOption MeterMHz Y "([Core16UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition10=(#CURRENTSECTION#=18)
IfTrueAction10=[!SetOption MeterMHz Y "([Core18UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition11=(#CURRENTSECTION#=20)
IfTrueAction11=[!SetOption MeterMHz Y "([Core20UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition12=(#CURRENTSECTION#=22)
IfTrueAction12=[!SetOption MeterMHz Y "([Core22UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition13=(#CURRENTSECTION#=24)
IfTrueAction13=[!SetOption MeterMHz Y "([Core24UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition14=(#CURRENTSECTION#=26)
IfTrueAction14=[!SetOption MeterMHz Y "([Core26UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition15=(#CURRENTSECTION#=28)
IfTrueAction15=[!SetOption MeterMHz Y "([Core28UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition16=(#CURRENTSECTION#=30)
IfTrueAction16=[!SetOption MeterMHz Y "([Core30UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition17=(#CURRENTSECTION#=32)
IfTrueAction17=[!SetOption MeterMHz Y "([Core32UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition18=(#CURRENTSECTION#=34)
IfTrueAction18=[!SetOption MeterMHz Y "([Core34UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition19=(#CURRENTSECTION#=36)
IfTrueAction19=[!SetOption MeterMHz Y "([Core36UsageText:Y]+16)"][!UpdateMeter "MeterMHz"][!Redraw]


DynamicVariables=1

;___________________________________________________________________CPU FAN RPM

[CPUFanText]
Meter=STRING
MeasureName=cpufan0
X=200
Y=r
Text="FAN: %1rpm"
StringStyle=NORMAL
FontColor=255, 255, 255,170
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1

[CPUFAN0]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.FCPU

;____________________________________________________________________RAM

[MeasureRAMTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=600

[MeasureRAMUsed]
Measure=PhysicalMemory
UpdateDivider=2

[MeasureRAMFree]
Measure=PhysicalMemory
InvertMeasure=1

[RAMUsageLabel]
Meter=String
x=10
y=18r
Text="RAM:"
StringStyle=NORMAL
FontColor=#colorText#
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1

[RAMUsage]
Meter=BAR
MeasureName=MeasureRAMUsed
X=10
Y=-1R
W=190
w=#barWidth#
H=#barHeight#
BarColor=[RAMWarn]
SolidColor=#EmptyBarColor#
BarOrientation=HORIZONTAL
DynamicVariables=1

[RAMUsedGB]
Meter=STRING
StringStyle=Normal
MeasureName=MeasureRAMTotal
MeasureName2=MeasureRAMUsed
MeasureName3=MeasureRAMFree
FontColor=255, 255, 255, 100
FontSize=8
StringAlign=Center
NumofDecimals=1
FontFace=#FontFace#
X=104
Y=-12r
W=1
H=1
Text="%2B/%1B"
AntiAlias=1
Autoscale=1
UpdateDivider=2

[RAMUsagePercent]
Meter=STRING
MeasureName=MeasureRAMUsed
StringAlign=RIGHT
FontFace=#FontFace#
FontColor=#colorText#
FontSize=8
StringStyle=BOLD
X=200
Y=r
W=145
H=14
Text="[%1%]"
AntiAlias=1
NumofDecimals=1
Percentual=1
UpdateDivider=2
part#2

Code: Select all

;[""""""""""""""""""""""""""""""[[Histogram]]""""""""""""""""""""""""""""""]

[CPUHistogram]
Meter=Histogram
MeasureName=MCLOADTOTAL
GraphStart=Left
X=11
Y=20r
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs

[RAMHistogram]
Meter=Histogram
MeasureName=MeasureRAMUsed
GraphStart=Left
X=11
Y=r
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs

[TempHistogram]
Meter=Histogram
MeasureName=MCPUTemp
GraphStart=Left
X=11
Y=r
W=186
H=25
Autoscale=1
Antialias=1
PrimaryColor=176,196,222,150
;SolidColor=255,255,255,15
Group=Graphs

;(""""""""""((UniqueHistBg))"""""""""")

[HistogramBackground]
Meter=Image
X=11
Y=r
W=186
H=25
;Antialias=1
;PrimaryColor=176,196,222,150
SolidColor=255,255,255,15
Group=Graphs

;(""""""""""((TEMP))"""""""""")

[HideTempHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=74
;Y=98
H=9
FontColor=255,140,0,100
Text="TMP"
LeftMouseUpAction=[!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!UpdateMeasure "MeasureTempHistState"]
Group=TButtons

[ShowTempHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
;Y=r
H=9
FontColor=255,255,255,50
Text="TMP"
LeftMouseUpAction=[!SetVariable TempHistState "1"][!WriteKeyValue Variables TempHistState "1"][!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!SetVariable MemHistState "0"][!WriteKeyValue Variables MemHistState "0"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureCpuHistState"][!UpdateMeasure "MeasureMemHistState"]
Hidden=1
Group=TButtons

[MeasureTempHistState]
Measure=Calc
Formula=#TempHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "TempHistogram"][!ShowMeter "ShowTempHistogram"][!HideMeter "HideTempHistogram"][!Update]
IfFalseAction=[!ShowMeter "TempHistogram"][!HideMeter "ShowTempHistogram"][!ShowMeter "HideTempHistogram"][!Update]
DynamicVariables=1

;(""""""""""((CPU))"""""""""")

[HideCpuHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=104
;Y=98
H=9
FontColor=255,140,0,100
Text="CPU"
LeftMouseUpAction=[!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!UpdateMeasure "MeasureCpuHistState"]
Group=TButtons

[ShowCpuHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
;Y=r
H=9
FontColor=255,255,255,50
Text="CPU"
LeftMouseUpAction=[!SetVariable CpuHistState "1"][!WriteKeyValue Variables CpuHistState "1"][!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!SetVariable MemHistState "0"][!WriteKeyValue Variables MemHistState "0"][!UpdateMeasure "MeasureCpuHistState"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureMemHistState"]
Hidden=1
Group=TButtons

[MeasureCpuHistState]
Measure=Calc
Formula=#CpuHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "CPUHistogram"][!ShowMeter "ShowCpuHistogram"][!HideMeter "HideCpuHistogram"][!Update]
IfFalseAction=[!ShowMeter "CPUHistogram"][!HideMeter "ShowCpuHistogram"][!ShowMeter "HideCpuHistogram"][!Update]
DynamicVariables=1


;(""""""""""((MEM))"""""""""")

[HideMemHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=134
;Y=98
H=9
FontColor=255,140,0,100
Text="MEM"
LeftMouseUpAction=[!SetVariable MemHistState "0"][!WriteKeyValue Variables MemHistState "0"][!UpdateMeasure "MeasureMemHistState"]
Group=TButtons

[ShowMemHistogram]
Meter=String
MeterStyle=styleCenterText
FontSize=7
X=r
;Y=r
H=9
FontColor=255,255,255,50
Text="MEM"
LeftMouseUpAction=[!SetVariable MemHistState "1"][!WriteKeyValue Variables MemHistState "1"][!SetVariable TempHistState "0"][!WriteKeyValue Variables TempHistState "0"][!SetVariable CpuHistState "0"][!WriteKeyValue Variables CpuHistState "0"][!UpdateMeasure "MeasureMemHistState"][!UpdateMeasure "MeasureTempHistState"][!UpdateMeasure "MeasureCpuHistState"]
Hidden=1
Group=TButtons

[MeasureMemHistState]
Measure=Calc
Formula=#MemHistState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!HideMeter "RAMHistogram"][!ShowMeter "ShowMemHistogram"][!HideMeter "HideMemHistogram"][!Update]
IfFalseAction=[!ShowMeter "RAMHistogram"][!HideMeter "ShowMemHistogram"][!ShowMeter "HideMemHistogram"][!Update]
DynamicVariables=1

;[""""""""""""""""""""""""""""""[[Collapse-Expand]]""""""""""""""""""""""""""""""]

[meterHideGraphs]
Meter=Button
ButtonImage=#@#Images\left.png
X=185
Y=15
ImageTint=255,255,255,150
LeftMouseUpAction=[!SetVariable SkinState "0"][!WriteKeyValue Variables SkinState "0"][!UpdateMeasure "MeasureSkinState"]
TooltipText=Hide graph

[meterShowGraphs]
Meter=Button
ButtonImage=#@#Images\right.png
X=r
Y=r
ImageTint=255,255,255,150
LeftMouseUpAction=[!SetVariable SkinState "1"][!WriteKeyValue Variables SkinState "1"][!UpdateMeasure "MeasureSkinState"]
TooltipText=Show graph
Hidden=1

[MeasureSkinState]
Measure=Calc
Formula=#SkinState#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!DisableMeasure "MeasureTempHistState"][!DisableMeasure "MeasureCpuHistState"][!DisableMeasure "MeasureMemHistState"][!HideMeterGroup "Graphs"][!HideMeterGroup "TButtons"][!ShowMeter "meterShowGraphs"][!HideMeter "meterHideGraphs"][!SetOptionGroup "Graphs" "Y" "0"][!SetOptionGroup "TButtons" "Y" "0"][!HideMeter "HistogramBackground"][!Update]
IfFalseAction=[!EnableMeasure "MeasureTempHistState"][!EnableMeasure "MeasureCpuHistState"][!EnableMeasure "MeasureMemHistState"][!HideMeter "meterShowGraphs"][!ShowMeter "meterHideGraphs"][!SetOption "TempHistogram" "Y" "([MeterMHz:Y]+55)"][!SetOption "CPUHistogram" "Y" "([MeterMHz:Y]+55)"][!SetOption "MEMHistogram" "Y" "([MeterMHz:Y]+55)"][!SetOption "HideTempHistogram" "Y" "([MeterMHz:Y]+80)"][!SetOption "ShowTempHistogram" "Y" "([MeterMHz:Y]+80)"][!SetOption "HideCpuHistogram" "Y" "([MeterMHz:Y]+80)"][!SetOption "ShowCpuHistogram" "Y" "([MeterMHz:Y]+80)"][!SetOption "HideMemHistogram" "Y" "([MeterMHz:Y]+80)"][!SetOption "ShowMemHistogram" "Y" "([MeterMHz:Y]+80)"][!ShowMeter "HistogramBackground"][!SetOption "HistogramBackground" "Y" "([MeterMHz:Y]+55)"][!Update][!Redraw]
DynamicVariables=1
Image
Last edited by pul53dr1v3r on November 9th, 2017, 9:24 pm, edited 1 time in total.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Y value for dynamic meter positions in "If" command

Post by fonpaolo »

Maybe... MoveMeter. ;-)
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Y value for dynamic meter positions in "If" command

Post by balala »

First of all, try to add a DynamicVariables=1 option to the [MeterMHz] meter.
If this doesn't help, please anytime you have such requests, post the whole code, not just parts of it. It would be much - much simpler for any of us to help.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Y value for dynamic meter positions in "If" command

Post by balala »

fonpaolo wrote:Maybe... MoveMeter. ;-)
I don't think there is any difference between setting the Y option of a meter with the !SetOption bang and using the !MoveMeter bang. At least I couldn't find one.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Y value for dynamic meter positions in "If" command

Post by pul53dr1v3r »

I thought it's a bad idea as the code is too large to post all. Have made .rmskin with required images.

Seems DynamicVariable=1 for [MeterMHz] does nothing...


https://we.tl/fjmTGTccco
Last edited by pul53dr1v3r on November 9th, 2017, 9:25 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Y value for dynamic meter positions in "If" command

Post by balala »

Let's clarify what you want to move: initially you said you'd like to move the histogram meter(s). But in the uploaded code, the IfTrueAction options of the [RelativeBottomPartPosition] measure are moving the [MeterMHz] meter, which is a String meter.
Now, what you want to move? Because the code works very well, it moves the [MeterMHz] meter, accordingly to the options set in the [RelativeBottomPartPosition] measure.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Y value for dynamic meter positions in "If" command

Post by pul53dr1v3r »

https://youtu.be/ZTIRdMS6HBI

Edit: Seems DynamicVariables solved the first issue, but this one exists.

Looks like [RelativeBottomPartPosition] is refreshed (got values) after (not before) [MeasureSkinState] so that [MeasureSkinState] can't catch the number of cores so it sets "Y" for the histogram by default on the top.
Am I right?
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Y value for dynamic meter positions in "If" command

Post by balala »

Finally it seems you indeed want to move the histogram(s), right?
Add an IfConditionMode=1 option to the [MeasureSkinState] measure. The !SetOption bangs of the IfTrueAction and IfFalseAction options of the same [MeasureSkinState] measure set the appropriate positions, but to do this, those bangs must be executed once again after the number of cores is determined. This is why the IfConditionMode=1 option is required. But if you apply this solution, it'll crash Rainmeter, because both options (IfTrueAction and IfFalseAction) have a [!Update] bangs, creating in infinite loop, which must be avoided. To avoid it, simply remove the [!Update] bangs (and also remove the [!Redraw] from the IfFalseAction - however, I still can't understand why have you leaved it there: https://forum.rainmeter.net/viewtopic.php?p=141181#p141181).
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Y value for dynamic meter positions in "If" command

Post by pul53dr1v3r »

The histograms and its buttons move only depending on the number of cores. More cores put it more down. Always the same vertical (Y) distance from RAM section and the Histograms. That was my wish.
The current skin state does it right. The only issues I've spotted with the current code are:
-slow (~1s slower than before) showing/hiding histograms and its buttons by clicking on Collapse-Expand buttons on the top, and on manual refresh,
-showing the histogram on the top of the skin during refresh/ click on Collapse-Expand button to show the Histograms.

Video proof is here: https://youtu.be/LhemztZypys

Didn't pay attention to [!Redraw]s this time as it's an old code that have to be analyzed once more at the finish.
Neither the correct Y values for the Histogram section had been set, as you could see.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Y value for dynamic meter positions in "If" command

Post by balala »

Pul53dr1v3r wrote:The only issues I've spotted with the current code are:
-slow (~1s slower than before) showing/hiding histograms and its buttons by clicking on Collapse-Expand buttons on the top, and on manual refresh,
Yeah, that's normal, because we've removed the [!Update] bangs, which makes the skin to have to wait for the next update cycle to update and show the histogram, when you click the button.
However there is a simple solution, I think: go back to the previous code (which had the [!Update] bangs in the IfTrueAction and IfFalseAction options of the [MeasureSkinState] measure) and add a Disabled=1 option to the same [MeasureSkinState] measure. Then add beside the [!EnableMeasure "MeasureSkinState"] bang of the OnRefreshAction option of the of the [Rainmeter] section, the following one: [!EnableMeasure "MeasureSkinState"].