Changes in / [f331852:44880ac] in sasview


Ignore:
Location:
src/sas/qtgui
Files:
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/GUITests.py

    rd5c5d3d r01cda57  
    3838from Calculators.UnitTesting import SlitSizeCalculatorTest 
    3939from Calculators.UnitTesting import ResolutionCalculatorPanelTest 
    40 from Calculators.UnitTesting import DataOperationUtilityTest 
    4140 
    4241# Utilities 
     
    9594        unittest.makeSuite(SlitSizeCalculatorTest.SlitSizeCalculatorTest, 'test'), 
    9695        unittest.makeSuite(ResolutionCalculatorPanelTest.ResolutionCalculatorPanelTest, 'test'), 
    97         unittest.makeSuite(DataOperationUtilityTest.DataOperationUtilityTest, 'test'), 
    9896 
    9997        # Perspectives 
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r1420066 r7d8bebf  
    9393        self.communicator.activeGraphName.connect(self.updatePlotName) 
    9494        self.communicator.plotUpdateSignal.connect(self.updatePlot) 
    95  
    9695        self.cbgraph.editTextChanged.connect(self.enableGraphCombo) 
    9796        self.cbgraph.currentIndexChanged.connect(self.enableGraphCombo) 
     
    281280        # Use 'while' so the row count is forced at every iteration 
    282281        deleted_indices = [] 
    283         deleted_names = [] 
    284282        while ind < self.model.rowCount(): 
    285283            ind += 1 
    286284            item = self.model.item(ind) 
    287  
    288285            if item and item.isCheckable() and item.checkState() == QtCore.Qt.Checked: 
    289286                # Delete these rows from the model 
    290                 deleted_names.append(str(self.model.item(ind).text())) 
    291287                deleted_indices.append(item) 
    292  
    293288                self.model.removeRow(ind) 
    294289                # Decrement index since we just deleted it 
     
    297292        # Let others know we deleted data 
    298293        self.communicator.dataDeletedSignal.emit(deleted_indices) 
    299  
    300         # update stored_data 
    301         self.manager.update_stored_data(deleted_names) 
    302294 
    303295    def deleteTheory(self, event): 
     
    877869        self.txt_widget.setWindowIcon(QtGui.QIcon(":/res/ball.ico")) 
    878870        self.txt_widget.setWindowTitle("Data Info: %s" % data.filename) 
    879         self.txt_widget.clear() 
    880871        self.txt_widget.insertPlainText(text_to_show) 
    881872 
     
    10211012        self.model.appendRow(checkbox_item) 
    10221013 
     1014 
    10231015    def updateModelFromPerspective(self, model_item): 
    10241016        """ 
  • src/sas/qtgui/MainWindow/DataManager.py

    r1420066 rdc5ef15  
    275275                del self.stored_data[id] 
    276276 
     277 
    277278    def get_by_name(self, name_list=None): 
    278279        """ 
     
    294295                if data_state.data.name == selected_name: 
    295296                    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, idx 
    303                     del self.stored_data[idx] 
    304297 
    305298    def get_data_state(self, data_id): 
  • src/sas/qtgui/MainWindow/GuiManager.py

    rf0bb711 r01cda57  
    3131from sas.qtgui.Calculators.GenericScatteringCalculator import GenericScatteringCalculator 
    3232from sas.qtgui.Calculators.ResolutionCalculatorPanel import ResolutionCalculatorPanel 
    33 from sas.qtgui.Calculators.DataOperationUtilityPanel import DataOperationUtilityPanel 
     33 
    3434 
    3535# Perspectives 
     
    4747    Main SasView window functionality 
    4848    """ 
    49  
    5049    def __init__(self, parent=None): 
    5150        """ 
     
    143142        self.GENSASCalculator = GenericScatteringCalculator(self) 
    144143        self.ResolutionCalculator = ResolutionCalculatorPanel(self) 
    145         self.DataOperation = DataOperationUtilityPanel(self) 
    146144 
    147145    def statusBarSetup(self): 
     
    339337        self.communicate.updateTheoryFromPerspectiveSignal.connect(self.updateTheoryFromPerspective) 
    340338        self.communicate.plotRequestedSignal.connect(self.showPlot) 
    341         self.communicate.updateModelFromDataOperationPanelSignal.connect(self.updateModelFromDataOperationPanel) 
    342339 
    343340    def addTriggers(self): 
     
    534531        """ 
    535532        """ 
    536         self.communicate.sendDataToPanelSignal.emit(self._data_manager.get_all_data()) 
    537  
    538         self.DataOperation.show() 
     533        print("actionData_Operation TRIGGERED") 
     534        pass 
    539535 
    540536    def actionSLD_Calculator(self): 
     
    735731        self.filesWidget.updateTheoryFromPerspective(index) 
    736732 
    737     def updateModelFromDataOperationPanel(self, new_item, new_datalist_item): 
    738         """ 
    739         :param new_item: item to be added to list of loaded files 
    740         :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, msg 
    746  
    747         self.filesWidget.model.appendRow(new_item) 
    748         self._data_manager.add_data(new_datalist_item) 
    749  
    750733    def showPlot(self, plot): 
    751734        """ 
     
    754737        if hasattr(self, "filesWidget"): 
    755738            self.filesWidget.displayData(plot) 
     739 
  • src/sas/qtgui/Plotting/Plotter.py

    rf0bb711 rfef38e8  
    145145 
    146146        # Now add the legend with some customizations. 
    147  
    148147        self.legend = ax.legend(loc='upper right', shadow=True) 
    149148        if self.legend: 
  • src/sas/qtgui/Plotting/Plotter2D.py

    rd5c5d3d r01cda57  
    8787        self._item = item 
    8888 
    89     def plot(self, data=None, marker=None, show_colorbar=True): 
     89    def plot(self, data=None, marker=None): 
    9090        """ 
    9191        Plot 2D self._data 
     
    109109                      ymin=self.ymin, ymax=self.ymax, 
    110110                      cmap=self.cmap, zmin=zmin_2D_temp, 
    111                       zmax=zmax_2D_temp, show_colorbar=show_colorbar) 
     111                      zmax=zmax_2D_temp) 
    112112 
    113113    def calculateDepth(self): 
     
    379379 
    380380    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): 
    382382        """ 
    383383        Render and show the current data 
     
    457457            self.vmax = cb.vmax 
    458458 
    459             if show_colorbar is False: 
    460                 cb.remove() 
    461  
    462459        else: 
    463460            # clear the previous 2D from memory 
  • src/sas/qtgui/Utilities/GuiUtils.py

    rf0bb711 re694f0f  
    144144    # custom open_path 
    145145    open_folder = custom_config.DEFAULT_OPEN_FOLDER 
    146     if open_folder is not None and os.path.isdir(open_folder): 
     146    if open_folder != None and os.path.isdir(open_folder): 
    147147        DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder) 
    148148    else: 
     
    230230    dataDeletedSignal = QtCore.pyqtSignal(list) 
    231231 
    232     # Send data to Data Operation Utility panel 
    233     sendDataToPanelSignal = QtCore.pyqtSignal(dict) 
    234  
    235     # Send result of Data Operation Utility panel to Data Explorer 
    236     updateModelFromDataOperationPanelSignal = QtCore.pyqtSignal(QtGui.QStandardItem, dict) 
    237232 
    238233def updateModelItemWithPlot(item, update_data, name=""): 
     
    435430    text += 'X_min = %s:  X_max = %s\n' % (xmin, max(data.x)) 
    436431    text += 'Y_min = %s:  Y_max = %s\n' % (ymin, max(data.y)) 
    437     if data.dy is not None: 
     432    if data.dy != None: 
    438433        text += 'dY_min = %s:  dY_max = %s\n' % (min(data.dy), max(data.dy)) 
    439434    text += '\nData Points:\n' 
    440435    x_st = "X" 
    441436    for index in range(len(data.x)): 
    442         if data.dy is not None and len(data.dy) > index: 
     437        if data.dy != None and len(data.dy) > index: 
    443438            dy_val = data.dy[index] 
    444439        else: 
    445440            dy_val = 0.0 
    446         if data.dx is not None and len(data.dx) > index: 
     441        if data.dx != None and len(data.dx) > index: 
    447442            dx_val = data.dx[index] 
    448443        else: 
    449444            dx_val = 0.0 
    450         if data.dxl is not None and len(data.dxl) > index: 
     445        if data.dxl != None and len(data.dxl) > index: 
    451446            if index == 0: 
    452447                x_st = "Xl" 
    453448            dx_val = data.dxl[index] 
    454         elif data.dxw is not None and len(data.dxw) > index: 
     449        elif data.dxw != None and len(data.dxw) > index: 
    455450            if index == 0: 
    456451                x_st = "Xw" 
     
    491486        y_val = data.qy_data[index] 
    492487        i_val = data.data[index] 
    493         if data.err_data is not None: 
     488        if data.err_data != None: 
    494489            di_val = data.err_data[index] 
    495         if data.dqx_data is not None: 
     490        if data.dqx_data != None: 
    496491            dx_val = data.dqx_data[index] 
    497         if data.dqy_data is not None: 
     492        if data.dqy_data != None: 
    498493            dy_val = data.dqy_data[index] 
    499494 
     
    528523                has_errors = False 
    529524        if has_errors: 
    530             if data.dx is not None and data.dx != []: 
     525            if data.dx != None and data.dx != []: 
    531526                out.write("<X>   <Y>   <dY>   <dX>\n") 
    532527            else: 
     
    537532        for i in range(len(data.x)): 
    538533            if has_errors: 
    539                 if data.dx is not None and data.dx != []: 
     534                if data.dx != None and data.dx != []: 
    540535                    if  data.dx[i] != None: 
    541536                        out.write("%g  %g  %g  %g\n" % (data.x[i], 
  • src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py

    rf0bb711 r464cd07  
    6969            'progressBarUpdateSignal', 
    7070            'activeGraphName', 
    71             'sendDataToPanelSignal', 
    72             'updateModelFromDataOperationPanelSignal' 
    7371        ] 
    7472 
     
    414412        self.assertEqual(yscale, "log") 
    415413 
    416  
    417414class FormulaValidatorTest(unittest.TestCase): 
    418415    """ Test the formula validator """ 
Note: See TracChangeset for help on using the changeset viewer.