Changeset 7d077d1 in sasview for src/sas/qtgui/DataExplorer.py


Ignore:
Timestamp:
Mar 31, 2017 3:29:50 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
0274aea
Parents:
0268aed
Message:

When chart is shown - react and show changes to Qmodel

File:
1 edited

Legend:

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

    r0268aed r7d077d1  
    4949 
    5050        # Active plots 
    51         self.active_plots = [] 
     51        self.active_plots = {} 
    5252 
    5353        # Connect the buttons 
     
    8787        self.communicator.activeGraphsSignal.connect(self.updateGraphCombo) 
    8888        self.communicator.activeGraphName.connect(self.updatePlotName) 
     89        self.communicator.plotUpdateSignal.connect(self.updatePlot) 
    8990        self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 
    9091        self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo) 
     
    473474 
    474475        # Update the active chart list 
    475         self.active_plots.append(title) 
     476        self.active_plots[new_plot.data.id] = new_plot 
     477        print "ADDING ", new_plot.data.id 
    476478 
    477479    def appendPlot(self): 
     
    494496                old_plot.data = plot_set 
    495497                old_plot.plot() 
     498 
     499    def updatePlot(self, new_data): 
     500        """ 
     501        Modify existing plot for immediate response 
     502        """ 
     503        data = new_data[0] 
     504        assert type(data).__name__ in ['Data1D', 'Data2D'] 
     505 
     506        id = data.id 
     507        if data.id in self.active_plots.keys(): 
     508            self.active_plots[id].replacePlot(id, data) 
    496509 
    497510    def chooseFiles(self): 
     
    940953        # Reset the view 
    941954        self.model.reset() 
    942  
    943955        # Pass acting as a debugger anchor 
    944956        pass 
Note: See TracChangeset for help on using the changeset viewer.