def validateInput(self, input, type):
     if type is 'channelName':
         if input not in self.info.getChanNames():
             raise Error('No such channel')
     if type is 'exposure':
         if not 0 <= input <= 2000:
             raise Error('exposure invalid')
Exemplo n.º 2
0
 def __init__(self,device_id,requesting_context,owning_context):
     Error.__init__(
         self,
         (
             'device "%s" can not be unlocked by context %s because ' +
             'it is owned by context %s'
         ) % (
             device_id,
             requesting_context,
             owning_context
         )
     )
Exemplo n.º 3
0
 def __init__(self,setting_id,setting_name,device_id,requesting_context,owning_context):
     Error.__init__(
         self,
         (
             'setting %d (%s) for device "%s" ' +
             'can not be accessed by context %s ' +
             'because it is locked by context %s'
         ) % (
             setting_id,
             setting_name,
             device_id,
             requesting_context,
             owning_context
         )
     )
Exemplo n.º 4
0
 def setSaveFolder(self, c, folder):
     try:
         yield self.dv.cd(folder, True)
         self.saveFolder = folder
     except AttributeError:
         print 'failing'
         from labrad.types import Error
         raise Error("NotReady")
Exemplo n.º 5
0
    def fit_stepedge(self, c, data):
        ans = yield self.get_data_at_path(c, data)
        data = ans.data.asarray

        fitobj = step_edge_fit(data[:, 0], data[:, 1])
        fitobj.fit()

        if fitobj.direction == 0:
            raise Error("No Direction", 100)
Exemplo n.º 6
0
 def __init__(self,invalid_device_id):
     Error.__init__(
         self,
         'device id "%s" is not a valid device id' % invalid_device_id
     )
Exemplo n.º 7
0
 def __init__(self,context_id):
     Error.__init__(self,'context %s has no device selected' % (context_id,))
Exemplo n.º 8
0
 def __init__(self,device_id,device_error):
     Error.__init__(
         self,
         'error from device "%s": %s' % (device_id,device_error.msg)
     )
Exemplo n.º 9
0
 def __init__(self,device_id):
     Error.__init__(
         self,
         'device "%s" has no owner beacuse it is unlocked' % device_id
     )
Exemplo n.º 10
0
 def __init__(self,device_id):
     Error.__init__(
         self,
         'can not unlock device "%s" because it is already unlocked' % device_id
     )