From ed26f6dcbbcd39942644f310836ee1e7c13d3454 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 29 Dec 2021 22:14:54 -0500 Subject: pid feedbacks logs to tsdb --- qolab/feedback/__init__.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'qolab') 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 -- cgit v1.2.3