19.08.2017, 16:52
Hello Edgar/admin,
I have rewritten the DMX library to my own needs and altered quite some functionality, but I am puzzled about something in the original DMX library you have written.
It stores the current values in storage (storage.exec), and each second, retrieves them from storage, populates an array with them, calculates the DMX updates and then forgets about them. But why are the current channel values in storage?
I have rewritten the DMX library to my own needs and altered quite some functionality, but I am puzzled about something in the original DMX library you have written.
It stores the current values in storage (storage.exec), and each second, retrieves them from storage, populates an array with them, calculates the DMX updates and then forgets about them. But why are the current channel values in storage?
- You could just leave the values in the channels array am I right?
- Changing to a new target value could be done by the set function directly to the value array as well I think?
- I believe the array is lost anyway when the calling resident script is deactivated/activated, so the storage will only be useful to refill that array with the old current values? But you don't know how current they are?
- And if the storage is there to just fill the channels array in memory on a restart, then why not only call it on a restart?
- I thought about memory efficiency, but seeing the array is filled every second anyway the memory will be taken anyway.