def __init__(self, config = None, desc = None, job_id = None, job_date = None): Resultable.__init__(self) if config is None: self.config = { } if desc is None: self.description = { } self.job_id = job_id self.job_date = job_date
def __init__(self, error_msg = None, desc = {}, job_id = None, job_date = None): Resultable.__init__(self) Drawable.__init__(self) if error_msg is not None: self.error_message = error_msg self.set_title("Error-Result: %s" % error_msg) else: self.error_message = error_msg self.description = desc self.job_id = job_id self.job_date = job_date
def __init__(self, x = None, y = None, desc = None, job_id = None, job_date = None): Resultable.__init__(self) Drawable.__init__(self) if (x is None) and (y is None) and (desc is None) and (job_id is None) and (job_date is None): pass elif (x is not None) and (y is not None) and (desc is not None) and (job_id is not None) and (job_date is not None): pass else: raise ValueError("Wrong usage of __init__!")
def __init__(self, x = None, y = None, index = None, sampl_freq = None, desc = None, job_id = None, job_date = None): Resultable.__init__(self) Drawable.__init__(self) # Title of this accumulation: set Values: Job-ID and Description (plotted in GUI -> look Drawable) # Is set in ResultReader.py (or in copy-construktor) self.__title_pattern = "ADC-Result: job_id = %s, desc = %s" # Axis-Labels (inherited from Drawable) self.xlabel = "Time (s)" self.ylabel = "Samples [Digits]" self.lock=threading.RLock() self.nChannels = 0 if (x is None) and (y is None) and (index is None) and (sampl_freq is None) and (desc is None) and (job_id is None) and (job_date is None): self.cont_data = False self.sampling_rate = 0 self.index = [] self.x = [] self.y = [] elif (x is not None) and (y is not None) and (index is not None) and (sampl_freq is not None) and (desc is not None) and (job_id is not None) and (job_date is not None): self.x = x self.y = y self.index = index self.sampling_rate = sampl_freq self.cont_data = True self.description = desc self.job_id = job_id self.job_date = job_date title="ADC-Result: job-id=%d"%int(self.job_id) if len(self.description)>0: for k,v in self.description.iteritems(): # string keys can be made invisible by adding two underscores in front of them if not (type(k) in types.StringTypes and k[0] == '_' and k[1] == '_'): title+=", %s=%s"%(k,v) self.set_title(title) else: raise ValueError("Wrong usage of __init__!")
def __init__(self, x = None, y = None, index = None, sampl_freq = None, desc = None, job_id = None, job_date = None): Resultable.__init__(self) Drawable.__init__(self) # Title of this accumulation: set Values: Job-ID and Description (plotted in GUI -> look Drawable) # Is set in ResultReader.py (or in copy-construktor) self.__title_pattern = "ADC-Result: job_id = %s, desc = %s" # Axis-Labels (inherited from Drawable) self.xlabel = "Time (s)" self.ylabel = "Samples [Digits]" if (x is None) and (y is None) and (index is None) and (sampl_freq is None) and (desc is None) and (job_id is None) and (job_date is None): self.cont_data = False self.sampling_rate = 0 self.index = [] self.x = [] self.y = [] elif (x is not None) and (y is not None) and (index is not None) and (sampl_freq is not None) and (desc is not None) and (job_id is not None) and (job_date is not None): self.x = x self.y = y self.index = index self.sampling_rate = sampl_freq self.cont_data = True self.description = desc self.job_id = job_id self.job_date = job_date title="ADC-Result: job-id = %d"%int(self.job_id) if len(self.description)>0: for k,v in self.description.iteritems(): title+=", %s=%s"%(k,v) self.set_title(title) else: raise ValueError("Wrong usage of __init__!")