Changeset 9463ca2 in sasview
- Timestamp:
- Aug 30, 2018 10:47:39 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- eef298d4
- Parents:
- b8080e1
- Location:
- src/sas/qtgui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
rf7d39c9 r9463ca2 526 526 # Now query the model item for available plots 527 527 plots = GuiUtils.plotsFromFilename(filename, model) 528 ids = [list(self.active_plots.values())[id].data.id for id in range(len(self.active_plots))]529 ids 2 = [list(self.active_plots.keys())[id] for id in range(len(self.active_plots))]528 ids_keys = list(self.active_plots.keys()) 529 ids_vals = [val.data.id for val in self.active_plots.values()] 530 530 531 531 new_plots = [] 532 532 for item, plot in plots.items(): 533 533 plot_id = plot.id 534 if plot_id in ids or plot_id in ids2:534 if plot_id in ids_keys: 535 535 self.active_plots[plot_id].replacePlot(plot_id, plot) 536 elif plot_id in ids_vals: 537 list(self.active_plots.values())[ids_vals.index(plot_id)].replacePlot(plot_id, plot) 536 538 else: 537 539 # Don't plot intermediate results, e.g. P(Q), S(Q) … … 666 668 old_plot.data = plot_set 667 669 old_plot.plot() 670 # need this for lookup - otherwise this plot will never update 671 self.active_plots[plot_set.id] = old_plot 668 672 669 673 def updatePlot(self, new_data): … … 674 678 assert type(data).__name__ in ['Data1D', 'Data2D'] 675 679 676 id = data.id 677 if data.id in list(self.active_plots.keys()): 678 self.active_plots[id].replacePlot(id, data) 680 ids_keys = list(self.active_plots.keys()) 681 ids_vals = [val.data.id for val in self.active_plots.values()] 682 683 data_id = data.id 684 if data_id in ids_keys: 685 self.active_plots[data_id].replacePlot(data_id, data) 686 elif data_id in ids_vals: 687 list(self.active_plots.values())[ids_vals.index(data_id)].replacePlot(data_id, data) 679 688 680 689 def chooseFiles(self): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r906e0c7 r9463ca2 2275 2275 pq_data.symbol = "Line" 2276 2276 self.createNewIndex(pq_data) 2277 # self.communicate.plotUpdateSignal.emit([pq_data]) 2277 2278 new_plots.append(pq_data) 2278 2279 if sq_data is not None: 2279 2280 sq_data.symbol = "Line" 2280 2281 self.createNewIndex(sq_data) 2282 # self.communicate.plotUpdateSignal.emit([sq_data]) 2281 2283 new_plots.append(sq_data) 2282 2284 2283 2285 if self.data_is_loaded: 2284 2286 GuiUtils.deleteRedundantPlots(self.all_data[self.data_index], new_plots) 2287 2288 for plot in new_plots: 2289 if hasattr(plot, "id") and "esidual" in plot.id: 2290 # TODO: fix updates to residuals plot 2291 pass 2292 else: 2293 self.communicate.plotUpdateSignal.emit([plot]) 2285 2294 2286 2295 def complete2D(self, return_data): … … 2294 2303 def calculateResiduals(self, fitted_data): 2295 2304 """ 2296 Calculate and print Chi2 and display chart of residuals 2305 Calculate and print Chi2 and display chart of residuals. Returns residuals plot object. 2297 2306 """ 2298 2307 # Create a new index for holding data … … 2309 2318 self.lblChi2Value.setText(chi2_repr) 2310 2319 2311 self.communicate.plotUpdateSignal.emit([fitted_data])2320 # self.communicate.plotUpdateSignal.emit([fitted_data]) 2312 2321 2313 2322 # Plot residuals if actual data -
src/sas/qtgui/Utilities/GuiUtils.py
r0fe7e5b r9463ca2 335 335 clone.__hash__ = self.__hash__ 336 336 return clone 337 338 337 339 338 def getMonospaceFont():
Note: See TracChangeset
for help on using the changeset viewer.