This repository was archived by the owner on May 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathptask.cpp
113 lines (102 loc) · 2.51 KB
/
ptask.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include "ptask.h"
PTask::PTask() { // constructeur
numberPredecessors = 0;
numberSuccessors = 0;
numberLinkPredecessors = 0;
numberLinkSuccessors = 0;
durationTask = 0;
lateDate = -1;
commencementDate = 0;
earlyDate = 0;//durationTask;
idTask = 0;
nameTask = "";
isCritique = 0;
start = end = "";
}
PTask::PTask(QString name) { // constructeur
numberPredecessors = 0;
numberSuccessors = 0;
numberLinkPredecessors = 0;
numberLinkSuccessors = 0;
durationTask = 0;
lateDate = -1;
commencementDate = 0;
earlyDate = 0;//durationTask;
idTask = 0;
nameTask = name;
slack = 0;
isCritique = 0;
start = end = "";
}
PTask::PTask(int id, int d, QString name) { // constructeur
numberPredecessors = 0;
numberSuccessors = 0;
numberLinkPredecessors = 0;
numberLinkSuccessors = 0;
durationTask = d;
lateDate = -1;
commencementDate = 0;
earlyDate = 0;//durationTask;
idTask = id;
nameTask = name;
slack = 0;
isCritique = 0;
start = end = "";
}
PTask::PTask(int id, int d, QString name, QString istart, QString iend)
{
numberPredecessors = 0;
numberSuccessors = 0;
numberLinkPredecessors = 0;
numberLinkSuccessors = 0;
durationTask = d;
lateDate = -1;
commencementDate = 0;
earlyDate = 0;//durationTask;
idTask = id;
nameTask = name;
slack = 0;
isCritique = 0;
this->start = istart;
this->end = iend;
}
PTask::PTask(int id, QString name) { // constructeur
numberPredecessors = 0;
numberSuccessors = 0;
numberLinkPredecessors = 0;
numberLinkSuccessors = 0;
durationTask = 0;
lateDate = -1;
commencementDate = 0;
earlyDate = 0;//durationTask;
idTask = id;
nameTask = name;
slack = 0;
isCritique = 0;
start = end = "";
}
void PTask::addSuccessor(PTask* t) { // ajoute la tache t a la liste des successeurs
listSuccessors.insert(0, t);
numberSuccessors++;
numberLinkSuccessors ++;
}
void PTask::addPredecessors(PTask* t) { // ajoute la tache t a la liste des predecessors
listPredecessors.insert(0,t);
numberPredecessors++;
numberLinkPredecessors ++;
}
QList<PTask *> PTask::getListSucc(){
return listSuccessors;
}
QList<PTask *> PTask::getListPred(){
return listPredecessors;
}
void PTask::resetListSucc(){
this->listSuccessors.clear();
numberSuccessors =0;
numberLinkSuccessors =0;
}
void PTask::resetListPred(){
numberPredecessors=0;
numberLinkPredecessors =0;
}