Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Field Incr/Decr Button Widget
#1
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
Reply
#2
Yeah they no longer work, I just converted mine to command buttons and increment the field in code...
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#3
It's a side effect of the gesture support

http://www.charmedquark.com/vb_forum/sho...hp?t=11635
Reply
#4
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?
Reply
#5
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
Reply
#6
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)
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#7
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
Reply
#8
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?
Reply
#9
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
Reply
#10
Thanks Dean - Sounds like a good idea. I'll work on it....
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trigger on Russound F1 button xlurkr 6 1,014 06-01-2020, 01:17 PM
Last Post: Dean Roddey
  How to copy/paste command button on template Deane Johnson 1 445 04-17-2020, 02:18 PM
Last Post: Dean Roddey
  Button Generator gReatAutomation 0 519 02-28-2020, 01:33 PM
Last Post: gReatAutomation
  Timed Field Change in Lutron HW8 avtexan 11 4,736 08-06-2018, 11:17 AM
Last Post: Dean Roddey
  ELK V2 Driver - AreaArm field & Triggers? sic0048 4 3,346 08-19-2017, 04:46 PM
Last Post: Dean Roddey
  Video Widget znelbok 67 33,760 04-12-2017, 04:08 PM
Last Post: Dean Roddey
  An idea for a new widget Dean Roddey 5 3,636 03-13-2017, 02:47 PM
Last Post: potts.mike
  Web browser widget Trioxide 7 4,609 02-25-2017, 06:30 AM
Last Post: Trioxide
  How to pass a variable into a field moniker EST 3 2,174 08-30-2016, 11:01 AM
Last Post: EST
  EventGhost alternatives to getting driver/field *TO* SmartPhone? IVB 37 12,348 08-13-2016, 07:32 PM
Last Post: IVB

Forum Jump:


Users browsing this thread: 1 Guest(s)