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')
예제 #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
         )
     )
예제 #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
         )
     )
예제 #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")
예제 #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)
예제 #6
0
 def __init__(self,invalid_device_id):
     Error.__init__(
         self,
         'device id "%s" is not a valid device id' % invalid_device_id
     )
예제 #7
0
 def __init__(self,context_id):
     Error.__init__(self,'context %s has no device selected' % (context_id,))
예제 #8
0
 def __init__(self,device_id,device_error):
     Error.__init__(
         self,
         'error from device "%s": %s' % (device_id,device_error.msg)
     )
예제 #9
0
 def __init__(self,device_id):
     Error.__init__(
         self,
         'device "%s" has no owner beacuse it is unlocked' % device_id
     )
예제 #10
0
 def __init__(self,device_id):
     Error.__init__(
         self,
         'can not unlock device "%s" because it is already unlocked' % device_id
     )