-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrunmanager.cpp
More file actions
53 lines (40 loc) · 985 Bytes
/
Copy pathrunmanager.cpp
File metadata and controls
53 lines (40 loc) · 985 Bytes
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
#include "runmanager.h"
#include <QFileInfo>
#include <QPixmap>
RunManager::RunManager()
{
this->lastRun = -1;
}
void RunManager::createNewRun(QString fileName)
{
QFileInfo fileInfo = QFileInfo(fileName);
QPixmap image = QPixmap(fileName);
this->runs.append(Run(fileInfo.fileName(), QString::number(image.width()) + "x" + QString::number(image.height())));
this->lastRun = this->runs.count() - 1;
}
void RunManager::stepProcessed(StepData stepData)
{
Run run = this->getLastRun();
run.addStepData(stepData);
this->replaceLastRun(run);
}
Run RunManager::getRun(int index)
{
return this->runs.value(index);
}
Run RunManager::getLastRun()
{
return this->runs.value(this->lastRun);
}
void RunManager::replaceLastRun(Run run)
{
this->runs.replace(this->lastRun, run);
}
void RunManager::setSelectedRun(int index)
{
this->selectedRun = index;
}
Run RunManager::getSelectedRun()
{
return this->runs.value(this->selectedRun);
}