From 40c7b3ed075246b352b98c46869d4293af309606 Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Wed, 2 Nov 2011 17:37:56 +0100 Subject: Axis name assignment --- Phytron.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Phytron.py b/Phytron.py index bb84003..3bed11e 100644 --- a/Phytron.py +++ b/Phytron.py @@ -25,9 +25,10 @@ class ParameterLimitsError(exceptions.ValueError): pass class Axis: - def __init__(self, ipcomm, ID): + def __init__(self, ipcomm, ID, name = None): self.ipcomm = ipcomm self.ID = ID + self.name = name def execute(self, cmd): result = self.ipcomm.execute(self.ID, cmd) @@ -69,14 +70,14 @@ class Status: INITIATOR_P = (1<<1) RUNNING = (1<<0) def __init__(self, bitvector): - self.coldboot = not not (bitvector & (1<<7)) - self.any_error = not not (bitvector & (1<<6)) - self.rx_error = not not (bitvector & (1<<5)) - self.SFI_error = not not (bitvector & (1<<4)) - self.outputstage_error = not not (bitvector & (1<<3)) - self.initiator_m = not not (bitvector & (1<<2)) - self.initiator_p = not not (bitvector & (1<<1)) - self.running = not not (bitvector & (1<<0)) + self.coldboot = not not (bitvector & Status.COLDBOOT) + self.any_error = not not (bitvector & Status.ANY_ERROR) + self.rx_error = not not (bitvector & Status.RX_ERROR) + self.SFI_error = not not (bitvector & Status.SFI_ERROR) + self.outputstage_error = not not (bitvector & Status.OUTPUTSTAGE_ERROR) + self.initiator_m = not not (bitvector & Status.INITIATOR_M) + self.initiator_p = not not (bitvector & Status.INITIATOR_P) + self.running = not not (bitvector & Status.RUNNING) def __str__(self): status = list() -- cgit v1.2.3