Announcement

Collapse
No announcement yet.

How to do several Page with parametric SmartSliders

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

  • How to do several Page with parametric SmartSliders

    Hi,
    I've to make a form to edit several parameters. Parameters can have different max and min values, and each parameter has a title and a string for unit name. Of course I could make different static forms and different static sliders for each parameter, but, with hundreds of parameters this could be very tedious and any edit could become very difficult.
    Is there any better way to do this?
    Regards
    Pietro

  • #2
    Hello Pietro,

    I'm not sure if I understood your question correctly but from what I understand, you want to edit
    some numerical parameters and some string parameters. The numerical parameters will be represented by a slider, right?

    For example if you have parameter1, you'll then have a corresponding slider that would reflect the value of this parameter?

    If so, you can try using an array to store all those parameters into. That way you can just call them by their array and update them in a similar manner

    The attached sample project should demonstrate this.

    Best regards,
    Attached Files
    Michael

    Comment


    • #3
      Hi Michael,
      Thank you for reply. You are right, in this way I can use the same slider for all parameters, but all parameter must have the same range (in your example, all parameters can assume a value between 0 and 100). In my application not all value are valid for all parameters. For example, some parameter can assume values from 0 to 10, some other from 0 to 255, some other from 1 to 5...
      So, try to suppose you have two constant arrays where, for each index, an array have the minimum value and the other the maximum value for the specific parameter.
      When you create a slider, you have to set the minvalue and the maxvalue. I think it is the way that the compiler uses to generate, at compile time, all the frames that can be displayed in runtime.
      But is there a way to change the min and max value at runtime? For example, changing the unit value of the slider?
      If I make a slider with values from 0 to 100 in compile time, in runtime could I set something like "now, instead of use all frame from 0 to 100, (unit = 1) use only 11 frame (0, 10, 20, 30, 40, 50... unit = 10)"?
      Regards
      Pietro

      Ps: sorry for my bad english
      Last edited by pitdibi; 26th March 2019, 06:38 PM.
      Pietro

      Comment


      • #4
        Hello Pietro,

        I don't think you can change the range of the slider during run time.

        However, you can sort of map-out the output value of the slider to your desired range.

        For example, on the sample project that I sent, the function MagicEvent3 had a line that says SliderVal:=newval ,that's for a range of 0-100.

        If you want have a range of 0-50 you can change that to something like SliderVal := newval/2.

        The range of the slider is still 0-100 but the output value is now just 0-50.

        You can try more complex equations to achieve more accurate results but that's the basic idea.

        Best regards,
        Michael

        Comment

        Working...
        X