Like:
- Code: Select all
Serial Number -- Label
[123456] [DOhub]
[345678] [DIhub1]
Etc.
Serial Number -- Label
[123456] [DOhub]
[345678] [DIhub1]
Etc.
FlyingDiver wrote:Phidget sensors and controllers, in other words, things that interact with the real world, are instantiated in Indigo as devices. However, these real devices may or may not connect directly to Indigo. So, the device address column should show the path to the actual device. And, there is always ultimately an element with a serial number involved, and that serial number is a necessary device property. it may belong to the device itself, or some other device the real device connects to. For example, the Indigo device address might be port 3, channel 2 on device serial number 1234.… If so, why keep a separate list? The name of the device is already there.
I wrote:I just found an old post from DaveL17, so....... is there a variable command similar to device.pluginProps.get("foo", 0). Where a default value can be set?...
if varName in indigo.variables:
addrIndex = str(indigo.variables[varName].value)
berkinet wrote:I need to wrap getting the variable in a try: block.
try:
addr_name = indigo.variables[varName].value
# This will check for an empty string just to make sure the user didn't create the variable but leave the value blank
if not addr_name:
raise
except:
# use the default or whatever
addr_name = #whatever the actual address is
jay (support) wrote:The problem with the approach Joe suggests is that for this particular plugin there are many more indigo devices than actual real-world devices with serial numbers. For example, a Phidgets 8/8/8 interface kit has a total of 24 ports. So, instead of entering a serial number to label lookup once, it would have to be done up to 24 times. Also, while the user must manually enter the serial number now, it is actually possible to do that automatically and I may add that at some future point....I don't think using a variable is very user-friendly (less intuitive), but...
... That would be the most pythonic way, and would solve another issue...
Users browsing this forum: No registered users and 5 guests