73 lines
1.3 KiB
C++
Executable File
73 lines
1.3 KiB
C++
Executable File
/**
|
|
* Holen und Schreiben der XDR-Telegramme vom/an Can-Bus
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QByteArray>
|
|
#include <QDateTime>
|
|
#include <QVector>
|
|
#include <QList>
|
|
#include <QPair>
|
|
#include <QSettings>
|
|
|
|
#include <LtsUtilsCore/sfm_bytemessage_converter.h>
|
|
|
|
#include "logger.h"
|
|
#include "ttci_channel.h"
|
|
#include "ttci_device.h"
|
|
|
|
namespace TrainingAreaBaseOC
|
|
{
|
|
|
|
|
|
class ConnectionHandlerTcpTtci : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ConnectionHandlerTcpTtci();
|
|
~ConnectionHandlerTcpTtci();
|
|
|
|
bool init();
|
|
|
|
|
|
bool send(const LtsUtils::SfmMessage &message);
|
|
bool isOpen();
|
|
|
|
signals:
|
|
void dataSent();
|
|
void received(const LtsUtils::SfmMessage &message);
|
|
void disconnectedFromEq();
|
|
|
|
private:
|
|
void initCanSocket();
|
|
void newDataAvailable(const QByteArray &);
|
|
bool findNextSyncByte(int &iCurReadPos) const;
|
|
|
|
private slots:
|
|
void slotReadCanFrame(const QByteArray &data);
|
|
|
|
|
|
private:
|
|
QByteArray m_messageData;
|
|
bool m_messageDataStart;
|
|
QByteArray m_wirkfeldData;
|
|
bool m_wirkfeldDataStart;
|
|
quint32 m_wirkfeldMultiplex;
|
|
QVector<LtsUtils::SfmMessage *> m_sfmMessages;
|
|
bool m_sendingData;
|
|
qint32 m_segmentToggle;
|
|
QList<QPair<qint32, QByteArray> > m_dataToSend;
|
|
Device *m_canDevice;
|
|
Channel *m_canChannel;
|
|
QByteArray m_buffer;
|
|
LOGGER_T m_logger;
|
|
|
|
};
|
|
|
|
} //namespace
|