Add 'set_multiple' function, to permit setting multiple attributes#3
Add 'set_multiple' function, to permit setting multiple attributes#3seb26 wants to merge 2 commits intoquentinmit:masterfrom
Conversation
re-add functionality for calling `set attr` by itself
|
Right now, setting attributes on an instance of I would guess that the UCP Control app is able to change multiple values at once by writing the entire configuration block to the device, instead of writing an individual setting. When I first implemented decimctl, I felt that was too dangerous without understanding what the other bytes in the register block do. That said, the UMD enabled/disabled status is stored in two consecutive bytes, so it should be possible to support setting those two bytes at once without much risk. Given that this only takes it from ~900ms to ~500ms, I don't really like adding this as-is. If you want to work out an API that could allow changing multiple registers with a single write (e.g. by diffing before/after states to identify changed bytes?) or an API that specifically allows toggling all the UMDs at once (should be easier to implement, but obviously more constrained) then I'd be happy to entertain that. |
|
Thanks Quentin for considering this, I will look at one of the alternative strategies you mention. |
Suggestion to resolve #2.
Using
decimctl set_multiple, set() is called, a single device instance is created and registers gathered, name & value pairs from the arguments are parsed and then set.Example command:
I am not sure how the UCP Control app is able to set All UMDs on or off in a single press, where all UMDs visually disappear or reappear together with no delay in between each one.
Testing:
It's much faster to switch UMDs on/off using
set_multiple.In #2 my shell script with 4 separate
decimctl setcalls, I can see ~891ms delay between each UMD appearing, measured using a slowmo iphone recording.Using
set_multiplethe visual appearance of each UMD appearing/off is much quicker and the delay is ~491ms.decimctl set attribanddecimctl set attrib valueare functioning as normal.