forked from asmwarrior/FactoryTestApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SessionManager.h
76 lines (58 loc) · 1.97 KB
/
SessionManager.h
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
68
69
70
71
72
73
74
75
76
#ifndef SESSIONMANAGER_H
#define SESSIONMANAGER_H
#include <QObject>
#include <QList>
#include <QSettings>
#include <QSharedPointer>
#include "Database.h"
class SessionManager : public QObject
{
Q_OBJECT
public:
explicit SessionManager(const QSharedPointer<QSettings>& settings, QObject *parent = nullptr);
~SessionManager();
public slots:
void logDutInfo(Dut dut);
void clear();
void writeDutRecordsToDatabase();
QString operatorName() const {return _operatorName;}
QString startTime() const {return _startTime;}
QString batchNumber() const {return _batchNumber;}
QString batchInfo() const {return _batchInfo;}
QString method() const {return _method;}
int successCount() const {return _successCount;}
int failedCount() const {return _failedCount;}
void setOperatorName(const QString& text) {_operatorName = text;}
void setStartTime(const QString& text) {_startTime = text;}
void setBatchNumber(const QString& text) {_batchNumber = text;}
void setBatchInfo(const QString& text) { _batchInfo = text;}
void setMethod(const QString& text) { _method = text;}
void increaseCyclesCount() {_testCyclesCount++;}
signals:
void sessionStatsChanged();
void printLabel(DutRecord dutRecord);
private:
// QMap<QString, QVariant> _properties =
// {
// {"operatorName", QString()},
// {"startTime", QString()},
// {"batchNumber", QString()},
// {"batchInfo", QString()},
// {"successCount", 0},
// {"failedCount", 0}
// };
QSharedPointer<QSettings> _settings;
QByteArray _csv_separator;
int _runningNumber;
QString _operatorName = "";
QString _startTime = "";
QString _batchNumber = "";
QString _batchInfo = "";
QString _method = "";
int _successCount = 0;
int _failedCount = 0;
int _testCyclesCount = 0;
QList<DutRecord> _records;
DataBase *_db;
};
#endif // SESSIONMANAGER_H