-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathbathastigdlg.cpp
48 lines (41 loc) · 1.04 KB
/
bathastigdlg.cpp
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
46
47
48
#include "bathastigdlg.h"
#include "ui_bathastigdlg.h"
#include "mirrordlg.h"
#include "math.h"
bathAstigDlg::bathAstigDlg(QWidget *parent) :
QDialog(parent),
ui(new Ui::bathAstigDlg)
{
ui->setupUi(this);
mirrorDlg &md = *mirrorDlg::get_Instance();
ui->diamSb->setValue(md.diameter);
ui->rocsb->setValue(md.roc);
ui->lambdaSb->setValue(md.lambda);
ui->sepSb->setValue(5.);
compute();
}
bathAstigDlg::~bathAstigDlg()
{
delete ui;
}
void bathAstigDlg::compute(){
double val = ui->diamSb->value() * ui->diamSb->value() * ui->sepSb->value() * ui->sepSb->value() /
(32. * ui->rocsb->value() * ui->rocsb->value() * ui->rocsb->value());
ui->pvAstig->setText( QString::number(round(1e9 * val/ui->lambdaSb->value())/1000.));
}
void bathAstigDlg::on_diamSb_valueChanged(double)
{
compute();
}
void bathAstigDlg::on_rocsb_valueChanged(double)
{
compute();
}
void bathAstigDlg::on_sepSb_valueChanged(double)
{
compute();
}
void bathAstigDlg::on_lambdaSb_valueChanged(double)
{
compute();
}