bitfocus / companion-module-panasonic-cameras

MIT License
7 stars 2 forks source link

Actions accepting variables #18

Closed phillipivan closed 3 weeks ago

phillipivan commented 1 month ago

I would like to be able to use variables as inputs for more actions. Especially gain and pedestal inc/dec step size.

We run about 30 instances of the module, and controls are replicated 3 times over for different control locations, so being able to define some control parameters as variables means we can easily and consistently adjust the system behavior for operators - rather than having to go and modify ~ 180 controls.

premultiply commented 1 month ago

The problem with this request is that nearly all the displayed values are decoded and encoded using ENUM fields (LUT) from/to raw values on the protocol side.

  1. Using variables it would not be predictable for the user which model requires which raw value.
  2. The raw values are not linear and need special formating.
  3. Some values have special meaning.
  4. The decoded display value does not match the raw value set.

All this up/down/set logic is completly covered by the module using a large set of translation tables and funtions.

It may be possible to allow setting raw values but I do not see how this could be of any use? This is already possible by using the custom commands.

Maybe just add variable support to the custom command?

premultiply commented 1 month ago

Especially gain and pedestal inc/dec step size.

As long as it just about the step size and other internal helper values (and not the values itself) there may be a better chance to do so.

phillipivan commented 1 month ago

It really is first and foremost for use to be able to change the step size of these controls that are mapped to rotary encoders. And to be able to do so in one place so our systems behave consistently.

So if gain and pedestal step size was possible that would meet our primary requirement.

premultiply commented 1 month ago

Would you try at least a draft PR for this feature?

phillipivan commented 1 month ago

Of course. I will have a look tomorrow. I am on leave for some time after that so it may be a couple of weeks away.