Faulhaber Serial Com Test  Version 1
A Qt interface to test Faulhaber MCBL 3006 motion controller
FaulhaberSerialComTestWidget.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * <Serial Com Test - Control of Faulhaber motor through serial port.>
3  * Copyright (C) 2015 B. Véron
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  ****************************************************************************/
18 
19 #ifndef FAULHABER_SERIAL_COM_TEST_WIDGET_H
20 #define FAULHABER_SERIAL_COM_TEST_WIDGET_H
21 
22 // Local includes
23 #include "ui_FaulhaberSerialComTestWidget.h"
24 
25 // Qt includes
26 #include <QWidget>
27 
28 // Forward declarations
29 class FaulhaberSerial;
30 class ErrorHandler;
31 
32 
33 class FaulhaberSerialComTestWidget : public QWidget {
34  Q_OBJECT
35 
36 public:
37  FaulhaberSerialComTestWidget(QWidget* parent = NULL);
39 
40 public slots:
41  void sendCommand();
42  void checkParameters();
43  void stopRobot();
44 
45 protected:
46  bool sendRequest(QString pCommand);
47  bool receiveRequest(int& pData);
48  bool queryController(QString pQuery, int&pData);
49  int check(int motor, QString param, int expectedValue);
50 
51 private:
52  Ui::FaulhaberSerialComTestWidget ui;
53  QSharedPointer<FaulhaberSerial> mCOMPort;
54  QSharedPointer<ErrorHandler>mErrorHandler;
55 };
56 
57 #endif // FAULHABER_SERIAL_COM_TEST_WIDGET_H
58 
59 
60 //------------------------------------------------------------------------------------------------
61 // Doxygen comments:
62 
72 // * \author Baptiste Véron
73 // * \date 17/05/2016
74 // * \bug None for the moment...
75 // */
76 
85 // virtual ~FaulhaberSerialComTestWidget();
86 
Graphical interface for controlling Faulhaber MCBL 3006 Motion Controllers.
Definition: FaulhaberSerialComTestWidget.h:33
int check(int motor, QString param, int expectedValue)
Check the value of a parameter.
Definition: FaulhaberSerialComWidget.cpp:75
void stopRobot()
Stop all the motors.
Definition: FaulhaberSerialComWidget.cpp:169
QSharedPointer< FaulhaberSerial > mCOMPort
Serial COM port.
Definition: FaulhaberSerialComTestWidget.h:53
Class for handling all the errors that occur in the Lpr Control library.
Definition: ErrorHandler.h:27
bool sendRequest(QString pCommand)
Send a command to a controller.
Definition: FaulhaberSerialComWidget.cpp:180
void checkParameters()
Check the controllers parameters.
Definition: FaulhaberSerialComWidget.cpp:92
Ui::FaulhaberSerialComTestWidget ui
Graphical user interface.
Definition: FaulhaberSerialComTestWidget.h:52
bool queryController(QString pQuery, int &pData)
Send a command and get the answer.
Definition: FaulhaberSerialComWidget.cpp:217
QSharedPointer< ErrorHandler > mErrorHandler
Error handler.
Definition: FaulhaberSerialComTestWidget.h:54
FaulhaberSerialComTestWidget(QWidget *parent=NULL)
Constructor.
Definition: FaulhaberSerialComWidget.cpp:31
bool receiveRequest(int &pData)
Read the COM port.
Definition: FaulhaberSerialComWidget.cpp:208
void sendCommand()
Send a command to a controller.
Definition: FaulhaberSerialComWidget.cpp:60
virtual ~FaulhaberSerialComTestWidget()
Definition: FaulhaberSerialComWidget.cpp:55
Class for communicating with Faulhaber MCBL 3006 through serial COM ports.
Definition: FaulhaberSerial.h:36