ConOpSys V2970  P004.07
ANVILEX control operating system
Function_Block_Debounce_BOOL_1C.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Function_Block_Debounce_BOOL_1C.h
3 //! @brief Boolean signal debounce class header file.
4 //! @copyright ANVILEX GmbH
5 //! @attention No special attention requered.
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Blocks/Function_Block_Debounce.h $
7 //! $Revision: 2954 $
8 //! $Date: 2022-03-01 12:44:44 +0500 (Вт, 01 мар 2022) $
9 //! $Author: minch $
10 //!
11 //! COPYRIGHT(C) 2016-2022 ANVILEX GmbH
12 //!
13 //! Redistribution and use in source and binary forms, with or without
14 //! modification, are permitted provided that the following conditions are met:
15 //!
16 //! 1. Redistributions of source code must retain the above copyright notice,
17 //! this list of conditions and the following disclaimer.
18 //!
19 //! 2. Redistributions in binary form must reproduce the above copyright notice,
20 //! this list of conditions and the following disclaimer in the documentation
21 //! and/or other materials provided with the distribution.
22 //!
23 //! 3. Neither the name of ANVILEX nor the names of its contributors may be
24 //! used to endorse or promote products derived from this software without
25 //! specific prior written permission.
26 //!
27 //! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 //! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 //! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 //! ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31 //! LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 //! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 //! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 //! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 //! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 //! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 //! POSSIBILITY OF SUCH DAMAGE.
38 //------------------------------------------------------------------------------
39 
40 //------------------------------------------------------------------------------
41 //! @page Doxygen_Page_Function_Block_Database Debounce
42 //!
43 //! Debounce - function block description first line text.
44 //!
45 //! Debounce - function block ABS description second line text.
46 //------------------------------------------------------------------------------
47 
48 //------------------------------------------------------------------------------
49 // Protecting header files from mutual, recursive inclusion.
50 //------------------------------------------------------------------------------
51 
52 #pragma once
53 
54 //------------------------------------------------------------------------------
55 // Include standard libraries header files
56 //------------------------------------------------------------------------------
57 
58 //------------------------------------------------------------------------------
59 // Include thrid party header files
60 //------------------------------------------------------------------------------
61 
62 //------------------------------------------------------------------------------
63 // Include ConOpSys header files
64 //------------------------------------------------------------------------------
65 
66 #include "Function_Block_Base.h"
67 
68 //------------------------------------------------------------------------------
69 // Include ConOpSys application header files
70 //------------------------------------------------------------------------------
71 
72 //------------------------------------------------------------------------------
73 // Macros
74 //------------------------------------------------------------------------------
75 
76 //------------------------------------------------------------------------------
77 // Class declarations
78 //------------------------------------------------------------------------------
79 
80 //! @brief Boolean signal debounce class
82 {
83 
84  //----------------------------------------------------------------------------
85  // Public defines, methods and variables
86  //----------------------------------------------------------------------------
87 
88  public:
89 
90  //--------------------------------------------------------------------------
91  // Public methods
92  //--------------------------------------------------------------------------
93 
94  //!-------------------------------------------------------------------------
95  //! @brief Class constructor method.
96  //! @note None
97  //! \par Override
98  //! Not allowed
99  //! @attention Don't call this method directly.
100  //--------------------------------------------------------------------------
101 
103 
104  //!-------------------------------------------------------------------------
105  //! @brief Class constructor method.
106  //! @note None
107  //! \par Override
108  //! Not allowed
109  //! @attention Don't call this method directly.
110  //--------------------------------------------------------------------------
111 
113 
114  //!-------------------------------------------------------------------------
115  //! @brief Function block initialisation method.
116  //! @note None
117  //! \par Override
118  //! Not allowed
119  //! @attention Don't call this method directly.
120  //--------------------------------------------------------------------------
121 
122  VOID Init();
123 
124  //!-------------------------------------------------------------------------
125  //! @brief Function block cyclic execution method.
126  //! @note None
127  //! \par Override
128  //! Not allowed
129  //! @attention Don't call this method directly.
130  //--------------------------------------------------------------------------
131 
132  virtual VOID Execute();
133 
134  //--------------------------------------------------------------------------
135  // Public variables
136  //--------------------------------------------------------------------------
137 
138  //--------------------------------------------------------------------------
139  // Function block parameter connectors
140  //--------------------------------------------------------------------------
141 
142  //! @brief Function block sample time parameter. Value must be given in seconds.
144 
145  //! @brief Function block on and off delays parameter. Value must be given in seconds.
147 
148  //--------------------------------------------------------------------------
149  // Function block input connectors
150  //--------------------------------------------------------------------------
151 
152  //! @brief Function block input signal.
154 
155  //--------------------------------------------------------------------------
156  // Function block output connectors
157  //--------------------------------------------------------------------------
158 
159  //! @brief Function block output signal.
161 
162  //----------------------------------------------------------------------------
163  // Protected defines, methods and variables
164  //----------------------------------------------------------------------------
165 
166  protected:
167 
168  //----------------------------------------------------------------------------
169  // Private defines, methods and variables
170  //----------------------------------------------------------------------------
171 
172  private:
173 
174  //--------------------------------------------------------------------------
175  // Private defines
176  //--------------------------------------------------------------------------
177 
178  //! @brief Internal FSM state definition
179  typedef enum
180  {
181 
182  //! @brief Initialisation state
184 
185  //! @brief Off state
187 
188  //! @brief Off to on transaction state
190 
191  //! @brief On state
193 
194  //! @brief On to off transaction state
195  enum_On_Off
196 
198 
199  //--------------------------------------------------------------------------
200  // Private variables
201  //--------------------------------------------------------------------------
202 
203  //! @brief Function block internal FSM state variable
204  TGlobal_FSM_State enum_FSM_State = TGlobal_FSM_State::enum_Init;
205 
206  //! @brief Timeout counter
208 
209  //! @brief Delay time in task counts
211 
212 };
213 
214 //------------------------------------------------------------------------------
215 // End of file
216 //------------------------------------------------------------------------------
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
Function block base class header file.
Function block input connector class.
Definition: Block_Input_Connector.h:83
Function block output connector class.
Definition: Block_Output_Connector.h:59
Function block base class for device.
Definition: Function_Block_Base.h:96
Boolean signal debounce class.
Definition: Function_Block_Debounce_BOOL_1C.h:82
U32 u32_Delay
Delay time in task counts.
Definition: Function_Block_Debounce_BOOL_1C.h:210
TGlobal_FSM_State enum_FSM_State
Function block internal FSM state variable.
Definition: Function_Block_Debounce_BOOL_1C.h:204
TFunction_Block_Debounce_BOOL_1C()
Class constructor method.
Definition: Function_Block_Debounce_BOOL_1C.cpp:75
virtual ~TFunction_Block_Debounce_BOOL_1C()
Class constructor method.
Definition: Function_Block_Debounce_BOOL_1C.cpp:98
TBlock_Input_Connector object_f32_Delay
Function block on and off delays parameter. Value must be given in seconds.
Definition: Function_Block_Debounce_BOOL_1C.h:146
U32 u32_Timeout_Counter
Timeout counter.
Definition: Function_Block_Debounce_BOOL_1C.h:207
TBlock_Input_Connector object_f32_Sample_Time
Function block sample time parameter. Value must be given in seconds.
Definition: Function_Block_Debounce_BOOL_1C.h:143
VOID Init()
Function block initialisation method.
Definition: Function_Block_Debounce_BOOL_1C.cpp:106
TBlock_Output_Connector object_bool_Output
Function block output signal.
Definition: Function_Block_Debounce_BOOL_1C.h:160
TBlock_Input_Connector object_bool_Input
Function block input signal.
Definition: Function_Block_Debounce_BOOL_1C.h:153
TGlobal_FSM_State
Internal FSM state definition.
Definition: Function_Block_Debounce_BOOL_1C.h:180
@ enum_Init
Initialisation state.
Definition: Function_Block_Debounce_BOOL_1C.h:183
@ enum_Off_On
Off to on transaction state.
Definition: Function_Block_Debounce_BOOL_1C.h:189
@ enum_On
On state.
Definition: Function_Block_Debounce_BOOL_1C.h:192
@ enum_On_Off
On to off transaction state.
Definition: Function_Block_Debounce_BOOL_1C.h:195
@ enum_Off
Off state.
Definition: Function_Block_Debounce_BOOL_1C.h:186
virtual VOID Execute()
Function block cyclic execution method.
Definition: Function_Block_Debounce_BOOL_1C.cpp:172