Results 1 to 3 of 3

Thread: Need help with vb.net and sliders !

  1. #1
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,769

    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 !

  2. #2
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,581
    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

  3. #3
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,769
    Quote 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 !!!

Similar Threads

  1. Dynamic Sliders
    By besjr69 in forum RR Skins
    Replies: 11
    Last Post: 12-11-2012, 04:27 PM
  2. Question On Sliders
    By Valheru in forum Road Runner
    Replies: 4
    Last Post: 12-30-2010, 03:32 AM
  3. more than 20 steps for sliders?
    By mstaedt in forum RR Skins
    Replies: 15
    Last Post: 05-16-2008, 10:51 AM
  4. Sliders!
    By spiro in forum StreetDeck
    Replies: 10
    Last Post: 05-02-2007, 05:22 PM
  5. mixer sliders !!
    By bishooman in forum Centrafuse
    Replies: 0
    Last Post: 03-23-2006, 03:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •