diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-29 22:14:54 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-29 22:14:54 -0500 |
commit | ed26f6dcbbcd39942644f310836ee1e7c13d3454 (patch) | |
tree | 3ce5524373f716d72dd76906428ec56a5d320ef0 /qolab | |
parent | 9cc643cd1e0f270e0af36a1674ab0768988fe71f (diff) | |
download | qolab-ed26f6dcbbcd39942644f310836ee1e7c13d3454.tar.gz qolab-ed26f6dcbbcd39942644f310836ee1e7c13d3454.zip |
pid feedbacks logs to tsdb
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/feedback/__init__.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/qolab/feedback/__init__.py b/qolab/feedback/__init__.py index e92df18..c0a79d2 100644 --- a/qolab/feedback/__init__.py +++ b/qolab/feedback/__init__.py @@ -2,47 +2,58 @@ import time from qolab.hardware.basic import BasicInstrument class PID(BasicInstrument): - def __init__(self, Gp=0, Gi=0, Gd=0, sign=1): - super().__init__() + def __init__(self, Gp=0, Gi=0, Gd=0, sign=1, *args, **kwds): + super().__init__(*args, **kwds) self.config['Device model'] = 'Generic Software PID loop' self.config['Device type']='PID loop' self.config['FnamePrefix'] = 'pid' self.deviceProperties = ['Gp', 'Gi', 'Gd', 'Sign', 'Enable' ]; - self.Gp = Gp - self.Gi = Gi - self.Gd = Gd - self.sign = sign - self.enable = True + self.setGp(Gp) + self.setGi(Gi) + self.setGd(Gd) + self.setSign(sign) + self.setEnable(True) self.reset() + @BasicInstrument.tsdb_append def getGp(self): return self.Gp + @BasicInstrument.tsdb_append def setGp(self,val): + print('setting Gp') self.Gp=val + @BasicInstrument.tsdb_append def getGi(self): return self.Gi + @BasicInstrument.tsdb_append def setGi(self,val): self.Gi=val + @BasicInstrument.tsdb_append def getGd(self): return self.Gd + @BasicInstrument.tsdb_append def setGd(self,val): self.Gd=val + @BasicInstrument.tsdb_append def getSign(self): return self.sign + @BasicInstrument.tsdb_append def setSign(self,val): self.sign=val + @BasicInstrument.tsdb_append def getEnable(self): return self.enable + @BasicInstrument.tsdb_append def setEnable(self,val): self.enable=val |