forked from PLCnext/CppExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPG_ReactToNotification.hpp
71 lines (56 loc) · 2.13 KB
/
PG_ReactToNotification.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
///////////////////////////////////////////////////////////////////////////////"
//
// Copyright PHOENIX CONTACT Electronics GmbH
//
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include "Arp/System/Core/Arp.h"
#include "Arp/Plc/Commons/Esm/ProgramBase.hpp"
#include "Arp/System/Commons/Logging.h"
#include "COMP_Notifications.hpp"
namespace NotificationExample
{
using namespace Arp;
using namespace Arp::System::Commons::Diagnostics::Logging;
using namespace Arp::Plc::Commons::Esm;
//#program
//#component(NotificationExample::COMP_Notifications)
class PG_ReactToNotification : public ProgramBase, private Loggable<PG_ReactToNotification>
{
public: // typedefs
public: // construction/destruction
PG_ReactToNotification(NotificationExample::COMP_Notifications& cOMP_NotificationsArg, const String& name);
PG_ReactToNotification(const PG_ReactToNotification& arg) = delete;
virtual ~PG_ReactToNotification() = default;
public: // operators
PG_ReactToNotification& operator=(const PG_ReactToNotification& arg) = delete;
public: // properties
public: // operations
void Execute() override;
public: /* Ports
=====
Ports are defined in the following way:
//#port
//#attributes(Input|Retain)
//#name(NameOfPort)
boolean portField;
The attributes comment define the port attributes and is optional.
The name comment defines the name of the port and is optional. Default is the name of the field.
*/
//#port
//#attributes(Output)
uint16 OP_uiInfoValue = 0;
//#port
//#attributes(Output)
uint16 OP_uiWarningValue = 0;
private: // fields
NotificationExample::COMP_Notifications& cOMP_Notifications;
};
///////////////////////////////////////////////////////////////////////////////
// inline methods of class ProgramBase
inline PG_ReactToNotification::PG_ReactToNotification(NotificationExample::COMP_Notifications& cOMP_NotificationsArg, const String& name)
: ProgramBase(name)
, cOMP_Notifications(cOMP_NotificationsArg)
{
}
} // end of namespace NotificationExample