コード例 #1
0
 def doWriteUserlimits(self, limits):
     abslimits = self.abslimits
     # include 0 in limits
     lmin = min(max(limits[0], abslimits[0]), 0)
     lmax = max(min(limits[1], abslimits[1]), 0)
     newlimits = (lmin, lmax)
     self.log.debug('Set limits: %r', newlimits)
     HasLimits.doWriteUserlimits(self, newlimits)
     # intentionally not calling CalibratedMagnet.doWriteUserlimits
     # we do not want to change the limits of the current source
     return newlimits
コード例 #2
0
 def doWriteUserlimits(self, limits):
     wlimits = HasLimits.doWriteUserlimits(self, limits)
     if wlimits:
         limits = wlimits
     try:
         self.__stop_and_set('usermax', limits[1])
     except Exception as err:
         if str(err) != 'resource not supported':
             self.log.warning('Error during update of usermax resource: %s',
                              err)
コード例 #3
0
 def doWriteUserlimits(self, limits):
     HasLimits.doWriteUserlimits(self, limits)
     currentsource = self._attached_currentsource
     # all Ok, set source to max of pos/neg field current
     maxcurr = max(abs(self._field2current(i)) for i in limits)
     currentsource.userlimits = (0, maxcurr)
コード例 #4
0
 def doWriteUserlimits(self, limits):
     HasLimits.doWriteUserlimits(self, limits)
     # all Ok, set source to max of pos/neg field current
     maxcurr = max(self._field2current(i) for i in limits)
     mincurr = min(self._field2current(i) for i in limits)
     self._attached_currentsource.userlimits = (mincurr, maxcurr)