Changeset 50bfab0 in sasview for src/sas/qtgui/Perspectives


Ignore:
Timestamp:
Dec 4, 2017 8:43:06 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
9387fe3
Parents:
200bd7e
Message:

Initial unit tests for inversion - SASVIEW-609

Location:
src/sas/qtgui/Perspectives
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Corfunc/CorfuncPerspective.py

    rcb4d219 r50bfab0  
    368368            self.setClosable(value=False) 
    369369            # Tell the MdiArea to close the container 
    370             self.parentWidget().close() 
     370            if self.parent: 
     371                self.parentWidget().close() 
    371372            event.accept() 
    372373        else: 
  • src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py

    r6cb305a r50bfab0  
    6363        self._model_item = QtGui.QStandardItem() 
    6464 
    65         self._helpView = QtWebKit.QWebView() 
     65        #self._helpView = QtWebKit.QWebView() 
    6666        self.detailsDialog = DetailsDialog(self) 
    6767        self.detailsDialog.cmdOK.clicked.connect(self.enabling) 
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    r19fce84 r50bfab0  
    2525        return 0.0 
    2626 
     27NUMBER_OF_TERMS = 10 
     28REGULARIZATION = 0.0001 
     29BACKGROUND_INPUT = 0.0 
     30MAX_DIST = 140.0 
    2731 
    2832# TODO: Modify plot references, don't just send new 
     
    227231        item = QtGui.QStandardItem("") 
    228232        self.model.setItem(WIDGETS.W_FILENAME, item) 
    229         item = QtGui.QStandardItem('0.0') 
     233        item = QtGui.QStandardItem(str(BACKGROUND_INPUT)) 
    230234        self.model.setItem(WIDGETS.W_BACKGROUND_INPUT, item) 
    231235        item = QtGui.QStandardItem("") 
     
    237241        item = QtGui.QStandardItem("") 
    238242        self.model.setItem(WIDGETS.W_SLIT_HEIGHT, item) 
    239         item = QtGui.QStandardItem("10") 
     243        item = QtGui.QStandardItem(str(NUMBER_OF_TERMS)) 
    240244        self.model.setItem(WIDGETS.W_NO_TERMS, item) 
    241         item = QtGui.QStandardItem("0.0001") 
     245        item = QtGui.QStandardItem(str(REGULARIZATION)) 
    242246        self.model.setItem(WIDGETS.W_REGULARIZATION, item) 
    243         item = QtGui.QStandardItem("140.0") 
     247        item = QtGui.QStandardItem(str(MAX_DIST)) 
    244248        self.model.setItem(WIDGETS.W_MAX_DIST, item) 
    245249        item = QtGui.QStandardItem("") 
     
    439443    def getNFunc(self): 
    440444        """Get the n_func value from the GUI object""" 
    441         return int(self.noOfTermsInput.text()) 
     445        try: 
     446            nfunc = int(self.noOfTermsInput.text()) 
     447        except ValueError: 
     448            logging.error("Incorrect number of terms specified: %s" %self.noOfTermsInput.text()) 
     449            self.noOfTermsInput.setText(str(NUMBER_OF_TERMS)) 
     450            nfunc = NUMBER_OF_TERMS 
     451        return nfunc 
    442452 
    443453    def setCurrentData(self, data_ref): 
Note: See TracChangeset for help on using the changeset viewer.