Ignore:
Timestamp:
Jan 17, 2012 3:07:33 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
4e65505
Parents:
f706e09c
Message:

Added quickplot on data in datapanel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/data_panel.py

    r98fdccd r7434020  
    387387            import MaskPanel as MaskDialog 
    388388         
    389         panel = MaskDialog(base=self, data=data, id=wx.NewId()) 
     389        panel = MaskDialog(parent=self.parent, base=self,  
     390                           data=data, id=wx.NewId()) 
    390391        #self.panel.Bind(wx.EVT_CLOSE, self._draw_masked_model) 
    391392        panel.ShowModal() 
     393     
     394    def on_plot_3d(self, event): 
     395        """ 
     396        Frozen image of 3D 
     397        """ 
     398        data = self._get_data_selection(event) 
     399        from sans.guiframe.local_perspectives.plotting.masking \ 
     400        import FloatPanel as Float3dDialog 
     401         
     402        panel = Float3dDialog(base=self, data=data,  
     403                              dimension=3, id=wx.NewId()) 
     404        panel.ShowModal()    
     405     
     406    def on_quick_plot(self, event): 
     407        """ 
     408        Frozen plot 
     409        """ 
     410        data = self._get_data_selection(event) 
     411        from sans.guiframe.local_perspectives.plotting.masking \ 
     412        import FloatPanel as QucikPlotDialog 
     413        if data.__class__.__name__ == "Data2D": 
     414            dimension = 2 
     415        else: 
     416            dimension = 1 
     417        panel = QucikPlotDialog(base=self, data=data,  
     418                                dimension=dimension, id=wx.NewId()) 
     419        panel.ShowModal()     
    392420         
    393421    def on_save_as(self, event): 
     
    426454        wx.EVT_MENU(self, id, self.on_save_as) 
    427455     
     456        self.quickplot_id = wx.NewId() 
     457        name = "Quick Plot" 
     458        msg = "Plot the current Data" 
     459        self.data_menu.Append(self.quickplot_id, name, msg) 
     460        wx.EVT_MENU(self, self.quickplot_id, self.on_quick_plot) 
     461     
     462        self.plot3d_id = wx.NewId() 
     463        name = "Quick 3DPlot (Slow)" 
     464        msg = "Plot3D the current 2D Data" 
     465        self.data_menu.Append(self.plot3d_id, name, msg) 
     466        wx.EVT_MENU(self, self.plot3d_id, self.on_plot_3d) 
     467             
    428468        self.editmask_id = wx.NewId() 
    429469        name = "Edit Mask" 
     
    431471        self.data_menu.Append(self.editmask_id, name, msg) 
    432472        wx.EVT_MENU(self, self.editmask_id, self.on_edit_data) 
    433  
     473         
    434474        tree_ctrl_theory_label = wx.StaticText(self, -1, "Theory") 
    435475        tree_ctrl_theory_label.SetForegroundColour('blue') 
     
    474514            return 
    475515        if self.data_menu is not None: 
    476             menu_enable = (data_class_name == "Data2D" and is_data) 
    477             self.data_menu.Enable(self.editmask_id, menu_enable) 
     516            menu_enable = (data_class_name == "Data2D") 
     517            maskmenu_enable = (menu_enable and is_data) 
     518            self.data_menu.Enable(self.editmask_id, maskmenu_enable) 
     519            self.data_menu.Enable(self.plot3d_id, menu_enable) 
    478520            self.PopupMenu(self.data_menu)  
    479521         
Note: See TracChangeset for help on using the changeset viewer.