It is currently March 28th, 2024, 2:19 pm

Check Snap Orientation with if condition

Get help with creating, editing & fixing problems with skins
Fatty-Do-Do
Posts: 15
Joined: October 29th, 2022, 12:32 pm

Re: Check Snap Orientation with if condition

Post by Fatty-Do-Do »

Thanks. Will adhere to that recommendation!
No not yet. I am having some Issues with dynamic variable assignment, which I have to prioritize right now, but a small test Skin is already working with your code (Just changes Height and Width depending on the Quadrant it's in). I will post the Code, once I've figured it out for the real skin ;-)
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Check Snap Orientation with if condition

Post by balala »

Fatty-Do-Do wrote: November 2nd, 2022, 6:47 am I will post the Code, once I've figured it out for the real skin ;-)
Alright. I'm gonna take a look when you post it. Good luck.
Fatty-Do-Do
Posts: 15
Joined: October 29th, 2022, 12:32 pm

Re: Check Snap Orientation with if condition

Post by Fatty-Do-Do »

balala wrote: November 2nd, 2022, 12:20 pm Alright. I'm gonna take a look when you post it. Good luck.
Here is your look. Hope You like it and if you have any suggestions please go ahead.
It isn't flawless yet, since it sometimes takes the Update Tick to correctly !Refresh, but i don't want to set the UpdateDivider for the [MeasureOrientationUpdate] nedlessly low and eat up resources. I'm trying to fine tune the internal update rules of the skin, but by using different Variable.inc's for Top, Bottom, Left and Right I pretty much limit myself to the !Refresh bang. I've only done the CPU Part of the Skin so far and I'm not done with the Color Picking option, but the foundations are laid out. Also I've not yet done a massive amout of code cleanup so in the final Version it will hopefully look a lot better (especially in the resources)

Variables:

Code: Select all

[Variables]

---CPU---

CPUName=0
CPUCoreClocks=0
CPUFrequency=1
CPUFrequencyMax=5004
CPUTemperature=2
CPUPowerdraw=3
CPUTemperatureMax=85

---GPU---

GPUName=4
GPUTemperature=4
GPUPowerdraw=5
GPUFrequency=6
GPUUsage=7
GPUVRAMUsage%=8
GPUVRAMUsageMB=
GPUTemperatureMax=85

---Colors---

Transparency=0,0,0,0
MeterBackgroundColor=255,255,255,20
MeterForegroundColor=236,151,006,200
StringColor=255,255,255,170
InputTextHoverColor=0,0,0,66
InputTextColor=0,0,0,255
User Variables:

Code: Select all

[Variables]

---CPU---

CustomCPUName=I5 8600K
CustomCPUFrequencyMax=#CPUFrequencyMax#
CustomCPUTemperatureMax=#CPUTemperatureMax#

---GPU---

CustomGPUName=#GPUName#
CustomGPUFrequencyMax=#GPUFrequencyMax#
CustomGPUTemperatureMax=#GPUTemperatureMax#

---Colors---

CustomMeterBackgroundColor=#MeterBackgroundColor#
CustomMeterForegroundColor=#MeterForegroundColor#
CustomCPUNameStringColor=#StringColor#
CustomGPUNameStringColor=#StringColor#
CustomStringColor=#StringColor#
VariablesR:

Code: Select all

[Variables]

--- Vertical ---

MeterCPU/GPUNameStringY=0

MeterRoundlineStringY1=120
MeterRoundlineStringY2=270
MeterRoundlineStringY3=420
MeterRoundlineHeaderStringY=-5r

MeterBarStringY=270
MeterBarY=70
MeterBarW=15
MeterBarH=400
MeterBarOrientation=Vertical

MeasureCustomCPU/GPUNameY=0

MeasureCustomUserInputY1=110
MeasureCustomUserInputY2=260
MeasureCustomUserInputY3=410

--- Horizontal ---

MeterRoundlineStringX1=60
MeterRoundlineStringX2=60
MeterRoundlineStringX3=60
MeterRoundlineHeaderStringX=60r
MeterRoundlineStartAngle=(Rad(70))
MeterRoundlineRotationAngle=(Rad(220))

MeterBarX=130
MeterBarStringX=100
MeterBarStringAngle=(Rad(-90))

MeasureCustomUserInputX1=35
MeasureCustomUserInputX2=35
MeasureCustomUserInputX3=35
VariablesL:

Code: Select all

[Variables]

--- Vertical ---

MeterCPU/GPUNameStringY=0

MeterRoundlineStringY1=120
MeterRoundlineStringY2=270
MeterRoundlineStringY3=420
MeterRoundlineHeaderStringY=-5r

MeterBarStringY=270
MeterBarY=70
MeterBarW=15
MeterBarH=400
MeterBarOrientation=Vertical

MeasureCustomCPU/GPUNameY=0

MeasureCustomUserInputY1=110
MeasureCustomUserInputY2=260
MeasureCustomUserInputY3=410

--- Left ---

MeterRoundlineStringX1=90
MeterRoundlineStringX2=90
MeterRoundlineStringX3=90
MeterRoundlineHeaderStringX=60r
MeterRoundlineStartAngle=(Rad(110))
MeterRoundlineRotationAngle=(Rad(-220))

MeterBarX=5
MeterBarStringX=50
MeterBarStringAngle=(Rad(90))

MeasureCustomUserInputX1=65
MeasureCustomUserInputX2=65
MeasureCustomUserInputX3=65
Styles:

Code: Select all

------------
---Styles---
------------

[StyleString]
X=#MeterRoundlineHeaderStringX#
Y=#MeterRoundlineHeaderStringY#
StringAlign=CenterCenter
FontFace=Segoe UI
FontWeight=700
FontSize=14
FontColor=#CustomStringColor#
AntiAlias=1
NumOfDecimals=0

[StyleCPU/GPUNameString]
X=(#CURRENTCONFIGWIDTH# * 0.5)
Y=#MeterCPU/GPUNameStringY#
H=25
W=(#CURRENTCONFIGWIDTH# - 20)
FontSize=16
StringAlign=Center
ClipString=1

[StyleCPU/GPUPowerdrawString]
X=(#CURRENTCONFIGWIDTH# * 0.5)
Y=20
FontSize=12
FontWeight=600
StringAlign=Center
Text=(%1)

[StyleMeterBarString]
X=#MeterBarStringX#
Y=#MeterBarStringY#
Angle=#MeterBarStringAngle#
AutoScale=1

[StyleMeterRoundline]
X=-60r
Y=-60r
W=120
H=120
LineStart=50
LineLength=35
LineColor=#CustomMeterBackgroundColor#
StartAngle=#MeterRoundlineStartAngle#
RotationAngle=#MeterRoundlineRotationAngle#
Solid=1
AntiAlias=1

[StyleMeterRoundlineForeground]
X=0r
Y=0r
LineColor=#CustomMeterForegroundColor#

[StyleMeterBar]
X=#MeterBarX#
Y=#MeterBarY#
W=#MeterBarW#
H=#MeterBarH#
BarOrientation=#MeterBarOrientation#
BarColor=#CustomMeterForegroundColor#
SolidColor=#CustomMeterBackgroundColor#
AntiAlias=1

[StyleMeterCustomUserInput]
SolidColor=#InputTextHoverColor#
X=0r
Y=0r
H=20
W=50
Hidden=1

[StyleTooltip]
ToolTipIcon=Info
ToolTipType=1
Main Skin:

Code: Select all

[Rainmeter]
Update=1000
SkinWidth=150
SkinHeight=480
AccurateText=1

[Metadata]
Name=CSM - Circular System Monitor
Author=Fatty-Do-Do
Information=This Skin uses HWiNFO64 to allow displaying CPU and GPU readouts.
Version=2.0
License=Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

[SourceAttribution]
-Snippets, Tutorials, etc. by the legendary Rainmeter Team (especially jsmorely)
-The Clock is inspired by "Evasion" from DD-921 and "Zirim Clock" from Mirix10
-Anurati Regular Free by Emmeran Richards (not included, used in the Clock)
-Quite Magical Regular by Misti Hammers (not included, used in Clock)

[How to set up?]
Install HWiNFO64 in English.
Hit "Configure Sensors", then "HWiNFO Gadget" and Enable reporting to Gadget for the following Sensors:
-Effective Core Clock
-CPU Package
-CPU Package Power
-GPU Temperature
-GPU Power
-GPU Effective Clock
-GPU Core Load
-GPU Memory Usage
-GPU Memory Allocated

Scroll through the "Sensors Status" HWiNFO64 Page, find the activated Sensors, right click them and hit "Customize values".
There you can rename the Sensors to your liking and also set the number of decimals you want to have displayed and select your Units of Measure.

Refresh the Skin and start editing the parts that allow/require it by following the tooltip instructions:
-CPU/GPU Name (not required, default HWiNFO64 Readout)
-CPU/GPU Frequency Max. (required)
-CPU/GPU Temperature Max. (not required, default 85�C)

You can also customize colors for:
-The CPU Nametag
-The GPU Nametag
-All other Text
-All Meters

[Variables]
Orientation=R
@IncludeVariables=#@#Variables.inc
@IncludeUserVariables=#@#UserVariables.inc
@IncludeOrientationVariables=#@#Variables#Orientation#.inc

[Styles]
@IncludeStyles=#@#Styles.inc

----------------
--- MEASURES ---
----------------

[MeasureCPUUsage]
Measure=CPU

[MeasureSystemMemoryUsage]
Measure=PhysicalMemory
UpdateDivider=2

[MeasureSystemMemoryMax]
Measure=PhysicalMemory
Total=1
UpdateDivider=3600

-------------------------
--- MEASURES-HWiNFO64 ---
-------------------------

[MeasureCPUName]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Sensor#CPUName#
RegExpSubstitute=1
Substitute="^.*]:":""

[MeasureCPUPowerdraw]
Measure=
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value#CPUPowerdraw#

[MeasureCPUCoreClocks]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw#CPUCoreClocks#
IfCondition=(MeasureCPUCoreClocks > #CPUFrequencyMax#)
IfTrueAction=[!WriteKeyValue Variables CPUFrequencyMax "[MeasureCPUCoreClocks]" "#@#Variables.inc"]

[MeasureCustomCPUFrequencyMaxReset]
Measure=String
String=#CustomCPUFrequencyMax#
IfMatch=^$
IfMatchAction=[!WriteKeyValue Variables CustomCPUFrequencyMax #*CPUFrequencyMax*# "#@#UserVariables.inc"][!Refresh]

[MeasureCPUFrequency]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=ValueRaw#CPUFrequency#
MinValue=0
MaxValue=#CPUFrequencyMax#

[MeasureCPUTemperature]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value#CPUTemperature#
MinValue=0
MaxValue=#CustomCPUTemperatureMax#

---------------------------
- CUSTOMIZATION - MEASURES-
---------------------------

[MeasureCustomCPUName]
Measure=Plugin
Plugin=InputText.dll
X=#MeasureCustomCPU/GPUNameX#
Y=#MeasureCustomCPU/GPUNameY#
H=25
W=#MeasureCustomCPU/GPUNameW#
SolidColor=#InputTextColor#
FontColor=#CustomStringColor#
FontFace=Segoe UI
FontSize=16
FontWeight=700
AntiAlias=1
FocusDismiss=1
DynamicVariables=1
Command1=[!WriteKeyValue Variables CustomCPUName "$UserInput$" "#@#UserVariables.inc"][!Refresh]

[MeasureCustomCPUTemperatureMax]
Measure=Plugin
Plugin=InputText.dll
X=#MeasureCustomUserInputX2#
Y=#MeasureCustomUserInputY2#
H=20
W=50
SolidColor=#InputTextColor#
FontColor=#CustomStringColor#
FontFace=Segoe UI
FontSize=14
FontWeight=500
InputNumber=1
InputLimit=3
AntiAlias=1
FocusDismiss=1
DynamicVariables=1
Command1=[!WriteKeyValue Variables CustomCPUTemperatureMax "$UserInput$" "#@#UserVariables.inc"][!Refresh]

[MeasureCustomCPUTemperatureMaxReset]
Measure=String
String=#CustomCPUTemperatureMax#
IfMatch=^$
IfMatchAction=[!WriteKeyValue Variables CustomCPUTemperatureMax #*CPUTemperatureMax*# "#@#UserVariables.inc"][!Refresh]

[MeasureCustomCPUFrequencyMax]
Measure=Plugin
Plugin=InputText.dll
X=#MeasureCustomUserInputX3#
Y=#MeasureCustomUserInputY3#
H=20
W=50
SolidColor=#InputTextColor#
FontColor=#CustomStringColor#
FontFace=Segoe UI
FontSize=14
FontWeight=500
InputNumber=1
InputLimit=4
AntiAlias=1
FocusDismiss=1
DynamicVariables=1
Command1=[!WriteKeyValue Variables CustomCPUFrequencyMax "$UserInput$" "#@#UserVariables.inc"][!Refresh]

--------------------------
--- POSITIONAL MEASURE ---
--------------------------

[MeasureTangent]
Measure=Calc
Formula=( #SCREENAREAHEIGHT# / #SCREENAREAWIDTH# )
IfCondition=((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))<#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#SCREENAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))<#CURRENTSECTION#))
IfTrueAction=[!SetVariable Orientation "T"][!WriteKeyValue Variables Orientation "T"][!UpdateMeasure MeasureOrientationUpdate]
IfCondition2=((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))<#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#SCREENAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))>=#CURRENTSECTION#))
IfTrueAction2=[!SetVariable Orientation "R"][!WriteKeyValue Variables Orientation "R"][!UpdateMeasure MeasureOrientationUpdate]
IfCondition3=((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))>=#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#SCREENAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))>=#CURRENTSECTION#))
IfTrueAction3=[!SetVariable Orientation "B"][!WriteKeyValue Variables Orientation "B"][!UpdateMeasure MeasureOrientationUpdate]
IfCondition4=((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))>=#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#SCREENAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))<#CURRENTSECTION#))
IfTrueAction4=[!SetVariable Orientation "L"][!WriteKeyValue Variables Orientation "L"][!UpdateMeasure MeasureOrientationUpdate]
DynamicVariables=1

[MeasureOrientationUpdate]
Measure=String
String=#Orientation#
OnChangeAction=[!Refresh]
DynamicVariables=1

--------------
--- METERS ---
--------------

[MeterBackground]
Meter=Image
X=0
Y=0
W=300
H=500
SolidColor=0,0,0,20

--- CPU Name ---

[MeterCPUName]
Meter=String
MeterStyle=StyleString | StyleCPU/GPUNameString
MeasureName=MeasureCPUName
FontColor=#CustomCPUNameStringColor#
Text=#CustomCPUName#
MouseOverAction=[!ShowMeter MeterCustomCPUName][!Redraw]
MouseLeaveAction=[!HideMeter MeterCustomCPUName][!Redraw]

[MeterCustomCPUName]
Meter=String
MeterStyle=StyleString | StyleCPU/GPUNameString | StyleTooltip
SolidColor=#InputTextHoverColor#
Hidden=1
ToolTipTitle=CPU Name
ToolTipText=Default: HWiNFO64 Readout for CPU#CRLF#Left Click: Change Color (TBD)#CRLF#Right Click: Rename#CRLF#Enter: Confirm new Name#CRLF#Enter with no Input: Restore Default
MouseOverAction=[!SetOption MeterCPUName FontColor #Transparency#][Redraw]
MouseLeaveAction=[!SetOption MeterCPUName FontColor ""][!Redraw]
LeftMouseUpAction=
RightMouseUpAction=[!CommandMeasure MeasureCustomCPUName "ExecuteBatch 1"][!Update]

--- CPU Powerdraw ---

[MeterCPUPowerdraw]
Meter=String
MeterStyle=StyleString | StyleCPU/GPUPowerdrawString | StyleTooltip
MeasureName=MeasureCPUPowerdraw
FontColor=0,0,0,0
ToolTipTitle=CPU Power Consumption
ToolTipText=Incompatible with Overclocking!#CRLF#(Requires SVID to be enabled in the BIOS)#CRLF#Left Click: Change Color (TBD)#CRLF#Right Click: Enable & Show#CRLF#Right Double Click: Disable & Hide
LeftMouseUpAction=
RightMouseDoubleClickAction=[!WriteKeyValue MeasureCPUPowerdraw Measure ""][!WriteKeyValue MeterCPUPowerdraw FontColor #Transparency#][!Refresh]
RightMouseDownAction=[!WriteKeyValue MeasureCPUPowerdraw Measure "Registry"][!WriteKeyValue MeterCPUPowerdraw FontColor #CustomStringColor#][!Refresh]

--- CPU Usage ---

[MeterStringCPUUsage]
Meter=String
MeterStyle=StyleString
MeasureName=MeasureCPUUsage
X=#MeterRoundlineStringX1#
Y=#MeterRoundlineStringY1#
Text=%1%

[MeterRoundlineCPUUsageBackground]
Meter=Roundline
MeterStyle=StyleMeterRoundline

[MeterRoundlineCPUUsage]
Meter=Roundline
MeterStyle=StyleMeterRoundline | StyleMeterRoundlineForeground
MeasureName=MeasureCPUUsage

[MeterStringCPUUsageHeader]
Meter=String
MeterStyle=StyleString
Text=Load

--- CPU Temp ---

[MeterStringCPUTemperature]
Meter=String
MeterStyle=StyleString
MeasureName=MeasureCPUTemperature
X=#MeterRoundlineStringX2#
Y=#MeterRoundlineStringY2#
FontColor=#CustomStringColor#
Text=%1
MouseOverAction=[!ShowMeter MeterCustomCPUTemperatureMax][!Redraw]
MouseLeaveAction=[!HideMeter MeterCustomCPUTemperatureMax][!Redraw]

[MeterCustomCPUTemperatureMax]
Meter=String
MeterStyle=StyleString | StyleMeterCustomUserInput | StyleTooltip
ToolTipTitle=CPU Temperature Max.
ToolTipText=Default: 85[\x00B0]C in your UoM#CRLF#Left Click: Change Color (TBD)#CRLF#Right Click: Set new CPU Temperature Max.#CRLF#Enter: Confirm new Temperature Max.#CRLF#Enter with no Input: Restore Default
MouseOverAction=[!SetOption MeterStringCPUTemperature FontColor #Transparency#][!Redraw]
MouseLeaveAction=[!SetOption MeterStringCPUTemperature FontColor ""][!Redraw]
LeftMouseUpAction=
RightMouseUpAction=[!CommandMeasure MeasureCustomCPUTemperatureMax "ExecuteBatch 1"][!Update]

[MeterRoundlineCPUTemperatureBackground]
Meter=Roundline
MeterStyle=StyleMeterRoundline

[MeterRoundlineCPUTemperature]
Meter=Roundline
MeterStyle=StyleMeterRoundline | StyleMeterRoundlineForeground
MeasureName=MeasureCPUTemperature

[MeterStringCPUTemperatureHeader]
Meter=String
MeterStyle=StyleString
Text=Temp

--- CPU Speed ---

[MeterStringCPUFrequency]
Meter=String
MeterStyle=StyleString | StyleMeterRoundlineString
MeasureName=MeasureCPUFrequency
X=#MeterRoundlineStringX3#
Y=#MeterRoundlineStringY3#
Text=%1
MouseOverAction=[!ShowMeter MeterCustomCPUFrequencyMax][!Redraw]
MouseLeaveAction=[!HideMeter MeterCustomCPUFrequencyMax][!Redraw]

[MeterCustomCPUFrequencyMax]
Meter=String
MeterStyle=StyleString | StyleMeterCustomUserInput | StyleTooltip
ToolTipTitle=CPU Maximum Frequency
ToolTipText=Default: Calculated from HWiNFO64 Sensor Data#CRLF#(Might be incorrect when Overclocking or Undervolting)#CRLF#(Manual Input recommended when Meter shows incorrectly)#CRLF#Left Click: Change Color (TBD)#CRLF#Right Click: Set new CPU Frequency Max.#CRLF#Enter: Confirm new Frequency Max.#CRLF#Enter with no Input: Restore Default
MouseOverAction=[!SetOption MeterStringCPUFrequency FontColor #Transparency#][!Redraw]
MouseLeaveAction=[!SetOption MeterStringCPUFrequency FontColor ""][!Redraw]
LeftMouseUpAction=
RightMouseUpAction=[!CommandMeasure MeasureCustomCPUFrequencyMax "ExecuteBatch 1"][!Update]

[MeterRoundlineCPUFrequencyBackground]
Meter=Roundline
MeterStyle=StyleMeterRoundline

[MeterRoundlineCPUFrequency]
Meter=Roundline
MeterStyle=StyleMeterRoundline | StyleMeterRoundlineForeground
MeasureName=MeasureCPUFrequency

[MeterStringCPUFrequencyHeader]
Meter=String
MeterStyle=StyleString
Text=MHz

--- RAM ---

[MeterBarStringSystemMemory]
Meter=String
MeterStyle=StyleString | StyleMeterBarString
MeasureName=MeasureSystemMemoryUsage
MeasureName2=MeasureSystemMemoryMax
Text=RAM: %1B / %2B

[MeterBarSystemMemory]
Meter=Bar
MeterStyle=StyleMeterBar
MeasureName=MeasureSystemMemoryUsage
In case you want to test the thing I attatched the skin package :)
Test for balala_CSM 2.0 Beta.rmskin
(7.96 KiB) Downloaded 5 times
PS: If anyone could try to recreate the issue I'm having with registry measures https://forum.rainmeter.net/viewtopic.php?t=41514 I'd appreciate it immensly.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Check Snap Orientation with if condition

Post by balala »

Fatty-Do-Do wrote: November 2nd, 2022, 11:18 pm Here is your look. Hope You like it and if you have any suggestions please go ahead.
Yep, there is something: in the [MeasureCPUPowerdraw] measure the measure type is set to nothing, you have only Measure=. Add the Measure=Registry type.
Fatty-Do-Do
Posts: 15
Joined: October 29th, 2022, 12:32 pm

Re: Check Snap Orientation with if condition

Post by Fatty-Do-Do »

balala wrote: November 3rd, 2022, 7:28 pm Yep, there is something: in the [MeasureCPUPowerdraw] measure the measure type is set to nothing, you have only Measure=. Add the Measure=Registry type.
Actually I have my 8600k running an OC at 5 GHz, for which I have to disable SVID in the BIOS. With SVID disabled Powerdraw readouts don't work. Therefore I have the meter customized to deactivate the measure on a double right click. But I now read that I can use "Disabled=1" for that too.
Works a charm!
I could use "Hidden=1" as well, but since I already have the color variables to work with this way seems easier, especially since I am doing a !Refresh anyway.

Code: Select all

[MeasureCPUPowerdraw]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=SOFTWARE\HWiNFO64\VSB
RegValue=Value#CPUPowerdraw#
Disabled=0

[MeterCPUPowerdraw]
Meter=String
MeterStyle=StyleString | StyleCPU/GPUPowerdrawString | StyleTooltip
MeasureName=MeasureCPUPowerdraw
FontColor=255,255,255,170
ToolTipTitle=CPU Power Consumption
ToolTipText=Incompatible with Overclocking!#CRLF#(Requires SVID to be enabled in the BIOS)#CRLF#Left Click: Change Color (TBD)#CRLF#Right Click: Enable & Show#CRLF#Right Double Click: Disable & Hide
LeftMouseUpAction=
RightMouseDoubleClickAction=[!WriteKeyValue MeasureCPUPowerdraw Disabled 1][!WriteKeyValue MeterCPUPowerdraw FontColor #Transparency#][!Refresh]
RightMouseDownAction=[!WriteKeyValue MeasureCPUPowerdraw Disabled 0][!WriteKeyValue MeterCPUPowerdraw FontColor #CustomStringColor#][!Refresh]
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Check Snap Orientation with if condition

Post by balala »

Fatty-Do-Do wrote: November 3rd, 2022, 7:37 pm Therefore I have the meter customized to deactivate the measure on a double right click. But I now read that I can use "Disabled=1" for that too.
Works a charm!
Let's see if I understand: you've removed the Registry measure type to get the [MeasureCPUPowerdraw] measure not to work?
Disabling it with the Disabled=1 option is a much better solution. Another way to get the measure disabled at the begginig is to add the following OnRefreshaction option to the [Rainmeter] section: OnRefreshAction=[!DisableMeasure "MeasureCPUPowerdraw"]. Actually, in most cases doesn't really matter which solution do you use (even if adding the Disabled=1 option is smarter and especially shorter), but in some cases there might be a difference.
Fatty-Do-Do
Posts: 15
Joined: October 29th, 2022, 12:32 pm

Re: Check Snap Orientation with if condition

Post by Fatty-Do-Do »

balala wrote: November 3rd, 2022, 8:09 pm Let's see if I understand: you've removed the Registry measure type to get the [MeasureCPUPowerdraw] measure not to work?
Disabling it with the Disabled=1 option is a much better solution. Another way to get the measure disabled at the begginig is to add the following OnRefreshaction option to the [Rainmeter] section: OnRefreshAction=[!DisableMeasure "MeasureCPUPowerdraw"]. Actually, in most cases doesn't really matter which solution do you use (even if adding the Disabled=1 option is smarter and especially shorter), but in some cases there might be a difference.
Originally I had the Measure without "Registry" setup with an IfMatch=0, because if a user has activated a wrong sensor it would give me 0, which then triggered an IfMatchAction that deactivated the corresponding Meter. However I scrapped that when I wanted to allow manually disabling the measure in case of overclocking where sensor spits some values that just simply aren't correct. And as I now know, that can also be done with Disable=1

Maybe I'll stumble across the need for that sometime. Just for my curiosity, beyond the obvious convenience of it, is there any technical reason why Disabled=1 is better? I am not a coder, so I've no idea how some of those functions differ. Either way Disabled=1 is the way to go forward.

The Problem with the OnRefreshAction in the [Rainmeter] Section would be that cannot be dynamic, so making a toggleable Measure wouln't be possible that way. Also it would disable the Powerdraw Measure whenever a refresh is performed and there are a bunch more necessary refreshes in my skin, since I want it to be highly intuitive and user configurable. Getting ever closer to the 2.0 Release thanks to your help :thumbup:

At the moment though I am still stuck on the IfMatch10 Problem
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Check Snap Orientation with if condition

Post by balala »

Fatty-Do-Do wrote: November 3rd, 2022, 8:46 pm Just for my curiosity, beyond the obvious convenience of it, is there any technical reason why Disabled=1 is better?
:thumbup:
For instance, exactly for what did you tell:
Fatty-Do-Do wrote: November 3rd, 2022, 8:46 pm The Problem with the OnRefreshAction in the [Rainmeter] Section would be that cannot be dynamic, so making a toggleable Measure wouln't be possible that way. Also it would disable the Powerdraw Measure whenever a refresh is performed and there are a bunch more necessary refreshes in my skin, since I want it to be highly intuitive and user configurable. Getting ever closer to the 2.0 Release thanks to your help :thumbup:
Fatty-Do-Do
Posts: 15
Joined: October 29th, 2022, 12:32 pm

Re: Check Snap Orientation with if condition

Post by Fatty-Do-Do »

Quick Update.

I've decided to use #WORKAREA...# instead of #SCREENAREA...# to recieve much better corner snapping behaviour. I've now set up everything the way I like and added some more flipping behaviour by splitting the monitor in eighths instead of quarters. Obviously that required a few more variable sets, but it was worth it. New code looks like this:

Code: Select all

[MeasureTangent]
Measure=Calc
Formula=( #WORKAREAHEIGHT# / #WORKAREAWIDTH# )
IfCondition=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))<#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))<#CURRENTSECTION#))&&((0.5 * #WORKAREAWIDTH#)>(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))
IfTrueAction=[!SetVariable Orientation "TL"][!WriteKeyValue Variables Orientation "TL"][!SetOption MeterBarSystemMemory Flip "0"][!WriteKeyValue MeterBarSystemMemory FLip "0"]
IfCondition2=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))<#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))<#CURRENTSECTION#))&&((0.5 * #WORKAREAWIDTH#)<(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))
IfTrueAction2=[!SetVariable Orientation "TR"][!WriteKeyValue Variables Orientation "TR"][!SetOption MeterBarSystemMemory Flip "1"][!WriteKeyValue MeterBarSystemMemory FLip "1"]
IfCondition3=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))<#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))>=#CURRENTSECTION#))&&((0.3 * #WORKAREAHEIGHT#)>(#CURRENTCONFIGY# * 0.5 * #CURRENTCONFIGHEIGHT#)))
IfTrueAction3=[!SetVariable Orientation "RT"][!WriteKeyValue Variables Orientation "RT"][!SetOption MeterBarSystemMemory Flip "1"][!WriteKeyValue MeterBarSystemMemory FLip "1"]
IfCondition4=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))<#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))>=#CURRENTSECTION#))&&((0.3 * #WORKAREAHEIGHT#)<(#CURRENTCONFIGY# * 0.5 * #CURRENTCONFIGHEIGHT#)))
IfTrueAction4=[!SetVariable Orientation "RB"][!WriteKeyValue Variables Orientation "RB"][!SetOption MeterBarSystemMemory Flip "0"][!WriteKeyValue MeterBarSystemMemory FLip "0"]
IfCondition5=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))>=#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))>=#CURRENTSECTION#))&&((0.5 * #WORKAREAWIDTH#)<(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))
IfTrueAction5=[!SetVariable Orientation "BR"][!WriteKeyValue Variables Orientation "BR"][!SetOption MeterBarSystemMemory Flip "1"][!WriteKeyValue MeterBarSystemMemory FLip "1"]
IfCondition6=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))>=#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))>=#CURRENTSECTION#))&&((0.5 * #WORKAREAWIDTH#)>(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))
IfTrueAction6=[!SetVariable Orientation "BL"][!WriteKeyValue Variables Orientation "BL"][!SetOption MeterBarSystemMemory Flip "0"][!WriteKeyValue MeterBarSystemMemory FLip "0"]
IfCondition7=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))>=#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))<#CURRENTSECTION#))&&((0.3 * #WORKAREAHEIGHT#)<(#CURRENTCONFIGY# * 0.5 * #CURRENTCONFIGHEIGHT#)))
IfTrueAction7=[!SetVariable Orientation "LB"][!WriteKeyValue Variables Orientation "LB"][!SetOption MeterBarSystemMemory Flip "0"][!WriteKeyValue MeterBarSystemMemory FLip "0"]
IfCondition8=(((((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#))>=#CURRENTSECTION#)&&(((#CURRENTCONFIGY# + 0.5 * #CURRENTCONFIGHEIGHT#)/(#WORKAREAWIDTH#-(#CURRENTCONFIGX# + 0.5 * #CURRENTCONFIGWIDTH#)))<#CURRENTSECTION#))&&((0.3 * #WORKAREAHEIGHT#)>(#CURRENTCONFIGY# * 0.5 * #CURRENTCONFIGHEIGHT#)))
IfTrueAction8=[!SetVariable Orientation "LT"][!WriteKeyValue Variables Orientation "LT"][!SetOption MeterBarSystemMemory Flip "1"][!WriteKeyValue MeterBarSystemMemory FLip "1"]
DynamicVariables=1
Cheers :great:
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Check Snap Orientation with if condition

Post by balala »

Fatty-Do-Do wrote: November 5th, 2022, 10:41 pm I've decided to use #WORKAREA...# instead of #SCREENAREA...# to recieve much better corner snapping behaviour. I've now set up everything the way I like and added some more flipping behaviour by splitting the monitor in eighths instead of quarters. Obviously that required a few more variable sets, but it was worth it. New code looks like this:
An improvement of the code: I replaced the [MeasureTangent] measure with the following [MeasureOrientation]. This measure returns a number which represents the number of degrees from the upper vertical line (drawn from the center of the screen to the center of its upper edge) to the line drawn from the center of the screen to the center of the skin, as shown below:
Degree.png
Having this number, you can extremely easily create the proper IfConditions to get the desired result. Hope you got how...
The code of the measure (only the measure, with no other sections and no IfConditions):

Code: Select all

[MeasureOrientation]
Measure=Calc
Formula=(( 360 + Deg ( Atan2 (( #WORKAREAWIDTH# / 2 - ( #CURRENTCONFIGX# + #CURRENTCONFIGWIDTH# / 2 )), ( #WORKAREAHEIGHT# / 2 - ( #CURRENTCONFIGY# + #CURRENTCONFIGHEIGHT# / 2 ))))) % 360 )
DynamicVariables=1
Post Reply