21 #include "ui_univariatedialog.h" 45 min = analyzer_->AbscissaMin();
46 max = analyzer_->AbscissaMax();
50 workspace_->main_window()->DisplayExceptionWarning(e);
55 QString label_text = QString::number(min) +
"–" + QString::number(max);
56 ui->rangeLabel->setText(label_text);
58 ui->minLineEdit->setValidator(
new QDoubleValidator(min, max, 2,
this));
59 ui->maxLineEdit->setValidator(
new QDoubleValidator(min, max, 2,
this));
61 uword middle = analyzer_->columns() / 2;
62 ui->indexSpinBox->setRange(0, analyzer_->columns() - 1);
63 ui->indexSpinBox->setValue(middle);
64 QVector<double> plot_data, wavelength;
71 if (plot_data.isEmpty())
73 ui->spectrumPlot->addGraph();
74 ui->spectrumPlot->graph(0)->addData(wavelength, plot_data);
75 ui->spectrumPlot->rescaleAxes();
89 void UnivariateDialog::on_buttonBox_accepted()
92 if (ui->minLineEdit->text().isEmpty() || ui->maxLineEdit->text().isEmpty()){
93 QMessageBox::warning(
this,
"Invalid Input!",
"You must enter numbers for left and right bounds.");
96 double entered_min = ui->minLineEdit->text().toDouble();
97 double entered_max = ui->maxLineEdit->text().toDouble();
98 uint bound_window = ui->searchWindowSpinBox->value();
99 QString name = ui->nameLineEdit->text();
103 QString value_method = ui->methodComboBox->currentText();
104 if (!analyzer_.isNull()){
105 if (value_method ==
"Empirical"){
107 analyzer_->Univariate(name, entered_min, entered_max, bound_window);
109 workspace_->main_window()->DisplayExceptionWarning(e);
114 analyzer_->FitPeak(name, value_method, entered_min, entered_max);
128 void UnivariateDialog::on_buttonBox_rejected()
133 void UnivariateDialog::on_minLineEdit_textChanged(
const QString &arg1)
136 double value = arg1.toDouble(&ok);
142 if(!ui->spectrumPlot->hasItem(min_line_))
143 ui->spectrumPlot->addItem(min_line_);
147 void UnivariateDialog::on_maxLineEdit_textChanged(
const QString &arg1)
150 double value = arg1.toDouble(&ok);
157 if(!ui->spectrumPlot->hasItem(max_line_))
158 ui->spectrumPlot->addItem(max_line_);
162 void UnivariateDialog::on_indexSpinBox_editingFinished()
164 size_t index = ui->indexSpinBox->value();
167 ui->spectrumPlot->graph(0)->clearData();
168 ui->spectrumPlot->graph(0)->addData(abscissa, plot_data);
0x001 Axis ranges are draggable (see QCPAxisRect::setRangeDrag, QCPAxisRect::setRangeDragAxes) ...
VESPUCCI_EXPORT arma::uword max(arma::uword a, arma::uword b)
Vespucci::Math::max.
void setCoords(double key, double value)
QVector< double > FromArmaVec(const arma::vec &data)
UnivariateDialog(QWidget *parent, QSharedPointer< VespucciWorkspace > ws, QSharedPointer< AbstractDataAnalyzer > analyzer)
UnivariateDialog::UnivariateDialog.
A straight line that spans infinitely in both directions.
VESPUCCI_EXPORT arma::uword min(arma::uword a, arma::uword b)
Vespucci::Math::min.
The QCustomPlot surface is immediately refreshed, by calling QWidget::repaint() after the replot...
QCPItemPosition *const point1
The UnivariateDialog class Class allowing user to create univariate images.
0x002 Axis ranges are zoomable with the mouse wheel (see QCPAxisRect::setRangeZoom, QCPAxisRect::setRangeZoomAxes)
QCPItemPosition *const point2