Posts: 152
Threads: 9
Joined: Apr 2008
I thought I remembered some discussion on the Incr/Decr button going away - with new versions... - Did it?
My tstat setpoint buttons no longer work and I didn't find an equivalent function in the editor.
How are others handling this?
Kerry
Posts: 3,415
Threads: 158
Joined: Jan 2006
Yeah they no longer work, I just converted mine to command buttons and increment the field in code...
Posts: 283
Threads: 26
Joined: Dec 2012
Posts: 152
Threads: 9
Joined: Apr 2008
wuench Wrote:Yeah they no longer work, I just converted mine to command buttons and increment the field in code...
Any chance you can share an example of your action parameters?
Posts: 40,483
Threads: 491
Joined: Aug 2002
Though it's a little more work, it's fairly straightforward to create a generic 'number adjuster' popup that you can pass a numeric field to, and have it allow you to adjust the value with a slider and then the user can either accept or cancel. If they accept, then the updated value is written to the field. When it associates the field with the slider, that slider will pick up its field limits and allow the user to adjust accordingly.
Or, if you really want to adjust by inc/dec, you can do that as well. There's actually an example one in the auto-generated content that lets you do both.
Dean Roddey
Explorans limites defectum
Posts: 3,415
Threads: 158
Joined: Jan 2006
Code:
[B]Up/Plus[/B]
[OnClick]
Devices::FieldRead(Security.T1CoolSP, LVar:Temp, True)
LocalVars::Add(LVar:Temp, 1)
Devices::FieldWrite(Security.T1CoolSP, %(LVar:Temp), True)
[B]Down/Minus[/B]
[OnClick]
Devices::FieldRead(Security.T1CoolSP, LVar:Temp, True)
LocalVars::Subtract(LVar:Temp, 1)
Devices::FieldWrite(Security.T1CoolSP, %(LVar:Temp), True)
Posts: 40,483
Threads: 491
Joined: Aug 2002
To be safe, you should also check that you aren't exceeding the limits, or even more likely that you aren't exceeding some more arbitrary limit that you want to keep it to.
Dean Roddey
Explorans limites defectum
Posts: 152
Threads: 9
Joined: Apr 2008
wuench Wrote:Code:
[B]Up/Plus[/B]
[OnClick]
Devices::FieldRead(Security.T1CoolSP, LVar:Temp, True)
LocalVars::Add(LVar:Temp, 1)
Devices::FieldWrite(Security.T1CoolSP, %(LVar:Temp), True)
[B]Down/Minus[/B]
[OnClick]
Devices::FieldRead(Security.T1CoolSP, LVar:Temp, True)
LocalVars::Subtract(LVar:Temp, 1)
Devices::FieldWrite(Security.T1CoolSP, %(LVar:Temp), True)
Thanks wuench - its works perfect, back to normal.
Dean - are you saying to set upper and lower limits for the setpoints such that the increments can't exceed the limit?
If so, would you accomplish that with an If/Then argument in the action?
Posts: 40,483
Threads: 491
Joined: Aug 2002
Yeh, you'd just compare the current value and only do the inc/dec and write back if it's within the limit, so something like:
Code:
Devices::FieldRead(Security.T1CoolSP, LVar:Temp, True)
If System::LessThan(%(LVar:Temp), 90)
LocalVars::Add(LVar:Temp, 1)
Devices::FieldWrite(Security.T1CoolSP, %(LVar:Temp), True)
EndIf;
You could make it fancier and do an If/Else and in the Else do a popup that says it's already at the max or something.
Dean Roddey
Explorans limites defectum
Posts: 152
Threads: 9
Joined: Apr 2008
Thanks Dean - Sounds like a good idea. I'll work on it....