Changeset 1042dba in sasview for src/sas/qtgui/DataExplorer.py
- Timestamp:
- Jun 17, 2016 9:56:01 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:
- 9e426c1
- Parents:
- a281ab8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/DataExplorer.py
ra281ab8 r1042dba 11 11 # SAS 12 12 from GuiUtils import * 13 from Plotter import Plotter 13 14 from sas.sascalc.dataloader.loader import Loader 14 15 from sas.sasgui.guiframe.data_manager import DataManager … … 41 42 self.cmdDelete.clicked.connect(self.deleteFile) 42 43 self.cmdSendTo.clicked.connect(self.sendData) 44 self.cmdNew.clicked.connect(self.newPlot) 43 45 44 46 # Connect the comboboxes … … 54 56 # The Data viewer is QTreeView showing the proxy model 55 57 self.treeView.setModel(self.proxy) 58 59 # Debug view on the model 60 self.listView.setModel(self.model) 56 61 57 62 … … 163 168 self._perspective.setData(data_item=data) 164 169 170 def newPlot(self): 171 """ 172 Create a new matplotlib chart from selected data 173 """ 174 175 plots = plotsFromCheckedItems(self.model) 176 177 # Call show on requested plots 178 new_plot = Plotter() 179 for plot_set in plots: 180 new_plot.data(plot_set) 181 new_plot.plot() 182 183 new_plot.show() 165 184 166 185 def chooseFiles(self): … … 415 434 416 435 # Add "Info" item 417 info_item = QtGui.QStandardItem("Info")436 # info_item = QtGui.QStandardItem("Info") 418 437 419 438 # Add the actual Data1D/Data2D object … … 424 443 425 444 # Add rows for display in the view 426 self.addExtraRows(info_item, data) 445 # self.addExtraRows(info_item, data) 446 info_item = infoFromData(data) 427 447 428 448 # Set info_item as the only child … … 444 464 msg = "Wrong data type returned from calculations." 445 465 raise AttributeError, msg 446 # Assert other properties 447 448 # Remove the original item 449 450 # Add the current item 451 # self.model.insertRow(model_item) 466 467 # TODO: Assert other properties 452 468 453 469 # Reset the view 454 470 self.model.reset() 471 455 472 # Pass acting as a debugger anchor 456 473 pass 457 458 def addExtraRows(self, info_item, data):459 """460 Extract relevant data to include in the Info ModelItem461 """462 title_item = QtGui.QStandardItem("Title: " + data.title)463 run_item = QtGui.QStandardItem("Run: " + str(data.run))464 type_item = QtGui.QStandardItem("Type: " + str(data.__class__.__name__))465 path_item = QtGui.QStandardItem("Path: " + data.path)466 instr_item = QtGui.QStandardItem("Instrument: " + data.instrument)467 process_item = QtGui.QStandardItem("Process")468 if isinstance(data.process, list) and data.process:469 for process in data.process:470 process_date = process.date471 process_date_item = QtGui.QStandardItem("Date: " + process_date)472 process_item.appendRow(process_date_item)473 474 process_descr = process.description475 process_descr_item = QtGui.QStandardItem("Description: " + process_descr)476 process_item.appendRow(process_descr_item)477 478 process_name = process.name479 process_name_item = QtGui.QStandardItem("Name: " + process_name)480 process_item.appendRow(process_name_item)481 482 info_item.appendRow(title_item)483 info_item.appendRow(run_item)484 info_item.appendRow(type_item)485 info_item.appendRow(path_item)486 info_item.appendRow(instr_item)487 info_item.appendRow(process_item)488 474 489 475
Note: See TracChangeset
for help on using the changeset viewer.