def __init__(self, parent=None): ScanEvent.__init__(self, parent) self.axis = 0 self.N = 257 self.dv = 0.1 self.propNames = ["Axis", "# Steps", "Step"] self.is_loop = True self.config = ["axis", "N", "dv"]
def stop(self, inst=None): """ Stop scan. Parameters: inst - pubsub event data """ # Insert here what should be done when the measurement stops ScanEvent.stop(self, inst)
def __init__(self, parent = None): ScanEvent.__init__(self, parent) self.instr = 0 self.instrlist = [] self.quantity = 0 self.tag = "tmp" self.propNames = ["Instrument","Quantity","Tag"] self.config = ["instr","quantity","tag"]
def __init__(self, parent = None): ScanEvent.__init__(self, parent) # Generic read self.input = 0 self.propNames = ["Input"] self.is_input = True self.is_visible = False self.config = ["input"]
def __init__(self, parent=None): ScanEvent.__init__(self, parent) self.is_display = True self.canvas = None self.can_plot = True self.auto_refresh = True self.clock = 0 pub.subscribe(self.set_canvas, "broadcast_canvas") pub.subscribe(self.set_refresh, "broadcast_refresh")
def refresh(self): ScanEvent.refresh(self) from terapy.hardware import devices self.axlist = devices["axis"] if self.axis >= len(self.axlist): self.axis = len(self.axlist) - 1 if self.axis < 0: self.axis = 0
def refresh(self): ScanEvent.refresh(self) from terapy import files if self.autoname: self.filename="" if hasattr(self,'fname'): del self.fname modnames = [x.__name__ for x in files.modules if x().can_save] if modnames.count(self.fclass)==0: self.fclass = modnames[0] self.filter = files.modules[modnames.index(self.fclass)]()
def __init__(self, parent = None): ScanEvent.__init__(self, parent) self.filename = "" self.autoname = True self.propNames = ["File name","Automatic"] self.is_save = True self.is_visible = False self.config = ["filename","autoname"] self.filter = None
def __init__(self, parent = None): ScanEvent.__init__(self, parent) self.filename = "" self.fclass = "" self.autoname = True self.propNames = ["File format","File name","Automatic"] self.is_save = True self.config = ["fclass","filename","autoname"] self.filter = None
def __init__(self, parent = None): ScanEvent.__init__(self, parent) self.axis = 0 self.axlist = [] self.position = 0.0 self.relative = False self.propNames = ["Axis","Position","Relative"] self.config = ["axis","position","relative"] self.is_axis = True
def __init__(self, parent=None): ScanEvent.__init__(self, parent) self.axis = 0 self.min = 0.0 self.max = 25.6 self.N = 257 self.dv = 0.1 self.propNames = ["Axis", "Minimum", "Maximum", "# Steps", "Step"] self.is_loop = True self.config = ["axis", "N", "min", "max", "dv"]
def edit_label(self, event, pos): """ Actions triggered by edit tree label event corresponding to given property node. Parameters: event - wx.Event pos - property index (int) """ # Insert here what should be done to display adequate editor when properties are edited in place # (i.e. inside the host TreeCtrl). See Read event for an example of custom editor. ScanEvent.edit_label(self, event, pos)
def refresh(self): ScanEvent.refresh(self) from terapy.hardware import devices self.axlist = devices['axis'] self.trlist = devices['input'] if self.axis>=len(self.axlist): self.axis = len(self.axlist)-1 if self.axis<0: self.axis = 0 if self.trigger>=len(self.trlist): self.trigger = len(self.trlist)-1 if self.trigger<0: self.trigger = 0 if self.quantity>=len(self.trlist[self.trigger].qtynames): self.quantity = len(self.trlist[self.trigger].qtynames)-1
def refresh(self): ScanEvent.refresh(self) from terapy.hardware import devices self.instrlist = devices['axis'][:] self.instrlist.extend(devices['input'][:]) if self.instr>=len(self.instrlist): self.instr = len(self.instrlist)-1 if isinstance(self.instrlist[self.instr],AxisDevice): self.quantity = 0 else: if self.quantity>=len(self.instrlist[self.instr].qtynames): self.quantity = len(self.instrlist[self.instr].qtynames)-1
def __init__(self, parent = None): ScanEvent.__init__(self, parent) self.axis = 0 self.axlist = [] self.trlist = [] self.step = 0.0 self.delay = 0.1 self.trigger = 0 self.quantity = 0 self.condition = 0 self.condlist = ["Equal","Smaller than","Greater than","Increased by","Decreased by","Multiplied by","Divided by"] self.value = 1.0 self.propNames = ["Axis","Step size","Delay","Trigger", "Quantity","Condition","Value"] self.config = ["axis","step","delay","trigger","quantity","condition","value"] self.is_axis = True
def run_children(self, meas): """ Run scan event children. Parameters: meas - measurement (Measurement) """ # Insert here how children should be called from within this scan event return ScanEvent.run_children(self, meas)
def run(self, meas): """ Run scan event. Parameters: meas - measurement (Measurement) """ # Insert here what the event should do with the measurement data structure. # See Measurement class for details. return ScanEvent.run(self, meas)
def set(self, parent=None): """ Run scan event configuration procedure. Parameters: parent - parent window (wx.Window) Output: True if successful """ # Insert here configuration actions (e.g. pop dialog box) return ScanEvent.set(self, parent)
def check_validity(self, data): """ Check whether given data can be processed by this event. Parameters: data - data array (DataArray) or measurement (Measurement) Output: True if yes """ # Insert here tests that will tell whether the given data is compatible or not with this event return ScanEvent.check_validity(self, data)
def __init__(self, parent = None): """ Initialization. Parameters: parent - parent control (wx.TreeCtrl) """ ScanEvent.__init__(self, parent) self.is_loop = False # set to True if this event implements a loop of some sort self.is_display = False # set to True if this event is meant to display something (i.e. plot/print/...) self.is_save = False # set to True if this event saves data to somewhere self.is_axis = False # set to True if this event acts on axis devices self.is_input = False # set to True if this event acts on input devices self.is_active = True # set to True if this event is active by default self.is_visible = True # set to True if this event is visible in the interface self.can_run = True # tell if the event can run (set to True on reset) self.host = parent # parent control (wx.TreeCtrl) self.name = self.__extname__ # event display name (str) self.propNames = [] # property names, as displayed in the interface self.propNodes = [] # property values self.config = [] # variables to be saved in config files
def refresh(self): ScanEvent.refresh(self) pub.sendMessage("request_canvas")
def refresh(self): """ Refresh scan event. """ # Insert here what should be done to refresh the state of the scan event. ScanEvent.refresh(self)
def refresh(self): ScanEvent.refresh(self) from terapy.hardware import devices self.inlist = devices['input'] if self.input>=len(self.inlist): self.input = len(self.inlist)-1 if self.input<0: self.input = 0
def __init__(self,parent=None): ScanEvent.__init__(self,parent) self.is_root = True
def refresh(self): ScanEvent.refresh(self) if self.autoname: self.filename="" if hasattr(self,'fname'): del self.fname if hasattr(self,'bfname'): del self.bfname
def refresh(self): ScanEvent.refresh(self) from terapy.hardware import devices self.instrlist = devices['axis'][:] self.instrlist.extend(devices['input'][:])
def __init__(self, parent = None): ScanEvent.__init__(self, parent) self.instr = 0 self.instrlist = [] self.propNames = ["Instrument"] self.config = ["instr"]
def __init__(self,parent=None): ScanEvent.__init__(self,parent) self.avg = 5 self.propNames = ["Count"] self.is_loop = True self.config = ["avg"]