More commands moved from hooke_cli to hooke.ui.gui.plotcommands stub
authorW. Trevor King <wking@drexel.edu>
Wed, 12 May 2010 20:03:11 +0000 (16:03 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 12 May 2010 20:03:11 +0000 (16:03 -0400)
hooke/hooke_cli.py
hooke/ui/gui/plotcommands.py

index 95c8ea1eab0cded0ae1a1f965c506e72fa58d66d..be217a8070ba1dfefd981702924c129fc63aa808 100644 (file)
@@ -67,55 +67,3 @@ class HookeCli(cmd.Cmd, object):
 
         #load default list, if possible
         self.do_loadlist(self.config['defaultlist'])
-
-#HELPER FUNCTIONS
-#Everything sending an event should be here
-    def _measure_N_points(self, N, whatset=1):
-        '''
-        general helper function for N-points measures
-        '''
-        wx.PostEvent(self.frame,self.list_of_events['measure_points'](num_of_points=N, set=whatset))
-        while 1:
-            try:
-                points=self.frame.events_from_gui.get()
-                break
-            except Empty:
-                pass
-        return points
-
-    def _get_displayed_plot(self,dest=0):
-        '''
-        returns the currently displayed plot.
-        '''
-        wx.PostEvent(self.frame, self.list_of_events['get_displayed_plot'](dest=dest))
-        while 1:
-            try:
-                displayed_plot=self.events_from_gui.get()
-            except Empty:
-                pass
-            if displayed_plot:
-                break
-        return displayed_plot
-
-    def _send_plot(self,plots):
-        '''
-        sends a plot to the GUI
-        '''
-        wx.PostEvent(self.frame, self.list_of_events['plot_graph'](plots=plots))
-        return
-
-    def _find_plotmanip(self, name):
-        '''
-        returns a plot manipulator function from its name
-        '''
-        return self.plotmanip[self.config['plotmanips'].index(name)]
-
-    def _clickize(self, xvector, yvector, index):
-        '''
-        returns a ClickedPoint() object from an index and vectors of x, y coordinates
-        '''
-        point=ClickedPoint()
-        point.index=index
-        point.absolute_coords=xvector[index],yvector[index]
-        point.find_graph_coords(xvector,yvector)
-        return point
index 4991994e75fd5c58c1b34ca563ec65963d5255dc..7dd67d6b45be8ce82538f8455b8735854f7246f1 100644 (file)
@@ -107,3 +107,55 @@ Syntax: plot
         '''
         show_plots=self.list_of_events['show_plots']
         wx.PostEvent(self.frame, show_plots())
+
+#HELPER FUNCTIONS
+#Everything sending an event should be here
+    def _measure_N_points(self, N, whatset=1):
+        '''
+        general helper function for N-points measures
+        '''
+        wx.PostEvent(self.frame,self.list_of_events['measure_points'](num_of_points=N, set=whatset))
+        while 1:
+            try:
+                points=self.frame.events_from_gui.get()
+                break
+            except Empty:
+                pass
+        return points
+
+    def _get_displayed_plot(self,dest=0):
+        '''
+        returns the currently displayed plot.
+        '''
+        wx.PostEvent(self.frame, self.list_of_events['get_displayed_plot'](dest=dest))
+        while 1:
+            try:
+                displayed_plot=self.events_from_gui.get()
+            except Empty:
+                pass
+            if displayed_plot:
+                break
+        return displayed_plot
+
+    def _send_plot(self,plots):
+        '''
+        sends a plot to the GUI
+        '''
+        wx.PostEvent(self.frame, self.list_of_events['plot_graph'](plots=plots))
+        return
+
+    def _find_plotmanip(self, name):
+        '''
+        returns a plot manipulator function from its name
+        '''
+        return self.plotmanip[self.config['plotmanips'].index(name)]
+
+    def _clickize(self, xvector, yvector, index):
+        '''
+        returns a ClickedPoint() object from an index and vectors of x, y coordinates
+        '''
+        point=ClickedPoint()
+        point.index=index
+        point.absolute_coords=xvector[index],yvector[index]
+        point.find_graph_coords(xvector,yvector)
+        return point