From 5d8331d0a61be05528dabf63a1aad6d18342a91c Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 30 Dec 2021 21:31:43 -0500 Subject: pid has __repr__ --- qolab/feedback/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'qolab/feedback') diff --git a/qolab/feedback/__init__.py b/qolab/feedback/__init__.py index 3e7ab2f..ad4bb65 100644 --- a/qolab/feedback/__init__.py +++ b/qolab/feedback/__init__.py @@ -12,10 +12,24 @@ class PID(BasicInstrument): self.setGi(Gi) self.setGd(Gd) self.setSign(sign) - self.setEnable(True) + self.setEnable(enable) self.reset() + def __repr__(self): + s = '' + s += f"PID(" + s += f'Gp={self.Gp}' + s += f', Gi={self.Gi}' + s += f', Gd={self.Gd}' + s += f', sign={self.enable}' + if self.config['DeviceNickname'] is not None: + s += ", device_nickname='" + s += f"{self.config['DeviceNickname']}" + s += "'" + s += ')' + return(s) + @BasicInstrument.tsdb_append def getGp(self): return self.Gp -- cgit v1.2.3