PDA

View Full Version : Dynamic Buttons in Netremote



mcmit
August 18th, 2006, 11:35 AM
I'am simply looking to have a button in Netremote change it's image based on the state of a device. I am using Girder 4 and NetRemote to try and do this. The device is being monitored via Global Cache Sensor and I am able to affect a change, based on state of the device, to this variable - ether 1(On) or 0(Off)

In Girder I have:
-- Get State from Module 2, Port 3.
x = a:GetState(2,3)
-- Set a Variable called PowerState based on the state.
NetRemote.SetVariable("PowerState", x)

I am also using statechange from the log window so that any manual changes to the device are reflected in the Variable - all the works great.
NetRemote is able to report this Variable correctly.
Now how does one change a graphic in NetRemote based on this?

Please be specific, relative Newbee at this and simply not getting anywhere fast!! Also, not really good with coding yet so please be patient. Thanks in advance!

mcmit
August 18th, 2006, 12:44 PM
Solved!

For the benifit of others you assign a new state to the button in NetRemote.
When you add a new state the selected state feature is made available. In this dialog box enter the name of the variable you are passing and then the state you are testing for, ie. 1(On). Then assign the image you wish to display when the condition is met as you would any image. You will have now two states a default state and the new state you have assigned.