/src/opendnp3/cpp/lib/src/outstation/SimpleCommandHandler.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2013-2022 Step Function I/O, LLC |
3 | | * |
4 | | * Licensed to Green Energy Corp (www.greenenergycorp.com) and Step Function I/O |
5 | | * LLC (https://stepfunc.io) under one or more contributor license agreements. |
6 | | * See the NOTICE file distributed with this work for additional information |
7 | | * regarding copyright ownership. Green Energy Corp and Step Function I/O LLC license |
8 | | * this file to you under the Apache License, Version 2.0 (the "License"); you |
9 | | * may not use this file except in compliance with the License. You may obtain |
10 | | * a copy of the License at: |
11 | | * |
12 | | * http://www.apache.org/licenses/LICENSE-2.0 |
13 | | * |
14 | | * Unless required by applicable law or agreed to in writing, software |
15 | | * distributed under the License is distributed on an "AS IS" BASIS, |
16 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
17 | | * See the License for the specific language governing permissions and |
18 | | * limitations under the License. |
19 | | */ |
20 | | #include "opendnp3/outstation/SimpleCommandHandler.h" |
21 | | |
22 | | namespace opendnp3 |
23 | | { |
24 | | |
25 | | SimpleCommandHandler::SimpleCommandHandler(CommandStatus status) |
26 | 9.43k | : status(status), numOperate(0), numSelect(0), numStart(0), numEnd(0) |
27 | 9.43k | { |
28 | 9.43k | } |
29 | | |
30 | | void SimpleCommandHandler::Begin() |
31 | 863 | { |
32 | 863 | ++numStart; |
33 | 863 | } |
34 | | |
35 | | void SimpleCommandHandler::End() |
36 | 863 | { |
37 | 863 | ++numEnd; |
38 | 863 | } |
39 | | |
40 | | CommandStatus SimpleCommandHandler::Select(const ControlRelayOutputBlock& command, uint16_t index) |
41 | 1.02k | { |
42 | 1.02k | this->DoSelect(command, index); |
43 | 1.02k | ++numSelect; |
44 | 1.02k | return status; |
45 | 1.02k | } |
46 | | CommandStatus SimpleCommandHandler::Operate(const ControlRelayOutputBlock& command, |
47 | | uint16_t index, |
48 | | IUpdateHandler& handler, |
49 | | OperateType opType) |
50 | 1.51k | { |
51 | 1.51k | this->DoOperate(command, index, opType); |
52 | 1.51k | ++numOperate; |
53 | 1.51k | return status; |
54 | 1.51k | } |
55 | | |
56 | | CommandStatus SimpleCommandHandler::Select(const AnalogOutputInt16& command, uint16_t index) |
57 | 5.85k | { |
58 | 5.85k | this->DoSelect(command, index); |
59 | 5.85k | ++numSelect; |
60 | 5.85k | return status; |
61 | 5.85k | } |
62 | | CommandStatus SimpleCommandHandler::Operate(const AnalogOutputInt16& command, |
63 | | uint16_t index, |
64 | | IUpdateHandler& handler, |
65 | | OperateType opType) |
66 | 11.7k | { |
67 | 11.7k | this->DoOperate(command, index, opType); |
68 | 11.7k | ++numOperate; |
69 | 11.7k | return status; |
70 | 11.7k | } |
71 | | |
72 | | CommandStatus SimpleCommandHandler::Select(const AnalogOutputInt32& command, uint16_t index) |
73 | 2.60k | { |
74 | 2.60k | this->DoSelect(command, index); |
75 | 2.60k | ++numSelect; |
76 | 2.60k | return status; |
77 | 2.60k | } |
78 | | CommandStatus SimpleCommandHandler::Operate(const AnalogOutputInt32& command, |
79 | | uint16_t index, |
80 | | IUpdateHandler& handler, |
81 | | OperateType opType) |
82 | 3.31k | { |
83 | 3.31k | this->DoOperate(command, index, opType); |
84 | 3.31k | ++numOperate; |
85 | 3.31k | return status; |
86 | 3.31k | } |
87 | | |
88 | | CommandStatus SimpleCommandHandler::Select(const AnalogOutputFloat32& command, uint16_t index) |
89 | 2.61k | { |
90 | 2.61k | this->DoSelect(command, index); |
91 | 2.61k | ++numSelect; |
92 | 2.61k | return status; |
93 | 2.61k | } |
94 | | CommandStatus SimpleCommandHandler::Operate(const AnalogOutputFloat32& command, |
95 | | uint16_t index, |
96 | | IUpdateHandler& handler, |
97 | | OperateType opType) |
98 | 4.11k | { |
99 | 4.11k | this->DoOperate(command, index, opType); |
100 | 4.11k | ++numOperate; |
101 | 4.11k | return status; |
102 | 4.11k | } |
103 | | |
104 | | CommandStatus SimpleCommandHandler::Select(const AnalogOutputDouble64& command, uint16_t index) |
105 | 2.66k | { |
106 | 2.66k | this->DoSelect(command, index); |
107 | 2.66k | ++numSelect; |
108 | 2.66k | return status; |
109 | 2.66k | } |
110 | | CommandStatus SimpleCommandHandler::Operate(const AnalogOutputDouble64& command, |
111 | | uint16_t index, |
112 | | IUpdateHandler& handler, |
113 | | OperateType opType) |
114 | 2.51k | { |
115 | 2.51k | this->DoOperate(command, index, opType); |
116 | 2.51k | ++numOperate; |
117 | 2.51k | return status; |
118 | 2.51k | } |
119 | | |
120 | | } // namespace opendnp3 |