It is currently March 29th, 2024, 9:22 am

Trouble disabling a Measure

Get help with creating, editing & fixing problems with skins
Spotknull
Posts: 7
Joined: June 28th, 2016, 1:23 am

Trouble disabling a Measure

Post by Spotknull »

I'm making an Alarm Clock and I got the AM PM to work, which was hell but I Cannot turn off the alarm clocks measure so it goes off at the specific time regardless. :/ Disable the measure doesn't seem to work and I don't know what to do to fix this.

Code: Select all

;===============================================================
;[VARIABLES]====================================================
;===============================================================

[Variables]
tint=ffffff
ValueHourSet=3
ValueMinSet=0
ValueAMPMSet=2
AlarmPath1=#@#Winamp.lnk
state=1

;===============================================================
;[DISPLAY MEASURES]=============================================
;===============================================================

[MeasureHour]
Measure=Time
Format="%#I"

[MeasureMin]
Measure=Time
Format="%M"

[MeasureAMPM]
Measure=Time
Format=%p

[MeasureDate]
Measure=Time
Format=%d

[MeasureMonth]
Measure=Time
Format=%B
Substitute="January":"JAN","February":"FEB","March":"MAR","April":"APR","May":"MAY","June":"JUN","July":"JUL","August":"AUG","September":"SEP","October":"OCT","November":"NOV","December":"DEC"

[MeasureDay]
Measure=Time
Format=%A
Substitute="Monday":"MON","Tuesday":"TUE","Wednesday":"WED","Thursday":"THU","Friday":"FRI","Saturday":"SAT","Sunday":"SUN"

[MeasureYear]
Measure=Time
Format=%Y

;===============================================================
;[ALARM MEASURES]===============================================
;===============================================================

[MeasureAlarmHour]
Measure=Time
Format="%#I"

[MeasureGetAlarmHour]
Measure=Calc
Formula=[MeasureAlarmHour]
DynamicVariables=1

[MeasureAlarmAMPMDisplay]
Measure=Time
Format=%p

[MeasureAlarmMin]
Measure=Time
Format=%M

[MeasureGetAlarmMin]
Measure=Calc
Formula=[MeasureAlarmMin]
DynamicVariables=1

[MeasureAlarmAMPM]
Measure=Time
Format=%p
Substitute="AM":"1","PM":"2"

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=winamp
PlayerType=TITLE

[MeasureGetAlarmAMPM]
Measure=Calc
Formula=[MeasureAlarmAMPM]
DynamicVariables=1

[MeasureAlarm]
Measure=calc
Formula=0
DynamicVariables=1
IfCondition=(MeasureGetAlarmHour = #ValueHourSet#) && (MeasureGetAlarmMin = #ValueMinSet#) && (MeasureGetAlarmAMPM = #ValueAMPMSet#)
IfTrueAction=["#AlarmPath1#"]
IfCondition2=(#state# <= 0)
IfTrueAction2=[!ShowMeter AlarmOnIcon]
IfFalseAction2=[!HideMeter AlarmOnIcon]
Disable=#state#

[MeasureMinMaxHourAlarm]
measure=calc
formula=#ValueHourSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueHourSet# <= 0)
IfTrueAction=[!SetVariable ValueHourSet "12"]
IfCondition2=(#ValueHourSet# >= 13)
IfTrueAction2=[!SetVariable ValueHourSet "1"]
Group=ALARM | mALARM
Disable=#state#

[MeasureMinMaxMinuteAlarm]
measure=calc
formula=#ValueMinSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueMinSet# < 0)
IfTrueAction=[!SetVariable ValueMinSet "55"]
IfCondition2=(#ValueMinSet# >= 56)
IfTrueAction2=[!SetVariable ValueMinSet "0"]
Group=ALARM | mALARM
Disable=#state#

[MeasureAMPMDisplayAlarm]
measure=calc
formula=#ValueAMPMSet#
DynamicVariables=1
ifconditionmode=1
IfCondition=(#ValueAMPMSet# = 1)
IfTrueAction=[!SetOption  AlarmAMPM Text "AM"]
IfCondition2=(#ValueAMPMSet# = 2)
IfTrueAction2=[!SetOption  AlarmAMPM Text "PM"]
Group=ALARM | mALARM
Disable=#state#

[MeasureDigitPrefixerAlarm]
Measure=calc
Formula=00
Dynamicvariables=1
IfCondition=(#ValueMinSet# >= 0) && (#ValueMinSet# <= 9)
IfTrueAction=[!SetOption MeterAlarmMin Prefix "0"]
IfFalseAction=[!SetOption MeterAlarmMin Prefix ""]
Group=ALARM | mALARM
Disable=#state#

Side Notes: The Alarmpath just opens my music player, and state is set to 1 and set to change through meter buttons.And the Value(w/e)Set are changed through other meters and they are the actual time the alarm is set too. But How do I disable the measure so it doesn't go off? :/
Last edited by Spotknull on January 14th, 2017, 9:28 pm, edited 3 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trouble disabling a Measure

Post by balala »

First please post the content of the [MeasureGetAlarmHour] measure, or even better, the whole code.
Spotknull
Posts: 7
Joined: June 28th, 2016, 1:23 am

Re: Trouble disabling a Measure

Post by Spotknull »

balala wrote:First please post the content of the [MeasureGetAlarmHour] measure, or even better, the whole code.
I updated it.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trouble disabling a Measure

Post by balala »

Replace the following options of the [MeasureAlarm] measure, as it follows:

Code: Select all

[MeasureAlarm]
Measure=Calc
Formula=( 12 * ( MeasureGetAlarmAMPM - 1 ) + (( MeasureGetAlarmHour = 12 ) ? 0 : MeasureGetAlarmHour ) + ( MeasureGetAlarmMin / 60 ))
DynamicVariables=1
IfCondition=(MeasureAlarm>=(12*(#ValueAMPMSet#-1)+((#ValueHourSet#=12)?0:#ValueHourSet#)+(#ValueMinSet#/60)))
IfTrueAction=["#AlarmPath1#"]
IfCondition2=(#state# <= 0)
IfTrueAction2=[!ShowMeter AlarmOnIcon]
IfFalseAction2=[!HideMeter AlarmOnIcon]
Disable=#state#
Spotknull
Posts: 7
Joined: June 28th, 2016, 1:23 am

Re: Trouble disabling a Measure

Post by Spotknull »

balala wrote:Replace the following options of the [MeasureAlarm] measure, as it follows:

Code: Select all

[MeasureAlarm]
Measure=Calc
Formula=( 12 * ( MeasureGetAlarmAMPM - 1 ) + (( MeasureGetAlarmHour = 12 ) ? 0 : MeasureGetAlarmHour ) + ( MeasureGetAlarmMin / 60 ))
DynamicVariables=1
IfCondition=(MeasureAlarm>=(12*(#ValueAMPMSet#-1)+((#ValueHourSet#=12)?0:#ValueHourSet#)+(#ValueMinSet#/60)))
IfTrueAction=["#AlarmPath1#"]
IfCondition2=(#state# <= 0)
IfTrueAction2=[!ShowMeter AlarmOnIcon]
IfFalseAction2=[!HideMeter AlarmOnIcon]
Disable=#state#
can you explain to me how that works, incase I later on wanna make a snooze button?
Also this change didn't fix the original problem of the alarm going off while it's still disabled. :/
That actually made it worse, now the alarm goes off whenever the skin is reloaded.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trouble disabling a Measure

Post by balala »

Spotknull wrote:can you explain to me how that works, incase I later on wanna make a snooze button?
Also this change didn't fix the original problem of the alarm going off while it's still disabled. :/
That actually made it worse, now the alarm goes off whenever the skin is reloaded.
The idea is the following: the formula of the [MeasureAlarm] measure converts the values of the [MeasureGetAlarmAMPM], [MeasureGetAlarmHour] and [MeasureGetAlarmMin] measures into a decimal number between 0 and 24. The (12*(#ValueAMPMSet#-1)+((#ValueHourSet#=12)?0:#ValueHourSet#)+(#ValueMinSet#/60)) part of the IfCondition makes a same kind of conversion of the ValueAMPMSet, ValueHourSet and ValueMinSet variables. These two values are compared by the IfCondition option. The #AlarmPath1# is executed when the first value is greater then the second one.
I'm not sure how are you disabling the alarm, because you've posted just the measures. Also don't know how and when the value of the state variable is changing.
Spotknull
Posts: 7
Joined: June 28th, 2016, 1:23 am

Re: Trouble disabling a Measure

Post by Spotknull »

balala wrote:The idea is the following: the formula of the [MeasureAlarm] measure converts the values of the [MeasureGetAlarmAMPM], [MeasureGetAlarmHour] and [MeasureGetAlarmMin] measures into a decimal number between 0 and 24. The (12*(#ValueAMPMSet#-1)+((#ValueHourSet#=12)?0:#ValueHourSet#)+(#ValueMinSet#/60)) part of the IfCondition makes a same kind of conversion of the ValueAMPMSet, ValueHourSet and ValueMinSet variables. These two values are compared by the IfCondition option. The #AlarmPath1# is executed when the first value is greater then the second one.
I'm not sure how are you disabling the alarm, because you've posted just the measures. Also don't know how and when the value of the state variable is changing.
I'm trying to disable it using a button to set the variable of #state# to 1. Here's the button I'm using.

Code: Select all

;===============================================================
;[ALARM OFF BUTTON]=============================================
;===============================================================

[ButtButton4]
Meter=BUTTON
ToolTipText="Turn Off Alarms"
X=286
W=87
H=18
MouseOverAction=!Execute [!ShowMeter Bar4][!ShowMeter OtherBar4][!ShowMeter ButtMouseOver4][;!HideMeter Butt4][!Redraw]
MouseLeaveAction=!Execute [!HideMeter ButtMouseOver4][;!HideMeter Bar4][;!HideMeter OtherBar4][;!ShowMeter Butt4][!Redraw]
LeftMouseDownAction=!Execute [!HideMeter ButtMouseOver4][!Redraw]
LeftMouseUpAction=!Execute [!SetVariable state 1][!DisableMeasure MeasureAlarm][!UpdateMeasureGroup ALARM][!HideMeterGroup ALARMSET][!ShowMeterGroup CLOCK][!HideMeter Butt4][!Redraw]
Group=AlarmSet
Hidden=1

[Bar4]
Meter=IMAGE
ImageName=#@#outlineL.png
X=-6r
Y=-14
W=50
H=40
imageflip=both
ScaleMargins=40,0,0,0
Greyscale=1
imagetint=#Tint#
Group=AlarmSet
Hidden=1
AntiAlias=1

[OtherBar4]
Meter=IMAGE
ImageName=#@#outlineL.png
X=48r
Y=r
W=50
H=40
imageflip=Vertical
ScaleMargins=0,0,40,0
Greyscale=1
imagetint=#Tint#
Group=AlarmSet
Hidden=1
AntiAlias=1

[Butt4]
Meter=STRING
MeterStyle=StyleText
X=1r
Y=14r
Text="Turn Off"
Group=AlarmSet
Hidden=1

[ButtMouseOver4]
Meter=STRING
MeterStyle=StyleText
X=r
Y=r
Text="Turn Off"
FontColor=#FontColor2#
Hidden=1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trouble disabling a Measure

Post by balala »

There are two problems with your meters:
  • the [ButtButton4] meter don't has a ButtonImage option, which is needed to can set the image of the button. If you don't add this option, the button won't be visible, even if you show the meter, using a !ShowMeter bang.
  • at the very first moment, each meter is hidden. You won't see nothing out of your skin.
If I'm wrong about any of these comments, please pack your config and upload it. To be honest, so far I can't clearly see what and how you would like to do.
Spotknull
Posts: 7
Joined: June 28th, 2016, 1:23 am

Re: Trouble disabling a Measure

Post by Spotknull »

The button is meant to be as an invisible overlay of the two combined images. Visibility isn't an issue. Functionality is. The button hides and images all hide and show correctly but I'm having issues turning off a measure so it doesn't execute the alarm. That's the issue. I tried setting a variable of the measure so it would activate or deactivate the measure. That hasn't worked. If you have any suggestions on how to do this with a meter, that's what I'm looking for.

I'm currently using the button measure the set the variable of #state# which is supposed to disable the measure that activates the executable for the alarm. The set variable bang doesn't seem to be working.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Trouble disabling a Measure

Post by balala »

As I said above, I'd need the whole config. It has some button meters (which are using some images, like outlineL.png) and it'd be much simpler if I'd have the config, without having to rebuild everything. So, please pack and post the config. Otherwise it's very hard to help.