Esempio n. 1
0
 def __init__(self):
     super(FSSettingsPreviewProcessor, self).__init__()
     self.hardwareController = HardwareController.instance()
     self.eventManager = FSEventManager.instance()
     self.config = Config.instance()
     self.settings = Settings.instance()
     self._image_processor = ImageProcessor(self.config, self.settings)
    def __init__(self):
        super(FSScanProcessor, self).__init__()
        self._logger =  logging.getLogger(__name__)
        self._logger.setLevel(logging.DEBUG)
        self._prefix = None
        self._resolution = 16
        self._number_of_pictures = 0
        self._total = 0
        self._laser_positions = 1
        self._progress = 0
        self._is_color_scan = True
        self.point_cloud = None
        self.image_task_q = multiprocessing.Queue(5)
        self.current_position = 0
        self._laser_angle = 33.0
        self._stop_scan = False
        self._current_laser_position = 1
        self.eventManager = FSEventManager.instance()
        self.settings = Settings.instance()
        self.config = Config.instance()
        self.semaphore = multiprocessing.BoundedSemaphore()
        self._contrast = 0.5
        self._brightness = 0.5


        self.event_q = self.eventManager.get_event_q()

        self._worker_pool = FSImageWorkerPool(self.image_task_q,self.event_q)
        self.hardwareController = HardwareController.instance()
        self.eventManager.subscribe(FSEvents.ON_IMAGE_PROCESSED, self.image_processed)
        self._scan_brightness = self.settings.camera.brightness
        self._scan_contrast =  self.settings.camera.contrast
 def __init__(self):
     super(FSSettingsPreviewProcessor, self).__init__()
     self.hardwareController = HardwareController.instance()
     self.eventManager = FSEventManager.instance()
     self.config = Config.instance()
     self.settings = Settings.instance()
     self._image_processor = ImageProcessor(self.config, self.settings)
Esempio n. 4
0
    def run(self):
        self._logger.info("FabScanPi-Server "+str(__version__))

        try:

            # create Singleton instances
            _config = Config.instance(self.config_file)
            _settings = Settings.instance(self.settings_file)

            _hardwareController = HardwareController.instance()
            _eventManager = FSEventManager.instance()

            # Websocket Server
            self.fsWebSocketServer = FSWebSocketServer()
            self.fsWebSocketServer.start()

            _scanner = FSScanner()
            _scanner.start()

            # Web Server
            self.fsWebServer = WebServer()
            self.fsWebServer.serve_forever()

        except (KeyboardInterrupt, SystemExit):

            time.sleep(0.5)
            _hardwareController.laser.off()
            _hardwareController.led.off()
            _hardwareController.turntable.stop_turning()

            sys.exit(0)
Esempio n. 5
0
    def __init__(self):
        super(FSScanProcessor, self).__init__()

        self.eventManager = FSEventManager.instance()
        self.settings = Settings.instance()
        self.config = Config.instance()

        self._logger = logging.getLogger(__name__)
        self._logger.setLevel(logging.DEBUG)

        self._prefix = None
        self._resolution = 16
        self._number_of_pictures = 0
        self._total = 0
        self._laser_positions = 1
        self._progress = 0
        self._is_color_scan = True
        self.point_cloud = None
        self.image_task_q = multiprocessing.Queue(self.config.process_numbers +
                                                  1)
        self.current_position = 0
        self._laser_angle = 33.0
        self._stop_scan = False
        self._current_laser_position = 1

        self.semaphore = multiprocessing.BoundedSemaphore()
        self.event_q = self.eventManager.get_event_q()

        self._worker_pool = FSImageWorkerPool(self.image_task_q, self.event_q)
        self.hardwareController = HardwareController.instance()
        self.eventManager.subscribe(FSEvents.ON_IMAGE_PROCESSED,
                                    self.image_processed)
        self._scan_brightness = self.settings.camera.brightness
        self._scan_contrast = self.settings.camera.contrast
        self._scan_saturation = self.settings.camera.saturation
Esempio n. 6
0
    def __init__(self):

        threading.Thread.__init__(self)
        self._state = FSState.IDLE
        self._logger =  logging.getLogger(__name__)
        self._logger.setLevel(logging.DEBUG)
        self.settings = Settings.instance()
        self.daemon = True
        self.hardwareController = HardwareController.instance()
        self._exit_requested = False

        self.eventManager = FSEventManager.instance()
        self.eventManager.subscribe(FSEvents.ON_CLIENT_CONNECTED, self._on_client_connected)
        self.eventManager.subscribe(FSEvents.COMMAND, self._on_command)
Esempio n. 7
0
    def __init__(self):
        threading.Thread.__init__(self)
        self._state = FSState.IDLE
        self._logger = logging.getLogger(__name__)
        self._logger.setLevel(logging.DEBUG)
        self.settings = Settings.instance()
        self.daemon = True
        self.hardwareController = HardwareController.instance()
        self._exit_requested = False
        self.meshingTaskRunning = False

        self._logger.debug("Number of cpu cores: "+str( multiprocessing.cpu_count()))
        self.eventManager = FSEventManager.instance()
        self.eventManager.subscribe(FSEvents.ON_CLIENT_CONNECTED, self._on_client_connected)
        self.eventManager.subscribe(FSEvents.COMMAND, self._on_command)
Esempio n. 8
0
    def __init__(self):
        threading.Thread.__init__(self)
        self._state = FSState.IDLE
        self._logger = logging.getLogger(__name__)
        self._logger.setLevel(logging.DEBUG)
        self.settings = Settings.instance()
        self.daemon = True
        self.hardwareController = HardwareController.instance()
        self._exit_requested = False
        self.meshingTaskRunning = False

        self._logger.debug("Number of cpu cores: "+str( multiprocessing.cpu_count()))
        self.eventManager = FSEventManager.instance()
        self.eventManager.subscribe(FSEvents.ON_CLIENT_CONNECTED, self._on_client_connected)
        self.eventManager.subscribe(FSEvents.COMMAND, self._on_command)