Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- MainWindow::MainWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::MainWindow)
- {
- ui->setupUi(this);
- automate = new Automate;
- }
- MainWindow::~MainWindow()
- {
- delete ui;
- }
- /*====================================================================================================================================================
- *
- * Partie Gestion des bouton poussoir present sur l'IHM
- *
- *
- *===================================================================================================================================================*/
- void MainWindow::on_pushButton_DetectionPortCOM_clicked()
- {
- /*==============================
- * Description : Fonction qui permet de savoir quel port peuvent être utiliser pour
- * la communication serie, donne differentes informations
- *
- * Created : 25/09/2013 - 16:30
- *
- * Notes : Cette fonction (premiere partie) n'a pas été réalisé par moi, ceci est un simple
- * copier/coller d'une fonction exemple que vous pourrez trouvez
- * a cette adresse: C:\Qt\Qt5.1.1\5.1.1\mingw48_32\examples\serialport\enumerator
- * (exemple pour l'utilisation de QSerialPort)
- *=============================*/
- //Premiere partie
- QWidget *FenetreDetectionPort = new QWidget;
- FenetreDetectionPort->setWindowTitle(QObject::tr("Info about all available serial ports."));
- QVBoxLayout *layout = new QVBoxLayout;
- foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
- QString s = QObject::tr("Port: ") + info.portName() + "\n"
- + QObject::tr("Location: ") + info.systemLocation() + "\n"
- + QObject::tr("Description: ") + info.description() + "\n"
- + QObject::tr("Manufacturer: ") + info.manufacturer() + "\n"
- + QObject::tr("Vendor Identifier: ") + (info.hasVendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : QString()) + "\n"
- + QObject::tr("Product Identifier: ") + (info.hasProductIdentifier() ? QString::number(info.productIdentifier(), 16) : QString()) + "\n"
- + QObject::tr("Busy: ") + (info.isBusy() ? QObject::tr("Yes") : QObject::tr("No")) + "\n";
- QLabel *label = new QLabel(s);
- layout->addWidget(label);
- }
- FenetreDetectionPort->setLayout(layout);
- FenetreDetectionPort->show();
- }
- void MainWindow::on_pushButton_Connexion_clicked()
- {
- /*=========================================
- * Description : Traitement à faire lors d'un click sur le bouton : activation
- * des boutons et émission d'un Signal de connexion
- *
- * Created : 26/09/2013 - 08:23
- * Notes :
- *=========================================*/
- automate->action_Connexion();
- }
- void MainWindow::on_pushButton_DebutCommunication_clicked()
- {
- /*=========================================
- * Description : Traitement à faire lors d'un click sur le bouton : activation
- * des boutons et émission d'un Signal de connexion
- *
- * Created : 26/09/2013 - 08:45
- * Notes :
- *=========================================*/
- automate->action_DebutCommunication();
- }
- void MainWindow::on_pushButton_Chenillard_clicked()
- {
- /*=========================================
- * Description : Traitement à faire lors d'un click sur le bouton : lance
- * le timer contrôlant le chenillard
- *
- * Created : 26/09/2013 - 08:48
- * Notes :
- *=========================================*/
- automate->action_Chenillard(); // démarrage du timer du chenillard
- }
- void MainWindow::on_pushButton_StopChenillard_clicked()
- {
- /*=========================================
- * Description : Traitement à faire lors d'un click sur le bouton : arrete
- * le timer contrôlant le chenillard
- *
- * Created : 26/09/2013 - 15:42
- * Notes :
- *=========================================*/
- automate->action_StopChenillard(); // arret du timer du chenillard
- }
- void MainWindow::on_pushButton_LireTrame_clicked()
- {
- /*=========================================
- * Description : Traitement à faire lors d'un click sur le bouton : lance
- * la lecture des données
- *
- * Created : 26/09/2013 - 08:50
- * Notes :
- *=========================================*/
- automate->action_LireTrame();
- }
- void MainWindow::on_pushButton_Quitter_clicked()
- {
- /*=========================================
- * Description : Traitement à faire lors d'un click sur le bouton : quitte
- * l'application
- *
- * Created : 26/09/2013 - 08:53
- * Notes :
- *=========================================*/
- automate->action_Quitter();
- }
- void MainWindow::on_pushButton_LED1_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED1, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED1();
- }
- void MainWindow::on_pushButton_LED2_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED2, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED2();
- }
- void MainWindow::on_pushButton_LED3_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED3, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED3();
- }
- void MainWindow::on_pushButton_LED4_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED4, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED4();
- }
- void MainWindow::on_pushButton_LED5_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED5, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED5();
- }
- void MainWindow::on_pushButton_LED6_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED6, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED6();
- }
- void MainWindow::on_pushButton_LED7_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED7, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED7();
- }
- void MainWindow::on_pushButton_LED8_clicked()
- {
- /*=========================================
- * Description : Lorsque l'on appuie sur le pushButon LED8, la LED
- * doit s'allumer ou s'éteindre
- *
- * Created : 26/09/2013 - 16:00
- * Notes :
- *=========================================*/
- automate->action_LED8();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement