Groom  1.1
BTS SNIR LaSalle Avignon 2021
IHMGroom.cpp
Aller à la documentation de ce fichier.
1 #include "IHMGroom.h"
2 #include "ui_IHMGroom.h"
3 
19 IHMGroom::IHMGroom(QWidget *parent) : QMainWindow(parent), uiIHMGroom(new Ui::IHMGroom), etatGroom(EtatGroom::Libre), etatSonnette(EtatSonnette::Active), etatPresence(EtatPresence::Arret), sonnetteOff(":sonnette-off.png"), sonnetteOn(":sonnette-on.png")
20 {
21  qDebug() << Q_FUNC_INFO;
22  uiIHMGroom->setupUi(this);
24 
26 
28 
30 
32 
33  #ifdef TEST_NOTIFICATION
34  connect(uiIHMGroom->boutonPoussoirSonnette, SIGNAL(clicked(bool)), this, SLOT(testerNotification()));
35  #endif
36 }
37 
45 {
47 
48  delete uiIHMGroom;
49  qDebug() << Q_FUNC_INFO;
50 }
51 
58 void IHMGroom::closeEvent(QCloseEvent *event)
59 {
60  if (iconeSysteme->isVisible())
61  {
63  {
64  QMessageBox::information(this, "IHMGroom", "Le programme continue à s'éxécuter. Utiliser le menu Quitter pour mettre fin à l'application.");
66  }
67  hide();
68  event->ignore();
69  }
70 }
71 
78 {
79  // Crée les actions
80  actionMinimiser = new QAction(QString::fromUtf8("Minimiser"), this);
81  actionMaximiser = new QAction(QString::fromUtf8("Maximiser"), this);
82  actionRestaurer = new QAction(QString::fromUtf8("Restaurer"), this);
83  actionQuitter = new QAction(QString::fromUtf8("&Quitter"), this);
84  barreEtat = statusBar();
85  calendrier = new Calendrier(this);
86  uiIHMGroom->widgetCalendrier->setMinimumDate(QDate(1900, 1, 1));
87  uiIHMGroom->widgetCalendrier->setMaximumDate(QDate(3000, 1, 1));
88  uiIHMGroom->widgetCalendrier->setGridVisible(true);
89  QMenu *fileMenu = new QMenu(tr("&Fichier"), this);
90  menuBar()->addMenu(fileMenu);
91  fileMenu->addAction(tr("&Ouvrir un fichier de calendrier"), this, SLOT(ouvrirFichier()), QKeySequence::New);
92  fileMenu->addAction(tr("&Ouvrir un calendrier avec une URL"), this, SLOT(ouvrirURL()), QKeySequence::Open);
93  fileMenu->addAction(tr("&Effacer"), this, SLOT(effacer()), QKeySequence(tr("Suppr", "Suppression")));
94  fileMenu->addAction(tr("&Quitter"), qApp, SLOT(quit()), QKeySequence::Quit);
95  menuBar()->setStyleSheet("background-color: rgb(176, 193, 173);");
96 
97  // Connecte les actions
98  connect(actionMinimiser, SIGNAL(triggered(bool)), this, SLOT(hide()));
99  connect(actionMaximiser, SIGNAL(triggered(bool)), this, SLOT(showMaximized()));
100  connect(actionRestaurer, SIGNAL(triggered(bool)), this, SLOT(showNormal()));
101  connect(actionQuitter, SIGNAL(triggered(bool)), qApp, SLOT(quit()));
102 
103  // Crée le menu
104  menuIconeSysteme = new QMenu(this);
105  menuIconeSysteme->addAction(actionMinimiser);
106  menuIconeSysteme->addAction(actionMaximiser);
107  menuIconeSysteme->addAction(actionRestaurer);
108  menuIconeSysteme->addSeparator();
109  menuIconeSysteme->addAction(actionQuitter);
110 
111  // Crée l'icône pour la barre de tâche
112  iconeSysteme = new QSystemTrayIcon(this);
113  iconeSysteme->setContextMenu(menuIconeSysteme);
114  iconeSysteme->setToolTip("Groom");
115  QIcon icone(":/groom.png");
116  iconeSysteme->setIcon(icone);
117  setWindowIcon(icone);
118 
119  connect(iconeSysteme, SIGNAL(messageClicked()), this, SLOT(acquitterNotification()));
120  //connect(iconeSysteme, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(aActiveIconeSysteme(QSystemTrayIcon::ActivationReason)));
121 
122  iconeSysteme->show();
124 }
125 
134 void IHMGroom::afficherNotification(QString titre, QString message, QSystemTrayIcon::MessageIcon icone, int duree)
135 {
136  //QIcon icone(":/groom.png");
137  iconeSysteme->showMessage(titre, message, icone, duree); // duree en ms
138  /*
139  QSystemTrayIcon::NoIcon
140  QSystemTrayIcon::Information
141  QSystemTrayIcon::Warning
142  QSystemTrayIcon::Critical
143  */
144 }
145 
152 {
153  qDebug() << Q_FUNC_INFO;
154 }
155 
156 #ifdef TEST_NOTIFICATION
157 
162 void IHMGroom::testerNotification()
163 {
164  afficherNotification("Groom", "Quelqu'un a sonné !");
165 }
166 #endif
167 
174 {
175  uiIHMGroom->listeBluetooth->clear();
176  uiIHMGroom->boutonRechercherBluetooth->setEnabled(true);
177  uiIHMGroom->labelEtatConnexion->setText("État : déconnecté");
178  uiIHMGroom->boutonConnecterBluetooth->setEnabled(false);
179  uiIHMGroom->boutonDeconnecterBluetooth->setEnabled(false);
180  connect(uiIHMGroom->boutonRechercherBluetooth, SIGNAL(clicked(bool)), this, SLOT(rechercherGroom()));
181  connect(uiIHMGroom->boutonConnecterBluetooth, SIGNAL(clicked(bool)), this, SLOT(connecterGroom()));
182  connect(uiIHMGroom->boutonDeconnecterBluetooth, SIGNAL(clicked(bool)), this, SLOT(deconnecterGroom()));
183 
184  connect(uiIHMGroom->boutonEnvoyerOccupant, SIGNAL(clicked(bool)), this, SLOT(envoyerAffichageOccupant()));
185 
186  uiIHMGroom->lineEditNom->setPlaceholderText("Nom");
187  uiIHMGroom->lineEditPrenom->setPlaceholderText("Prénom");
188  uiIHMGroom->lineEditFonction->setPlaceholderText("Fonction");
189  uiIHMGroom->zoneTexteMessage->setPlaceholderText("Message à afficher");
190  uiIHMGroom->boutonEnvoyerOccupant->setEnabled(false);
191  uiIHMGroom->lineEditNom->setEnabled(false);
192  uiIHMGroom->lineEditPrenom->setEnabled(false);
193  uiIHMGroom->lineEditFonction->setEnabled(false);
194  uiIHMGroom->listeOccupant->setEnabled(false);
195  uiIHMGroom->boutonViderFormulaire->setEnabled(false);
196  uiIHMGroom->zoneTexteMessage->setEnabled(false);
197  uiIHMGroom->boutonEnvoyerMessage->setEnabled(false);
198  uiIHMGroom->boutonRadioLibre->setEnabled(false);
199  uiIHMGroom->boutonRadioOccupe->setEnabled(false);
200  uiIHMGroom->boutonRadioAbsent->setEnabled(false);
201  uiIHMGroom->boutonRadioEntrer->setEnabled(false);
202  uiIHMGroom->boutonPoussoirSonnette->setEnabled(false);
203  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(false);
204 
205  uiIHMGroom->boutonAjouterOccupant->setEnabled(false);
206  uiIHMGroom->boutonEditerOccupant->setEnabled(false);
207  uiIHMGroom->boutonSupprimerOccupant->setEnabled(false);
208  connect(uiIHMGroom->listeOccupant, SIGNAL(activated(int)), this, SLOT(selectionnerOccupant(int)));
209  connect(uiIHMGroom->boutonAjouterOccupant, SIGNAL(clicked(bool)), this, SLOT(ajouterOccupant()));
210  connect(uiIHMGroom->boutonEditerOccupant, SIGNAL(clicked(bool)), this, SLOT(modifierOccupant()));
211  connect(uiIHMGroom->boutonSupprimerOccupant, SIGNAL(clicked(bool)), this, SLOT(supprimerOccupant()));
212  connect(uiIHMGroom->boutonRadioLibre, SIGNAL(clicked(bool)), this, SLOT(envoyerEtatLibre()));
213  connect(uiIHMGroom->boutonRadioAbsent, SIGNAL(clicked(bool)), this, SLOT(envoyerEtatAbsent()));
214  connect(uiIHMGroom->boutonRadioOccupe, SIGNAL(clicked(bool)), this, SLOT(envoyerEtatOccupe()));
215  uiIHMGroom->boutonRadioEntrer->setEnabled(false);
216  connect(uiIHMGroom->boutonRadioEntrer, SIGNAL(clicked(bool)), this, SLOT(envoyerEtatEntrer()));
217  uiIHMGroom->boutonPoussoirSonnette->setEnabled(false);
218  connect(uiIHMGroom->boutonPoussoirSonnette, SIGNAL(clicked(bool)), this, SLOT(envoyerEtatSonnette()));
219  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(false);
220  connect(uiIHMGroom->boutonActiverDesactiverPresence, SIGNAL(clicked(bool)), this, SLOT(envoyerEtatPresence()));
221  connect(uiIHMGroom->boutonEnvoyerMessage, SIGNAL(clicked(bool)), this, SLOT(envoyerMessageOccupant()));
222  connect(uiIHMGroom->widgetCalendrier, SIGNAL(clicked(QDate)), this, SLOT(selectionnerDate(QDate)));
223  connect(uiIHMGroom->boutonViderFormulaire, SIGNAL(clicked(bool)), this, SLOT(viderFormulaire()));
224 
225  connect(communicationGroom, SIGNAL(groomDetecte(QString,QString)), this, SLOT(detecterGroom(QString,QString)));
226  connect(communicationGroom, SIGNAL(connexionGroom(QString,QString)), this, SLOT(afficherConnexionGroom(QString,QString)));
227  connect(communicationGroom, SIGNAL(deconnexionGroom(QString,QString)), this, SLOT(afficherDeconnexionGroom(QString,QString)));
228  connect(communicationGroom, SIGNAL(rechercheTerminee()), this, SLOT(arreterRechercheGroom()));
229  connect(communicationGroom, SIGNAL(actualiserEtats(int,int,int,int,int)), this, SLOT(actualiserIndicateurs(int,int,int,int,int)));
230 }
231 
239 {
240  QUrl
241  hostURL("https://calendar.google.com/calendar/ical/robertutilisateur84%40gmail.com/private-ab9f00fcf91e8c05d89d6e5c8a1234f7/basic.ics");
242  requete.setUrl(hostURL);
243  requete.setRawHeader("User-Agent", "CalendarClient_ICS");
244  requete.setRawHeader("Depth", "0");
245  requete.setRawHeader("Prefer", "return-minimal");
246  requete.setRawHeader("Content-Type", "text/xml; charset=utf-8");
247  requete.setRawHeader("Content-Length", "0");
248 
249  QSslConfiguration configuration = requete.sslConfiguration();
250  configuration.setPeerVerifyMode(QSslSocket::VerifyNone);
251  requete.setSslConfiguration(configuration);
252 
254 
255  if (networkReply != nullptr)
256  {
257  connect(networkReply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(handleHTTPError()));
258  connect(networkReply, SIGNAL(finished()), this, SLOT(traiterRequete()));
259  }
260 }
261 
263 {
264  if (networkReply != nullptr)
265  {
266  QBuffer buffer(this);
267  buffer.setData(networkReply->readAll());
268 
269  buffer.open(QIODevice::ReadOnly);
270  bool trouve = false;
271  do
272  {
273  QString ligne = buffer.readLine();
274  if (!ligne.isNull())
275  {
276  if (ligne.startsWith("X-WR-CALNAME"))
277  {
278  QString nomCalendrier = ligne.trimmed();
279  nomCalendrier.remove(";LANGUAGE=fr", Qt::CaseInsensitive);
280  nomCalendrier.remove("X-WR-CALNAME:", Qt::CaseInsensitive);
281  trouve = true;
282  }
283  }
284  }
285  while (!buffer.atEnd() && !trouve);
286  buffer.seek(0);
287  buffer.close();
288 
289  //contenuCalendrier = new QTextStream(buffer.data());
290 
291  // ...
292  }
293 }
294 
302 {
303  if(occupants.size() < 1)
304  return;
305  indexOccupant = index + 1;
306  qDebug() << Q_FUNC_INFO << "Occupant courant" << indexOccupant;
307  uiIHMGroom->lineEditNom->setText(occupants[index].nom);
308  uiIHMGroom->lineEditPrenom->setText(occupants[index].prenom);
309  uiIHMGroom->lineEditFonction->setText(occupants[index].fonction);
310  uiIHMGroom->boutonAjouterOccupant->setEnabled(true);
311  uiIHMGroom->boutonEditerOccupant->setEnabled(true);
312  uiIHMGroom->boutonSupprimerOccupant->setEnabled(true);
313 }
314 
321 {
322  if(!(uiIHMGroom->lineEditNom->text() == "" || uiIHMGroom->lineEditPrenom->text() == "" || uiIHMGroom->lineEditFonction->text() == ""))
323  {
324  if((!uiIHMGroom->lineEditNom->text().isEmpty() || !uiIHMGroom->lineEditPrenom->text().isEmpty() || !uiIHMGroom->lineEditFonction->text().isEmpty()) && ((uiIHMGroom->lineEditNom->text() != occupants[uiIHMGroom->listeOccupant->currentIndex()].nom) || (uiIHMGroom->lineEditPrenom->text() != occupants[uiIHMGroom->listeOccupant->currentIndex()].prenom) || (uiIHMGroom->lineEditFonction->text() != occupants[uiIHMGroom->listeOccupant->currentIndex()].fonction)))
325  {
326  qDebug() << Q_FUNC_INFO;
327  QString contenuNom = uiIHMGroom->lineEditNom->text();
328  QString contenuPrenom = uiIHMGroom->lineEditPrenom->text();
329  QString contenuFonction = uiIHMGroom->lineEditFonction->text();
330 
331  Occupant nouveau(contenuNom, contenuPrenom, contenuFonction);
332  occupants.push_back(nouveau);
333  uiIHMGroom->listeOccupant->setCurrentIndex(uiIHMGroom->listeOccupant->findText(uiIHMGroom->listeOccupant->currentText()));
334 
336  }
337 
338  if(uiIHMGroom->lineEditNom->text() == uiIHMGroom->listeOccupant->findText(uiIHMGroom->listeOccupant->currentText()))
339  {
340  uiIHMGroom->lineEditNom->clear();
341  uiIHMGroom->lineEditPrenom->clear();
342  uiIHMGroom->lineEditFonction->clear();
343  }
344  }
345  else
346  {
347  QSystemTrayIcon::MessageIcon icone = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Information);
348  afficherNotification("Groom", "Complétez tous les champs du formulaire !", icone);
349  }
350 }
351 
358 {
359  if(!(uiIHMGroom->lineEditNom->text() == "" || uiIHMGroom->lineEditPrenom->text() == "" || uiIHMGroom->lineEditFonction->text() == ""))
360  {
361  qDebug() << Q_FUNC_INFO << uiIHMGroom->listeOccupant->currentIndex() << indexOccupant;
362 
363  if((!uiIHMGroom->lineEditNom->text().isEmpty() || !uiIHMGroom->lineEditPrenom->text().isEmpty() || !uiIHMGroom->lineEditFonction->text().isEmpty()) && ((uiIHMGroom->lineEditNom->text() != occupants[uiIHMGroom->listeOccupant->currentIndex()].nom) || (uiIHMGroom->lineEditPrenom->text() != occupants[uiIHMGroom->listeOccupant->currentIndex()].prenom) || (uiIHMGroom->lineEditFonction->text() != occupants[uiIHMGroom->listeOccupant->currentIndex()].fonction)))
364  {
365  QString contenuNom = uiIHMGroom->lineEditNom->text();
366  QString contenuPrenom = uiIHMGroom->lineEditPrenom->text();
367  QString contenuFonction = uiIHMGroom->lineEditFonction->text();
368 
369  // modifier l'objet Occupant qui EST dans le QVector
370  occupants[uiIHMGroom->listeOccupant->currentIndex()].nom = contenuNom;
371  occupants[uiIHMGroom->listeOccupant->currentIndex()].prenom = contenuPrenom;
372  occupants[uiIHMGroom->listeOccupant->currentIndex()].fonction = contenuFonction;
373 
374  uiIHMGroom->listeOccupant->setItemText(uiIHMGroom->listeOccupant->currentIndex(), occupants[uiIHMGroom->listeOccupant->currentIndex()].nom + " " + occupants[uiIHMGroom->listeOccupant->currentIndex()].prenom + " - " + occupants[uiIHMGroom->listeOccupant->currentIndex()].fonction);
375  }
376  }
377  else
378  {
379  QSystemTrayIcon::MessageIcon icone = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Information);
380  afficherNotification("Groom", "Complétez tous les champs du formulaire !", icone);
381  }
382 }
383 
390 {
391  qDebug() << Q_FUNC_INFO << uiIHMGroom->listeOccupant->currentIndex() << indexOccupant;
392 
393  occupants.removeAt(uiIHMGroom->listeOccupant->currentIndex());
394  uiIHMGroom->listeOccupant->view()->update();
395 
397 
398  uiIHMGroom->lineEditNom->clear();
399  uiIHMGroom->lineEditPrenom->clear();
400  uiIHMGroom->lineEditFonction->clear();
401 }
402 
410 void IHMGroom::detecterGroom(QString nomPeripherique, QString adressePeripherique)
411 {
412  QString module = nomPeripherique + " [" + adressePeripherique + "]";
413  qDebug() << Q_FUNC_INFO << module;
414 
415  // déjà présent dans la liste ?
416  if(uiIHMGroom->listeBluetooth->findText(module) == -1)
417  {
418  uiIHMGroom->listeBluetooth->addItem(module);
419  uiIHMGroom->boutonConnecterBluetooth->setEnabled(true);
420  }
421 }
422 
429 {
430  qDebug() << Q_FUNC_INFO;
432 }
433 
440 {
441  qDebug() << Q_FUNC_INFO;
443  int Groom = 1;
444  int Sonnette = 0;
445  int Presence = 0;
446  int ModeSonnette = 0;
447  int ModePresence = 0;
450 }
451 
458 void IHMGroom::afficherConnexionGroom(QString nomPeripherique, QString adressePeripherique)
459 {
460  qDebug() << Q_FUNC_INFO << nomPeripherique << adressePeripherique;
461  uiIHMGroom->listeBluetooth->setEnabled(false);
462  uiIHMGroom->boutonRechercherBluetooth->setEnabled(false);
463  uiIHMGroom->boutonConnecterBluetooth->setEnabled(false);
464  uiIHMGroom->boutonDeconnecterBluetooth->setEnabled(true);
465  uiIHMGroom->labelEtatConnexion->setText("État : connecté");
466 
467  uiIHMGroom->boutonEnvoyerOccupant->setEnabled(true);
468  uiIHMGroom->lineEditNom->setEnabled(true);
469  uiIHMGroom->lineEditPrenom->setEnabled(true);
470  uiIHMGroom->lineEditFonction->setEnabled(true);
471  uiIHMGroom->listeOccupant->setEnabled(true);
472  uiIHMGroom->boutonViderFormulaire->setEnabled(true);
473  uiIHMGroom->zoneTexteMessage->setEnabled(true);
474  uiIHMGroom->boutonEnvoyerMessage->setEnabled(true);
475  uiIHMGroom->boutonRadioLibre->setEnabled(true);
476  uiIHMGroom->boutonRadioOccupe->setEnabled(true);
477  uiIHMGroom->boutonRadioAbsent->setEnabled(true);
478  uiIHMGroom->boutonRadioEntrer->setEnabled(true);
479  uiIHMGroom->boutonPoussoirSonnette->setEnabled(true);
480  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(true);
481  uiIHMGroom->boutonAjouterOccupant->setEnabled(true);
482  uiIHMGroom->boutonSupprimerOccupant->setEnabled(true);
483  uiIHMGroom->boutonEditerOccupant->setEnabled(true);
484  uiIHMGroom->boutonRadioLibre->setChecked(true);
486  int Groom = 0;
487  int Sonnette = 0;
488  int Presence = 0;
489  int ModeSonnette = 1;
490  int ModePresence = 0;
492  uiIHMGroom->labelSonnette->setPixmap(sonnetteOn.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
493 
494  int index = uiIHMGroom->listeOccupant->currentIndex();
495  selectionnerOccupant(index);
496 }
497 
504 void IHMGroom::afficherDeconnexionGroom(QString nomPeripherique, QString adressePeripherique)
505 {
506  qDebug() << Q_FUNC_INFO << nomPeripherique << adressePeripherique;
507  uiIHMGroom->listeBluetooth->setEnabled(true);
508  uiIHMGroom->boutonRechercherBluetooth->setEnabled(true);
509  uiIHMGroom->boutonConnecterBluetooth->setEnabled(true);
510  uiIHMGroom->boutonDeconnecterBluetooth->setEnabled(false);
511  uiIHMGroom->labelEtatConnexion->setText("État : déconnecté");
512 
513  uiIHMGroom->boutonEnvoyerOccupant->setEnabled(false);
514  uiIHMGroom->lineEditNom->setEnabled(false);
515  uiIHMGroom->lineEditPrenom->setEnabled(false);
516  uiIHMGroom->lineEditFonction->setEnabled(false);
517  uiIHMGroom->listeOccupant->setEnabled(false);
518  uiIHMGroom->boutonViderFormulaire->setEnabled(false);
519  uiIHMGroom->zoneTexteMessage->setEnabled(false);
520  uiIHMGroom->boutonEnvoyerMessage->setEnabled(false);
521  uiIHMGroom->boutonRadioLibre->setEnabled(false);
522  uiIHMGroom->boutonRadioOccupe->setEnabled(false);
523  uiIHMGroom->boutonRadioAbsent->setEnabled(false);
524  uiIHMGroom->boutonRadioEntrer->setEnabled(false);
525  uiIHMGroom->boutonPoussoirSonnette->setEnabled(false);
526  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(false);
527  uiIHMGroom->boutonAjouterOccupant->setEnabled(false);
528  uiIHMGroom->boutonSupprimerOccupant->setEnabled(false);
529  uiIHMGroom->boutonEditerOccupant->setEnabled(false);
530  uiIHMGroom->labelEtatSonnette->setText("État : ...");
531  uiIHMGroom->labelEtatPresence->setText("État : ...");
532  uiIHMGroom->labelSonnette->setAutoFillBackground(true);
533  uiIHMGroom->labelSonnette->clear();
534  uiIHMGroom->boutonRadioAbsent->setChecked(true);
535  uiIHMGroom->lineEditNom->setText("");
536  uiIHMGroom->lineEditPrenom->setText("");
537  uiIHMGroom->lineEditFonction->setText("");
538 }
539 
545 {
546  if(occupants.size() < 1)
547  return;
548  qDebug() << Q_FUNC_INFO << "Occupant courant" << indexOccupant << uiIHMGroom->listeOccupant->currentIndex();
549  qDebug() << Q_FUNC_INFO << occupants[uiIHMGroom->listeOccupant->currentIndex()].nom << occupants[uiIHMGroom->listeOccupant->currentIndex()].prenom << occupants[uiIHMGroom->listeOccupant->currentIndex()].fonction;
553  QString trame = "$AFFICHAGE;" + occupants[uiIHMGroom->listeOccupant->currentIndex()].nom + ";" + occupants[uiIHMGroom->listeOccupant->currentIndex()].prenom + ";" + occupants[uiIHMGroom->listeOccupant->currentIndex()].fonction + "\r\n";
554  communicationGroom->envoyer(trame);
555 }
556 
562 {
566  communicationGroom->envoyer(trame);
567 
569  {
570  uiIHMGroom->boutonPoussoirSonnette->setEnabled(true);
571  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(true);
572  uiIHMGroom->boutonRadioEntrer->setEnabled(true);
573 
574  int Groom = 0;
575  int Sonnette = 0;
576  int Presence = 0;
577  int ModeSonnette = 1;
578  int ModePresence = 0;
580  }
581 }
582 
588 {
591  communicationGroom->envoyer(trame);
592 
594  {
595  uiIHMGroom->boutonPoussoirSonnette->setEnabled(false);
596  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(false);
597  uiIHMGroom->boutonRadioEntrer->setEnabled(false);
598 
600  {
602  uiIHMGroom->labelSonnette->setPixmap(sonnetteOff.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
603  }
604 
606  communicationGroom->envoyer(trame);
607 
609  {
611  }
612 
614  communicationGroom->envoyer(trame);
615 
616  int Groom = 3;
617  int Sonnette = 0;
618  int Presence = 0;
619  int ModeSonnette = 0;
620  int ModePresence = 0;
622  }
623 }
624 
630 {
633  communicationGroom->envoyer(trame);
634 
636  {
637  uiIHMGroom->boutonPoussoirSonnette->setEnabled(false);
638  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(false);
639  uiIHMGroom->boutonRadioEntrer->setEnabled(false);
640 
642  {
644  uiIHMGroom->labelSonnette->setPixmap(sonnetteOff.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
645  }
646 
648  communicationGroom->envoyer(trame);
649 
651  {
653  }
654 
656  communicationGroom->envoyer(trame);
657 
658  int Groom = 2;
659  int Sonnette = 0;
660  int Presence = 0;
661  int ModeSonnette = 0;
662  int ModePresence = 0;
664  }
665 }
666 
672 {
675  communicationGroom->envoyer(trame);
676 
678  {
679  uiIHMGroom->boutonPoussoirSonnette->setEnabled(false);
680  uiIHMGroom->boutonActiverDesactiverPresence->setEnabled(false);
681 
683  {
685  uiIHMGroom->labelSonnette->setPixmap(sonnetteOff.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
686  }
687 
689  communicationGroom->envoyer(trame);
690 
692  {
694  }
695 
697  communicationGroom->envoyer(trame);
698 
699  int Groom = 0;
700  int Sonnette = 0;
701  int Presence = 0;
702  int ModeSonnette = 0;
703  int ModePresence = 0;
705  }
706 }
707 
713 {
714  QString trame;
716  {
718  uiIHMGroom->labelSonnette->setPixmap(sonnetteOff.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
719  }
721  {
723  uiIHMGroom->labelSonnette->setPixmap(sonnetteOn.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
724  }
725 
727  communicationGroom->envoyer(trame);
728 }
729 
735 {
736  QString trame;
738  {
740  }
742  {
744  }
745 
747  communicationGroom->envoyer(trame);
748 }
749 
755 {
756  QString trame = communicationGroom->fabriquerTrameMessageOccupant(uiIHMGroom->zoneTexteMessage->text());
757  communicationGroom->envoyer(trame);
758 
760  {
761  uiIHMGroom->zoneTexteMessage->clear();
762 
763  QStringList listeChamps = trame.split(";");
764  QString chaineChampMessage = listeChamps[1];
765  QString nouvelleChaineChampMessage = chaineChampMessage.remove('\n');
766 
767  if(listeChamps[1] != "\r\n")
768  {
769  uiIHMGroom->labelAffichageMessageOccupant->setText("Message affiché : \"" + nouvelleChaineChampMessage + "\"");
770  }
771  else if(listeChamps[1] == "\r\n")
772  {
773  uiIHMGroom->labelAffichageMessageOccupant->setText("Aucun message affiché");
774  }
775  }
776 }
777 
784 {
785  // Fichier de stockage des noms, prénoms et fonctions des occupants de la pièce
786  QString nomFichier = QApplication::applicationDirPath() + "/parametres.ini";
787  qDebug() << Q_FUNC_INFO << nomFichier;
788  QSettings settings(nomFichier, QSettings::IniFormat);
789 
790  int nbOccupants = settings.value("NbOccupants", 0).toInt();
791  qDebug() << Q_FUNC_INFO << "NbOccupants" << nbOccupants;
792  indexOccupant = settings.value("Occupant", 0).toInt();
793  qDebug() << Q_FUNC_INFO << "Occupant courant" << indexOccupant;
794 
795  uiIHMGroom->listeOccupant->clear();
796  for(int i = 0; i < nbOccupants; i++)
797  {
798  QString nomOccupant = "Occupant" + QString::number(i+1);
799  settings.beginGroup(nomOccupant);
800  qDebug() << Q_FUNC_INFO << nomOccupant << settings.value("Nom").toString() << settings.value("Prenom").toString() << settings.value("Fonction").toString();
801  Occupant occupant;
802  occupant.nom = settings.value("Nom").toString();
803  occupant.prenom = settings.value("Prenom").toString();
804  occupant.fonction = settings.value("Fonction").toString();
805  occupants.push_back(occupant);
806  settings.endGroup();
807  uiIHMGroom->listeOccupant->addItem(occupant.nom + " " + occupant.prenom + " - " + occupant.fonction);
808  }
809  uiIHMGroom->listeOccupant->setCurrentIndex(indexOccupant-1);
810 }
811 
818 {
819  // Fichier de stockage des noms, prénoms et fonctions des occupants de la pièce
820  QString nomFichier = QApplication::applicationDirPath() + "/parametres.ini";
821  qDebug() << Q_FUNC_INFO << nomFichier;
822  QSettings settings(nomFichier, QSettings::IniFormat);
823 
824  qDebug() << Q_FUNC_INFO << occupants.size();
825  for(int i = 0; i < occupants.size(); i++)
826  {
827  QString nomOccupant = "Occupant" + QString::number(i+1);
828  settings.beginGroup(nomOccupant);
829  settings.setValue("Nom", occupants[i].nom);
830  settings.setValue("Prenom", occupants[i].prenom);
831  settings.setValue("Fonction", occupants[i].fonction);
832  settings.endGroup();
833  }
834  settings.setValue("NbOccupants", occupants.size());
835  settings.setValue("Occupant", indexOccupant);
836 }
837 
844 {
845  uiIHMGroom->listeBluetooth->clear();
846  uiIHMGroom->listeBluetooth->setEnabled(false);
847  uiIHMGroom->boutonRechercherBluetooth->setEnabled(false);
848  uiIHMGroom->boutonConnecterBluetooth->setEnabled(false);
849  uiIHMGroom->boutonDeconnecterBluetooth->setEnabled(false);
850  uiIHMGroom->labelEtatConnexion->setText("État : déconnecté");
851 
853 }
854 
861 {
862  uiIHMGroom->listeBluetooth->setEnabled(true);
863  uiIHMGroom->boutonRechercherBluetooth->setEnabled(true);
864  if(uiIHMGroom->listeBluetooth->count() > 0 )
865  uiIHMGroom->boutonConnecterBluetooth->setEnabled(true);
866  uiIHMGroom->boutonDeconnecterBluetooth->setEnabled(false);
867  uiIHMGroom->labelEtatConnexion->setText("État : déconnecté");
868 }
869 
876 {
877  disconnect(uiIHMGroom->listeOccupant, SIGNAL(currentIndexChanged(int)), this, SLOT(selectionnerOccupant(int)));
878  uiIHMGroom->listeOccupant->clear();
879  for(int i = 0; i < occupants.size(); i++)
880  {
881  uiIHMGroom->listeOccupant->addItem(occupants.at(i).nom + " " + occupants.at(i).prenom + " - " + occupants.at(i).fonction);
882  if (uiIHMGroom->lineEditNom->text() != '\0')
883  {
884  uiIHMGroom->listeOccupant->setCurrentIndex(i);
885  }
886  }
887 
888  connect(uiIHMGroom->listeOccupant, SIGNAL(currentIndexChanged(int)), this, SLOT(selectionnerOccupant(int)));
889 }
890 
897 {
898 
903  switch (Groom)
904  {
905  case EtatGroom::Libre:
906  uiIHMGroom->labelEtatOccupant->setText("État : libre");
907  break;
908  case EtatGroom::Absent:
909  uiIHMGroom->labelEtatOccupant->setText("État : absent");
910  break;
911  case EtatGroom::Occupe:
912  uiIHMGroom->labelEtatOccupant->setText("État : occupé");
913  break;
914  }
915 
920  switch (Sonnette)
921  {
923  break;
925  QSystemTrayIcon::MessageIcon icone = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Information);
926  afficherNotification("Groom", "Quelqu'un a sonné !", icone);
927  break;
928  }
929 
934  switch (Presence)
935  {
937  break;
939  QSystemTrayIcon::MessageIcon icone = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Information);
940  afficherNotification("Groom", "Présence détecté !", icone);
941  break;
942  }
943 
948  switch (ModeSonnette)
949  {
951  uiIHMGroom->labelEtatSonnette->setText("État : désactivé");
952  uiIHMGroom->labelSonnette->setPixmap(sonnetteOff.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
953  break;
955  uiIHMGroom->labelEtatSonnette->setText("État : activé");
956  uiIHMGroom->labelSonnette->setPixmap(sonnetteOn.scaled(uiIHMGroom->labelSonnette->width(), uiIHMGroom->labelSonnette->height(), Qt::KeepAspectRatio));
957  break;
958  }
959 
964  switch (ModePresence)
965  {
966  case EtatPresence::Arret:
967  uiIHMGroom->labelEtatPresence->setText("État : désactivé");
968  break;
970  uiIHMGroom->labelEtatPresence->setText("État : activé");
971  break;
972  }
973 }
974 
981 {
982  uiIHMGroom->lineEditNom->clear();
983  uiIHMGroom->lineEditPrenom->clear();
984  uiIHMGroom->lineEditFonction->clear();
985 }
986 
993 {
994  QString fileName; // QCoreApplication::applicationDirPath()
995 
996  if (fileName.isNull())
997  fileName = QFileDialog::getOpenFileName(this, tr("Ouvrir le fichier"), "", tr("Fichiers iCal (*.ics)"));
998 
999  if (!fileName.isEmpty())
1000  {
1001  afficherEtat(fileName, 5000);
1002  fileName.prepend("file://");
1003  calendrier->setHostURL(fileName);
1004  calendrier->charger();
1005  }
1006 }
1007 
1014 {
1015  bool ok = true;
1016  QString url = QInputDialog::getText(this, tr("Ouvrir un calendrier avec une URL"), tr("URL :"), QLineEdit::Normal, "", &ok);
1017  //QString url = "https://calendar.google.com/calendar/ical/robertutilisateur84%40gmail.com/private-ab9f00fcf91e8c05d89d6e5c8a1234f7/basic.ics";
1018  if (ok && !url.isEmpty())
1019  {
1020  afficherEtat(url, 5000);
1021  calendrier->setHostURL(url);
1022  calendrier->charger();
1023  }
1024  uiIHMGroom->labelAffichageEvenements->clear();
1025 }
1026 
1032 void IHMGroom::afficherEtat(QString message)
1033 {
1034  barreEtat->showMessage(message);
1035 }
1036 
1042 void IHMGroom::afficherEtat(QString message, int duree)
1043 {
1044  barreEtat->showMessage(message, duree);
1045 }
1046 
1053 {
1054  barreEtat->clearMessage();
1055 }
1056 
1063 {
1064  //effacerEtat();
1065  effacerEvenement();
1066 }
1067 
1074 {
1075  uiIHMGroom->evenement->clear();
1076 }
1077 
1084 {
1085  qDebug() << __FUNCTION__ << date;
1086  effacerEvenement();
1087  QList<Evenement> listeEvenements = calendrier->getEvenements(date);
1088  foreach(Evenement evt, listeEvenements)
1089  {
1090  qDebug() << __FUNCTION__ << evt;
1091  QString dtStart = evt.getAttribut("dtstart");
1092  QString dtEnd = evt.getAttribut("dtend");
1093  bool ok;
1094  QDateTime debutEvenement = Evenement::convertirHorodatage(dtStart, ok);
1095  QDateTime finEvenement = Evenement::convertirHorodatage(dtEnd, ok);
1096  QDateTime dts = QDateTime(debutEvenement.date(), debutEvenement.time(), Qt::UTC);
1097  qDebug() << dts.toTimeZone(QTimeZone("Europe/Paris"));
1098  QDateTime dte = QDateTime(finEvenement.date(), finEvenement.time(), Qt::UTC);
1099  qDebug() << dte.toTimeZone(QTimeZone("Europe/Paris"));
1100 
1101  if(ok)
1102  {
1103  qDebug() << Q_FUNC_INFO << "summary" << evt.getAttribut("summary");
1104 
1105  qDebug() << Q_FUNC_INFO << "dtstart" << dtStart << dts.toTimeZone(QTimeZone("Europe/Paris")).toString("HH:mm");
1106  if(dts.toTimeZone(QTimeZone("Europe/Paris")).time().minute() == 0)
1107  {
1108  qDebug() << Q_FUNC_INFO << "dtstart" << dtStart << dts.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'");
1109  uiIHMGroom->evenement->append("L'événement \"" + evt.getAttribut("summary") + "\" est noté du " + date.toString("dd/MM/yyyy") + " de " + dts.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'"));
1110  }
1111  else
1112  {
1113  qDebug() << Q_FUNC_INFO << "dtstart" << dtStart << dts.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'mm");
1114  uiIHMGroom->evenement->append("L'événement \"" + evt.getAttribut("summary") + "\" est noté du " + date.toString("dd/MM/yyyy") + " de " + dts.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'mm"));
1115  }
1116 
1117  qDebug() << Q_FUNC_INFO << "dtend" << dtStart << dte.toTimeZone(QTimeZone("Europe/Paris")).toString("HH:mm");
1118  if(dte.toTimeZone(QTimeZone("Europe/Paris")).time().minute() == 0)
1119  {
1120  qDebug() << Q_FUNC_INFO << "dtend" << dtStart << dte.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'");
1121  uiIHMGroom->evenement->append(" à " + dte.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'") + ".");
1122  }
1123  else
1124  {
1125  qDebug() << Q_FUNC_INFO << "dtend" << dtStart << dte.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'mm");
1126  uiIHMGroom->evenement->append(" à " + dte.toTimeZone(QTimeZone("Europe/Paris")).toString("h'h'mm") + ".");
1127  }
1128  }
1129  else
1130  {
1131  qDebug() << Q_FUNC_INFO << "dtstart" << dtStart << "Erreur conversion !";
1132  }
1133  }
1134 }
IHMGroom::actionMaximiser
QAction * actionMaximiser
L'action maximiser l'application.
Definition: IHMGroom.h:129
Calendrier::getEvenements
QList< Evenement > getEvenements(QDate date) const
Definition: Calendrier.cpp:76
Presence
@ Presence
Definition: CommunicationGroom.h:89
IHMGroom.h
Déclaration de la classe IHMGroom.
CommunicationGroom::fabriquerTrame
QString fabriquerTrame(EtatGroom etatGroom, EtatSonnette etatSonnette, EtatPresence etatPresence)
Méthode de fabrication de la trame "CMD".
Definition: CommunicationGroom.cpp:281
Sonnette
@ Sonnette
Definition: CommunicationGroom.h:88
IHMGroom::recupererRequeteCalendrier
void recupererRequeteCalendrier()
Méthode qui permet de sélectionner une date.
Definition: IHMGroom.cpp:238
IHMGroom::etatInitialIconeSysteme
bool etatInitialIconeSysteme
Booléen indiquant si c'est la première demande Quitter.
Definition: IHMGroom.h:132
EtatSonnette
EtatSonnette
Définit les différents états du mode Sonnette.
Definition: CommunicationGroom.h:63
IHMGroom::envoyerAffichageOccupant
void envoyerAffichageOccupant()
Méthode qui permet d'envoyer l'affichage de l'occupant vers le système groom.
Definition: IHMGroom.cpp:544
IHMGroom
Déclaration de la classe IHMGroom.
Definition: IHMGroom.h:47
CommunicationGroom::estConnecte
bool estConnecte()
Méthode pour valider la connexion ou non.
Definition: CommunicationGroom.cpp:143
IHMGroom::afficherEtat
void afficherEtat(QString message)
Méthode qui permet l'affichage d'un état (Calendrier)
Definition: IHMGroom.cpp:1032
IHMGroom::closeEvent
void closeEvent(QCloseEvent *event)
Méthode redéfinie qui est appelée automatiquement lors d'une demande de fermeture.
Definition: IHMGroom.cpp:58
IHMGroom::initialiserIconeSysteme
void initialiserIconeSysteme()
Méthode qui permet à l'application de s'installer dans la barre système.
Definition: IHMGroom.cpp:77
Arret
@ Arret
Definition: CommunicationGroom.h:75
IHMGroom::initialiserIHM
void initialiserIHM()
Initialise l'IHM GROOM.
Definition: IHMGroom.cpp:173
IHMGroom::rechercherGroom
void rechercherGroom()
Méthode qui permet de rechercher le périphérique groom voulu.
Definition: IHMGroom.cpp:843
Calendrier
Déclaration de la classe Calendrier.
Definition: Calendrier.h:38
QMainWindow
Evenement::getAttribut
QString getAttribut(QString nomAttribut) const
Definition: Evenement.cpp:65
IHMGroom::afficherDeconnexionGroom
void afficherDeconnexionGroom(QString nomPeripherique, QString adressePeripherique)
Méthode qui permet d'afficher l'état "déconnecté".
Definition: IHMGroom.cpp:504
Desactive
@ Desactive
Definition: CommunicationGroom.h:65
CommunicationGroom::deconnecter
void deconnecter()
Slot de déconnexion bluetooth.
Definition: CommunicationGroom.cpp:124
IHMGroom::barreEtat
QStatusBar * barreEtat
Pointeur vers la classe QStatusBar.
Definition: IHMGroom.h:136
IHMGroom::rechargerListeOccupants
void rechargerListeOccupants()
Recharge la liste d'occupants.
Definition: IHMGroom.cpp:875
IHMGroom::iconeSysteme
QSystemTrayIcon * iconeSysteme
L'icône de l'application pour la barre système.
Definition: IHMGroom.h:126
IHMGroom::ouvrirFichier
void ouvrirFichier()
Méthode qui permet l'ouverture d'un fichier de type .ics.
Definition: IHMGroom.cpp:992
Marche
@ Marche
Definition: CommunicationGroom.h:76
Occupe
@ Occupe
L'occupant est occupé
Definition: CommunicationGroom.h:35
IHMGroom::actionQuitter
QAction * actionQuitter
L'action quitter l'application.
Definition: IHMGroom.h:131
Calendrier::charger
void charger()
Definition: Calendrier.cpp:100
IHMGroom::envoyerEtatAbsent
void envoyerEtatAbsent()
Méthode qui permet d'envoyer l'état absent vers le système groom.
Definition: IHMGroom.cpp:587
IHMGroom::acquitterNotification
void acquitterNotification()
Acquitter les notifications.
Definition: IHMGroom.cpp:151
IHMGroom::IHMGroom
IHMGroom(QWidget *parent=nullptr)
Constructeur de la classe IHMGroom.
Definition: IHMGroom.cpp:19
Absent
@ Absent
L'occupant est absent.
Definition: CommunicationGroom.h:34
IHMGroom::detecterGroom
void detecterGroom(QString nomPeripherique, QString adressePeripherique)
Méthode déclenchée lorsque le module Bluetooth GROOM est détectée.
Definition: IHMGroom.cpp:410
IHMGroom::envoyerEtatPresence
void envoyerEtatPresence()
Méthode qui permet d'envoyer l'état du capteur de présence vers le système groom (le mode)
Definition: IHMGroom.cpp:734
IHMGroom::menuIconeSysteme
QMenu * menuIconeSysteme
Le menu de l'application.
Definition: IHMGroom.h:127
IHMGroom::chargerParametres
void chargerParametres()
Charge les paramètres dans le fichier .ini de l'application Groom.
Definition: IHMGroom.cpp:783
IHMGroom::envoyerEtatOccupe
void envoyerEtatOccupe()
Méthode qui permet d'envoyer l'état occupé vers le système groom.
Definition: IHMGroom.cpp:629
CommunicationGroom
Definition: CommunicationGroom.h:94
IHMGroom::envoyerEtatEntrer
void envoyerEtatEntrer()
Méthode qui permet d'envoyer l'état entrer vers le système groom.
Definition: IHMGroom.cpp:671
IHMGroom::networkManager
QNetworkAccessManager networkManager
Objet pour la classe QNetworkAccessManager.
Definition: IHMGroom.h:133
IHMGroom::communicationGroom
CommunicationGroom * communicationGroom
Pointeur vers l'objet communicationGroom de la classe CommunicationGroom.
Definition: IHMGroom.h:119
IHMGroom::indexOccupant
int indexOccupant
Index de l'occupant courant.
Definition: IHMGroom.h:118
IHMGroom::actualiserIndicateurs
void actualiserIndicateurs(int Groom, int Sonnette, int Presence, int ModeSonnette, int ModePresence)
Méthode qui permet d'actualiser les indicateurs d'états dans l'IHM (labels)
Definition: IHMGroom.cpp:896
IHMGroom::selectionnerOccupant
void selectionnerOccupant(int index)
Méthode qui permet de sélectionner un occupant.
Definition: IHMGroom.cpp:301
IHMGroom::networkReply
QNetworkReply * networkReply
Pointeur vers la classe QNetworkReply.
Definition: IHMGroom.h:135
IHMGroom::sauvegarderParametres
void sauvegarderParametres()
Sauvegarde les paramètres dans le fichier .ini de l'application Groom.
Definition: IHMGroom.cpp:817
IHMGroom::supprimerOccupant
void supprimerOccupant()
Méthode qui permet de supprimer un occupant.
Definition: IHMGroom.cpp:389
IHMGroom::effacerEvenement
void effacerEvenement()
Méthode qui permet d'effacer les événements affichés.
Definition: IHMGroom.cpp:1073
IHMGroom::sonnetteOn
QPixmap sonnetteOn
Icône sonnette en mode onn.
Definition: IHMGroom.h:124
IHMGroom::connecterGroom
void connecterGroom()
Méthode qui permet de se connecter au périphérique voulu.
Definition: IHMGroom.cpp:428
ModePresence
@ ModePresence
Definition: CommunicationGroom.h:91
Evenement
Déclaration de la classe Evenement.
Definition: Evenement.h:36
CommunicationGroom::connecter
void connecter()
Slot de connexion bluetooth.
Definition: CommunicationGroom.cpp:87
Occupant::fonction
QString fonction
Membre définissant la fonction de l'occupant.
Definition: Occupant.h:22
IHMGroom::sonnetteOff
QPixmap sonnetteOff
Icône sonnette en mode off.
Definition: IHMGroom.h:123
Entrez
@ Entrez
Ordre envoyé par l'occupant au groom.
Definition: CommunicationGroom.h:36
IHMGroom::ouvrirURL
void ouvrirURL()
Méthode qui permet l'ouverture d'un URL de type .ics.
Definition: IHMGroom.cpp:1013
EtatGroom
EtatGroom
Définit les différents états du groom.
Definition: CommunicationGroom.h:31
IHMGroom::effacer
void effacer()
Méthode qui appelle les méthodes d'effacement.
Definition: IHMGroom.cpp:1062
IHMGroom::actionMinimiser
QAction * actionMinimiser
L'action minimiser l'application.
Definition: IHMGroom.h:128
IHMGroom::afficherNotification
void afficherNotification(QString titre, QString message, QSystemTrayIcon::MessageIcon icone, int duree=1000)
Méthode qui permet d'afficher une notification système.
Definition: IHMGroom.cpp:134
Occupant::prenom
QString prenom
Membre définissant le prénom de l'occupant.
Definition: Occupant.h:21
Occupant::nom
QString nom
Membre définissant le nom de l'occupant.
Definition: Occupant.h:20
IHMGroom::calendrier
Calendrier * calendrier
Pointeur vers la classe Calendrier.
Definition: IHMGroom.h:137
ModeSonnette
@ ModeSonnette
Definition: CommunicationGroom.h:90
Detecte
@ Detecte
Definition: CommunicationGroom.h:56
Occupant
Structure qui définit les informations d'un occupant du bureau.
Definition: Occupant.h:18
Evenement::convertirHorodatage
static QDateTime convertirHorodatage(QString horodatage, bool &ok)
Definition: Evenement.cpp:87
CommunicationGroom::rechercher
void rechercher()
Méthode de recherche bluetooth.
Definition: CommunicationGroom.cpp:66
IHMGroom::deconnecterGroom
void deconnecterGroom()
Méthode qui permet de se déconnecter du périphérique voulu.
Definition: IHMGroom.cpp:439
Active
@ Active
Definition: CommunicationGroom.h:66
IHMGroom::selectionnerDate
void selectionnerDate(QDate date)
Méthode qui permet d'accéder et d'afficher les événements (Calendrier)
Definition: IHMGroom.cpp:1083
Ui
Definition: IHMGroom.h:37
EtatPresence
EtatPresence
Définit les différents états du mode Détecteur de présence.
Definition: CommunicationGroom.h:73
IHMGroom::envoyerEtatLibre
void envoyerEtatLibre()
Méthode qui permet d'envoyer l'état libre vers le système groom.
Definition: IHMGroom.cpp:561
IHMGroom::uiIHMGroom
Ui::IHMGroom * uiIHMGroom
Association vers l'interface utilisateur.
Definition: IHMGroom.h:116
IHMGroom::traiterRequete
void traiterRequete()
Definition: IHMGroom.cpp:262
IHMGroom::effacerEtat
void effacerEtat()
Méthode qui permet d'effacer un état (barre d'état)
Definition: IHMGroom.cpp:1052
IHMGroom::etatSonnette
EtatSonnette etatSonnette
Stockage état sonnette.
Definition: IHMGroom.h:121
IHMGroom::actionRestaurer
QAction * actionRestaurer
L'action restaurer l'application.
Definition: IHMGroom.h:130
PasSonne
@ PasSonne
Definition: CommunicationGroom.h:45
IHMGroom::~IHMGroom
~IHMGroom()
Destructeur de la classe IHMGroom.
Definition: IHMGroom.cpp:44
Libre
@ Libre
Le bureau de loccupant est libre d'accès.
Definition: CommunicationGroom.h:33
CommunicationGroom::envoyer
void envoyer(QString trame)
Méthode d'envoi de trame.
Definition: CommunicationGroom.cpp:265
IHMGroom::afficherConnexionGroom
void afficherConnexionGroom(QString nomPeripherique, QString adressePeripherique)
Méthode qui permet d'afficher l'état "connecté".
Definition: IHMGroom.cpp:458
IHMGroom::etatPresence
EtatPresence etatPresence
Stockage état présence.
Definition: IHMGroom.h:122
IHMGroom::envoyerEtatSonnette
void envoyerEtatSonnette()
Méthode qui permet d'envoyer l'état de la sonnette vers le système groom (le mode)
Definition: IHMGroom.cpp:712
NonDetecte
@ NonDetecte
Definition: CommunicationGroom.h:55
IHMGroom::occupants
QVector< Occupant > occupants
Conteneur pour les objets Occupant.
Definition: IHMGroom.h:117
IHMGroom::etatGroom
EtatGroom etatGroom
Stockage état groom.
Definition: IHMGroom.h:120
IHMGroom::envoyerMessageOccupant
void envoyerMessageOccupant()
Méthode qui permet d'envoyer un message de la part de l'occupant vers le système groom.
Definition: IHMGroom.cpp:754
Calendrier::setHostURL
bool setHostURL(const QString hostURL)
Definition: Calendrier.cpp:29
IHMGroom::modifierOccupant
void modifierOccupant()
Méthode qui permet d'ajouter un occupant.
Definition: IHMGroom.cpp:357
CommunicationGroom::fabriquerTrameMessageOccupant
QString fabriquerTrameMessageOccupant(QString messageOccupant)
Méthode de fabrication de la trame "MSGPERSO".
Definition: CommunicationGroom.cpp:304
ASonne
@ ASonne
Definition: CommunicationGroom.h:46
IHMGroom::arreterRechercheGroom
void arreterRechercheGroom()
Méthode qui permet d'arrêter la recherche du module groom.
Definition: IHMGroom.cpp:860
IHMGroom::viderFormulaire
void viderFormulaire()
Méthode qui permet de vider le formulaire (Occupant)
Definition: IHMGroom.cpp:980
IHMGroom::requete
QNetworkRequest requete
Objet pour la classe QNetworkRequest.
Definition: IHMGroom.h:134
IHMGroom::ajouterOccupant
void ajouterOccupant()
Definition: IHMGroom.cpp:320