Changeset 8696721 in sasview for src/sas/qtgui/DataExplorer.py


Ignore:
Timestamp:
Dec 13, 2016 5:04:25 AM (8 years ago)
Author:
wojciech
Branches:
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
Children:
0532d7c1
Parents:
6b9d41d (diff), c3b2327 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged with ESS_GUI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/DataExplorer.py

    r253e7170 r8696721  
    8080        self.communicator.fileReadSignal.connect(self.loadFromURL) 
    8181        self.communicator.activeGraphsSignal.connect(self.updateGraphCombo) 
     82        self.communicator.activeGraphName.connect(self.updatePlotName) 
    8283        self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 
    8384        self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo) 
     
    368369        return new_item 
    369370 
     371    def updatePlotName(self, name_tuple): 
     372        """ 
     373        Modify the name of the current plot 
     374        """ 
     375        old_name, current_name = name_tuple 
     376        ind = self.cbgraph.findText(old_name) 
     377        self.cbgraph.setCurrentIndex(ind) 
     378        self.cbgraph.setItemText(ind, current_name) 
     379 
    370380    def updateGraphCombo(self, graph_list): 
    371381        """ 
     
    411421                raise AttributeError, msg 
    412422 
     423 
    413424        if plots and \ 
    414            hasattr(new_plot, 'data') and \ 
    415            len(new_plot.data.x) > 0: 
    416             self.plotAdd(new_plot) 
     425            hasattr(new_plot, 'data') and \ 
     426            isinstance(new_plot.data, Data1D): 
     427                self.plotAdd(new_plot) 
    417428 
    418429    def plotAdd(self, new_plot): 
     
    436447        """ 
    437448        Add data set(s) to the existing matplotlib chart 
    438  
    439         TODO: Add 2D-functionality 
    440449        """ 
    441450        # new plot data 
     
    443452 
    444453        # old plot data 
    445         plot_id = self.cbgraph.currentText() 
    446         plot_id = int(plot_id[5:]) 
     454        plot_id = self.cbgraph.currentIndex() + 1 
    447455 
    448456        assert plot_id in PlotHelper.currentPlots(), "No such plot: Graph%s"%str(plot_id) 
Note: See TracChangeset for help on using the changeset viewer.