From ab64a95b67b489b18eed4603f9fa483bb5f38bff Mon Sep 17 00:00:00 2001 From: gobbo_a Date: Thu, 25 Aug 2022 10:40:57 +0200 Subject: [PATCH] Script execution --- script/test/test_thread.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/script/test/test_thread.py b/script/test/test_thread.py index 8d27244..6ef38a0 100644 --- a/script/test/test_thread.py +++ b/script/test/test_thread.py @@ -1,8 +1,23 @@ -from bsread import source, Source, PUB, SUB, PUSH, PULL, DEFAULT_DISPATCHER_URL -from threading import Thread import threading +import queue +import traceback +from bsread import source, Source, PUB, SUB, PUSH, PULL, DEFAULT_DISPATCHER_URL +from cam_server.pipeline.configuration import PipelineConfig +#from processing import run as processing_pipeline +from cam_server.pipeline.types.processing import run as processing_pipeline - +class Namespace(object): + def __init__(self, **kwds): + self.__dict__.update(kwds) + def __repr__(self): + items = self.__dict__.items() + temp = [] + for name, value in items: + if not name.startswith('_'): + temp.append('%s=%r' % (name, value)) + temp.sort() + return 'Namespace(%s)' % str.join(', ', temp) + statistics=Namespace() pipeline_config = PipelineConfig("test_pipeline", parameters={"camera_name": "simulation", "function":"transparent"}) @@ -26,7 +41,7 @@ def get_data(port): OUTPUT_PORT = 12005 stop_event = threading.Event() parameter_queue = queue.Queue() -thread = Thread(target=run_pipeline, args=(OUTPUT_PORT,pipeline_config, parameter_queue, stop_event)) +thread = threading.Thread(target=run_pipeline, args=(OUTPUT_PORT,pipeline_config, parameter_queue, stop_event)) thread.start() get_data(OUTPUT_PORT) stop_event.set() @@ -39,7 +54,7 @@ print ("Done") OUTPUT_PORT = 12006 stop_event = threading.Event() parameter_queue = queue.Queue() -thread = Thread(target=run_pipeline, args=(OUTPUT_PORT,pipeline_config, parameter_queue, stop_event)) +thread = threading.Thread(target=run_pipeline, args=(OUTPUT_PORT,pipeline_config, parameter_queue, stop_event)) thread.start() get_data(OUTPUT_PORT) stop_event.set()