aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2011-11-02 17:37:56 +0100
committerWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2011-11-02 17:37:56 +0100
commit40c7b3ed075246b352b98c46869d4293af309606 (patch)
tree7109b992561529593fcf862f4b12175bec0c0541
parente5d6d9f80723394fe4ca859aeca2ae55af668e95 (diff)
downloadPyPhytron-40c7b3ed075246b352b98c46869d4293af309606.tar.gz
PyPhytron-40c7b3ed075246b352b98c46869d4293af309606.tar.bz2
Axis name assignment
-rw-r--r--Phytron.py19
1 files 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()