Black and White Touch Screen Selector Component

Discussion in 'C-Bus Automation Controllers' started by brianza, Oct 19, 2020.

  1. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    3
    Likes Received:
    0
    This is my first post here.

    I am not new to Cbus but would like to use a Coponent on PICED which I havent used before.
    I have not been able to find an example for what I want to achieve and not sure it can actually be done.

    On the tocuh screen I would like to have one selector component with a list of outputs (Light loads) and one slider.
    I would like the Slider to control the selected output in order not to clutter the screen.

    The only example I found is that each line of the selector componet is a page link to a new page whith the addres on the Slider component changed to a new address on each page (which is very cumbersome to manage).

    I'd apprecite to know if anyone has managed to do this.

    rgs
    Brian
     
    brianza, Oct 19, 2020
    #1
    1. Advertisements

  2. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,142
    Likes Received:
    118
    Location:
    Adelaide, Australia
    You will need to write a bit of logic to accomplish this.

    For the selector, create a user system integer io value and attach it to the selector. This value will change (from 0 up) when you select an item. Then in logic, just test if this value changes and set the slider to the current group value associated with that selected item. Also in logic, test if the slider has been moved and if so output its value to the appropriate group address. If you create an array containing each group address you can use the selector value to index directly into this array.
     
    Ashley, Oct 19, 2020
    #2
    1. Advertisements

  3. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    3
    Likes Received:
    0
    I think I got it. Thank you (the manual is a little poor in this area)
     
    brianza, Oct 19, 2020
    #3
  4. brianza

    brianza

    Joined:
    Oct 19, 2020
    Messages:
    3
    Likes Received:
    0
    Hi, me again.

    I am nearly there.

    Would you share the command in Logic to achieve this please:

    "set the slider to the current group value associated with that selected item"
     
    brianza, Oct 20, 2020
    #4
  5. brianza

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,142
    Likes Received:
    118
    Location:
    Adelaide, Australia
    I did the whole thing.

    Selector is assigned to integer system io "Selector"
    Slider is assigned to integer system io "Slider Value" with a range of 0 to 255

    In global variables put:

    Code:
    selectorGroups: array[0..2] of integer; // Change for number of selector items (3 here)
    activeSliderGroup: integer;
    in Initialisation:

    Code:
    // Change these to your group addresses
    selectorGroups[0] := 29;  // Group addresses of selector items
    selectorGroups[1] := 42;
    selectorGroups[2] := 43;
    // etc
    
    
    and the module is:

    Code:
    activeSliderGroup := selectorGroups[GetIntSystemIO("Selector")];  // Get currently selected group
    if HasChanged(GetIntSystemIO("Slider Value")) then // Slider moved?
      SetLightingLevel(activeSliderGroup, GetIntSystemIO("Slider Value"), "0s")  // User has moved slider
    else
      SetIntSystemIO("Slider Value", GetLightingLevel(activeSliderGroup)); // In case group has changed externally
    
     
    Ashley, Oct 21, 2020
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.