|
|
|
@ -212,6 +212,22 @@ int max(int a, int b)
|
|
|
|
|
return (b);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int calculerDureeProjet(Tache **tachesTriees, int nbTaches)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int dureeProjet;
|
|
|
|
|
int finTache;
|
|
|
|
|
|
|
|
|
|
dureeProjet = 0;
|
|
|
|
|
for (i = 0; i < nbTaches; i++)
|
|
|
|
|
{
|
|
|
|
|
finTache = tachesTriees[i]->dateDebut + tachesTriees[i]->duree;
|
|
|
|
|
if (finTache > dureeProjet)
|
|
|
|
|
dureeProjet = finTache;
|
|
|
|
|
}
|
|
|
|
|
return (dureeProjet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------informations------------*/
|
|
|
|
|
|
|
|
|
|
// Retourne une liste des successeurs pour un travail donne
|
|
|
|
@ -239,6 +255,14 @@ Tache* trouverTache(Tache **tabTache, int nbTaches, char *nom)
|
|
|
|
|
return (NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void listerTachesRestantes(Tache **tachesTriees, int nbTaches, int date)
|
|
|
|
|
{
|
|
|
|
|
printf("Taches restantes a realiser :\n");
|
|
|
|
|
for (int i = 0; i < nbTaches; i++)
|
|
|
|
|
if (tachesTriees[i]->dateDebut >= date)
|
|
|
|
|
printf("Tache: %s\n", tachesTriees[i]->tache);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------affichages--------------*/
|
|
|
|
|
|
|
|
|
|
// Affiche les details d'un devis
|
|
|
|
@ -252,8 +276,9 @@ void displayDevis(Devis d)
|
|
|
|
|
void displayOffre(Offre *o)
|
|
|
|
|
{
|
|
|
|
|
trace("displayOffre");
|
|
|
|
|
printf("\n%s\n", o->travaux);
|
|
|
|
|
printf("%s\n", o->travaux);
|
|
|
|
|
displayListeDevis(o->ldevis);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Affiche les details de la liste de devis
|
|
|
|
@ -312,13 +337,22 @@ void afficherDevisEntreprise(Offre **tabTravaux)
|
|
|
|
|
void displayPrecedences(Precedence *tabP, int tlog)
|
|
|
|
|
{
|
|
|
|
|
trace("displayPrecedences");
|
|
|
|
|
int i;
|
|
|
|
|
printf("Liste des precedences :\n");
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < tlog; i++) {
|
|
|
|
|
for (i = 0; i < tlog; i++) {
|
|
|
|
|
printf("\t%s\t\t : \t%s\n", tabP[i].travauxPrec, tabP[i].travauxSucc);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherTaches(Tache **tachesTriees, int p_tmax)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
printf("Tâches triées par date de début :\n");
|
|
|
|
|
for (i = 0; i < p_tmax; i++)
|
|
|
|
|
printf("la tache: %s, debute : %d\n", tachesTriees[i]->tache, tachesTriees[i]->dateDebut);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Partie 4 (à trier)
|
|
|
|
|
|
|
|
|
|