def _createWidgets(self): '''Create the widgets contained in this box''' # Peak number chooser self.numpeaks = [QRadioButton("2"), QRadioButton("3"), QRadioButton("4")] self.numpeaks[0].setToolTip(ttt('Model the exchange of 2 peaks')) self.numpeaks[1].setToolTip(ttt('Model the exchange of 3 peaks')) self.numpeaks[2].setToolTip(ttt('Model the exchange of 4 peaks')) # Make 4x4 matrix of QLabels self.exview = [[QLabel(self) for i in xrange(4)] for j in xrange(4)] for i in xrange(4): for e in self.exview[i]: e.setToolTip(ttt('The current exchange matrix')) # Enforce symmetry button self.symmetry = QCheckBox("Enforce Symmetry", self) self.symmetry.setToolTip(ttt('If symmetry is on then you only need to ' 'manually set the upper triangle of the ' 'exchange matrix. Thse values are ' 'mirrored ' 'in the lower triangle and the diagonals ' 'are automatically set so that each row ' 'sums to 1. ' 'Otherwise you must set every element')) # Exchange picker self.exchooser = QComboBox(self) self.exchooser.setToolTip(ttt('Choose between which two peaks to set ' 'the exchange (relative) rate')) # Exchange value self.exvalue = QLineEdit(self) self.exvalue.setToolTip(ttt('The exchange (relative) rate')) self.exvalue.setValidator(QDoubleValidator(0.0, 1.0, 3, self.exvalue))
def _createWidgets(self): '''Create the widgets contained in this box''' # Rate or lifetime chooser self.rate = QRadioButton('Rate', self) self.rate.setToolTip(ttt('Choose this to express exchange as rate')) self.lifetime = QRadioButton('Lifetime', self) self.lifetime.setToolTip(ttt('Choose this to express exchange as ' 'lifetime')) # Box containing value self.rate_value = QLineEdit(self) validate = QDoubleValidator(self.rate_value) validate.setDecimals(3) validate.setBottom(0.0) self.rate_value.setValidator(validate) self.rate_value.setToolTip(ttt('The rate or lifetime value')) # Unit self.unit = QComboBox(self) self.unit.setToolTip(ttt('Selects the input unit for the rate ' 'or lifetime'))
def _createWidgets(self): '''Create the widgets contained in this box''' # The three choosers self.xmin = QLineEdit(self) self.xmin.setToolTip(ttt('The lower limit of the plot, in ' 'wavenumbers')) self.xmax = QLineEdit(self) self.xmax.setToolTip(ttt('The upper limit of the plot, in ' 'wavenumbers')) self.reverse = QCheckBox("Reverse Limits", self) self.reverse.setToolTip(ttt('Display plot with higher frequencies on ' 'the left, not the right')) # Set validators for limits self.xmin.setValidator(QIntValidator(300, 3000, self.xmin)) self.xmax.setValidator(QIntValidator(300, 3000, self.xmax)) # The wavelength selection self.wavenum = QLineEdit(' ') self.wavenum.setReadOnly(True) self.intense = QLineEdit(' ') self.intense.setReadOnly(True)
def _createWidgets(self): '''Create the contained widgets''' self.inputpeak = QLineEdit(self) self.inputGL = QLineEdit(self) self.inputGG = QLineEdit(self) self.inputH = QLineEdit(self) self.newpeak = QLineEdit(self) self.newGL = QLineEdit(self) self.newGG = QLineEdit(self) self.newH = QLineEdit(self) self.inputpeak.setValidator(QDoubleValidator(300.0, 3000.0, 1, self.inputpeak)) self.inputGL.setValidator(QDoubleValidator(0.0, 100.0, 3, self.inputGL)) self.inputGG.setValidator(QDoubleValidator(0.0, 100.0, 3, self.inputGG)) self.inputH.setValidator(QDoubleValidator(0.0, 1.0, 3, self.inputH)) self.newpeak.setReadOnly(True) self.newGL.setReadOnly(True) self.newGG.setReadOnly(True) self.newH.setReadOnly(True) self.inputpeak.setToolTip(ttt('The vibrational frequency of this peak' ', in wavenumbers')) self.inputGL.setToolTip(ttt('The Lorentzian FWHM broadening of this ' 'peak, in wavenumbers')) self.inputGG.setToolTip(ttt('The Gaussian FWHM broadening of this peak' ', in wavenumbers')) self.inputH.setToolTip(ttt('The relative height of this peak')) self.newpeak.setToolTip(ttt('The vibrational frequency after ' 'exchange')) self.newGL.setToolTip(ttt('The Gaussian FWHM after exchange')) self.newGG.setToolTip(ttt('The Lorentzian FWHM after exchange')) self.newH.setToolTip(ttt('The relative height after exchange'))
def _createtWidgets(self): '''Creates all the widgets''' # Make the views self.plot = Plot(self) self.rate = RateView(parent=self) self.exchange = ExchangeView(parent=self) self.peak = PeakView(parent=self) self.scale = ScaleView(parent=self) # Create the model controller self.control = Controller(self) # Attach models to the views self.rate.setModel(self.control.rate) self.exchange.setModel(self.control.exchange, self.control.numpeaks) self.peak.setModel(self.control.peak) self.scale.setModel(self.control.scale) # Init the UI of all the views self.rate.initUI() self.exchange.initUI() self.peak.initUI() self.scale.initUI() # Last, make inter-view connections self.rate.makeConnections() self.exchange.makeConnections() self.peak.makeConnections() self.scale.makeConnections() self.plot.makeConnections() # The window will own a button to clear raw data self.clear = QPushButton('Clear Raw Data', self) self.clear.setToolTip(ttt('Remove raw data from the plot ' 'if there is any'))