Ejemplo n.º 1
0
 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"]
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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"]
Ejemplo n.º 4
0
 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"]
Ejemplo n.º 5
0
 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")
Ejemplo n.º 6
0
    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
Ejemplo n.º 7
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)]()
Ejemplo n.º 8
0
 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
Ejemplo n.º 9
0
 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
Ejemplo n.º 10
0
 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
Ejemplo n.º 11
0
 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"]
Ejemplo n.º 12
0
 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)
Ejemplo n.º 13
0
 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
Ejemplo n.º 14
0
 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
Ejemplo n.º 15
0
 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
Ejemplo n.º 16
0
 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)
Ejemplo n.º 17
0
 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)
Ejemplo n.º 18
0
 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)
Ejemplo n.º 19
0
 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)
Ejemplo n.º 20
0
 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
Ejemplo n.º 21
0
 def refresh(self):
     ScanEvent.refresh(self)
     pub.sendMessage("request_canvas")
Ejemplo n.º 22
0
 def refresh(self):
     """
         Refresh scan event.
     """
     # Insert here what should be done to refresh the state of the scan event.
     ScanEvent.refresh(self)
Ejemplo n.º 23
0
 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
Ejemplo n.º 24
0
 def __init__(self,parent=None):
     ScanEvent.__init__(self,parent)
     self.is_root = True
Ejemplo n.º 25
0
 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
Ejemplo n.º 26
0
 def refresh(self):
     ScanEvent.refresh(self)
     from terapy.hardware import devices
     self.instrlist = devices['axis'][:]
     self.instrlist.extend(devices['input'][:])
Ejemplo n.º 27
0
 def __init__(self, parent = None):
     ScanEvent.__init__(self, parent)
     self.instr = 0
     self.instrlist = []
     self.propNames = ["Instrument"]
     self.config = ["instr"]
Ejemplo n.º 28
0
 def __init__(self,parent=None):
     ScanEvent.__init__(self,parent)
     self.avg = 5
     self.propNames = ["Count"]
     self.is_loop = True
     self.config = ["avg"]