From 8920a783699d007aa82c406f0e587ef1a17b631d Mon Sep 17 00:00:00 2001 From: Mads Jakobsen <mads.jakobsen@xfel.eu> Date: Thu, 13 Mar 2025 12:59:04 +0100 Subject: [PATCH] moved schema injecion --- .../src/onlinemid_karabo/processor.py | 73 ++++++++++--------- 1 file changed, 39 insertions(+), 34 deletions(-) diff --git a/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py b/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py index 8373c2a..89d5ff5 100644 --- a/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py +++ b/karabo_devices/shared_mem_processor/src/onlinemid_karabo/processor.py @@ -184,40 +184,7 @@ class OnlineMIDProcessor(TrainMatcher.TrainMatcher): # self.onlineImagePlotter.hash_to_output_channel() #'data.current_det_image', AgipdModulePlotter - if self.schemupdate_test is False and True: - print("updating schema") - res = Schema() - ( - NODE_ELEMENT(res) - .key("data") - .displayedName('Data') - .commit(), - - IMAGEDATA_ELEMENT(res) - .key("data.test_hash") - .displayedName('test') - .description('test') - .commit(), - - # NODE_ELEMENT(res) - # .key("image") - # .commit(), - ) - - schema_update = Schema() - ( - OUTPUT_CHANNEL(schema_update) - .key("plots") - .dataSchema(res) - .commit(), - ) - - self.updateSchema(schema_update) - #self.assembled_output = self._ss.getOutputChannel("plots") - self.schemupdate_test = True - print("updating schema done") - - + @@ -414,8 +381,46 @@ class OnlineMIDProcessor(TrainMatcher.TrainMatcher): plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'data.current_det_image', AgipdModulePlotter, train_id, detector_data_list[0][1][0]) + + if self.schemupdate_test is False and True: + print("updating schema") + res = Schema() + ( + NODE_ELEMENT(res) + .key("data") + .displayedName('Data') + .commit(), + + IMAGEDATA_ELEMENT(res) + .key("data.test_hash") + .displayedName('test') + .description('test') + .commit(), + + # NODE_ELEMENT(res) + # .key("image") + # .commit(), + ) + + schema_update = Schema() + ( + OUTPUT_CHANNEL(schema_update) + .key("plots") + .dataSchema(res) + .commit(), + ) + + self.updateSchema(schema_update) + #self.assembled_output = self._ss.getOutputChannel("plots") + self.schemupdate_test = True + print("updating schema done") + self.assembled_output = self.signalSlotable.getOutputChannel("plots") + + if numPixelPerGainStage is not None: plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'data.accumulating_lit_bunch', GainStagePlotter, train_id, numPixelPerGainStage) + + plot_hash = self.onlineImagePlotter.add_to_hash(plot_hash, 'data.test_hash', GainStagePlotter, train_id, numPixelPerGainStage) -- GitLab