-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwashdialog.cpp
46 lines (42 loc) · 1.34 KB
/
washdialog.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
#include "washdialog.h"
#include "ui_washdialog.h"
#include <QDebug>
washDialog::washDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::washDialog)
{
ui->setupUi(this);
setWindowTitle("Washer configuration");
connect(ui->confirmButton, SIGNAL(clicked()), this, SLOT(checkAndConfirm()));
connect(ui->inputRow, SIGNAL(valueChanged(int)), this, SLOT(setInputRow(int)));
connect(ui->inputCol, SIGNAL(valueChanged(int)), this, SLOT(setInputCol(int)));
connect(ui->outputRow, SIGNAL(valueChanged(int)), this, SLOT(setOutputRow(int)));
connect(ui->outputCol, SIGNAL(valueChanged(int)), this, SLOT(setOutputCol(int)));
connect(ui->checkBox, SIGNAL(stateChanged(int)), this, SLOT(switchWash(int)));
}
washDialog::~washDialog() {
delete ui;
}
void washDialog::checkAndConfirm() {
//qDebug() << "!!!!!" << inputRow << inputCol << outputRow << outputCol;
emit inputChanged(inputRow, inputCol);
emit outputChanged(outputRow, outputCol);
emit enableChanged(enable);
emit validInput();
accept();
}
void washDialog::setInputRow(int row) {
inputRow = row;
}
void washDialog::setInputCol(int col) {
inputCol = col;
}
void washDialog::setOutputRow(int row) {
outputRow = row;
}
void washDialog::setOutputCol(int col) {
outputCol = col;
}
void washDialog::switchWash(int state) {
enable = state;
}