def __init__(self, directory, file_name, file_manager=FileManager()): self._log = logging.getLogger(".".join([__name__])) self._directory = directory self._file_name = file_name self._file_manager = file_manager self._path = None self._records = []
def main(config_file, version): app = QtWidgets.QApplication(sys.argv) config = BarcodeConfig(config_file, FileManager()) ui = DiamondBarcodeMainWindow(config, version, None) manager = MainManager(ui, config) manager.initialise_timers() log = logging.getLogger(".".join([__name__])) log.debug('2) timers initialised') manager.initialise_scanner() sys.exit(app.exec_())
def main(config_file, version): # Start process logger logconfig.setup_logging() log = logging.getLogger(".".join([__name__])) log.info("CONFIG: " + config_file) log.debug(version) app = QtWidgets.QApplication(sys.argv) config = BarcodeConfig(config_file, FileManager()) ui = DiamondBarcodeMainWindow(config, 'version', None) ui.set_actions_triger() sys.exit(app.exec_())
def __init__(self, barcode_table, image_frame, options, to_run_on_table_clicked): super(ScanRecordTable, self).__init__() # Read the store from file self._store = Store(options.store_directory.value(), options.store_capacity, FileManager()) self._options = options self._barcodeTable = barcode_table self._imageFrame = image_frame self.setTitle("Scan Records") self._init_ui(to_run_on_table_clicked) self._load_store_records()
def __init__(self, config_file, version): super(DiamondBarcodeMainWindow, self).__init__() self._config = BarcodeConfig(config_file, FileManager()) self._version = version # UI elements self._record_table = None self._barcode_table = None self._image_frame = None self._scan_button = None # Scan elements self._camera_scanner = None self._camera_switch = None self._init_ui() # Queue that holds new results generated in continuous scanning mode self._result_queue = multiprocessing.Queue() self._view_queue = multiprocessing.Queue() self._message_queue = multiprocessing.Queue() self._initialise_scanner() self._reset_msg_timer() # Timer that controls how often new scan results are looked for self._result_timer = QtCore.QTimer() self._result_timer.timeout.connect(self._read_result_queue) self._result_timer.start(RESULT_TIMER_PERIOD) self._view_timer = QtCore.QTimer() self._view_timer.timeout.connect(self._read_view_queue) self._view_timer.start(VIEW_TIMER_PERIOD) self._message_timer = QtCore.QTimer() self._message_timer.timeout.connect(self._read_message_queue) self._message_timer.start(MESSAGE_TIMER_PERIOD) self._restart_live_capture_from_side()
from dls_barcode.config.barcode_config import BarcodeConfig from dls_barcode.data_store import Store from dls_barcode.geometry.unipuck import Unipuck from dls_barcode.scan import GeometryScanner from dls_util import Color from dls_util.image import Image from dls_util.file import FileManager # SHOULD BE OPEN CV 2.4.10 # Directory storing all of the test images from dls_util.shape import Point TEST_IMG_DIR = 'tests/test-resources/blue_stand/' CONFIG_FILE = os.path.join(TEST_IMG_DIR, "system_test_config.ini") FILE_MANAGER = FileManager() OPTIONS = BarcodeConfig(CONFIG_FILE, FILE_MANAGER) # Clear store before creating a new one store_dir = OPTIONS.store_directory.value() if os.path.isdir(store_dir): shutil.rmtree(store_dir) STORE = Store(store_dir, OPTIONS.store_capacity, FILE_MANAGER) def test_generator(): TEST_CASES = generate_test_cases() for params in TEST_CASES: yield run_scans, params[0], params[1] def run_scans(img_file, expected_codes):
def __init__(self, directory, file_name, file_manager=FileManager()): self._directory = directory self._file_name = file_name self._file_manager = file_manager self._path = None self._records = []
def __init__(self, directory, file_name, file_manager=FileManager()): self._file_manager = file_manager self._directory = directory self._file_name = file_name self._image_path = None self._holder_image_path = None