Ejemplo n.º 1
0
    def doPreinit(self, mode):
        PyTangoDevice.doPreinit(self, mode)

        # Create hw specific device if given
        if self.hwdevice:
            self._hwDev = HwDevice(self.name + '._hwDev',
                                   tangodevice=self.hwdevice, lowlevel=True)

        # optional components
        self._shutter = None

        if mode != SIMULATION:
            self._initOptionalComponents()

            if self._dev.camera_model.startswith('SIMCAM'):
                self.log.warning('Using lima simulation camera! If that\'s not'
                                 ' intended, please check the cables and '
                                 'restart the camera and the lima server')

            # set some dummy roi to avoid strange lima rotation behaviour
            # (not at 0, 0 to avoid possible problems with strides)
            self._writeRawRoi((8, 8, 8, 8))
            # ensure NO rotation
            self._dev.image_rotation = 'NONE'
            # set full detector size as roi
            self._writeRawRoi((0, 0, 0, 0))
            # cache full detector size
            self._width_height = (self.imagewidth, self.imageheight)
        else:
            # some dummy shape for simulation
            self._width_height = (2048, 1536)
Ejemplo n.º 2
0
 def doStatus(self, maxage=0):
     # Workaround for status changes from busy to another state although the
     # operation has _not_ been completed.
     st, msg = PyTangoDevice.doStatus(self, maxage)
     if self._lastStatus == status.BUSY and st != status.BUSY:
         self.log.debug("doStatus: leaving busy state (%d)? %d. "
                        "Check again after a short delay.", status.BUSY, st)
         session.delay(5)
         st, msg = PyTangoDevice.doStatus(self, 0)
         self.log.debug("doStatus: recheck result: %d", st)
     self._lastStatus = st
     return st, msg
Ejemplo n.º 3
0
 def doPreinit(self, mode):
     PyTangoDevice.doPreinit(self, mode)
     self.log.info('Checking if camera script is ready!')
     try:
         msg = self._dev.communicate('ready?')
         if msg.strip() != 'ready!':
             raise CommunicationError(
                 self, 'Camera script gave wrong '
                 'answer - please check!')
     except NicosError:
         self.log.warning('Camera is not responding - please start '
                          'tomography script on camera first!')
         raise
Ejemplo n.º 4
0
 def doStatus(self, maxage=0):
     return PyTangoDevice.doStatus(self, maxage)[0], ''
Ejemplo n.º 5
0
 def doFinish(self):
     self._dev.Stop()
     session.delay(0.2)
     PyTangoDevice._hw_wait(self)
Ejemplo n.º 6
0
 def doPrepare(self):
     self._dev.Clear()
     PyTangoDevice._hw_wait(self)
     self.log.debug("Detector cleared")
     self._dev.Prepare()