Changeset 412e069e in sasview for src/sas/qtgui/Plotting
- Timestamp:
- Nov 7, 2017 8:29:59 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:
- 3e8dee3
- Parents:
- 6280464
- Location:
- src/sas/qtgui/Plotting
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/BoxSum.py
r6280464 r412e069e 5 5 from PyQt5 import QtGui 6 6 from PyQt5 import QtWidgets 7 8 import sas.qtgui.Utilities.GuiUtils as GuiUtils 7 9 8 10 # Local UI … … 17 19 assert isinstance(model, QtGui.QStandardItemModel) 18 20 19 self.txtBoxHeight.setValidator( QtGui.QDoubleValidator())20 self.txtBoxWidth.setValidator( QtGui.QDoubleValidator())21 self.txtCenterX.setValidator( QtGui.QDoubleValidator())22 self.txtCenterY.setValidator( QtGui.QDoubleValidator())21 self.txtBoxHeight.setValidator(GuiUtils.DoubleValidator()) 22 self.txtBoxWidth.setValidator(GuiUtils.DoubleValidator()) 23 self.txtCenterX.setValidator(GuiUtils.DoubleValidator()) 24 self.txtCenterY.setValidator(GuiUtils.DoubleValidator()) 23 25 24 26 self.model = model -
src/sas/qtgui/Plotting/ColorMap.py
r0849aec r412e069e 13 13 from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas 14 14 from sas.qtgui.Plotting.PlotterData import Data2D 15 from sas.qtgui.Utilities.GuiUtils import formatNumber 15 from sas.qtgui.Utilities.GuiUtils import formatNumber, DoubleValidator 16 16 from .rangeSlider import RangeSlider 17 17 … … 51 51 52 52 # Initialize validators on amplitude textboxes 53 validator_min = QtGui.QDoubleValidator(self.txtMinAmplitude)53 validator_min = DoubleValidator(self.txtMinAmplitude) 54 54 validator_min.setNotation(0) 55 55 self.txtMinAmplitude.setValidator(validator_min) 56 validator_max = QtGui.QDoubleValidator(self.txtMaxAmplitude)56 validator_max = DoubleValidator(self.txtMaxAmplitude) 57 57 validator_max.setNotation(0) 58 58 self.txtMaxAmplitude.setValidator(validator_max) -
src/sas/qtgui/Plotting/LinearFit.py
r304d082 r412e069e 8 8 from PyQt5 import QtWidgets 9 9 10 from sas.qtgui.Utilities.GuiUtils import formatNumber 10 from sas.qtgui.Utilities.GuiUtils import formatNumber, DoubleValidator 11 11 12 12 from sas.qtgui.Plotting import Fittings … … 43 43 self.y_is_log = self.yLabel == "log10(y)" 44 44 45 self.txtFitRangeMin.setValidator( QtGui.QDoubleValidator())46 self.txtFitRangeMax.setValidator( QtGui.QDoubleValidator())45 self.txtFitRangeMin.setValidator(DoubleValidator()) 46 self.txtFitRangeMax.setValidator(DoubleValidator()) 47 47 48 48 # Default values in the line edits … … 158 158 y_model = self.model.run(xmin) 159 159 tempx.append(xminView) 160 tempy.append(numpy.power(10 , y_model) if self.y_is_log else y_model)160 tempy.append(numpy.power(10.0, y_model) if self.y_is_log else y_model) 161 161 162 162 # load tempy with the maximum transformation 163 163 y_model = self.model.run(xmax) 164 164 tempx.append(xmaxView) 165 tempy.append(numpy.power(10 , y_model) if self.y_is_log else y_model)165 tempy.append(numpy.power(10.0, y_model) if self.y_is_log else y_model) 166 166 167 167 # Set the fit parameter display when FitDialog is opened again … … 247 247 return numpy.sqrt(numpy.sqrt(x)) 248 248 elif self.xLabel == "log10(x)": 249 return numpy.power(10 , x)249 return numpy.power(10.0, x) 250 250 elif self.xLabel == "ln(x)": 251 251 return numpy.exp(x) 252 252 elif self.xLabel == "log10(x^(4))": 253 return numpy.sqrt(numpy.sqrt(numpy.power(10 , x)))253 return numpy.sqrt(numpy.sqrt(numpy.power(10.0, x))) 254 254 return x 255 255 -
src/sas/qtgui/Plotting/Plotter2D.py
r6280464 r412e069e 3 3 import pylab 4 4 import functools 5 import logging 5 6 6 7 from PyQt5 import QtCore … … 126 127 zmax_temp = self.zmax 127 128 # self.scale predefined in the baseclass 129 # in numpy > 1.12 power(int, -int) raises ValueException 130 # "Integers to negative integer powers are not allowed." 128 131 if self.scale == 'log_{10}': 129 132 if self.zmin is not None: 130 zmin_temp = numpy.power(10 , self.zmin)133 zmin_temp = numpy.power(10.0, self.zmin) 131 134 if self.zmax is not None: 132 zmax_temp = numpy.power(10 , self.zmax)135 zmax_temp = numpy.power(10.0, self.zmax) 133 136 else: 134 137 if self.zmin is not None: … … 289 292 new_plot.is_data = True 290 293 GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 294 291 295 self.manager.communicator.plotUpdateSignal.emit([new_plot]) 292 296 -
src/sas/qtgui/Plotting/SetGraphRange.py
r0849aec r412e069e 5 5 from PyQt5 import QtGui 6 6 from PyQt5 import QtWidgets 7 8 import sas.qtgui.Utilities.GuiUtils as GuiUtils 7 9 8 10 # Local UI … … 18 20 assert(isinstance(y_range, tuple)) 19 21 20 self.txtXmin.setValidator( QtGui.QDoubleValidator())21 self.txtXmax.setValidator( QtGui.QDoubleValidator())22 self.txtYmin.setValidator( QtGui.QDoubleValidator())23 self.txtYmax.setValidator( QtGui.QDoubleValidator())22 self.txtXmin.setValidator(GuiUtils.DoubleValidator()) 23 self.txtXmax.setValidator(GuiUtils.DoubleValidator()) 24 self.txtYmin.setValidator(GuiUtils.DoubleValidator()) 25 self.txtYmax.setValidator(GuiUtils.DoubleValidator()) 24 26 25 27 self.txtXmin.setText(str(x_range[0])) -
src/sas/qtgui/Plotting/SlicerModel.py
r0849aec r412e069e 1 1 from PyQt5 import QtGui 2 from PyQt5 import QtCore 2 3 3 4 import sas.qtgui.Utilities.GuiUtils as GuiUtils -
src/sas/qtgui/Plotting/SlicerParameters.py
r0849aec r412e069e 8 8 from PyQt5 import QtWidgets 9 9 from PyQt5 import QtWebKitWidgets 10 11 import sas.qtgui.Utilities.GuiUtils as GuiUtils 10 12 11 13 # Local UI … … 126 128 super(PositiveDoubleEditor, self).__init__(parent) 127 129 self.setAutoFillBackground(True) 128 validator = QtGui.QDoubleValidator()130 validator = GuiUtils.DoubleValidator() 129 131 # Don't use the scientific notation, cause 'e'. 130 validator.setNotation( QtGui.QDoubleValidator.StandardNotation)132 validator.setNotation(GuiUtils.DoubleValidator.StandardNotation) 131 133 132 134 self.setValidator(validator) -
src/sas/qtgui/Plotting/Slicers/SectorSlicer.py
r0849aec r412e069e 3 3 """ 4 4 import numpy 5 import logging 5 6 6 7 from .BaseInteractor import BaseInteractor … … 167 168 new_plot.is_data = True 168 169 GuiUtils.updateModelItemWithPlot(self._item, new_plot, new_plot.id) 170 169 171 self.base.manager.communicator.plotUpdateSignal.emit([new_plot]) 170 172
Note: See TracChangeset
for help on using the changeset viewer.