Dynamic ConfigUI

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Mon Jul 23, 2012 7:50 pm
Perry The Cynic offline
Posts: 838
Joined: Apr 07, 2008

Dynamic ConfigUI

I need to dynamically generate the ConfigUI for some actions. This has been discussed in several threads, but is there any official guidance on how best to do this? I'm planning to interpose the getWhateverConfigUiXml calls, use minidom to parse the file XML, put in my edits, then reconstitute the XML and pass it to Indigo. Is there a better/more future-proof way to do this?

Why am I doing this? I want to define dynamic default values, morph menus to text fields and back, implement macros like menu-or-other, and such - all cases where I want to pick up the static XML, edit it according to rules, and then pass the result upstream. I'm not (currently) trying to make up ConfigUI from scratch.

This all means I'll add XML elements to your ConfigUI. Do you have any suggestion on how to name mine, so they're less likely to clash with future additions of yours?

Cheers
-- perry

Posted on
Tue Jul 24, 2012 8:31 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dynamic ConfigUI

I'd suggest naming your elements and attributes as well as any field types you may define with some prefix (CYN_ or something). Since it's unlikely we'll be using prefixes/namespaces in future versions I think that would make sure there are no collisions.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 26, 2012 11:46 pm
Perry The Cynic offline
Posts: 838
Joined: Apr 07, 2008

Re: Dynamic ConfigUI

Okay, so I put a custom field type into a field in my Devices.xml, defined getDeviceConfigUiXml in my plugin, and wrote code to translate the custom field into a series of standard fields. Except someone's getting to the XML before my getDeviceConfigUiXml is called and yells:
Error (client) runDialogForDevice() caught exception: PAXDialogControllerError -- Fields must contain a valid 'type' attribute: textfield, menu, checkbox, list, separator, label, button.

Who is it, and how do I shut it up? Whatever check that is (and I can't find that message), shouldn't it be applied to what getDeviceConfigUiXml produces, rather than to its input?

Or (as always), what am I missing here?

Cheers
-- perry

Posted on
Fri Jul 27, 2012 12:39 am
Perry The Cynic offline
Posts: 838
Joined: Apr 07, 2008

Re: Dynamic ConfigUI

Never mind that. It turns out that Indigo's log reorders messages. The
Error (client) runDialogForDevice() caught exception: PAXDialogControllerError -- Fields must contain a valid 'type' attribute: textfield, menu, checkbox, list, separator, label, button.

message is about the output of getDeviceConfigUiXml (I found that bug in my code), but it performs some miraculous time travel and ends up before the log messages issued from that function. A bit eerie, actually... but harmless.

It reminds me faintly of Einstein, actually. Which event happens first depends on where you are. :-)

Cheers
-- perry

Posted on
Fri Jul 27, 2012 1:13 am
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Dynamic ConfigUI

We send those error messages on the neutrino display bus, so they travel faster than the normal electrons and get to the display faster.

Seriously though, the (client) in the log means the message is being logged directly by the Indigo client to its own window. The other error messages are coming through the Indigo Server as it broadcasts log packets to all connected clients.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests