From 7385db6de9e5931c33a8bb9c8a172450ce257621 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 11 May 2013 10:42:40 -0400 Subject: [PATCH] Fix old 'get_temp' -> 'get_pv' and 'get_ambient_temp' -> 'get_ambient_pv' This brings some crufty bits up to date after 5d9293b (Copy fit.py from Hooke to remove dependency, and generalize temp -> PV, etc., 2011-07-27). --- examples/temp_monitor.py | 4 ++-- pypid/backend/melcor.py | 2 +- pypid/controller.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/temp_monitor.py b/examples/temp_monitor.py index 9c1369f..46638cc 100755 --- a/examples/temp_monitor.py +++ b/examples/temp_monitor.py @@ -35,8 +35,8 @@ with open('temp_monitor.log', 'a') as f: while True: time.sleep(next_time - time.time()) tstr = time.strftime('%Y-%m-%d %H:%M:%S') - temp = str(b.get_temp()) - ambient = str(b.get_ambient_temp()) + temp = str(b.get_pv()) + ambient = str(b.get_ambient_pv()) f.write('\t'.join([tstr, temp, ambient]) + '\n') f.flush() print('\t'.join([tstr, temp, ambient])) diff --git a/pypid/backend/melcor.py b/pypid/backend/melcor.py index c7736d0..452096b 100644 --- a/pypid/backend/melcor.py +++ b/pypid/backend/melcor.py @@ -645,7 +645,7 @@ class MelcorBackend (_Backend, _ManualMixin, _PIDMixin, _TemperatureMixin): self.set_heating_gains(proportional=p) while True: _LOG.debug('waiting for an out-of-propband temperature') - if abs(self.get_temp() - sp) > small_temp_range: + if abs(self.get_pv() - sp) > small_temp_range: break # we're out of the propband, I-term resets self.set_cooling_gains(proportional=cp) self.set_heating_gains(proportional=hp) diff --git a/pypid/controller.py b/pypid/controller.py index 07df6e2..22d20c8 100644 --- a/pypid/controller.py +++ b/pypid/controller.py @@ -324,7 +324,7 @@ class Controller (object): _time.sleep(sleep_time) def _time_function(self, function, args=(), kwargs=None, count=10): - "Rough estimate timing of get_temp(), takes me about 0.1s" + "Rough estimate timing of get_pv(), takes me about 0.1s" if kwargs is None: kwargs = {} start = _time.time() -- 2.26.2