-
Notifications
You must be signed in to change notification settings - Fork 0
/
distributedloaddialog.cpp
42 lines (34 loc) · 1.26 KB
/
distributedloaddialog.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
#include "distributedloaddialog.h"
#include "ui_distributedloaddialog.h"
#include "easydiag.h"
DistributedLoadDialog::DistributedLoadDialog(double &beamL, QWidget *parent) :
QDialog(parent),
ui(new Ui::DistributedLoadDialog)
{
ui->setupUi(this);
lbeamL = beamL;
ui->q1SpinBox->setDecimals(4);
ui->q1SpinBox->setMaximum(std::numeric_limits<double>::max());
ui->q1SpinBox->setMinimum(std::numeric_limits<double>::max()*(-1));
ui->q2SpinBox->setDecimals(4);
ui->q2SpinBox->setMaximum(std::numeric_limits<double>::max());
ui->q2SpinBox->setMinimum(std::numeric_limits<double>::max()*(-1));
ui->distanceSpinBox->setDecimals(4);
ui->distanceSpinBox->setMaximum(lbeamL);
ui->distanceSpinBox->setMinimum(0);
ui->lengthSpinBox->setDecimals(4);
ui->lengthSpinBox->setMaximum(std::numeric_limits<double>::max());
ui->lengthSpinBox->setMinimum(0);
}
DistributedLoadDialog::~DistributedLoadDialog()
{
delete ui;
}
void DistributedLoadDialog::on_buttonBox_accepted()
{
load[0] = DistributedLoad(ui->q1SpinBox->value(),ui->q2SpinBox->value(),ui->distanceSpinBox->value(),ui->lengthSpinBox->value());
}
void DistributedLoadDialog::on_distanceSpinBox_valueChanged(double d)
{
ui->lengthSpinBox->setMaximum(lbeamL-d);
}