Пример #1
0
    def start(self):
        # if self.managers:
        from pychron.initializer import Initializer

        dp = DevicePreferences()
        afh = self.application.preferences.get('pychron.hardware.auto_find_handle')
        awh = self.application.preferences.get('pychron.hardware.auto_write_handle')
        if afh is not None:
            toBool = lambda x: True if x == 'True' else False
            dp.serial_preference.auto_find_handle = toBool(afh)
            dp.serial_preference.auto_write_handle = toBool(awh)

        ini = Initializer(device_prefs=dp)
        for m in self.managers:
            ini.add_initialization(m)

        # any loaded managers will be registered as services
        if not ini.run(application=self.application):
            self.application.exit()
            return

        # create the hardware server
        rhm = self.application.get_service(RemoteHardwareManager)
        bind_preference(rhm, 'enable_hardware_server', 'pychron.hardware.enable_hardware_server')
        bind_preference(rhm, 'enable_directory_server', 'pychron.hardware.enable_directory_server')

        rhm.bootstrap()
Пример #2
0
    def start(self):
        # if self.managers:
        from pychron.initializer import Initializer

        dp = DevicePreferences()
        afh = self.application.preferences.get(
            'pychron.hardware.auto_find_handle')
        awh = self.application.preferences.get(
            'pychron.hardware.auto_write_handle')
        if afh is not None:
            toBool = lambda x: True if x == 'True' else False
            dp.serial_preference.auto_find_handle = toBool(afh)
            dp.serial_preference.auto_write_handle = toBool(awh)

        ini = Initializer(device_prefs=dp)
        for m in self.managers:
            ini.add_initialization(m)

        # any loaded managers will be registered as services
        if not ini.run(application=self.application):
            self.application.exit()
            return

        # create the hardware server
        rhm = self.application.get_service(RemoteHardwareManager)
        bind_preference(rhm, 'enable_hardware_server',
                        'pychron.hardware.enable_hardware_server')
        bind_preference(rhm, 'enable_directory_server',
                        'pychron.hardware.enable_directory_server')

        rhm.bootstrap()
Пример #3
0
        return v


if __name__ == '__main__':
    from pychron.core.helpers.logger_setup import logging_setup
    from pychron.initializer import Initializer

    logging_setup('fusions diode')
    f = FusionsDiodeManager()
    f.use_video = True
    f.record_brightness = True
    ini = Initializer()

    a = dict(manager=f, name='FusionsDiode')
    ini.add_initialization(a)
    ini.run()
    #    f.bootstrap()
    f.configure_traits()

#======================= EOF ============================
#    def get_laser_amps(self):
#        '''
#        '''
#        return self.control_module.read_laser_amps()
#
#    def get_laser_current(self):
#        '''
#        '''
#        return self.control_module.read_laser_current_adc()

#    def get_laser_power(self):
Пример #4
0

if __name__ == '__main__':
    from pychron.core.helpers.logger_setup import logging_setup
    from pychron.initializer import Initializer


    logging_setup('fusions diode')
    f = FusionsDiodeManager()
    f.use_video = True
    f.record_brightness = True
    ini = Initializer()

    a = dict(manager=f, name='FusionsDiode')
    ini.add_initialization(a)
    ini.run()
    #    f.bootstrap()
    f.configure_traits()

#======================= EOF ============================
#    def get_laser_amps(self):
#        '''
#        '''
#        return self.control_module.read_laser_amps()
#
#    def get_laser_current(self):
#        '''
#        '''
#        return self.control_module.read_laser_current_adc()

#    def get_laser_power(self):