Ejemplo n.º 1
0
              ),
              layout='tabbed'),
        VSplit(
            Item('figure_image', show_label=False, resizable=True),
            Item('figure_line', show_label=False, resizable=True),
            Item('figure_drift', show_label=False, resizable=True),
        ),
    ),
                       title='Auto Focus',
                       buttons=[],
                       resizable=True)


if __name__ == '__main__':
    logging.getLogger().addHandler(logging.StreamHandler())
    logging.getLogger().setLevel(logging.DEBUG)
    logging.getLogger().info('Starting logger.')

    from tools.emod import JobManager
    JobManager().start()

    from hardware.mocking import Imager
    imager = Imager()

    from measurements.confocal import Confocal
    confocal = Confocal(imager)
    confocal.edit_traits()

    auto_focus = AutoFocus(imager, confocal)
    auto_focus.edit_traits()
Ejemplo n.º 2
0
            filename = self.filename
        if self.timestamp:
            filename = '<timestamp>_' + filename
        return 'Save ' + str(self.job) + ' to ' + filename


class SetJob(ManagedJob):
    def __init__(self, job, d):
        super(SetJob, self).__init__()
        self.job = job
        self.d = d

    def _run(self):

        try:
            self.state = 'run'
            self.job.set_items(self.d)
        finally:
            self.state = 'idle'

    def __repr__(self):
        return 'Set items ' + str(self.d) + ' of job ' + str(self.job)


for target in auto_focus.targets.keys():
    JobManager().submit(SwitchTarget(target))
    odmr = me.odmr.ODMR()
    odmr.stop_time = 360
    JobManager().submit(odmr)
    JobManager().submit(SaveJob(odmr, target + '_odmr.pys', timestamp=True))