Changeset 8d0ec40 in sasview


Ignore:
Timestamp:
Sep 6, 2012 4:37:54 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, 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, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
65261207
Parents:
7034fc0
Message:

batch window: distinguishes non-numeric/empty cells in hightlighed cells

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/model_editor.py

    r0ed400d r8d0ec40  
    778778            try: 
    779779                # try to remove pyc file if exists 
    780                 #_deleteFile(self.fname) 
     780                _deleteFile(self.fname) 
    781781                _deleteFile(self.fname + "c") 
    782782            except: 
  • sansguiframe/src/sans/guiframe/data_processor.py

    rc2e5898 r8d0ec40  
    682682                 
    683683            # Finally check the highlighted cell if any cells missing 
    684             self.get_highlighted_row() 
     684            self.get_highlighted_row(True) 
    685685        else: 
    686686            msg = "No item selected.\n" 
     
    689689        return grid.selected_cells 
    690690        
    691     def get_highlighted_row(self): 
     691    def get_highlighted_row(self, is_number=True): 
    692692        """ 
    693693        Add highlight rows 
     
    700700            if grid.IsInSelection(row, col): 
    701701                cel = (row, col) 
    702                 if row < 1: 
     702                if row < 1 and not is_number: 
    703703                    continue 
    704                 if not grid.GetCellValue(row, col): 
     704                # empty cell 
     705                if not grid.GetCellValue(row, col).lstrip().rstrip(): 
     706                    if cel in grid.selected_cells: 
     707                        grid.selected_cells.remove(cel) 
    705708                    continue 
     709                if is_number: 
     710                    try:  
     711                        float(grid.GetCellValue(row, col)) 
     712                    except: 
     713                        # non numeric cell 
     714                        if cel in grid.selected_cells: 
     715                            grid.selected_cells.remove(cel) 
     716                        continue 
    706717                if cel not in grid.selected_cells: 
    707718                    grid.selected_cells.append(cel) 
     
    970981        grid = self.notebook.GetPage(pos) 
    971982        title = self.notebook.GetPageText(pos) 
    972         self.notebook.get_highlighted_row() 
     983        self.notebook.get_highlighted_row(False) 
    973984        if len(grid.selected_cells) == 0: 
    974985            msg = "Highlight a Data or Chi2 column first..." 
     
    12801291        try: 
    12811292            cell_list = self.notebook.on_edit_axis() 
     1293            label, title = self.create_axis_label(cell_list) 
    12821294        except: 
    12831295            msg = str(sys.exc_value) 
     
    12851297                             StatusEvent(status=msg, info="error"))  
    12861298            return  
    1287         label, title = self.create_axis_label(cell_list) 
    12881299        tcrtl = event.GetEventObject() 
    12891300        if tcrtl == self.x_axis_add: 
Note: See TracChangeset for help on using the changeset viewer.