Skip to main content

Dynamic lists in AMX (IRLB commands)​

For displaying a list, such as music or movies, that changes while the project is running


iRidi List dynamic list - a project item that creates a scrollable list from a single popup (template) in an AMX project. List items are added and removed while the project is running.

The controller command sets the number of list items, subject to the limits configured for the graphical item that serves as the list base. Special commands can change the contents of a list item.

Preparing the list base in AMX TPDesign4​

The list base is always a Multistate-Bargraph :

AMX_DinList_AddBase1.png

In the Description field of the Multistate-Bargraph item, specify the popup that serves as the list item template:

AMX_DinList_AddTemplate.png

IridiumList=Template_1;

Template_1 - name of the popup used as the list item template

On the Programming tab of the Multistate-Bargraph item, configure how presses on list items are handled:

AMX_DinList_AddBase2.png


Address Code is used to control the list from the controller.
Sending the value 10 to the list's <Address Code> positions it at item 10 (if that item exists)



Level Code is used to track presses on list items. Level Code reports to the controller which item and subitem were pressed. If Level Code: 401 is set and item 10 is pressed, the controller receives the value 10 on Level Code: 401. Information about the pressed subitem is sent on the next Level Code: 402. If item 10 has 3 subitems and the second subitem is pressed, Level Code: 402 receives the value 2 (counting from zero: 0 - item background, 1 - first subitem, ...)


Note

When a list item is pressed, it sends its identifier and the identifier of the pressed subitem to the AMX controller. The controller processes these two values and runs the corresponding scenario

Note

The identifier of the first list item (the first item's ID) is specified when the list is created with the IRLB_ADD command.

Note

The value selected on a level or joystick is NOT sent to the controller, because only the press on the subitem is recorded.

IRLB commands: list control​

IRLB commands - a set of commands that can only be sent to iRidi client applications. Standard AMX TouchPanel devices do not recognize them.

1. Adding a specified number of items to the list

send_command dvTP, "'IRLB_ADD-<address,count,start_id>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • count - number of list items to create
  • start_id - identifier of the first item in the list

Example: create a list with 25 items (base item Code:400, number of items - 25, first item ID - 0)

AMX_DinList_SendAdd.png

2. Deleting a specified item by ID

send_command dvTP, "'IRLB_DELETE-<address,id>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the list item to delete

3. Deleting all items

send_command dvTP, "'IRLB_CLEAR-<address>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)

4. Setting the list's resistance to movement as a percentage from 0-100% (0 - no friction, 100 - no movement)

send_command dvTP, "'IRLB_RESISTENCE-<address,value>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • value - resistance value from 0 to 100

5. Setting the list position

send_command dvTP, "'IRLB_POSITION-<address,id>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the list item to move to

6. Setting the list color

send_command dvTP, "'IRLB_SCROLL_COLOR-<address,color>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • color - color (HEX, RGB, color name)

7. Setting the horizontal coordinate of a list subitem

send_command dvTP, "'IRLB_ITEM_X-<address,id,subitem,value>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • value - X coordinate of the item in pixels

8. Setting the vertical coordinate of a list subitem

send_command dvTP, "'IRLB_ITEM_Y-<address,id,subitem,value>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • value - Y coordinate of the item in pixels

9. Setting the width of a list subitem

send_command dvTP, "'IRLB_ITEM_WIDTH-<address,id,subitem,value>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • value - item width in pixels

10. Setting the height of a list subitem

send_command dvTP, "'IRLB_ITEM_HEIGHT-<address,id,subitem,value>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • value - item height in pixels

11. Setting the subitem color

send_command dvTP, "'IRLB_ITEM_COLOR-<address,id,subitem,color>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • color - color (HEX, RGB, color name)

12. Setting the opacity of a list subitem

send_command dvTP, "'IRLB_ITEM_OPACITY-<address,id,subitem,value>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • value - item opacity from 0 to 255

13. Setting the text of a list subitem in CP1251 format

send_command dvTP, "'IRLB_ITEM_TEXT-<address,id,subitem,string>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • string - string in CP1251 format

14. Setting the subitem text in Unicode format

send_command dvTP, "'IRLB_ITEM_UNI-<address,id,subitem,string>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • string - string in Unicode format
To populate string, use the Unicode Edit tool in NetLinx Studio.
# In the current project, open Edit -> Advanced -> Unicode Edit.
# In the window that opens, enter the value and copy the generated Unicode string.

15. Setting the subitem text color
send_command dvTP, "'IRLB_ITEM_TEXT_COLOR-<address,id,subitem,color>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • color - color (HEX, RGB, color name)

16. Setting the subitem text alignment
send_command dvTP, "'IRLB_ITEM_TEXT_ALIGN-<address,id,subitem,align>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • align - alignment method

17. Setting the subitem image
send_command dvTP, "'IRLB_ITEM_IMAGE-<address,id,subitem,image name>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • image name - name of the image added to the project gallery

18. Setting the subitem image alignment
send_command dvTP, "'IRLB_ITEM_IMAGE_ALIGN-<address,id,subitem,align>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • align - alignment method

19. Setting the subitem icon
send_command dvTP, "'IRLB_ITEM_ICON-<address,id,subitem,slot_id>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • slot_id - slot number in Resource Manager
Example using slot_id: IRLB_ITEM_ICON-400,0,1,3

20. Setting the subitem icon alignment
send_command dvTP, "'IRLB_ITEM_ICON_ALIGN-<address,id,subitem,align>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • align - alignment method

21. Setting the subitem border by identifier
send_command dvTP, "'IRLB_ITEM_BORDER-<address,id,subitem,border>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • border - border type

22. Setting the subitem border color
send_command dvTP, "'IRLB_ITEM_BORDER_COLOR-<address,id,subitem,color>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph)
  • id - identifier of the item in the list
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on)
  • color - color (HEX, RGB, color name)

23. Assigning Value to a subitem of a list item
send_command dvTP, "'IRLB_ITEM_VALUE-<address,id,subitem,value>'"

  • address - address of the AMX list;
  • id - identifier of the item in the list, the list base (Multistate-Bargraph);
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on);
  • value - value

24. Linking a specific list to three levels that receive values when a subitem's value changes.
send_command dvTP, "'IRLB_LINK_LEVEL-<address,port,item_code,subitem_code,value_code>'"

  • address - address associated with the list;
  • port - port in AMX;
  • item_code - AMX code that receives the list item identifier;
  • subitem_code - AMX code that receives the list subitem identifier;
  • value_code - AMX code that receives the list subitem value. How it works:
    1. The user changes a level value on a list item.
    2. item_code on AMX receives the identifier of the list item where the change occurred.
    3. subitem_code on AMX receives the identifier of the subitem within the list item (the level's ordinal number in the template).
    4. value_code on AMX receives the level value.

25. Linking a specific list to two levels and one channel that receive values when a subitem is pressed or released.
send_command dvTP, "'IRLB_LINK_CHANNEL-<address,port,item_code,subitem_code,value_code>'"

  • address - address associated with the list;
  • port - port in AMX;
  • item_code - AMX code that receives the list item identifier;
  • subitem_code - AMX code that receives the list subitem identifier;
  • value_code - AMX code that receives one (push) when a list subitem is pressed and zero (release) when it is released. How it works:
    1. The user presses or releases an item
    2. item_code on AMX receives the identifier of the list item where the press occurred.
    3. subitem_code on AMX receives the identifier of the subitem within the list item (the item's ordinal number in the template).
    4. value_code on AMX receives the channel press (push) or release (release).

26. Assigning Visible=1 to a list item
send_command dvTP, "'IRLB_ITEM_SHOW-<address,id,subitem>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph);
  • id - identifier of the item in the list;
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on).

27. Assigning Visible=0 to a list item
send_command dvTP, "'IRLB_ITEM_HIDE-<address,id,subitem>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph);
  • id - identifier of the item in the list;
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on).

28. Assigning Enable=1 to a list item
send_command dvTP, "'IRLB_ITEM_ENABLE-<address,id,subitem>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph);
  • id - identifier of the item in the list;
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on).

29. Assigning Enable=0 to a list item
send_command dvTP, "'IRLB_ITEM_DISABLE-<address,id,subitem>'"

  • address - address of the item that serves as the list base (Multistate-Bargraph);
  • id - identifier of the item in the list;
  • subitem - identifier of the subitem in the list (starts at zero: 0 - background, and so on).