Changeset 2298
- Timestamp:
- 02/15/10 17:14:19 (5 months ago)
- Location:
- trunk/papywizard
- Files:
-
- 3 modified
-
hardware/abstractHardware.py (modified) (1 diff)
-
hardware/gigaPanBotHardware.py (modified) (3 diffs)
-
plugins/abstractHardwarePlugin.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/papywizard/hardware/abstractHardware.py
r2290 r2298 93 93 """ 94 94 pass 95 96 def shutdown(self): 97 """ Shutdown the low-level hardware. 98 """ 99 pass -
trunk/papywizard/hardware/gigaPanBotHardware.py
r2286 r2298 189 189 except IOError: 190 190 Logger().exception("GigaPanBotHardware.__sendCmd") 191 Logger().warning("GigaPanBotHardware.__sendCmd(): %s axis %d can't sent command %s. Retrying..." % (NAME,self._axis, repr(cmd)))191 Logger().warning("GigaPanBotHardware.__sendCmd(): axis %d can't sent command %s. Retrying..." % (self._axis, repr(cmd))) 192 192 else: 193 193 break 194 194 else: 195 raise HardwareError(" %s axis %d can't send command %s" % (NAME,self._axis, repr(cmd)))195 raise HardwareError("Axis %d can't send command %s" % (self._axis, repr(cmd))) 196 196 #Logger().debug("GigaPanBotHardware.__sendCmd(): axis %d ans=%s" % (self._axis, repr(answer))) 197 197 … … 199 199 200 200 def init(self): 201 """ Init the GigaPanBot hardware.202 203 Done only once per axis.204 """205 201 self._driver.acquireBus() 206 202 try: … … 217 213 self.__encoderFullCircle = self.__decodeAxisValue(value) 218 214 Logger().debug("GigaPanBotHardware.init(): full circle count=%s" % hex(self.__encoderFullCircle)) 215 216 # Tell the controller we are connected 217 self.__sendCmd("F", "1") 218 219 finally: 220 self._driver.releaseBus() 221 222 def shutdown(self): 223 self._driver.acquireBus() 224 try: 225 226 # Tell the controller we are disconnected 227 self.__sendCmd("F", "0") 219 228 220 229 finally: -
trunk/papywizard/plugins/abstractHardwarePlugin.py
r2279 r2298 103 103 self._hardware.setNbRetry(ConfigManager().getInt('Plugins/HARDWARE_COM_RETRY')) 104 104 self._hardware.init() 105 106 def shutdown(self): 107 Logger().trace("AbstractHardwarePlugin.shutdown()") 108 AbstractPlugin.shutdown(self) 109 self._hardware.shutdown()
