Advertisement
Guest User

automate.h

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