Posts: 4,225
Threads: 365
Joined: May 2005
02-08-2009, 07:51 PM
(This post was last modified: 02-08-2009, 08:03 PM by znelbok.)
I am trying to set up an interface that has to be written for a conference room
What I want to do is hide a widget if the device it controls is not connected. I can only think of using states to achieve this. Unfortunately there is no field that gives you a connected or not connected field
Any clues as to how I could achieve this.
Mick
Posts: 1,763
Threads: 76
Joined: Jun 2007
If you use a checkbox widget it will not be visible if the field/variable it belongs to is in error or doesn't exist.
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Posts: 40,483
Threads: 491
Joined: Aug 2002
I've been seriously thinking about a magic driver that each CQCServer provides, which has an on/offline boolean field for each driver loaded in that CQCServer. That would be a very useful thing. The only issue is how error prone it would be to fake such a driver into all of the interfaces that currently interact with drivers.
Dean Roddey
Explorans limites defectum
Posts: 4,225
Threads: 365
Joined: May 2005
I did it with a scheduled task running every minute to check the driver (If DriverIsReady Then) and the set a field in a variable driver and it works OK - not that I like the concept of running a scheduled task every minute for something like this.
The only problem is drivers that are deadifoff such as the universal LG driver, which is always connected, regardless of the state of the device.
I will look into the checkbox, - I am loading an overlay specific to the device from the button (command widget) and I want the button to dissapear when the device is off-line for whatever reason (someone turned it off). I will see how it goes.
Mick
Posts: 40,483
Threads: 491
Joined: Aug 2002
If you just need to do it when you load an overlay, then you can just check in the OnLoad and see if the driver is ready and hide things at that point. The hard part (currently) is just doing it at any time that the driver may go offline.
Dean Roddey
Explorans limites defectum
Posts: 4,225
Threads: 365
Joined: May 2005
the buttons are not in an overlay, they load an overlay so the OnLoad will not work, but thanks
Mick