QtPdCom  1.5.2
MessageImpl.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * Copyright (C) 2009-2024 Florian Pose <fp@igh.de>
4 *
5 * This file is part of the QtPdCom library.
6 *
7 * The QtPdCom library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * The QtPdCom library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with the QtPdCom Library. If not, see <http://www.gnu.org/licenses/>.
19 *
20 ****************************************************************************/
21
22#ifndef PD_MESSAGE_IMPL
23#define PD_MESSAGE_IMPL
24
25#include "Message.h"
26#include "MessageModelImpl.h"
27#include "ScalarVariable.h"
28
29#include <pdcom5/MessageManagerBase.h>
30
31#include <QObject>
32#include <QDomElement>
33#include <QMap>
34
35/****************************************************************************/
36
37namespace QtPdCom {
38
39class Message::Impl: public QObject
40{
41 Q_OBJECT
42
43 friend class Message;
44 friend class MessageModel;
45
46 public:
47 Impl(Message *);
48 ~Impl();
49
50 static QString
51 pathFromPlainXmlElement(QDomElement, const QString & = QString());
52 static int indexFromPlainXmlElement(QDomElement);
53
54 void fromPlainXmlElement(QDomElement, const QString & = QString());
55 void fromPdComMessage(const PdCom::Message &);
56
57 static QString timeString(quint64);
58
59 private:
61
63 QString path;
64 int index;
65 typedef QMap<QString, QString> TranslationMap;
68
71 bool announced;
72
73 void loadTranslations(QDomElement, TranslationMap &);
74
75 static Message::Type typeFromString(const QString &);
76
77 private slots:
78 void valueChanged();
79};
80
81} // namespace QtPdCom
82
83#endif
84
85/****************************************************************************/
Definition MessageImpl.h:40
QMap< QString, QString > TranslationMap
Definition MessageImpl.h:65
TranslationMap description
Description of the message.
Definition MessageImpl.h:67
Message *const parent
Definition MessageImpl.h:60
friend class MessageModel
Definition MessageImpl.h:44
static int indexFromPlainXmlElement(QDomElement)
Get the index.
Definition MessageImpl.cpp:73
void loadTranslations(QDomElement, TranslationMap &)
Processes a TextNode XML element.
Definition MessageImpl.cpp:187
void fromPlainXmlElement(QDomElement, const QString &=QString())
Constructor with XML element.
Definition MessageImpl.cpp:93
~Impl()
Destructor.
Definition MessageImpl.cpp:50
static Message::Type typeFromString(const QString &)
Converts a message type string to the appropriate Type.
Definition MessageImpl.cpp:215
friend class Message
Definition MessageImpl.h:43
MessageModel::Impl::MessageItem * currentItem
Definition MessageImpl.h:70
Type type
Message type.
Definition MessageImpl.h:62
TranslationMap text
Text of the message.
Definition MessageImpl.h:66
void fromPdComMessage(const PdCom::Message &)
Constructor with PdCom5 message.
Definition MessageImpl.cpp:128
QString path
Path of the process variable.
Definition MessageImpl.h:63
int index
Definition MessageImpl.h:64
DoubleVariable variable
Definition MessageImpl.h:69
void valueChanged()
Variable value changed.
Definition MessageImpl.cpp:237
static QString timeString(quint64)
Returns the message time as a string.
Definition MessageImpl.cpp:169
static QString pathFromPlainXmlElement(QDomElement, const QString &=QString())
Get the path.
Definition MessageImpl.cpp:57
bool announced
Already announced via anyMessage.
Definition MessageImpl.h:71
Type
Message type.
Definition Message.h:47
class Q_DECL_HIDDEN Impl
Definition Message.h:82
Definition BroadcastModel.h:32
ScalarVariable< double > DoubleVariable
Definition ScalarVariable.h:103
Definition MessageItem.h:38