Advertisement
Guest User

automate.h

a guest
Oct 31st, 2013
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. #ifndef AUTOMATE_H
  2. #define AUTOMATE_H
  3.  
  4. #include <QObject>
  5. #include <QTimer>
  6. #include <QString>
  7. #include <QFile>
  8. #include <QSignalMapper>
  9. #include <QAction>
  10. #include <QMenu>
  11. #include <QtSerialPort/QSerialPort>
  12. #include <QtSerialPort/QSerialPortInfo>
  13. #include <QMessageBox>
  14. #include <QWidget>
  15. #include <QVBoxLayout>
  16. #include <QLabel>
  17.  
  18. #include <qextserialport.h>
  19. #include <qextserialenumerator.h>
  20. #include "tableau.h"
  21. #include "mainwindow.h"
  22.  
  23. class MainWindow;
  24.  
  25. class Automate : QObject
  26. {
  27. Q_OBJECT
  28.  
  29. public:
  30. explicit Automate();
  31. ~Automate();
  32.  
  33. QextSerialPort *serialPort;
  34.  
  35. bool flagComStarted;
  36. bool sortieTOR[8];
  37. int indiceSortieTOR;
  38. QString etatConnexion;
  39.  
  40. void initialisation();
  41. QString configurationPort();
  42. void detectionPortCOM();
  43. void selectPort(QString name);
  44. void startCom();
  45. Tableau* configurationPortCheckBox();
  46.  
  47.  
  48. void sendTrameWriteModBus(char adrSlave, char CodeCommande, int adresseData, int nbrData, Tableau* tableau);
  49. void envoiTrame(Tableau* bufferEmission);
  50.  
  51.  
  52. void addCRC16(Tableau *tableau, int longueur);
  53. bool testCRC16(Tableau *tableau, int longueur);
  54. Tableau* tableauEnvoye;
  55.  
  56.  
  57. void action_DetectionPortCOM();
  58. void action_DebutCommunication();
  59. void action_Chenillard();
  60. void action_StopChenillard();
  61. void action_Connexion();
  62. void action_LED1();
  63. void action_LED2();
  64. void action_LED3();
  65. void action_LED4();
  66. void action_LED5();
  67. void action_LED6();
  68. void action_LED7();
  69. void action_LED8();
  70. void action_Quitter();
  71. void action_LireTrame();
  72.  
  73. signals:
  74. void workReady();
  75.  
  76. private slots:
  77. void timerRepetTicks();
  78. void timerRecepTicks();
  79. void timerChenillardTicks();
  80.  
  81. void onDataAvailable();
  82.  
  83. private:
  84. int valueTimer;
  85. QList<QextPortInfo> ports;
  86. QString portCOMName;
  87. int nombreTotPortCOM;
  88. QList<QAction *> actions;
  89. QSignalMapper *signalMapper;
  90.  
  91. QTimer *timerRepet;
  92. QTimer *timerRecep;
  93. QTimer *timerChenillard;
  94.  
  95. MainWindow *m_interface;
  96. };
  97.  
  98. #endif // AUTOMATE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement