Changeset 2d466e4 in sasview for src/sas


Ignore:
Timestamp:
Jan 17, 2018 9:44:35 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:
c5a2722f
Parents:
47d7d2d
Message:

Started work on the complex constraint widget SASVIEW-853

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

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py

    • Property mode changed from 100755 to 100644
    r47d7d2d r2d466e4  
    99from sas.qtgui.Perspectives.Fitting.UI.ConstraintWidgetUI import Ui_ConstraintWidgetUI 
    1010from sas.qtgui.Perspectives.Fitting.FittingWidget import FittingWidget 
     11from sas.qtgui.Perspectives.Fitting.ComplexConstraint import ComplexConstraint 
    1112 
    1213class ConstraintWidget(QtWidgets.QWidget, Ui_ConstraintWidgetUI): 
     
    434435        Invoke the complex constraint editor 
    435436        """ 
    436         pass 
     437        selected_rows = self.selectedParameters(self.tblTabList) 
     438        assert(len(selected_rows)==2) 
     439 
     440        tab_list = [ObjectLibrary.getObject(self.tblTabList.item(s, 0).data(0)) for s in selected_rows] 
     441        # Create and display the widget for param1 and param2 
     442        cc_widget = ComplexConstraint(self, tabs=tab_list) 
     443        if cc_widget.exec_() != QtWidgets.QDialog.Accepted: 
     444            return 
     445 
     446        #constraint = Constraint() 
     447        #c_text = cc_widget.txtConstraint.text() 
     448        pass 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r47d7d2d r2d466e4  
    567567        constraint.param = mc_widget.params[0] 
    568568        # Function should have the model name preamble 
    569         #model_name = self.kernel_module.name 
    570         #constraint.func = model_name + ":" + c_text 
    571569        constraint.func = c_text 
    572570 
     
    576574 
    577575        # Which row is the constrained parameter in? 
    578         row = self.rowFromName(constraint.param) 
     576        row = self.getRowFromName(constraint.param) 
    579577        self._model_model.item(row, 1).setChild(0, item) 
    580578        self.constraintAddedSignal.emit([row]) 
     
    589587        self.communicate.statusBarUpdateSignal.emit('Constraints added') 
    590588 
    591     def rowFromName(self, name): 
     589    def getRowFromName(self, name): 
    592590        """ 
    593591        Given parameter name get the row number in self._model_model 
     
    598596                return row 
    599597        return None 
     598 
     599    def getParamNames(self): 
     600        """ 
     601        Return list of all parameters for the current model 
     602        """ 
     603        #params = [] 
     604        #for row in range(self._model_model.rowCount()): 
     605        #    params.append(self._model_model.item(row).text()) 
     606        #return params 
     607        return [self._model_model.item(row).text() for row in range(self._model_model.rowCount())] 
    600608 
    601609    def modifyViewOnRow(self, row, font=None, brush=None): 
Note: See TracChangeset for help on using the changeset viewer.