2017-07-03 09:30:10 +02:00
|
|
|
/*!
|
|
|
|
* \brief Controller for an external PersoSim process.
|
|
|
|
*
|
2017-12-20 14:54:05 +01:00
|
|
|
* \copyright Copyright (c) 2014-2017 Governikus GmbH & Co. KG, Germany
|
2017-07-03 09:30:10 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QProcess>
|
2017-12-20 14:54:05 +01:00
|
|
|
#include <QTcpSocket>
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
namespace governikus
|
|
|
|
{
|
|
|
|
|
|
|
|
class PersoSimController
|
|
|
|
: public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PersoSimController();
|
2017-12-20 14:54:05 +01:00
|
|
|
~PersoSimController() = default;
|
2017-07-03 09:30:10 +02:00
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
bool isEnabled() const;
|
2017-07-03 09:30:10 +02:00
|
|
|
bool init();
|
2017-12-20 14:54:05 +01:00
|
|
|
bool write(const QByteArray& pData);
|
|
|
|
bool shutdown();
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
private:
|
2017-12-20 14:54:05 +01:00
|
|
|
QProcess* mProcess;
|
|
|
|
const QSharedPointer<QTcpSocket> mSocket;
|
2017-07-03 09:30:10 +02:00
|
|
|
|
2017-12-20 14:54:05 +01:00
|
|
|
bool startProcess();
|
|
|
|
void newData();
|
2017-07-03 09:30:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace governikus */
|