- Timestamp:
- Jan 9, 2017 3:28:03 AM (8 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
- Location:
- src/sas/qtgui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/GuiUtils.py
r570a58f9 rfed94a2 9 9 import webbrowser 10 10 import urlparse 11 import numpy 11 12 12 13 warnings.simplefilter("ignore") -
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 """ -
src/sas/qtgui/Plotter.py
r570a58f9 rfed94a2 22 22 23 23 self.parent = parent 24 self.addText = AddText(self)25 24 26 25 # Dictionary of {plot_id:Data1d} … … 29 28 # Simple window for data display 30 29 self.txt_widget = QtGui.QTextEdit(None) 31 30 # Window for text add 31 self.addText = AddText(self) 32 33 # Log-ness of the axes 32 34 self.xLogLabel = "log10(x)" 33 35 self.yLogLabel = "log10(y)" … … 39 41 40 42 # Add a slot for receiving update signal from LinearFit 41 # NEW style signals - don't work!43 # NEW style signals 42 44 #self.updatePlot = QtCore.pyqtSignal(tuple) 43 # self.updatePlot.connect(self.updateWithData)44 # OLD style signals - work perfectly45 # self.updatePlot.connect(self.onFitDisplay) 46 # OLD style signals 45 47 QtCore.QObject.connect(self, QtCore.SIGNAL('updatePlot'), self.onFitDisplay) 46 48 … … 68 70 is_fit = (self._data.id=="fit") 69 71 70 # Shortcut for anaxis72 # Shortcut for the current axis 71 73 ax = self.ax 72 74 … … 436 438 self.removePlot(id) 437 439 continue 440 438 441 new_xlabel, new_ylabel, xscale, yscale =\ 439 442 GuiUtils.xyTransform(current_plot, xLabel, yLabel) -
src/sas/qtgui/ScaleProperties.py
r3b7b218 rfed94a2 45 45 Return current values from comboboxes 46 46 """ 47 return s elf.cbX.currentText(), self.cbY.currentText()47 return str(self.cbX.currentText()), str(self.cbY.currentText()) 48 48 49 49 def viewIndexChanged(self, index):
Note: See TracChangeset
for help on using the changeset viewer.