Announcement

Collapse
No announcement yet.

VSPair for Control with Dropdown

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

  • VSPair for Control with Dropdown

    I'm trying to add a dropdown list to a device for some CAPI control.

    I can add a button, a dropdown for a range, but I'm not sure of the syntax required to add a list of strings with one selectable. Code snippet:

    Code:
                pair = New VSPair(ePairStatusControl.Control)
                pair.PairType = VSVGPairType.SingleValue
                pair.Value = 1
                pair.Status = "Item 1"
                pair.Render = Enums.CAPIControlType.Single_Text_from_List
                pair.StringListAdd() = preset
                hs.DeviceVSP_AddPair(ref, pair)
    As usual, the docs are quite "light" when it comes to explaining the Enum.CAPIControlType

    Code:
    Enum CAPIControlType
            Not_Specified = 1
            Values = 2                          'This is the default to use if one of the others is not specified.
            Single_Text_from_List = 3
            List_Text_from_List = 4
            Button = 5
            ValuesRange = 6                 'Rendered as a drop-list by default.
            ValuesRangeSlider = 7
            TextList = 8
            TextBox_Number = 9
            TextBox_String = 10
            Radio_Option = 11
            Button_Script = 12      ' Rendered as a button, executes a script when activated.
        End Enum
    Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

  • #2
    Did you manage to solve this ?
    The SDK documentation is realy below par :-/

    Comment


    • #3
      Nope. Opened a big but nothing has happened in months.


      Sent from my iPhone using Tapatalk
      Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

      Comment


      • #4
        Great...

        Could you maybe share the code for the list of presets in your BlueIris plugin?

        Comment


        • #5
          Sure, it's in VB:
          Code:
           i = 20 'Preset values start from 20
           For Each preset In BI.Cameras(camera).ptzData.presets
                          pair = New VSPair(ePairStatusControl.Control)
                          pair.PairType = VSVGPairType.SingleValue
                          pair.Value = i
                          i += 1
                          pair.Status = preset
                          pair.Render = Enums.CAPIControlType.Single_Text_from_List
                          pair.StringListAdd() = preset
                          hs.DeviceVSP_AddPair(ref, pair)
            Next
          Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

          Comment


          • #6
            I've done this but I ended up adding a value range and the list of commands:

            Code:
               Dim MyVSP As New VSPair(ePairStatusControl.Both)
                    Dim i As Integer
                    For i = 0 To _Buttons.Length - 1
                        MyVSP.PairType = VSVGPairType.SingleValue
                        MyVSP.Render_Location.Row = 0
                        MyVSP.Render_Location.Column = 0
                        MyVSP.Render_Location.ColumnSpan = 0
                        MyVSP.Value = i
                        MyVSP.Status = _Buttons(i)
                        MyVSP.IncludeValues = False
                        MyVSP.Render = Enums.CAPIControlType.TextList
                        hs.DeviceVSP_AddPair(ref, MyVSP)
                    Next
            
                    Dim xMyVSP As New VSPair(ePairStatusControl.Control)
                    xMyVSP.PairType = VSVGPairType.Range
                    xMyVSP.Render_Location.Row = 1
                    xMyVSP.Render_Location.Column = 1
                    xMyVSP.Render_Location.ColumnSpan = 15
                    'MyVSP.IncludeValues = True
                    xMyVSP.RangeStart = -1
                    xMyVSP.RangeEnd = _Buttons.Length - 1
                    'MyVSP.RangeStatusPrefix = " "
                    xMyVSP.Render = Enums.CAPIControlType.ValuesRange
                    hs.DeviceVSP_AddPair(ref, xMyVSP)
            The _Buttons() array contain the list of strings I want to display in the drop down.
            Nicolai L

            Comment

            Working...
            X