- Timestamp:
- Mar 31, 2017 3:29:50 AM (8 years ago)
- 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
- Location:
- src/sas/qtgui
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/DataExplorer.py
r0268aed r7d077d1 49 49 50 50 # Active plots 51 self.active_plots = []51 self.active_plots = {} 52 52 53 53 # Connect the buttons … … 87 87 self.communicator.activeGraphsSignal.connect(self.updateGraphCombo) 88 88 self.communicator.activeGraphName.connect(self.updatePlotName) 89 self.communicator.plotUpdateSignal.connect(self.updatePlot) 89 90 self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 90 91 self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo) … … 473 474 474 475 # 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 476 478 477 479 def appendPlot(self): … … 494 496 old_plot.data = plot_set 495 497 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) 496 509 497 510 def chooseFiles(self): … … 940 953 # Reset the view 941 954 self.model.reset() 942 943 955 # Pass acting as a debugger anchor 944 956 pass -
src/sas/qtgui/GuiUtils.py
r5236449 r7d077d1 228 228 plotRequestedSignal = QtCore.pyqtSignal(str) 229 229 230 # Plot update requested from a perspective 231 plotUpdateSignal = QtCore.pyqtSignal(list) 232 230 233 # Progress bar update value 231 234 progressBarUpdateSignal = QtCore.pyqtSignal(int) … … 255 258 if plot_item.isCheckable(): 256 259 plot_data = plot_item.child(0).data().toPyObject() 257 if plot_data.id == py_update_data.id: 258 item.removeRow(index) 259 break 260 if plot_data.id is not None and plot_data.id == py_update_data.id: 261 # replace data section in item 262 plot_item.child(0).setData(update_data) 263 plot_item.setText(name) 264 # Force redisplay 265 return 260 266 261 267 # Create the new item -
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
r0268aed r7d077d1 103 103 self._data.ymax = ymax 104 104 105 def new1DPlot(self, return_data ):105 def new1DPlot(self, return_data, tab_id): 106 106 """ 107 107 Create a new 1D data instance based on fitting results … … 121 121 122 122 new_plot.group_id = data.group_id 123 #new_plot.id = str(self.tab_id) + " " + data.name123 new_plot.id = str(tab_id) + " " + data.name 124 124 new_plot.name = model.name + " [" + data.name + "]" 125 125 new_plot.title = new_plot.name … … 135 135 Create a new 2D data instance based on fitting results 136 136 """ 137 138 137 image, data, page_id, model, state, toggle_mode_on,\ 139 138 elapsed, index, fid, qmin, qmax, weight, \ -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r0268aed r7d077d1 224 224 def residualsData1D(reference_data, current_data): 225 225 """ 226 Calculate the residuals for difference of two Data1D sets 226 227 """ 227 228 # temporary default values for index and weight … … 265 266 def residualsData2D(reference_data, current_data): 266 267 """ 268 Calculate the residuals for difference of two Data2D sets 267 269 """ 268 270 # temporary default values for index and weight … … 304 306 data_copy = deepcopy(current_data) 305 307 # Get data: data I, theory I, and data dI in order 306 307 308 method_name = current_data.__class__.__name__ 308 309 residuals_dict = {"Data1D": residualsData1D, -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r0268aed r7d077d1 586 586 # multishell params in self.kernel_module.details[??] = value 587 587 588 # Force the chart update 589 self.onPlot() 590 588 591 def nameForFittedData(self, name): 589 592 """ … … 605 608 fitted_data.name = name 606 609 fitted_data.filename = name 610 fitted_data.symbol = "Line" 607 611 self.updateModelIndex(fitted_data) 608 612 else: … … 625 629 name = fitted_data.name 626 630 # Make this a line if no other defined 627 if fitted_data.symbol is None:631 if hasattr(fitted_data, 'symbol') and fitted_data.symbol is None: 628 632 fitted_data.symbol = 'Line' 629 633 # Notify the GUI manager so it can update the main model in DataExplorer 630 634 GuiUtils.updateModelItemWithPlot(self._index, QtCore.QVariant(fitted_data), name) 635 # Force redisplay 631 636 632 637 def createTheoryIndex(self, fitted_data): … … 680 685 Plot the current 1D data 681 686 """ 682 fitted_plot = self.logic.new1DPlot(return_data )687 fitted_plot = self.logic.new1DPlot(return_data, self.tab_id) 683 688 self.calculateResiduals(fitted_plot) 684 689 … … 695 700 """ 696 701 # Create a new index for holding data 702 fitted_data.symbol = "Line" 697 703 self.createNewIndex(fitted_data) 698 704 # Calculate difference between return_data and logic.data … … 704 710 if self.data_is_loaded: 705 711 residuals_plot = FittingUtilities.plotResiduals(self.data, fitted_data) 712 residuals_plot.id = "Residual " + residuals_plot.id 706 713 self.createNewIndex(residuals_plot) 714 715 self.communicate.plotUpdateSignal.emit([fitted_data]) 707 716 708 717 def calcException(self, etype, value, tb):
Note: See TracChangeset
for help on using the changeset viewer.