Files
qad/piqt_utils/qpiconnection.h
2020-04-30 16:07:01 +03:00

51 lines
1.5 KiB
C++

/*
PIQt Utils - Qt utilites for PIP
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QPICONNECTION_H
#define QPICONNECTION_H
#include <QObject>
#include <QMetaObject>
#include "piconnection.h"
#include "qpiconfig.h"
#include "piqt.h"
class QPIConnection: public QObject, public PIConnection {
Q_OBJECT
PIOBJECT_SUBCLASS(QPIConnection, PIConnection)
public:
QPIConnection(const QString & name = QString());
bool loadFromCMFile(const QString & file);
protected:
void propertyChanged(const PIString & ) {setObjectName(PI2QString(name()));}
EVENT_HANDLER2(void, piDataRec, const PIString &, from, const PIByteArray &, data);
EVENT_HANDLER2(void, piPacketRec, const PIString &, from, const PIByteArray &, data);
public slots:
signals:
void qDataReceivedEvent(QString from, QByteArray data);
void qPacketReceivedEvent(QString from, QByteArray data);
};
#endif // QPICONNECTION_H