Accessing Device List Options

Posted on
Thu May 25, 2017 6:22 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Accessing Device List Options

This has probably already been discussed (heck, I've probably asked before), but I can't seem to find an answer. I have a list within a device configuration that's built using a generator (but I think this would apply to standard lists too). When the valuesDict is passed to the plugin, the valuesDict list key contains whatever is selected in the menu. If nothing is selected in the list, the key value is empty.

I just want to confirm that there's no way from within the plugin to get all the available options for the list without maintaining a local copy of the generated options.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu May 25, 2017 9:32 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Accessing Device List Options

A couple of thoughts: first, you can get the <ConfigUI> XML as defined in your Devices.xml file thusly:

Code: Select all
self.devicesTypeDict[DEVICETYPEID]["ConfigUIRawXml"]


Then you can take the XML apart yourself to find the options.

Second, depending on the complexity of the method you're using to dynamically create the menu items, you can just call that method yourself. That would return the list of tuples with each option.

Finally, you could construct the config dialog completely in code (rather than in Devices.xml) so the list could be in code. You do this by overriding this method:

Code: Select all
def getDeviceConfigUiXml(self, typeId, devId)


in your plugin. The default is to return the XML specified in the first option, but you can return anything you want. That makes the dialog completely dynamic.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu May 25, 2017 10:20 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Accessing Device List Options

jay (support) wrote:
A couple of thoughts

Super helpful Jay, thanks. This is just what I needed.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu May 25, 2017 10:42 am
jay (support) offline
Site Admin
User avatar
Posts: 18216
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Accessing Device List Options

Correction, it's the <ConfigUI> XML element, not the entire <Device> element. I'll correct it above as well.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests