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