Announcement

Collapse
No announcement yet.

Need help with vb.net and sliders !

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

  • Need help with vb.net and sliders !

    Hello all,
    I work on a very fun X10 automation around the ActiveHome API for RR and i need a slider that difine the dimmer from 0% to 100% .
    This is my code:
    Code:
        '*****************************************************************
        '* This Function will be called with requested slider code
        '* specified at the skin file. Simply return the value of the
        '* slider to be displayed. Values should range from 0 to 65536.
        '* It is also possible to intercept/change the slider code before
        '* it is processed in RideRunner (to overwrite existing codes).
        '*****************************************************************
        Public Function ReturnSlider(ByRef SLD As String) As Integer
    
            'This tells RR that the Slider was not processed in this plugin
            ReturnSlider = -1
    
            Select Case LCase(SLD)
                Case "x10_sld_e1" ' Shutdown Delay (MINUTES)
                    X10SliderE1 = SKININI.ReadString("X10SLIDERS", "E1", "")
                    ReturnSlider = Math.Round((X10SliderE1 / 10) * 65535)
                Case "x10_sld_e7" ' Shutdown Delay (MINUTES)
                    X10SliderE7 = SKININI.ReadString("X10SLIDERS", "E7", "")
                    ReturnSlider = Math.Round((X10SliderE7 / 10) * 65535)
            End Select
    
        End Function
    
    
        '*****************************************************************
        '* This Function will be called with requested slider code
        '* specified at the skin file. Simply return the value of the
        '* slider to be displayed. Values should range from 0 to 65536.
        '* It is also possible to intercept/change the slider code before
        '* it is processed in RideRunner (to overwrite existing codes).
        '*****************************************************************
        Public Sub SetSlider(ByRef SLD As String, ByRef Value As Integer, ByRef Direction As Boolean)
    
            Select Case LCase(SLD)
                Case "x10_sld_e1" ' Shutdown Delay (MINUTES)
                    X10SliderE1 = Math.Round((Value * 10) / 65535)
                    If X10SliderE1 <> SKININI.ReadString("X10SLIDERS", "E1", "") Then SKININI.Write("X10SLIDERS", "E1", X10SliderE1)
                    ActiveHomeObj.SendAction("sendplc", "e1 dim " & X10SliderE1) 'x10sendplc;dim;c2;100
                Case "x10_sld_e7" ' Shutdown Delay (MINUTES)
                    X10SliderE7 = Math.Round((Value * 10) / 65535)
                    If X10SliderE7 <> SKININI.ReadString("X10SLIDERS", "E7", "") Then SKININI.Write("X10SLIDERS", "E7", X10SliderE7)
                    ActiveHomeObj.SendAction("sendplc", "e7 dim " & X10SliderE7) 'x10sendplc;dim;c2;100
            End Select
    
        End Sub
    The slider run very well, but i obtain only a value from 0 to 10 and not 100.
    Where is my error please !

    Thanks for your help !

  • #3
    Originally posted by Enforcer View Post
    Those sliders seem to be for shutdown timers in minutes not brightness.

    Unless by dimmer you mean slider.

    What we would need to know is the range 'value' can be
    It's not the RR dimmer that i change by this slider but the dimmer of a X10 CM15 module !

    I have found my error and replaced 10 by 100 !!!

    Comment

    Working...
    X