From 8badd4ba0c2ffce210e0b5dec9bad0d042918f4e Mon Sep 17 00:00:00 2001
From: "Michael D. M. Dryden" <mdryden@chem.utoronto.ca>
Date: Wed, 6 Apr 2016 15:07:17 -0400
Subject: [PATCH] Add save functions to plugin.

---
 dstat_interface/plugin.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/dstat_interface/plugin.py b/dstat_interface/plugin.py
index b1d1f23..e4744ed 100644
--- a/dstat_interface/plugin.py
+++ b/dstat_interface/plugin.py
@@ -2,6 +2,7 @@
 import logging
 
 from params import get_params, set_params, load_params, save_params
+from interface.save import save_text, save_plot
 from zmq_plugin.plugin import Plugin as ZmqPlugin
 from zmq_plugin.schema import decode_content_data
 import gtk
@@ -100,6 +101,26 @@ class DstatPlugin(ZmqPlugin):
         self.parent.statusbar.push(self.parent.message_context_id, "µDrop "
                                    "acquisition requested.")
         return self.parent.run_active_experiment()
+    
+    def on_execute__save_text(self, request):
+        '''
+        Args
+        ----
+
+            save_data_path (str) : Path to file to save text data.
+        '''
+        data = decode_content_data(request)
+        save_text(self.parent.current_exp, data['save_data_path'])
+
+    def on_execute__save_plot(self, request):
+        '''
+        Args
+        ----
+
+            save_plot_path (str) : Path to file to save text data.
+        '''
+        data = decode_content_data(request)
+        save_text(self.parent.current_exp, data['save_plot_path'])
 
     def on_execute__acquisition_complete(self, request):
         '''
-- 
GitLab