Announcement

Collapse
No announcement yet.

Enumerate VSPairs in Plug-in?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enumerate VSPairs in Plug-in?

    Does anyone know if it is possible to enumerate or access the full list of the VSPairs? I need to associate additional information to each status and ask the user if certain controls should be visible.

  • #2
    A device can have more control options than what a value/status pair can generate - for example you could have a button added that runs a script, and that is not done through the value/status pairs. For this reason, there is no way to get all of the control/both value/status pairs, as you should be using CAPIGetControl/CAPIGetControlEx/CAPIGetSingleControl.

    Recently somebody asked for the ability to get all of the status items on a device, and while I do not know exactly why that was desired, I went ahead and added DeviceVSP_GetAllStatus, which will return an array of VSPair from a device for all pair types defined as Status or Both. That will be in the next release of HS3.

    So if you are enumerating through to get CONTROL options, stick to CAPI - there should be little to no use in getting all of the status pairs, but it is there now.

    Keep in mind that a device can have a status of "On" with the value of 100, but a completely different control definition for "On" that has a value of say 1100 - so if you read the status pair and see the value of 100 and set the device to that value, it will not do anything! This is why CAPI is used whenever you want to get the CONTROL options for a device.
    Regards,

    Rick Tinker (a.k.a. "Tink")

    Comment


    • #3
      Originally posted by Rick Tinker View Post
      A device can have more control options than what a value/status pair can generate - for example you could have a button added that runs a script, and that is not done through the value/status pairs. For this reason, there is no way to get all of the control/both value/status pairs, as you should be using CAPIGetControl/CAPIGetControlEx/CAPIGetSingleControl.

      Recently somebody asked for the ability to get all of the status items on a device, and while I do not know exactly why that was desired, I went ahead and added DeviceVSP_GetAllStatus, which will return an array of VSPair from a device for all pair types defined as Status or Both. That will be in the next release of HS3.

      So if you are enumerating through to get CONTROL options, stick to CAPI - there should be little to no use in getting all of the status pairs, but it is there now.

      Keep in mind that a device can have a status of "On" with the value of 100, but a completely different control definition for "On" that has a value of say 1100 - so if you read the status pair and see the value of 100 and set the device to that value, it will not do anything! This is why CAPI is used whenever you want to get the CONTROL options for a device.
      Sorry to necro this old post, but I have a similar need. I want to update many of my devices to use different graphics and status values. I could sit and manually do the massive amount of clicking required to do that, or I could use a script (or eventually maybe a plugin?) to get all the VSPairs and VGPairs from one and apply them to another.

      But with the current capability, it looks like I can do that for VSPair statuses, and I could maybe infer VSPair control options from the devices CAPIControl array, but it's impossible to do this for VGPairs.

      Ideally, there would be a way to just get an array of ALL VSPairs and an array of ALL VGPairs. Or you could add this functionality (copy status/graphics from an existing device) to the software

      Comment

      Working...
      X