From f416eaf4869bcd9eadaddf2f653c352bbe9368ec Mon Sep 17 00:00:00 2001 From: Wolfgang Draxinger Date: Wed, 7 Dec 2011 15:43:37 +0100 Subject: Phytron.Axis getFullStatus alias getStatus added, execute no longer copies returned status data into instance, status property added instead --- Phytron.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Phytron.py b/Phytron.py index 8f8ac90..fb478e2 100644 --- a/Phytron.py +++ b/Phytron.py @@ -203,13 +203,15 @@ class Axis(object): """ result = self.ipcomm.execute(self.ID, cmd) assert result.ID == self.ID - self.status = result.status - if isinstance(result.data, ExtendedStatus): - self.extended_status = result.data +# self.status = result.status +# if isinstance(result.data, ExtendedStatus): +# self.extended_status = result.data return result def getFullStatus(self): return self.execute("IS?").data + status = property(getFullStatus) + getStatus = getFullStatus def gotoAbsolute(self, position): return self.execute("GA%d" % position).status @@ -348,27 +350,27 @@ class Axis(object): return inputs inputs = property(getInputs) - def clearDriverError(): + def clearDriverError(self): return self.execute("CA").status - def clearInitiatorError(): + def clearInitiatorError(self): return self.execute("CI").status - def clearOutputError(): + def clearOutputError(self): return self.execute("CO").status - def resetHW(): + def resetHW(self): return self.execute("CR").status - def resetSFI(): + def resetSFI(self): return self.execute("CS").status - def getDriverTemperature(): + def getDriverTemperature(self): return int(self.execute("SA?").data) driver_temperature = property(getDriverTemperature) - def getDriverCurrent(): + def getDriverCurrent(self): return int(self.execute("SC?").data) driver_current = property(getDriverCurrent) - def getDriverVoltage(): + def getDriverVoltage(self): return int(self.execute("SU?").data) driver_voltage = property(getDriverVoltage) -- cgit v1.2.3