From bb6b0804113cd8ab7939323f5ca3246b3c13f9f6 Mon Sep 17 00:00:00 2001 From: mer0m Date: Fri, 4 Nov 2016 22:41:25 +0100 Subject: [PATCH] Add configure method --- instruments/TPG261.py | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/instruments/TPG261.py b/instruments/TPG261.py index d259383..a670a47 100644 --- a/instruments/TPG261.py +++ b/instruments/TPG261.py @@ -10,30 +10,23 @@ ADRESS = "/dev/ttyS0" #============================================================================== class TPG261(abstract_instrument): - def __init__(self, adress=ADRESS, vtype=[ALL_VAL_TYPE[0]], channels = [ALL_CHANNELS[0]]): + def __init__(self, channels, vtypes, adress): self.adress = adress - self.vtype = vtype + self.channels = channels + self.vtypes = vtypes def model(self): return "PfeifferTPG261" def connect(self): - try: - print('Connecting to device @%s...' %(self.adress)) - self.TPG = MaxiGauge(self.adress) - print(' --> Ok') - - print(self.model()) - - if self.vtype == "PRE": - 1 - else: - print("Wrong -v argument") - raise - - except Exception as er: - print("Unexpected error during connection: " + str(er)) - raise + print('Connecting to device @%s...' %(self.adress)) + self.TPG = MaxiGauge(self.adress) + print(' --> Ok') + print(self.model()) + self.configure() + + def configure(self): + pass def getValue(self): self.read() -- 2.16.4