-
Notifications
You must be signed in to change notification settings - Fork 1
/
processError.cpp
67 lines (65 loc) · 2.26 KB
/
processError.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "mainwindow.h"
void MainWindow::dealWithInterpolatingErr() {
delay(1000);
if (ui->lineEdit_Thread->text() != "") {
QStringList list = ui->lineEdit_Thread->text().split(':');
int load = list[0].toInt(),
proc = list[1].toInt(),
save = list[2].toInt();
if (load == 1 && proc == 1 && save == 1) state = "Stopped";
if (load > 1) load--;
if (proc > 1) proc--;
if (save > 1) save--;
ui->lineEdit_Thread->setText(QString::number(load) + ':' + QString::number(proc) + ':' + QString::number(save));
}
else {
state = "Stopped";
}
}
void MainWindow::dealWithUpscalingErr() {
delay(1000);
int TileSize = ui->lineEdit_TileSize->text().toInt();
/*
if tile > 1024 then down tile;
else if thread > 2 then down thread;
else if tile > 256 then down tile;
else if thread > 1 then down thread;
else if tile > 0 then set tile 0;
else stop
*/
if (TileSize > 1024) {
TileSize /= 2;
ui->lineEdit_TileSize->setText(QString::number(TileSize));
}
else if (ui->lineEdit_Thread->text() != "") {
QStringList list = ui->lineEdit_Thread->text().split(':');
int load = list[0].toInt(),
proc = list[1].toInt(),
save = list[2].toInt();
if (load > 2) load--;
if (proc > 2) proc--;
if (save > 2) save--;
ui->lineEdit_Thread->setText(QString::number(load) + ':' + QString::number(proc) + ':' + QString::number(save));
}
else if (TileSize > 256) {
TileSize /= 2;
ui->lineEdit_TileSize->setText(QString::number(TileSize));
}
else if (ui->lineEdit_Thread->text() != "") {
QStringList list = ui->lineEdit_Thread->text().split(':');
int load = list[0].toInt(),
proc = list[1].toInt(),
save = list[2].toInt();
if (load > 1) load--;
if (proc > 1) proc--;
if (save > 1) save--;
ui->lineEdit_Thread->setText(QString::number(load) + ':' + QString::number(proc) + ':' + QString::number(save));
}
else if (TileSize > 0) {
TileSize /= 2;
ui->lineEdit_TileSize->setText(QString::number(TileSize));
}
else {
state = "Stopped";
}
}