TTPA (Écran)  1.1
BTS SN-IR La Salle Avignon 2018
ihm.h
Aller à la documentation de ce fichier.
00001 /*===================================
00002 
00003 Taille table de tenis:  x = 152.5 cm
00004                         y = 137 cm
00005 
00006 Taille d'une case:      x = 50.83
00007                         y = 45.66
00008 
00009 =====================================*/
00010 
00011 #ifndef IHM_H
00012 #define IHM_H
00013 
00026 #include <QWidget>
00027 #include <QThread>
00028 #include <QDebug>
00029 #include <unistd.h>
00030 #include <stdio.h>
00031 #include "ui_ihm.h"
00032 #include "const.h"
00033 #include "table.h"
00034 #include "trame.h"
00035 #include <cstdint>
00036 
00037 #define PORT_BLUETOOTH  "rfcomm0"
00038 
00039 //===================================
00040 
00041 namespace Ui {class CIhm;}
00042 
00043 class CommunicationBluetooth;
00044 class CTrame;
00045 class CTable;
00046 
00057 class CIhm : public QWidget, public Ui::CIhm
00058 {
00059     Q_OBJECT
00060     
00061 public:
00062     explicit CIhm(QWidget *parent = 0);
00063     float getRatioFenetreX(); 
00064     float getRatioFenetreY();
00071     void rafraichirCSS(float ratio);
00072     ~CIhm();
00073 
00074 public slots:
00075     void rafraichirCSS(); 
00082     void setInfoConnect(QString nom);
00089     void setNomPeripherique(QString nom);
00096     void setLayerEcran(uint8_t layer);
00102     void commencerSeance();
00108     void finirSeance();
00114     void pauserSeance();
00120     void reprendreSeance();
00126     void resetSeance();
00133     void impacterZone(uint8_t zone);
00139     void balleEnJeu();
00146     void setZoneRobot(uint8_t zone);
00153     void setZoneObjectif(uint8_t zone);
00160     void setBallesMaximum(int balles);
00161     void rafraichirHeure(); 
00162     void rafraichirTimerSeance(); 
00163     void quitter(); 
00165 private:
00166     QString ballesTotalSurBallesMaximum(); 
00167     void connecterSignaux(); 
00169     void initialisationStats(); 
00170     void rafraichirStats(); 
00172     void raccourcisClavier();  
00173     void gererArguments();  
00175     QString calculerPourcentageQString(int x,int y); 
00177     void setTimerSeance(unsigned int iTemps = 0); 
00178     QString getTimerSeanceString(unsigned int iTemps);
00179 
00180     CommunicationBluetooth* m_pCommunicationBluetooth; 
00181     QThread*                m_pThreadCommunicationBluetooth; 
00182     CTable*                 m_pTable; 
00183     CTrame*                 m_pTrame;
00184     QFont                   m_font;
00185     QFont                   m_fontSmall;
00186     QFont                   m_fontNormal;
00187     QFont                   m_fontNom;
00188     QString                 m_fontNoirStyle;
00189     QString                 m_fontRougeStyle;
00190     QString                 m_fontVertStyle;
00191     QString                 m_fontTitreStyle;
00192 
00193     unsigned int            m_iTempsSeance; 
00195     QTimer* m_pTimerHeure; 
00196     QTimer* m_pTimerSeance; 
00198 private slots:
00199     void initialisationFenetre(); 
00200     void setLayerEcranLogo(); 
00201     void setLayerEcranTable(); 
00202     void setLayerEcranRecap(); 
00203     void deconnecterJoueur(); 
00204     void connecterJoueur(); 
00206     //==========
00207     // DEBUG
00208     void impacterRandom(); 
00209     void setZoneRobotRandom(); 
00210     void setZoneObjectifRandom(); 
00211     void setInfoConnectDemo(); 
00212     void setNomPeripheriqueDemo(); 
00213     void envoyerCommande(); 
00214     void activerConsole(); 
00215 };
00216 
00217 #endif // IHM_H
 Tout Classes Fichiers Fonctions Variables Énumérations Valeurs énumérées Macros