Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Add C API Support for RoboDK_getItemList including item filter

#1
Similar to the Python, C#, and C++ API's, it would be nice to have the C API for ItemList support a filter parameter.

For example: `void RoboDK_getItemList(struct RoboDK_t *inst, struct Item_t *itemlist, int32_t itemlist_maxsize, int32_t *itemlist_sizeout, enum eITEM_TYPE itemtype)` would be analagous to how the filter is implemented in the C API for RoboDK_getItem.

I currently have a workaround (creating an array of items by repeatedly getting a new one and checking validity), it's just quite a bit slower and messier to add items one-by-one to an array rather than getting an array of items directly from the API.

I know that just using the C++ API is preferred, but the dependency on Qt is too onerous in this case.
#2
We just added a new version of ItemList that includes the filter option. Thank you for your suggestion. You can find the latest version of the RoboDK API for C here:
https://github.com/RoboDK/RoboDK-API/blo...dk_api_c.h

This is the new function:
Code:
void RoboDK_getItemListFilter(struct RoboDK_t *inst, const int32_t filter, struct Item_t *itemlist, int32_t itemlist_maxsize, int32_t *itemlist_sizeout);
We also improved the previous ItemList and it should now be slightly faster.
#3
Thanks, Albert!
  




Users browsing this thread:
1 Guest(s)