Changes in / [f331852:44880ac] in sasview
- Location:
- src/sas/qtgui
- Files:
-
- 3 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GUITests.py
rd5c5d3d r01cda57 38 38 from Calculators.UnitTesting import SlitSizeCalculatorTest 39 39 from Calculators.UnitTesting import ResolutionCalculatorPanelTest 40 from Calculators.UnitTesting import DataOperationUtilityTest41 40 42 41 # Utilities … … 95 94 unittest.makeSuite(SlitSizeCalculatorTest.SlitSizeCalculatorTest, 'test'), 96 95 unittest.makeSuite(ResolutionCalculatorPanelTest.ResolutionCalculatorPanelTest, 'test'), 97 unittest.makeSuite(DataOperationUtilityTest.DataOperationUtilityTest, 'test'),98 96 99 97 # Perspectives -
src/sas/qtgui/MainWindow/DataExplorer.py
r1420066 r7d8bebf 93 93 self.communicator.activeGraphName.connect(self.updatePlotName) 94 94 self.communicator.plotUpdateSignal.connect(self.updatePlot) 95 96 95 self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 97 96 self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo) … … 281 280 # Use 'while' so the row count is forced at every iteration 282 281 deleted_indices = [] 283 deleted_names = []284 282 while ind < self.model.rowCount(): 285 283 ind += 1 286 284 item = self.model.item(ind) 287 288 285 if item and item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 289 286 # Delete these rows from the model 290 deleted_names.append(str(self.model.item(ind).text()))291 287 deleted_indices.append(item) 292 293 288 self.model.removeRow(ind) 294 289 # Decrement index since we just deleted it … … 297 292 # Let others know we deleted data 298 293 self.communicator.dataDeletedSignal.emit(deleted_indices) 299 300 # update stored_data301 self.manager.update_stored_data(deleted_names)302 294 303 295 def deleteTheory(self, event): … … 877 869 self.txt_widget.setWindowIcon(QtGui.QIcon(":/res/ball.ico")) 878 870 self.txt_widget.setWindowTitle("Data Info: %s" % data.filename) 879 self.txt_widget.clear()880 871 self.txt_widget.insertPlainText(text_to_show) 881 872 … … 1021 1012 self.model.appendRow(checkbox_item) 1022 1013 1014 1023 1015 def updateModelFromPerspective(self, model_item): 1024 1016 """ -
src/sas/qtgui/MainWindow/DataManager.py
r1420066 rdc5ef15 275 275 del self.stored_data[id] 276 276 277 277 278 def get_by_name(self, name_list=None): 278 279 """ … … 294 295 if data_state.data.name == selected_name: 295 296 del self.stored_data[id] 296 297 def update_stored_data(self, name_list=None):298 """ update stored data after deleting files in Data Explorer """299 for selected_name in name_list:300 for idx in self.stored_data.keys():301 if str(selected_name) in str(idx):302 print selected_name, idx303 del self.stored_data[idx]304 297 305 298 def get_data_state(self, data_id): -
src/sas/qtgui/MainWindow/GuiManager.py
rf0bb711 r01cda57 31 31 from sas.qtgui.Calculators.GenericScatteringCalculator import GenericScatteringCalculator 32 32 from sas.qtgui.Calculators.ResolutionCalculatorPanel import ResolutionCalculatorPanel 33 from sas.qtgui.Calculators.DataOperationUtilityPanel import DataOperationUtilityPanel 33 34 34 35 35 # Perspectives … … 47 47 Main SasView window functionality 48 48 """ 49 50 49 def __init__(self, parent=None): 51 50 """ … … 143 142 self.GENSASCalculator = GenericScatteringCalculator(self) 144 143 self.ResolutionCalculator = ResolutionCalculatorPanel(self) 145 self.DataOperation = DataOperationUtilityPanel(self)146 144 147 145 def statusBarSetup(self): … … 339 337 self.communicate.updateTheoryFromPerspectiveSignal.connect(self.updateTheoryFromPerspective) 340 338 self.communicate.plotRequestedSignal.connect(self.showPlot) 341 self.communicate.updateModelFromDataOperationPanelSignal.connect(self.updateModelFromDataOperationPanel)342 339 343 340 def addTriggers(self): … … 534 531 """ 535 532 """ 536 self.communicate.sendDataToPanelSignal.emit(self._data_manager.get_all_data()) 537 538 self.DataOperation.show() 533 print("actionData_Operation TRIGGERED") 534 pass 539 535 540 536 def actionSLD_Calculator(self): … … 735 731 self.filesWidget.updateTheoryFromPerspective(index) 736 732 737 def updateModelFromDataOperationPanel(self, new_item, new_datalist_item):738 """739 :param new_item: item to be added to list of loaded files740 :param new_datalist_item:741 """742 if not isinstance(new_item, QtGui.QStandardItem) or \743 not isinstance(new_datalist_item, dict):744 msg = "Wrong data type returned from calculations."745 raise AttributeError, msg746 747 self.filesWidget.model.appendRow(new_item)748 self._data_manager.add_data(new_datalist_item)749 750 733 def showPlot(self, plot): 751 734 """ … … 754 737 if hasattr(self, "filesWidget"): 755 738 self.filesWidget.displayData(plot) 739 -
src/sas/qtgui/Plotting/Plotter.py
rf0bb711 rfef38e8 145 145 146 146 # Now add the legend with some customizations. 147 148 147 self.legend = ax.legend(loc='upper right', shadow=True) 149 148 if self.legend: -
src/sas/qtgui/Plotting/Plotter2D.py
rd5c5d3d r01cda57 87 87 self._item = item 88 88 89 def plot(self, data=None, marker=None , show_colorbar=True):89 def plot(self, data=None, marker=None): 90 90 """ 91 91 Plot 2D self._data … … 109 109 ymin=self.ymin, ymax=self.ymax, 110 110 cmap=self.cmap, zmin=zmin_2D_temp, 111 zmax=zmax_2D_temp , show_colorbar=show_colorbar)111 zmax=zmax_2D_temp) 112 112 113 113 def calculateDepth(self): … … 379 379 380 380 def showPlot(self, data, qx_data, qy_data, xmin, xmax, ymin, ymax, 381 zmin, zmax, label='data2D', cmap=DEFAULT_CMAP , show_colorbar=True):381 zmin, zmax, label='data2D', cmap=DEFAULT_CMAP): 382 382 """ 383 383 Render and show the current data … … 457 457 self.vmax = cb.vmax 458 458 459 if show_colorbar is False:460 cb.remove()461 462 459 else: 463 460 # clear the previous 2D from memory -
src/sas/qtgui/Utilities/GuiUtils.py
rf0bb711 re694f0f 144 144 # custom open_path 145 145 open_folder = custom_config.DEFAULT_OPEN_FOLDER 146 if open_folder is notNone and os.path.isdir(open_folder):146 if open_folder != None and os.path.isdir(open_folder): 147 147 DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder) 148 148 else: … … 230 230 dataDeletedSignal = QtCore.pyqtSignal(list) 231 231 232 # Send data to Data Operation Utility panel233 sendDataToPanelSignal = QtCore.pyqtSignal(dict)234 235 # Send result of Data Operation Utility panel to Data Explorer236 updateModelFromDataOperationPanelSignal = QtCore.pyqtSignal(QtGui.QStandardItem, dict)237 232 238 233 def updateModelItemWithPlot(item, update_data, name=""): … … 435 430 text += 'X_min = %s: X_max = %s\n' % (xmin, max(data.x)) 436 431 text += 'Y_min = %s: Y_max = %s\n' % (ymin, max(data.y)) 437 if data.dy is notNone:432 if data.dy != None: 438 433 text += 'dY_min = %s: dY_max = %s\n' % (min(data.dy), max(data.dy)) 439 434 text += '\nData Points:\n' 440 435 x_st = "X" 441 436 for index in range(len(data.x)): 442 if data.dy is notNone and len(data.dy) > index:437 if data.dy != None and len(data.dy) > index: 443 438 dy_val = data.dy[index] 444 439 else: 445 440 dy_val = 0.0 446 if data.dx is notNone and len(data.dx) > index:441 if data.dx != None and len(data.dx) > index: 447 442 dx_val = data.dx[index] 448 443 else: 449 444 dx_val = 0.0 450 if data.dxl is notNone and len(data.dxl) > index:445 if data.dxl != None and len(data.dxl) > index: 451 446 if index == 0: 452 447 x_st = "Xl" 453 448 dx_val = data.dxl[index] 454 elif data.dxw is notNone and len(data.dxw) > index:449 elif data.dxw != None and len(data.dxw) > index: 455 450 if index == 0: 456 451 x_st = "Xw" … … 491 486 y_val = data.qy_data[index] 492 487 i_val = data.data[index] 493 if data.err_data is notNone:488 if data.err_data != None: 494 489 di_val = data.err_data[index] 495 if data.dqx_data is notNone:490 if data.dqx_data != None: 496 491 dx_val = data.dqx_data[index] 497 if data.dqy_data is notNone:492 if data.dqy_data != None: 498 493 dy_val = data.dqy_data[index] 499 494 … … 528 523 has_errors = False 529 524 if has_errors: 530 if data.dx is notNone and data.dx != []:525 if data.dx != None and data.dx != []: 531 526 out.write("<X> <Y> <dY> <dX>\n") 532 527 else: … … 537 532 for i in range(len(data.x)): 538 533 if has_errors: 539 if data.dx is notNone and data.dx != []:534 if data.dx != None and data.dx != []: 540 535 if data.dx[i] != None: 541 536 out.write("%g %g %g %g\n" % (data.x[i], -
src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py
rf0bb711 r464cd07 69 69 'progressBarUpdateSignal', 70 70 'activeGraphName', 71 'sendDataToPanelSignal',72 'updateModelFromDataOperationPanelSignal'73 71 ] 74 72 … … 414 412 self.assertEqual(yscale, "log") 415 413 416 417 414 class FormulaValidatorTest(unittest.TestCase): 418 415 """ Test the formula validator """
Note: See TracChangeset
for help on using the changeset viewer.