Changeset 09e0c32 in sasview
- Timestamp:
- Nov 16, 2018 4:44:40 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 64b9e61
- Parents:
- ecc5d043
- Location:
- src/sas/qtgui/Perspectives/Fitting
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/ComplexConstraint.py
recc5d043 r09e0c32 82 82 ttip = "Add constraints between all identically named parameters in both fitpages" 83 83 self.actionAddAll.setToolTip(ttip) 84 #self.actionAddAll.setStatusTip(ttip)85 84 self.actionAddAll.triggered.connect(self.onSetAll) 86 85 all_menu.addAction(self.actionAddAll) -
src/sas/qtgui/Perspectives/Fitting/Constraint.py
recc5d043 r09e0c32 12 12 self._value_ex = value_ex 13 13 self._func = func 14 self.active = True15 14 self._min = min 16 15 self._max = max 17 16 self._operator = operator 17 self.validate = True 18 self.active = True 18 19 19 20 @property -
src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py
recc5d043 r09e0c32 79 79 self.tblConstraints.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) 80 80 self.tblConstraints.setEnabled(False) 81 header = self.tblConstraints.horizontalHeaderItem(0) 82 header.setToolTip("Double click to edit.") 81 83 82 84 self.tblConstraints.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) … … 307 309 # No check on function here - trust the user (R) 308 310 if function != constraint.func: 309 #from sas.sascalc.fit.expression import compile_constraints 311 # This becomes rather difficult to validate now. 312 # Turn off validation for Edit Constraint 310 313 constraint.func = function 314 constraint.validate = False 311 315 312 316 def onTabCellEntered(self, row, column): -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
recc5d043 r09e0c32 714 714 # what is the parameter to constraint to? 715 715 constraint.value = param_used 716 717 # Should the new constraint be validated? 718 constraint.validate = mc_widget.validate 716 719 717 720 # Create a new item and add the Constraint object as a child … … 843 846 constraint.value_ex = updated_param_used 844 847 constraint.value = param_used 848 # Should the new constraint be validated? 849 constraint.validate = mc_widget.validate 845 850 846 851 # Which row is the constrained parameter in? … … 3684 3689 value_ex = constraint.value_ex 3685 3690 param = constraint.param 3686 3687 cons = (value, param, value_ex, func) 3688 3689 param_list.append([param_name, param_checked, param_value, param_error, param_min, param_max, cons]) 3691 validate = constraint.validate 3692 3693 cons = (value, param, value_ex, validate, func) 3694 3695 param_list.append([param_name, param_checked, param_value,param_error, param_min, param_max, cons]) 3690 3696 3691 3697 def gatherPolyParams(row): … … 3935 3941 # constraints 3936 3942 cons = param_dict[param_name][4+ioffset] 3937 if cons is not None and len(cons)== 4:3943 if cons is not None and len(cons)==5: 3938 3944 value = cons[0] 3939 3945 param = cons[1] 3940 3946 value_ex = cons[2] 3941 function = cons[3] 3947 validate = cons[3] 3948 function = cons[4] 3942 3949 constraint = Constraint() 3943 3950 constraint.value = value … … 3945 3952 constraint.param = param 3946 3953 constraint.value_ex = value_ex 3954 constraint.validate = validate 3947 3955 self.addConstraintToRow(constraint=constraint, row=row) 3948 3956 -
src/sas/qtgui/Perspectives/Fitting/MultiConstraint.py
rbaeac95 r09e0c32 31 31 self.params = params 32 32 self.parent = parent 33 # Text of the constraint 33 34 self.function = None 35 # Should this constraint be validated? 36 self.validate = True 34 37 35 38 self.input_constraint = constraint 36 39 if self.input_constraint is not None: 37 40 variable = constraint.value 38 #variable = func[func.index('.')+1:]39 41 self.function = constraint.func 40 42 self.params.append(variable) 41 43 self.model_name = constraint.value_ex 44 # Passed constraint may be too complex for simple validation 45 self.validate = constraint.validate 42 46 else: 43 47 self.model_name = self.params[1] … … 97 101 Add visual cues when formula is incorrect 98 102 """ 103 # Don't validate if requested 104 if not self.validate: return 105 99 106 formula_is_valid = False 100 107 formula_is_valid = self.validateConstraint(self.txtConstraint.text())
Note: See TracChangeset
for help on using the changeset viewer.