Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
QHyodaTcp.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*****************************************************************************
8 * QHyodaTcp.h (C) 2012 *
9 *****************************************************************************/
10#ifndef Q_HYODA_TCP_H
11#define Q_HYODA_TCP_H
12
13#include <QObject>
14#include <QtNetwork/QtNetwork>
15
16
17class QHyodaJob;
18
19class QHyodaTcp:public QObject {
20 Q_OBJECT
21public:
22 //Mathematica: BaseForm [Hash[ "...", "CRC32"], 16]
23 enum QHyodaTcpSwitch{
24 Sleeping,
25 MeshIceTHeader = 0xcbce69bcul,
26 MeshIceTImage = 0x73491278ul,
27 VariableName = 0xca6cd6f0ul,
28 HandShake = 0xe73b2e9cul,
29 Papi = 0xb80dd1a3ul,
30 MatrixIceTHeader = 0x78f78f67ul,
31 MatrixIceTImage = 0x2cd5e780ul
32 };
33public:
35 ~QHyodaTcp();
36public slots:
37 void acceptConnection();
38 void tcpReadyRead();
39 void displayError(QAbstractSocket::SocketError socketError);
40private:
41 void tcpSleeping();
42 void tcpHandShake();
43 void tcpVariableName();
44 void tcpMeshIceTHeader();
45 void tcpMeshIceTImage();
46 void tcpPapi();
47 void tcpMatrixIceTHeader();
48 void tcpMatrixIceTImage();
49private:
50 qint64 sendPacket(const char *data, qint64 maxSize);
51 void sendAcknowledgePacket(void);
52 void recvAcknowledgePacket(void);
53private:
54 QHyodaJob *job;
55 QTcpServer tcpServer;
56 QTcpSocket *tcpServerConnection;
57 quint32 iceWdth;
58 quint32 iceHght;
59 quint32 tcpImageBytes;
60 QImage *image,*matrix;
61 QByteArray *byteArray,*matrixArray;
62 QHyodaTcpSwitch state;
63 quint32 tcpPacketLength;
64};
65
66#endif // Q_HYODA_TCP_H