paulscherrerinstitute / pcaspy

Portable Channel Access Server in Python
BSD 3-Clause "New" or "Revised" License
32 stars 24 forks source link

Support for ADEL / MDEL #46

Closed pklaus closed 6 years ago

pklaus commented 7 years ago

Hello @xiaoqiangwang & PSI, thanks for creating and maintaining this fine piece of software!

I would like to ask, if it's considered to implement the following or how difficult it would be to do so:

Support the fields ADEL and MDEL (as for ai records for example). This would require a change in at least two locations of driver.py: L171 and L541. There, the flag DBE_LOG (or its alias DBE_MONITOR) should only be set if the change from the previous to the current (new) value exceeds ADEL value.

For old-school IOCs, this is done with recGblCheckDeadband() for example for ai records here.

A quick workaround for me would be to override SimplePV.updateValue() and Driver.setParamValue().

xiaoqiangwang commented 7 years ago

I have thought of this but wondered whether this has any use cases. I will have a look at this now.

xiaoqiangwang commented 7 years ago

I just added ADEL/MDEL support in commit b236f3b, and also refactored the value/alarm checking code quite a bit.

It does not break the example programs, but I stay cautious until it gets widely tested.

pklaus commented 7 years ago

Wow, this was well done. And fast! With my PCASpy-based IOC, those changes worked out-of-the box.

Maybe, you should add 'mdel', 'adel' to the info_keys list of Driver.getParamInfo(), too.

The use case for me is clear: Reduce the amount of noise for operator interfaces and reduce the amount of noise recorded with our CS-Studio-based archiver (reducing required database disk space).

By the way: The IOC I implemented using PCASpy is to be found in this Github Gist. It connects our Lufft Opus20 device to EPICS/CA. It is a networked (PoE), calibrated temperature/humidity measurement device in our clean room laboratory. More devices of our slow-control setup (= the Micro-Vertex Detector of the CBM experiment) might follow.

Thanks again for implementing this.

xiaoqiangwang commented 7 years ago

I added mdel/adel to the getParamInfo. Thanks for the suggest.

pklaus commented 7 years ago

Great. Did you, by chance, forget to push the commit with that change?

xiaoqiangwang commented 7 years ago

Ok. Now the change is pushed.

xiaoqiangwang commented 6 years ago

This change has been included into 0.7 release.