Changeset fed94a2 in sasview for src/sas/qtgui/LinearFit.py
- Timestamp:
- Jan 9, 2017 3:28:03 AM (7 years ago)
- 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:
- a66ff280
- Parents:
- 570a58f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/LinearFit.py
- Property mode changed from 100755 to 100644
r570a58f9 rfed94a2 2 2 Adds a linear fit plot to the chart 3 3 """ 4 import re 4 5 import numpy 5 6 from PyQt4 import QtGui … … 46 47 self.txtBerr.setText("0") 47 48 self.txtChi2.setText("0") 49 48 50 # Initial ranges 49 51 self.txtRangeMin.setText(str(max_range[0])) … … 52 54 self.txtFitRangeMax.setText(str(fit_range[1])) 53 55 54 self.lblRange.setText('Fit range of ' + self.xLabel) 56 # cast xLabel into html 57 label = re.sub(r'\^\((.)\)(.*)', r'<span style=" vertical-align:super;">\1</span>\2', 58 str(self.xLabel).rstrip()) 59 self.lblRange.setText('Fit range of ' + label) 55 60 56 61 self.model = LineModel() … … 62 67 self.transform = transform 63 68 69 # connect Fit button 64 70 self.cmdFit.clicked.connect(self.fit) 65 71 … … 108 114 # Set the qmin and qmax in the panel that matches the 109 115 # transformed min and max 110 self.txtRangeMin.setText(formatNumber(self.floatInvTransform(xmin))) 111 self.txtRangeMax.setText(formatNumber(self.floatInvTransform(xmax))) 116 #value_xmin = X_VAL_DICT[self.xLabel].floatTransform(xmin) 117 #value_xmax = X_VAL_DICT[self.xLabel].floatTransform(xmax) 118 value_xmin = self.floatInvTransform(xmin) 119 value_xmax = self.floatInvTransform(xmax) 120 self.txtRangeMin.setText(formatNumber(value_xmin)) 121 self.txtRangeMax.setText(formatNumber(value_xmax)) 112 122 113 123 # Store the transformed values of view x, y and dy before the fit … … 233 243 return flag 234 244 235 #def checkFitRanges(self, usermin, usermax):236 # """237 # Ensure that fields parameter contains a min and a max value238 # within x min and x max range239 # """240 # self.mini = float(self.xminFit.GetValue())241 # self.maxi = float(self.xmaxFit.GetValue())242 # flag = True243 # try:244 # mini = float(usermin.GetValue())245 # maxi = float(usermax.GetValue())246 # if mini < maxi:247 # usermin.SetBackgroundColour(wx.WHITE)248 # usermin.Refresh()249 # else:250 # flag = False251 # usermin.SetBackgroundColour("pink")252 # usermin.Refresh()253 # except:254 # # Check for possible values entered255 # flag = False256 # usermin.SetBackgroundColour("pink")257 # usermin.Refresh()258 259 # return flag260 245 def floatInvTransform(self, x): 261 246 """
Note: See TracChangeset
for help on using the changeset viewer.