51 lines
868 B
C++
Executable File
51 lines
868 B
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* TTCI-Server Library - handler for a specific TTCI channel
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Patric Karwat, NLS, 2019-01-17
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
namespace TrainingAreaBaseOC
|
|
{
|
|
class Device;
|
|
|
|
// a single TTCI channel
|
|
class Channel : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
Channel(QChar channel, bool bIsBinary, QObject *parent = nullptr);
|
|
|
|
void setDevice(Device *dev);
|
|
|
|
bool writeData(const QByteArray &data);
|
|
|
|
QChar channel() const { return m_channel; }
|
|
|
|
signals:
|
|
void dataAvailable(const QByteArray &);
|
|
void disconnectedFromEq();
|
|
|
|
|
|
protected slots:
|
|
void onDeviceDestroyed();
|
|
void onDataAvailable(const QByteArray &data);
|
|
|
|
protected:
|
|
QChar m_channel;
|
|
bool m_bIsBinary;
|
|
Device *m_device;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
} // namespace TrainingAreaBaseOC
|