-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathUpCounterProgram.hpp
More file actions
58 lines (44 loc) · 1.53 KB
/
UpCounterProgram.hpp
File metadata and controls
58 lines (44 loc) · 1.53 KB
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
//
// Copyright (c) Phoenix Contact GmbH & Co. KG. All rights reserved.
// Licensed under the MIT. See LICENSE file in the project root for full license information.
//
#pragma once
#include "Arp/System/Core/Arp.h"
#include "Arp/Plc/Commons/Esm/ProgramBase.hpp"
#include "Arp/System/Commons/Logging.h"
#include "CounterComponent.hpp"
#include "Helpers/Enums.hpp"
namespace ProgramComponentInteraction
{
using namespace Arp;
using namespace Arp::System::Commons::Diagnostics::Logging;
using namespace Arp::Plc::Commons::Esm;
//#program
//#component(ProgramComponentInteraction::CounterComponent)
class UpCounterProgram : public ProgramBase, private Loggable<UpCounterProgram>
{
public: // typedefs
public: // construction/destruction
UpCounterProgram(ProgramComponentInteraction::CounterComponent& counterComponentArg, const String& name);
public: // operators
public: // properties
public: // operations
void Execute() override;
private: // fields
ProgramComponentInteraction::CounterComponent& counterComponent;
private: // fields
Progress progress = Progress::Done;
public:
//#port
//#attributes(Output|Retain)
//#name(UP_Counter)
uint8 OP_Counter = 0;
};
///////////////////////////////////////////////////////////////////////////////
// inline methods of class ProgramBase
inline UpCounterProgram::UpCounterProgram(ProgramComponentInteraction::CounterComponent& counterComponentArg, const String& name)
: ProgramBase(name)
, counterComponent(counterComponentArg)
{
}
} // end of namespace ProgramComponentInteraction