Ejemplo n.º 1
0
 def __init__(self, name, config, globalDict, instrument):
     self.instrument = None
     ExternalParameterBase.__init__(self, name, config, globalDict)
     logger = logging.getLogger(__name__)
     logger.info("trying to open '{0}'".format(instrument))
     self.instrument = LabBrick(instrument)
     logger.info("opened {0}".format(instrument))
     self.initializeChannelsToExternals()
     self.qtHelper = qtHelper()
     self.newData = self.qtHelper.newData
     self.setDefaults()
Ejemplo n.º 2
0
 def __init__(self, name, config, globalDict, instrument="COM3"):
     logger = logging.getLogger(__name__)
     ExternalParameterBase.__init__(self, name, config, globalDict)
     logger.info("trying to open '{0}'".format(instrument))
     self.instrument = APTInstrument()
     self.instrument.open(instrument)
     self.instrument.homeSearch()
     logger.info("opened {0}".format(instrument))
     self.setDefaults()
     self.initializeChannelsToExternals()
     self.lastTargetValue = None
     if self.settings.limit > self.instrument.maxPos:
         self.settings.limit = Q(self.instrument.maxPos, '')
Ejemplo n.º 3
0
 def __init__(self, name, config, globalDict, instrument="COM3"):
     logger = logging.getLogger(__name__)
     ExternalParameterBase.__init__(self, name, config, globalDict)
     logger.info("trying to open '{0}'".format(instrument))
     self.instrument = APTInstrument()
     self.instrument.open(instrument)
     self.instrument.homeSearch()
     logger.info("opened {0}".format(instrument))
     self.setDefaults()
     self.initializeChannelsToExternals()
     self.lastTargetValue = None
     if self.settings.limit > self.instrument.maxPos:
         self.settings.limit = Q(self.instrument.maxPos, '')
Ejemplo n.º 4
0
 def paramDef(self):
     superior = ExternalParameterBase.paramDef(self)
     superior.append({
         'name': 'limit',
         'type': 'magnitude',
         'value': self.settings.limit
     })
     superior.append({
         'name':
         'belowMargin',
         'type':
         'magnitude',
         'value':
         self.settings.belowMargin,
         'tip':
         'if not zero: if coming from above always go that far below and then up'
     })
     return superior
Ejemplo n.º 5
0
 def setDefaults(self):
     ExternalParameterBase.setDefaults(self)
     self.settings.__dict__.setdefault(
         'limit', Q(360))  # if True go to the target value in one jump
     self.settings.__dict__.setdefault(
         'belowMargin', Q(0))  # if True go to the target value in one jump
Ejemplo n.º 6
0
 def paramDef(self):
     superior = ExternalParameterBase.paramDef(self)
     superior.append({'name': 'rfOn', 'type': 'bool', 'value': self.instrument.rfOn if self.instrument else True})
     superior.append({'name': 'useInternalReference', 'type': 'bool', 'value': self.instrument.useInternalReference if self.instrument else True})
     return superior
Ejemplo n.º 7
0
 def setDefaults(self):
     ExternalParameterBase.setDefaults(self)
     self.settings.__dict__.setdefault('rfOn', True)
     self.settings.__dict__.setdefault('useInternalReference', True)
Ejemplo n.º 8
0
 def paramDef(self):
     superior = ExternalParameterBase.paramDef(self)
     superior.append({'name': 'limit', 'type': 'magnitude', 'value': self.settings.limit})
     superior.append({'name': 'belowMargin', 'type': 'magnitude', 'value': self.settings.belowMargin,
                      'tip': 'if not zero: if coming from above always go that far below and then up'})
     return superior
Ejemplo n.º 9
0
 def setDefaults(self):
     ExternalParameterBase.setDefaults(self)
     self.settings.__dict__.setdefault('limit', Q(360))  # if True go to the target value in one jump
     self.settings.__dict__.setdefault('belowMargin', Q(0))  # if True go to the target value in one jump