-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSamplingParametersDialog.cpp
More file actions
45 lines (34 loc) · 1 KB
/
SamplingParametersDialog.cpp
File metadata and controls
45 lines (34 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "SamplingParametersDialog.hpp"
#include "ui_SamplingParametersDialog.h"
SamplingParametersDialog::SamplingParametersDialog(SamplingNode* cvor, QWidget *parent) :
QDialog(parent),
ui(new Ui::SamplingParametersDialog),
smplN(cvor)
{
ui->setupUi(this);
}
SamplingParametersDialog::~SamplingParametersDialog()
{
delete ui;
}
void SamplingParametersDialog::on_Odabir_clicked()
{
QString unos = ui->Unos->text();
if(unos.isEmpty()){
QMessageBox::information(this,"Greska!", "Unesite zeljenu velicinu!");
return;
}
bool ok;
unos.toDouble(&ok);
if(ok == false){
QMessageBox::information(this,"Greska!", "Pogresan Unos! Unestie broj u intervalu [0.0, 1.0]");
return;
}
const double unos_d = unos.toDouble();
if(unos_d < 0.0 || unos_d > 1.0){
QMessageBox::information(this,"Greska!", "Pogresan Unos! Broj nije u intervalu [0.0, 1.0]");
return;
}
smplN->SetSampleSizeRatio(unos_d);
this->close();
}