From 0967f0e72097b4098b8170ac7de1e0bcfc16b478 Mon Sep 17 00:00:00 2001 From: "Michael D. M. Dryden" Date: Mon, 2 May 2016 18:37:17 -0400 Subject: [PATCH] Added attribute for storing metadata and setting it from the zmq plugin. --- dstat_interface/main.py | 5 ++++- dstat_interface/plugin.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dstat_interface/main.py b/dstat_interface/main.py index 146c83b..49d403d 100755 --- a/dstat_interface/main.py +++ b/dstat_interface/main.py @@ -171,7 +171,9 @@ class Main(object): 'menu_dropbot_disconnect') self.dropbot_enabled = False self.dropbot_triggered = False - + + self.metadata = None + self.plot_notebook.get_nth_page( self.plot_notebook.page_num(self.ft_window)).hide() self.plot_notebook.get_nth_page( @@ -470,6 +472,7 @@ class Main(object): selection = self.expcombobox.get_active() parameters = {} parameters['version'] = self.version + parameters['metadata'] = self.metadata # Make sure these are defined parameters['sync_true'] = False diff --git a/dstat_interface/plugin.py b/dstat_interface/plugin.py index ebe2493..c4ce9c1 100644 --- a/dstat_interface/plugin.py +++ b/dstat_interface/plugin.py @@ -101,6 +101,18 @@ class DstatPlugin(ZmqPlugin): self.parent.statusbar.push(self.parent.message_context_id, "µDrop " "acquisition requested.") return self.parent.run_active_experiment() + + def on_execute__set_metadata(self, request=None): + ''' + Args + ---- + + (dict) : Dictionary of metadata to be used in subsequent + experiments. Should include `device_id`, `patient_id`, and + `experiment_id`. Leave blank to reset all metadata fields or set + individual keys to `None` to reset individual values. + ''' + self.parent.metadata = request def on_execute__save_text(self, request): ''' -- GitLab