Bugfixing Parameters Interface & Adding a Callback to VoltageControlComponent#37
Bugfixing Parameters Interface & Adding a Callback to VoltageControlComponent#37Ulfgard wants to merge 5 commits into
Conversation
nulinspiratie
left a comment
There was a problem hiding this comment.
Nice pull request. It looks good. A few thoughts on this.
First, good catch on unit versus units. I'm wondering whether we should make the function signature use unit by default, and then in keyword arguments, also check for units if it's passed to add backwards compatibility. We could add a deprecation warning for this.
Second, for the callback parameter, I think it makes sense as well. Maybe the callback should receive three arguments: one is the parameter, second is the previous value (using get_latest()), and the third is the new value. It should get the latest value before, then update, and then do the callback. This way, you can see both the old value and the new value, which might be useful information for the callback.
Given the simulated delay in the basic parameter might not be that important, maybe we should just remove the delay. If it's really a basic parameter, I don't think it needs it. It was mainly used for testing purposes.
Finally, I don't fully understand the check property you have in type checking. Can you explain this part?
Let me know what you think. I don't feel strongly on any of the points raised above
|
…h QCodes Parameters. Added Type checking to BasicParameter
…f values. This is done by adding wrapper class CallbackParameter
|
changes are incorporated |
This PR adds a few bug fixes and improvements to Parameters:
Further, it adds a new feature which allows
VoltageControlComponentcallback if any of the parameters is changed via ParameterProtocol.set(). This is necessary because we might want to inform the data acquirer if any of the parameters are changed. for example a change of a plunger gate could trigger deletion of history. The Implementation is done via a new classCallbackParameterwhich just wraps ParameterProtocol.set() and calls the callback with the changed parameter provided as argument. This seemed to be the least invasive way. TypeChecking was also added here.