Home / Troubleshooting & Faults

Knobs - Generic Controls - image control

CommunityMartin AI Resolved
Started by Nebulous · 10y ago · 12 views · 7 replies
10y ago

I'm trying to create a kiosk interface.
I would like my user feedback to be driven by an integer value output by my script.
If I set the control style to meter it reflects the integer value but the buttons and leds all seem to just be either on or off.
How does the "Image Control" control style work. How do I associate an image with it?

10y ago

Here is a quick example of image control...
May not be what you are wanting to do, but you are doing a script, so you may be able to incorporate this feature into what you are already doing.
Good luck,
Fergy
Post's attachments
Image Control.npa
465.19 kb, 873 downloads since 2015-07-08

10y ago

Thanks for the reply, I can't see or edit the script for some reason, could  you post the code?

10y ago

# This script takes the router number and converts it to a friendly
# name for the selected channel
BGM_Selection = [ "0.jpg", "1.jpeg", "2.jpeg",
"3.jpg", "4.jpg", "5.jpg"]
n = inputs[0].value_get()
message.string_set( BGM_Selection[n] )
I stole this from myself, which is why it says BGM Selection, instead of Image Control (didn't take the time to make this simple change).
Fergy

10y ago

I'm sorry, but I don't see how the script is associated with the Image Control. There's no wiring node or control alias, the only association I see is the label 'Message' in the control properties dialog.

10y ago

Hi,
All Scott has done is copied out the 'message' panel from the live python block and instead of leaving it as a standard text box to display the 'string name', he's just changed it's control style to an image control.  (If you open the python block and watch what happens to the 'message' block when you alter the integer - I'm sure you'll see what's happening)
The string still passes from the script to this copied object - it's just how the message block object it's being displayed that has changed.
Lee 8)

10y ago

Thank  you!

10y ago

No problem,
Feel free to email us any other queries.
Lee

Log in to reply to this topic.