implement pfeiffer TPG vacuum reading

this is an example where StringIO.communicate has to be extended

Change-Id: Iff6bb426ee7960904993574531de84793152e21d
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32385
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
zolliker 2023-10-23 15:51:03 +02:00
parent 158477792f
commit 0004dc7620

View File

@ -18,7 +18,7 @@
# *****************************************************************************
"""pfeiffer TPG vacuum pressure reading"""
from frappy.core import StringIO, HasIO, Command, StringType, IntRange, \
from frappy.core import StringIO, HasIO, IntRange, \
IDLE, WARN, ERROR, Readable, Parameter, Property
from frappy.errors import CommunicationFailedError
@ -43,7 +43,7 @@ class IO(StringIO):
class Pressure(HasIO, Readable):
value = Parameter(unit='mbar')
channel = Property('channel number', IntRange(1,2), default=1)
channel = Property('channel number', IntRange(1, 2), default=1)
STATUS_MAP = {
'0': (IDLE, ''),
@ -56,7 +56,7 @@ class Pressure(HasIO, Readable):
}
ioClass = IO
def read_value(self):
reply = self.communicate(f'PR{self.channel}')
status, strvalue = reply.split(',')