-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.cpp
58 lines (48 loc) · 1.43 KB
/
utils.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
#include "utils.h"
QString stringProcessState(ProccesThreadState pts) {
switch(pts) {
case WAITING: return "Waiting";
case FINISH: return "Finish";
case WORKING: return "Working";
case STARTING: return "Starting";
}
return "";
}
QString crtiterionsToString(Criterions crt) {
switch(crt) {
case GOAL_FIRTS_TIME: return "Goals in 1st time";
case GOAL_SECOND_TIME: return "Goals in 2ed time";
case GOAL_IN_3_TIMES: return "Goal in all times";
}
return "";
}
int criterionsToTime(Criterions crt) {
switch (crt) {
case GOAL_FIRTS_TIME: return 1;
case GOAL_SECOND_TIME: return 2;
case GOAL_IN_3_TIMES: return 999;
}
return -1;
}
ConfigFileParametrs StringToCFP(QString param) {
if (param == "Xlsx_path")
return ConfigFileParametrs::Xlsx_path;
else if (param == "DB_path")
return ConfigFileParametrs::DB_path;
}
MatchPeriod criterionToMatchPeriod(Criterions crt) {
MatchPeriod p;
switch(crt) {
case GOAL_FIRTS_TIME: p = FIRST_TIME; break;
case GOAL_SECOND_TIME: p = SECOND_TIME; break;
case GOAL_IN_3_TIMES: p = WHOLE_MATCH; break;
}
return p;
}
Criterions intToCrt(int i) {
switch (i) {
case 1: return GOAL_FIRTS_TIME;
case 2: return GOAL_SECOND_TIME;
case 3: return GOAL_IN_3_TIMES;
}
}