Changeset 2aa960a in sasview for src/sas/qtgui/MainWindow
- Timestamp:
- Oct 25, 2017 7:01:37 AM (7 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:
- aae5f4c
- Parents:
- e7a0b2f (diff), f7d14a1 (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. - Location:
- src/sas/qtgui/MainWindow
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/MainWindow/DataExplorer.py
r1420066 r88e1f57 463 463 Forces display of charts for the given filename 464 464 """ 465 # Assure no multiple plots for the same ID466 465 plot_to_show = data_list[0] 467 if plot_to_show.id in PlotHelper.currentPlots(): 468 return469 470 # Now query the model item for available plots466 467 # passed plot is used ONLY to figure out its title, 468 # so all the charts related by it can be pulled from 469 # the data explorer indices. 471 470 filename = plot_to_show.filename 472 471 model = self.model if plot_to_show.is_data else self.theory_model 472 473 # Now query the model item for available plots 473 474 plots = GuiUtils.plotsFromFilename(filename, model) 475 item = GuiUtils.itemFromFilename(filename, model) 476 477 new_plots = [] 474 478 for plot in plots: 475 479 plot_id = plot.id … … 477 481 self.active_plots[plot_id].replacePlot(plot_id, plot) 478 482 else: 479 self.plotData([(None, plot)]) 483 # 'sophisticated' test to generate standalone plot for residuals 484 if 'esiduals' in plot.title: 485 self.plotData([(item, plot)]) 486 else: 487 new_plots.append((item, plot)) 488 489 if new_plots: 490 self.plotData(new_plots) 480 491 481 492 def addDataPlot2D(self, plot_set, item): … … 487 498 plot2D.plot(plot_set) 488 499 self.addPlot(plot2D) 500 self.active_plots[plot2D.data.id] = plot2D 489 501 #============================================ 490 502 # Experimental hook for silx charts … … 507 519 # Call show on requested plots 508 520 # All same-type charts in one plot 509 #if isinstance(plot_set, Data1D):510 # new_plot = Plotter(self)511 512 521 for item, plot_set in plots: 513 522 if isinstance(plot_set, Data1D): … … 515 524 new_plot = Plotter(self) 516 525 new_plot.plot(plot_set) 526 # active_plots may contain multiple charts 527 self.active_plots[plot_set.id] = new_plot 517 528 elif isinstance(plot_set, Data2D): 518 529 self.addDataPlot2D(plot_set, item) … … 556 567 557 568 # Update the active chart list 558 self.active_plots[new_plot.data.id] = new_plot569 #self.active_plots[new_plot.data.id] = new_plot 559 570 560 571 def appendPlot(self): -
src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
rf4a1433 rf7d14a1 25 25 import sas.qtgui.Plotting.PlotHelper as PlotHelper 26 26 27 #if not QApplication.instance():28 app = QApplication(sys.argv)27 if not QApplication.instance(): 28 app = QApplication(sys.argv) 29 29 30 30 class DataExplorerTest(unittest.TestCase): … … 37 37 def allowBatch(self): 38 38 return False 39 def setData(self, data_item=None ):39 def setData(self, data_item=None, is_batch=False): 40 40 return None 41 41 def title(self): … … 170 170 171 171 # Populate the model 172 #filename = ["cyl_400_20.txt", "P123_D2O_10_percent.dat", "cyl_400_20.txt"] 173 filename = ["cyl_400_20.txt", "cyl_400_20.txt", "P123_D2O_10_percent.dat"] 172 filename = ["cyl_400_20.txt", "cyl_400_20.txt", "cyl_400_20.txt"] 174 173 self.form.readData(filename) 175 176 self.form.show()177 app.exec_()178 174 179 175 # Assure the model contains three items
Note: See TracChangeset
for help on using the changeset viewer.