Esempio n. 1
0
 def __init__(self):
     self.stage_pos = ActiveValue((0,0)) # m,m
     self.stage_pos.bind(self.avOnStagePos)
     
     # FIXME: maybe could go into (sub)classes like OpticalEmitter, SEDetector... 
     self.optical_emt_wavelength = ActiveValue(450) # nm XXX a range?
     self.optical_det_wavelength = ActiveValue(568) # nm
     self.optical_det_exposure_time = ActiveValue(0.5) # s
     self.optical_det_image = ActiveValue(InstrumentalImage(None, None, None))
     
     self.sem_emt_dwell_time = ActiveValue(0.00001) #s
     self.sem_emt_spot = ActiveValue(4) # no unit (could be m²)
     self.sem_emt_hv = ActiveValue(30000) # V
     self.sem_det_image = ActiveValue(InstrumentalImage(None, None, None))
Esempio n. 2
0
class SECOMModel(object):
    """
    Represent the data of a SECOM microscope
    This is the main Model, from a Model/View/Controller perspective
    """
    
    def __init__(self):
        self.stage_pos = ActiveValue((0,0)) # m,m
        self.stage_pos.bind(self.avOnStagePos)
        
        # FIXME: maybe could go into (sub)classes like OpticalEmitter, SEDetector... 
        self.optical_emt_wavelength = ActiveValue(450) # nm XXX a range?
        self.optical_det_wavelength = ActiveValue(568) # nm
        self.optical_det_exposure_time = ActiveValue(0.5) # s
        self.optical_det_image = ActiveValue(InstrumentalImage(None, None, None))
        
        self.sem_emt_dwell_time = ActiveValue(0.00001) #s
        self.sem_emt_spot = ActiveValue(4) # no unit (could be m²)
        self.sem_emt_hv = ActiveValue(30000) # V
        self.sem_det_image = ActiveValue(InstrumentalImage(None, None, None))
    
    def avOnStagePos(self, val):
        print "requested to move stage to pos:", val 
Esempio n. 3
0
 def _set(self, value):
     # don't raise an error, just clamp the values
     final_val = sorted((0.0, 1.0) + (value,))[1] # clamp
     ActiveValue._set(self, final_val)
Esempio n. 4
0
 def _set(self, value):
     assert(0.0 < value)
     ActiveValue._set(self, value)