PLCnext API Documentation 25.0.2.69
PnStationStatePayload.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6
7#pragma once
8
9
10#include "Arp/System/Core/Arp.h"
11#include "Arp/System/Nm/SpecializedPayload.hpp"
12#include "Arp/System/NmPayload/Io/ProfinetStack/PnStationType.hpp"
13#include <tuple>
14
15
16namespace Arp { namespace System { namespace NmPayload { namespace Io { namespace ProfinetStack
17{
18
19
21class ARP_CXX_SYMBOL_EXPORT PnStationStatePayload : public Arp::System::Nm::SpecializedPayload<PnStationStatePayload>
22{
23public:
25 using ArgumentsType = std::tuple<const char*, PnStationType, bool, bool>;
27 explicit PnStationStatePayload(const ArgumentsType& args);
29 const String& componentName, PnStationType stationType, bool bfLed, bool sfLed);
30 String GetComponentName() const;
31 PnStationType GetStationType() const;
32 bool GetBfLed() const;
33 bool GetSfLed() const;
34
35private:
36 String GetFormatstring(bool bfLed, bool sfLed) const;
37 String LedStateToString(bool state) const;
38
39private:
40 // Do not change the order of the field initialization!
41 const size_t indexComponentName = this->AddField<String>();
42 const size_t indexStationType = this->AddField<PnStationType>();
43 const size_t indexBfLed = this->AddField<bool>();
44 const size_t indexSfLed = this->AddField<bool>();
45};
46
47
48}}}}} // namespace Arp::System::NmPayload::Io::ProfinetStack
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
Payload class for state changes of PROFINET LEDs
Definition: PnStationStatePayload.hpp:22
std::tuple< const char *, PnStationType, bool, bool > ArgumentsType
ArgumentsType to be used with NonBlockingNotificationRegistration3
Definition: PnStationStatePayload.hpp:25
Base class for custom Payload classes
Definition: SpecializedPayload.hpp:44
SpecializedPayload(const Notification &notification)
Creates a view on a Notification object
Definition: SpecializedPayload.hpp:211
Root namespace for the PLCnext API