ConOpSys V2970  P004.07
ANVILEX control operating system
Application_Task_Base.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Application_Task_Base.h
3 //! @brief ConOpSys application task base class header file.
4 //! @attention No special attention requered.
5 //! @copyright (C) 2015-2020 ANVILEX LLC
6 //! $HeadURL: https://192.168.3.4:8443/svn/P004_07/ConOpSys/Engine/Application_Task_Base.h $
7 //! $Revision: 2794 $
8 //! $Date: 2021-07-11 04:06:01 +0500 (So, 11 Jul 2021) $
9 //! $Author: minch $
10 //------------------------------------------------------------------------------
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are met:
14 //
15 // 1. Redistributions of source code must retain the above copyright notice,
16 // this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright notice,
19 // this list of conditions and the following disclaimer in the documentation
20 // and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of ANVILEX nor the names of its contributors may be
23 // used to endorse or promote products derived from this software without
24 // specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 // POSSIBILITY OF SUCH DAMAGE.
37 //
38 //------------------------------------------------------------------------------
39 
40 #pragma once
41 
42 //------------------------------------------------------------------------------
43 // Include system files
44 //------------------------------------------------------------------------------
45 
46 #include "Defines.h"
47 //#include "Function_Block_Includes.h"
48 
49 //------------------------------------------------------------------------------
50 
51 //! @brief Application task state enumeration
52 typedef enum
53 {
54 
55  //! @brief Application task state is undefined
57 
58  //! @brief Application task is in initialising state
60 
61  //! @brief Application task is in error state
63 
64  //! @brief Application task is in inhibit state
66 
67  //! @brief Application task is in ready state
69 
70  //! @brief Application task is in transition state
72 
73  //! @brief Application task is in standby state
75 
76  //! @brief Application task is in operation state
78 
79  //! @brief Application task is in fault state
81 
82  //! @brief Application task is in reseting state
83  state_Reseting = 9
84 
86 
87 //------------------------------------------------------------------------------
88 // Class definition
89 //------------------------------------------------------------------------------
90 
91 //! @brief Application task base class
93 {
94 
95  //----------------------------------------------------------------------------
96  // Public defines, methods and variables
97  //----------------------------------------------------------------------------
98 
99  public:
100 /*
101  //! @brief Application task state enumeration
102  typedef enum
103  {
104 
105  //! @brief Application task state is undefined
106  state_Undefined = 0,
107 
108  //! @brief Application task is in initialising state
109  state_Initialising = 1,
110 
111  //! @brief Application task is in error state
112  state_Error = 2,
113 
114  //! @brief Application task is in inhibit state
115  state_Inhibit = 3,
116 
117  //! @brief Application task is in ready state
118  state_Ready = 4,
119 
120  //! @brief Application task is in transition state
121  state_Transition = 5,
122 
123  //! @brief Application task is in standby state
124  state_Standby = 6,
125 
126  //! @brief Application task is in operation state
127  state_Operation = 7,
128 
129  //! @brief Application task is in fault state
130  state_Fault = 8,
131 
132  //! @brief Application task is in reseting state
133  state_Reseting = 9
134 
135  } TApplication_Task_State;
136 */
137  //!-------------------------------------------------------------------------
138  //! @brief Class constructor method.
139  //! @note None
140  //! \par Override
141  //! Not allowed
142  //! @attention Don't call this method directly.
143  //--------------------------------------------------------------------------
144 
145  TApplication_Task_Base( U32 u32_New_Task_ID );
146 
147  //!-------------------------------------------------------------------------
148  //! @brief Class destructor method.
149  //! @note None
150  //! \par Override
151  //! Not allowed
152  //! @attention Don't call this method directly.
153  //--------------------------------------------------------------------------
154 
155  virtual ~TApplication_Task_Base();
156 
157  //!-------------------------------------------------------------------------
158  //! @brief Performe interconnection of the function blocks within task.
159  //! @note None
160  //! @return None
161  //! \par Override
162  //! Optional
163  //! @attention None
164  //--------------------------------------------------------------------------
165 
166 // virtual VOID Connect();
167 
168  //!-------------------------------------------------------------------------
169  //! @brief Performed initialisation of the function blocks.
170  //! @note None
171  //! @return None
172  //! \par Override
173  //! Optional
174  //! @attention None
175  //--------------------------------------------------------------------------
176 
177  virtual VOID Init();
178 
179  //!-------------------------------------------------------------------------
180  //! @brief Performed cyclic execution of the function blocks.
181  //! @note None
182  //! @return None
183  //! \par Override
184  //! Optional
185  //! @attention None
186  //--------------------------------------------------------------------------
187 
188  virtual VOID Execute();
189 
190  //!-------------------------------------------------------------------------
191  //! @brief Returns status of the function block interconnection
192  //! @note None
193  //! @return BOOL - Interconnection status of the function blocks
194  //! @retval false - Function block has invalid interconnection
195  //! @retval true - Function block has valid interconnection
196  //! \par Override
197  //! Not allowed
198  //! @attention None
199  //--------------------------------------------------------------------------
200 
201  BOOL Is_Connected();
202 
203  //!-------------------------------------------------------------------------
204  //! @brief Returns task identifier
205  //! @note None
206  //! @return U32 - Task identifier
207  //! \par Override
208  //! Not allowed
209  //! @attention None
210  //--------------------------------------------------------------------------
211 
212  U32 Get_Task_ID();
213 
214  //----------------------------------------------------------------------------
215  // Protected defines, methods and variables
216  //----------------------------------------------------------------------------
217 
218  protected:
219 
220  //! @brief Create event method
221  VOID Create_Event( U32 u32_Event_ID );
222 
223  //! @brief Task ID
225 
226  //! @brief Task sample time in seconds
228 
229  //! @brief Connected status
231 
232  //----------------------------------------------------------------------------
233  // Private defines, methods and variables
234  //----------------------------------------------------------------------------
235 
236  private:
237 
238 };
239 
240 //------------------------------------------------------------------------------
241 // End of file
242 //------------------------------------------------------------------------------
TApplication_Task_State
Application task state enumeration.
Definition: Application_Task_Base.h:53
@ state_Error
Application task is in error state.
Definition: Application_Task_Base.h:62
@ state_Transition
Application task is in transition state.
Definition: Application_Task_Base.h:71
@ state_Fault
Application task is in fault state.
Definition: Application_Task_Base.h:80
@ state_Undefined
Application task state is undefined.
Definition: Application_Task_Base.h:56
@ state_Reseting
Application task is in reseting state.
Definition: Application_Task_Base.h:83
@ state_Inhibit
Application task is in inhibit state.
Definition: Application_Task_Base.h:65
@ state_Initialising
Application task is in initialising state.
Definition: Application_Task_Base.h:59
@ state_Ready
Application task is in ready state.
Definition: Application_Task_Base.h:68
@ state_Standby
Application task is in standby state.
Definition: Application_Task_Base.h:74
@ state_Operation
Application task is in operation state.
Definition: Application_Task_Base.h:77
ConOpSys data type definitions header file.
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
float F32
IEEE-754 32-Bit single presession floating point numbers datatype defenition.
Definition: Defines.h:324
Application task base class.
Definition: Application_Task_Base.h:93
VOID Create_Event(U32 u32_Event_ID)
Create event method.
Definition: Application_Task_Base.cpp:126
virtual VOID Execute()
Performed cyclic execution of the function blocks.
Definition: Application_Task_Base.cpp:106
F32 f32_Sample_Time
Task sample time in seconds.
Definition: Application_Task_Base.h:227
BOOL bool_Connected
Connected status.
Definition: Application_Task_Base.h:230
virtual ~TApplication_Task_Base()
Class destructor method.
Definition: Application_Task_Base.cpp:82
U32 Get_Task_ID()
Returns task identifier.
Definition: Application_Task_Base.cpp:138
U32 u32_Task_ID
Task ID.
Definition: Application_Task_Base.h:224
BOOL Is_Connected()
Returns status of the function block interconnection.
Definition: Application_Task_Base.cpp:114
virtual VOID Init()
Performe interconnection of the function blocks within task.
Definition: Application_Task_Base.cpp:98
TApplication_Task_Base(U32 u32_New_Task_ID)
Class constructor method.
Definition: Application_Task_Base.cpp:64