Property change bounds checking

Having problems? Maybe others have had the same problem too. Post HouseBot technical issues here.
Post Reply
jasonb1
Member
Posts: 34
Joined: Tue Nov 11, 2003 12:50 am

Property change bounds checking

Post by jasonb1 »

I used the sample theme device and hooked up += 1 and -= 1 property change buttons to the volume property. It looks like when I reach either end of the allowed range (1-99) it just keeps going and sets out of range values. Shouldn't the increment/decrement respect the allowed range, or am I missing something?



When I hook this up to a real device going to a serially controlled reciever, I think the out of range values will definately mess it up. Not to mention, it messes up the graphics as well in the gauge control when you get out of bounds.



I used this method instead of using a slider because clicking and dragging a slider control seems like it would be hard on a touch screen. If the sliders acted more like a window scroll bar where you can click the entire length of the bar to set a specific value, then it might be more workable for touch screens and I wouldn't need the up/down buttons.



- Jason
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Post by yaccri »

Jason,



You can create an 'automatic' task (when conditins are met) that would check that the new value is within the range, and fix if necessary. It should look like:

If ('Receiver.Volume' is greater than '99') then

Change 'Receiver.Volume' to '99'



Make sure that the 'execution mode' of the task is set to 'when conditins are met'



HTH,

Yoram
Post Reply