ConOpSys V2970  P004.07
ANVILEX control operating system
Parameter_Manager.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 //! @file Parameter_Manager.h
3 //! @brief ConOpSys parameter database manager 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/Parameters/Parameter_Manager.h $
7 //! $Revision: 2954 $
8 //! $Date: 2022-03-01 12:44:44 +0500 (Di, 01 Mrz 2022) $
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 //------------------------------------------------------------------------------
41 //! @page Doxygen_Page_Parameter_Database Parameter database
42 //!
43 //! Parameter database description first line text.
44 //!
45 //! Parameter database description second line text.
46 //
47 //------------------------------------------------------------------------------
48 
49 //! @addtogroup Test_Group New hroup
50 //
51 
52 //------------------------------------------------------------------------------
53 // Protecting header files from mutual, recursive inclusion.
54 //------------------------------------------------------------------------------
55 
56 #pragma once
57 
58 //------------------------------------------------------------------------------
59 
60 #include "ConOpSys_Target.h"
61 
62 #if CONOPSYS_TARGET == CONOPSYS_TARGET_DEVICE
63 
64 //------------------------------------------------------------------------------
65 // Include system files
66 //------------------------------------------------------------------------------
67 
68 #include "System_Resource.h"
69 #include "Parameter_Base.h"
70 #include "SPI_Memory_Base.h"
71 #include "ConOpSys_Variant.h"
72 
73 //------------------------------------------------------------------------------
74 // Include ConOpSys parameter manager relates parameters
75 //------------------------------------------------------------------------------
76 
85 
86 //------------------------------------------------------------------------------
87 // Include ConOpSys device related parameters
88 //------------------------------------------------------------------------------
89 
98 
99 //------------------------------------------------------------------------------
100 // Include ConOpSys event manager related parameter
101 //------------------------------------------------------------------------------
102 
109 
117 
118 //------------------------------------------------------------------------------
119 // Include ConOpSys scope related parameters
120 //------------------------------------------------------------------------------
121 
122 #include "Parameter_SCOPE_ID.h"
123 #include "Parameter_SCOPE_ACCESS.h"
136 
137 //------------------------------------------------------------------------------
138 // Include VDC panel related parameters
139 //------------------------------------------------------------------------------
140 
141 #include "Parameter_VDC_PANEL_ID.h"
143 
144 //----------------------------------------------------------------------------
145 // Include communication related parameters
146 //----------------------------------------------------------------------------
147 
148 #if ( COM1_COMMUNICATION_MODE == USART_COMMUNICATION_MODE_MODBUS_RTU )
149 
151 
152 #endif
153 
154 #if ( COM2_COMMUNICATION_MODE == USART_COMMUNICATION_MODE_MODBUS_RTU )
155 
157 
158 #endif
159 
160 #if ( COM3_COMMUNICATION_MODE == USART_COMMUNICATION_MODE_MODBUS_RTU )
161 
163 
164 #endif
165 
166 //------------------------------------------------------------------------------
167 // Include CAN communication link related parameters
168 //------------------------------------------------------------------------------
169 
170 #if ( CAN1_MODULE_INSTALLED == true )
171 
781 
782 #endif
783 
784 //------------------------------------------------------------------------------
785 // Include ETHERNET communication link related parameters
786 //------------------------------------------------------------------------------
787 
788 #if ( ETHERNET_MODULE_INSTALLED == true )
789 
794 
795 #endif
796 
797 //------------------------------------------------------------------------------
798 // Include application related parameters
799 //------------------------------------------------------------------------------
800 
803 
809 
816 
823 
832 
835 
836 //------------------------------------------------------------------------------
837 // Class definitions
838 //------------------------------------------------------------------------------
839 
840 //! @brief Parameter database manager class
842 {
843 
844  //----------------------------------------------------------------------------
845  // Public defines, methods and variables
846  //----------------------------------------------------------------------------
847 
848  public:
849 
850  //--------------------------------------------------------------------------
851  // Public methods
852  //--------------------------------------------------------------------------
853 
854  //!-------------------------------------------------------------------------
855  //! @brief Class constructor method.
856  //! @note None
857  //! \par Override
858  //! Not allowed
859  //! @attention Don't call this method directly.
860  //--------------------------------------------------------------------------
861 
863 
864  //!-------------------------------------------------------------------------
865  //! @brief Class destructor method.
866  //! @note None
867  //! \par Override
868  //! Not allowed
869  //! @attention Don't call this method directly.
870  //--------------------------------------------------------------------------
871 
873 
874  //!-------------------------------------------------------------------------
875  //! @brief Parameter database manager initialisation method.
876  //! @note None
877  //! @return None
878  //! \par Override
879  //! Not allowed
880  //! @attention None
881  //--------------------------------------------------------------------------
882 
883  VOID Init();
884 
885  //!-------------------------------------------------------------------------
886  //! @brief Parameter database manager finalisation method.
887  //! @note None
888  //! @return None
889  //! \par Override
890  //! Not allowed
891  //! @attention None
892  //--------------------------------------------------------------------------
893 
894  VOID Done();
895 
896  //!-------------------------------------------------------------------------
897  //! @brief Get parameter database hash value
898  //! @note None
899  //! @return U32 - Parameter database hash value
900  //! \par Override
901  //! Not allowed
902  //! @attention None
903  //--------------------------------------------------------------------------
904 
906 
907  //!-------------------------------------------------------------------------
908  //! @brief Get count of parameter managed by parameter manager
909  //! @note None
910  //! @return U32 - Total managed parameter count
911  //! \par Override
912  //! Not allowed
913  //! @attention None
914  //--------------------------------------------------------------------------
915 
917 
918  //!-------------------------------------------------------------------------
919  //! @brief Get count of volatile parameters managed by parameter manager
920  //! @note None
921  //! @return U32 - Volatile parameter count
922  //! \par Override
923  //! Not allowed
924  //! @attention None
925  //--------------------------------------------------------------------------
926 
928 
929  //!-------------------------------------------------------------------------
930  //! @brief Get count of nonvolatile parameters managed by parameter manager
931  //! @note None
932  //! @return U32 - Nonvolatile parameter count
933  //! \par Override
934  //! Not allowed
935  //! @attention None
936  //--------------------------------------------------------------------------
937 
939 
940  //!-------------------------------------------------------------------------
941  //! @brief Get count of not initialised parameters
942  //! @note None
943  //! @return U32 - Not initialised parameter count
944  //! \par Override
945  //! Not allowed
946  //! @attention None
947  //--------------------------------------------------------------------------
948 
950 
951  //!-------------------------------------------------------------------------
952  //! @brief Get count of parameters initialised with default values
953  //! @note None
954  //! @return U32 - Count of parameter initialised with default value
955  //! \par Override
956  //! Not allowed
957  //! @attention None
958  //--------------------------------------------------------------------------
959 
961 
962  //!-------------------------------------------------------------------------
963  //! @brief Get count of parameters initialised with values from nonvolatile media
964  //! @note None
965  //! @return U32 - Count of parameters initialised from nonvolatile media
966  //! \par Override
967  //! Not allowed
968  //! @attention None
969  //--------------------------------------------------------------------------
970 
972 
973  //!-------------------------------------------------------------------------
974  //! @brief Get amount of parameter not fitted into nonvolatile storage
975  //! @note None
976  //! @return U32 - Count of parameters not fitted into nonvolatile storage
977  //! \par Override
978  //! Not allowed
979  //! @attention None
980  //--------------------------------------------------------------------------
981 
983 
984  //!-------------------------------------------------------------------------
985  //! @brief Get parameter manages storage usage method.
986  //! @note None
987  //! @param [out] *u32_Parameter_Capacity - Capacity of the parameter storage
988  //! @param [out] *u32_Parameter_Count - Count of the parameters stored in the parameter storage
989  //! @return None
990  //! \par Override
991  //! Not allowed
992  //! @attention None
993  //--------------------------------------------------------------------------
994 
995  VOID Get_Usage( U32 *u32_Parameter_Capacity, U32 *u32_Parameter_Count );
996 
997  //!-------------------------------------------------------------------------
998  //! @brief Send information about parameter manager over communication link protocol
999  //! @note This method sends information about parameter manager over specified communication link protocol.
1000  //! @param [in] *object_Protocol - Pointer to the communication link protocol
1001  //! @return None
1002  //! \par Override
1003  //! Optional
1004  //! @attention None
1005  //--------------------------------------------------------------------------
1006 
1008 
1009  //!-------------------------------------------------------------------------
1010  //! @brief Send boot information about parameter manager over communication link protocol
1011  //! @note This method sends boot information about parameter manager over specified communication link protocol.
1012  //! @param [in] *object_Protocol - Pointer to the communication link protocol
1013  //! @return None
1014  //! \par Override
1015  //! Optional
1016  //! @attention None
1017  //--------------------------------------------------------------------------
1018 
1020 
1021  //!-------------------------------------------------------------------------
1022  //! @brief Assign communication protocol link to the parameter manager
1023  //! @note None
1024  //! @param [in] *object_Protocol - Pointer to the communication link protocol
1025  //! @return None
1026  //! \par Override
1027  //! Optional
1028  //! @attention None
1029  //--------------------------------------------------------------------------
1030 
1032 
1033  //!-------------------------------------------------------------------------
1034  //! @brief Assign nonvolatile media storage to the parameter manager.
1035  //! @note None
1036  //! @param [in] *object_Media_Pointer - Pointer to the nonvolatile media storage
1037  //! @return None
1038  //! \par Override
1039  //! Optional
1040  //! @attention None
1041  //--------------------------------------------------------------------------
1042 
1043  VOID Assign_Media( TSPI_Memory_Base *object_Media_Pointer );
1044 
1045  //!-------------------------------------------------------------------------
1046  //! @brief Initialisation of nonvolatile parameter storage method.
1047  //! @note None
1048  //! @return BOOL - Method execution status
1049  //! @retval true - Format nonvolatile parameter storage successed
1050  //! @retval false - Format nonvolatile parameter storage failed
1051  //! \par Override
1052  //! Not allowed
1053  //! @attention None
1054  //--------------------------------------------------------------------------
1055 
1057 
1058  //!-------------------------------------------------------------------------
1059  //! @brief Restore nonvolatile and quasinonvolatile parameter values from storage.
1060  //! @note None
1061  //! @return BOOL - Method execution status
1062  //! @retval true - Restore nonvolatile parameter values successed
1063  //! @retval false - Restore nonvolatile parameter values failed
1064  //! \par Override
1065  //! Not allowed
1066  //! @attention None
1067  //--------------------------------------------------------------------------
1068 
1070 
1071  //!-------------------------------------------------------------------------
1072  //! @brief Clear quasi volatile parameter values.
1073  //! @note None
1074  //! @return None
1075  //! \par Override
1076  //! Not allowed
1077  //! @attention None
1078  //--------------------------------------------------------------------------
1079 
1081 
1082  //!-------------------------------------------------------------------------
1083  //! @brief ???.
1084  //! @note None
1085  //! @return None
1086  //! \par Override
1087  //! Not allowed
1088  //! @attention None
1089  //--------------------------------------------------------------------------
1090 
1092 
1093  //!-------------------------------------------------------------------------
1094  //! @brief Background cyclic execution method.
1095  //! @note None
1096  //! @return None
1097  //! \par Override
1098  //! Not allowed
1099  //! @attention None
1100  //--------------------------------------------------------------------------
1101 
1102  VOID Execute();
1103 
1104  //!-------------------------------------------------------------------------
1105  //! @brief Verify database method
1106  //! @note None
1107  //! @return BOOL - Parameter database verification status
1108  //! @retval true - Parameter database verification successed
1109  //! @retval false - Parameter database verification failed
1110  //! \par Override
1111  //! Not allowed
1112  //! @attention None
1113  //! \par UML diagram TParameter_Manager__Verify_Database.dt
1114  //--------------------------------------------------------------------------
1115 
1117 
1118  //!-------------------------------------------------------------------------
1119  //! @brief Register parameter in to the parameter database.
1120  //! @note None
1121  //! @param [in] *object_Parameter - Pointer to the parameter object
1122  //! @return BOOL - Parameter registration status
1123  //! @retval true - Parameter resistration successed
1124  //! @retval false - Parameter resistration failed
1125  //! \par Override
1126  //! Not allowed
1127  //! @attention None
1128  //--------------------------------------------------------------------------
1129 
1130  BOOL Register( TParameter_Base *object_Parameter );
1131 
1132  //!-------------------------------------------------------------------------
1133  //! @brief Unregister parameter from the parameter database.
1134  //! @note None
1135  //! @param [in] *object_Parameter - Pointer to the parameter object
1136  //! @return BOOL - Parameter unregistration status
1137  //! @retval true - Parameter unresistration successed
1138  //! @retval false - Parameter unresistration failed
1139  //! \par Override
1140  //! Not allowed
1141  //! @attention None
1142  //--------------------------------------------------------------------------
1143 
1144  BOOL Unregister( TParameter_Base *object_Parameter );
1145 
1146  //!-------------------------------------------------------------------------
1147  //! @brief Check for parameter registered in parameter database.
1148  //! @note The method verified registarion in parameter database using parameter identifier.
1149  //! @param [in] *object_Parameter - Pointer to the parameter object
1150  //! @return BOOL - Parameter registration status
1151  //! @retval true - Parameter registered in parameter database
1152  //! @retval false - Parameter not registered in parameter database
1153  //! \par Override
1154  //! Not allowed
1155  //! @attention None
1156  //--------------------------------------------------------------------------
1157 
1158  BOOL Is_Registered_By_ID( TParameter_Base *object_Parameter );
1159 
1160  //!-------------------------------------------------------------------------
1161  //! @brief Check for parameter registered in parameter database.
1162  //! @note The method verified registarion in parameter database using parameter pointer.
1163  //! @param [in] *object_Parameter - Pointer to the parameter object
1164  //! @return BOOL - Parameter registration status
1165  //! @retval true - Parameter registered in parameter database
1166  //! @retval false - Parameter not registered in parameter database
1167  //! \par Override
1168  //! Not allowed
1169  //! @attention None
1170  //--------------------------------------------------------------------------
1171 
1172  BOOL Is_Registered( TParameter_Base *object_Parameter );
1173 
1174  //!-------------------------------------------------------------------------
1175  //! @brief Get parameter index referenced by parameter object.
1176  //! @note None
1177  //! @param [out] *u32_Parameter_Index - Pointer to the parameter index variable
1178  //! @param [in] *object_Parameter - Pointer to the parameter object
1179  //! @return BOOL - Method execution status
1180  //! @retval true - Method executed without any errors
1181  //! @retval false - Method executed with errors
1182  //! \par Override
1183  //! Not allowed
1184  //! @attention None
1185  //--------------------------------------------------------------------------
1186 
1187  BOOL Get_Parameter_Index( U32 *u32_Parameter_Index, TParameter_Base *object_Parameter );
1188 
1189  //!-------------------------------------------------------------------------
1190  //! @brief Get pointer to the parameter referenced by parameter identifier.
1191  //! @note None
1192  //! @param [in] u32_ID - Parameter identifier
1193  //! @param [out] **object_Parameter - Pointer to the parameter object
1194  //! @return BOOL - Method execution status
1195  //! @retval true - Parameter found and valid pointer returned
1196  //! @retval false - Parameter not found
1197  //! \par Override
1198  //! Not allowed
1199  //! @attention None
1200  //--------------------------------------------------------------------------
1201 
1202  BOOL Get_Parameter_By_ID( U32 u32_ID, TParameter_Base **object_Parameter );
1203 
1204  //!-------------------------------------------------------------------------
1205  //! @brief Get pointer to the parameter referenced by parameter storage index.
1206  //! @note None
1207  //! @param [in] u32_Parameter_Index - Parameter storage index
1208  //! @param [out] **object_Parameter - Pointer to the parameter object
1209  //! @return BOOL - Method execution status
1210  //! @retval true - Parameter found and valid pointer returned
1211  //! @retval false - Parameter not found
1212  //! \par Override
1213  //! Not allowed
1214  //! @attention None
1215  //--------------------------------------------------------------------------
1216 
1217  BOOL Get_Parameter_By_Index( U32 u32_Parameter_Index, TParameter_Base **object_Parameter );
1218 
1219  //!-------------------------------------------------------------------------
1220  //! @brief Get pointer to the parameter referenced by parameter name.
1221  //! @note None
1222  //! @param [in] *c8_Parameter_Name - Pointer to the parameter name string
1223  //! @param [out] **object_Parameter - Pointer to the parameter object
1224  //! @return BOOL - Method execution status
1225  //! @retval true - Parameter found and valid pointer returned
1226  //! @retval false - Parameter not found
1227  //! \par Override
1228  //! Not allowed
1229  //! @attention None
1230  //--------------------------------------------------------------------------
1231 
1232  BOOL Get_Parameter_By_Name( C8 *c8_Parameter_Name, TParameter_Base **object_Parameter );
1233 
1234  //!-------------------------------------------------------------------------
1235  //! @brief Resolve parameter storage index referenced by parameter name.
1236  //! @note None
1237  //! @param [out] *u32_Parameter_Index - Parameter storage index
1238  //! @param [in] *c8_Parameter_Name - Pointer to the parameter name string
1239  //! @return BOOL - Method execution status
1240  //! @retval true - Parameter found and parameter storage index returned
1241  //! @retval false - Parameter not found
1242  //! \par Override
1243  //! Not allowed
1244  //! @attention None
1245  //--------------------------------------------------------------------------
1246 
1247  BOOL Resolve_Parameter_Index_By_Name( U32 *u32_Parameter_Index, C8 *c8_Parameter_Name );
1248 
1249  //!-------------------------------------------------------------------------
1250  //! @brief This method return OS status
1251  //! @note None
1252  //! @return U32 - OS status word
1253  //! \par Override
1254  //! Required
1255  //! @attention None
1256  //--------------------------------------------------------------------------
1257 
1258  U32 Get_OS_Status();
1259 
1260  //!-------------------------------------------------------------------------
1261  //! @brief This method set parameter database in operation mode
1262  //! @note None
1263  //! @return BOOL - Parameter database start operation status
1264  //! @retval false - Parameter database in error mode
1265  //! @retval true - Parameter database ready for operations
1266  //! \par Override
1267  //! Required
1268  //! @attention None
1269  //--------------------------------------------------------------------------
1270 
1272 
1273  //!-------------------------------------------------------------------------
1274  //! @brief Calculate parameter descriptor database hash description.
1275  //! @note None
1276  //! @return U32 - Parameter database hash value
1277  //! \par Override
1278  //! Not allowed
1279  //! @attention None
1280  //--------------------------------------------------------------------------
1281 
1283 
1284  //----------------------------------------------------------------------------
1285  // Protected defines, methods and variables
1286  //----------------------------------------------------------------------------
1287 
1288  protected:
1289 
1290  //----------------------------------------------------------------------------
1291  // Private defines, methods and variables
1292  //----------------------------------------------------------------------------
1293 
1294  private:
1295 
1296  //--------------------------------------------------------------------------
1297  // Private defines
1298  //--------------------------------------------------------------------------
1299 
1300  //! @brief Parameter table record header
1301  //! @note ATTENTION: Size of the record must be according data align of 8.
1302  typedef struct
1303  {
1304 
1305  //! @brief Parameter data block CRC (4 byte)
1307 
1308  //! @brief Appication ID (4 byte)
1310 
1311 // ANVILEX KM: Try to move structure field to this place to prevent memory holes
1312 // //! @brief Timestamp (8 byte)
1313 // U64 u64_Timestamp;
1314 
1315 // ANVILEX KM: Try to move structure field to this place to prevent memory holes
1316 // //! @brief Parameter universally unique identifier high
1317 // //! @note Size: 8 byte
1318 // U64 u64_PUUID_High;
1319 
1320 // ANVILEX KM: Try to move structure field to this place to prevent memory holes
1321 // //! @brief Parameter universally unique identifier low
1322 // //! @note Size: 8 byte
1323 // U64 u64_PUUID_Low;
1324 
1325  //! @brief Parameter ID (4 byte)
1327 
1328  //! @brief Data type (2 byte)
1330 
1331  //! @brief Reserved (2 byte)
1333 
1334  //! @brief Parameter element index (4 byte)
1336 
1337  //! @brief Timestamp (8 byte)
1339 
1340  //! @brief Parameter universally unique identifier high
1341  //! @note Size: 8 byte
1343 
1344  //! @brief Parameter universally unique identifier low
1345  //! @note Size: 8 byte
1347 
1349 
1350  //! @brief Parameter table record body
1351  //! @note ATTENTION: Size of the record must be according data align of 8.
1352  typedef struct
1353  {
1354 
1355  //! @brief Parameter table record data value
1357 
1359 
1360  //! @brief Parameter table record
1361  typedef struct
1362  {
1363 
1364  //! @brief Parameter table record header data
1366 
1367  //! @brief Parameter table record body data
1369 
1371 
1372  //! @brief FSM state definition
1373  typedef enum
1374  {
1375 
1376  //! @brief Idle state
1378 
1379  //! @brief Media initialisation state
1381 
1382  //! @brief Media flish state
1384 
1385  //! @brief Regular operation state
1387 
1389 
1390  //--------------------------------------------------------------------------
1391  // Private methods
1392  //--------------------------------------------------------------------------
1393 
1394  //!-------------------------------------------------------------------------
1395  //! @brief Read nonvolatile and quasinonvolatile parameter values from storage.
1396  //! @note None
1397  //! @return BOOL - Method execution status
1398  //! @retval true - Read of nonvolatile parameter values successed
1399  //! @retval false - Read of nonvolatile parameter values failed
1400  //! \par Override
1401  //! Not allowed
1402  //! @attention None
1403  //--------------------------------------------------------------------------
1404 
1406 
1407  //!-------------------------------------------------------------------------
1408  //! @brief Store noninitialised nonvolatile and quasinonvolatile parameter values into storage.
1409  //! @note None
1410  //! @return BOOL - Method execution status
1411  //! @retval true - Store of non initialised nonvolatile parameter values successed
1412  //! @retval false - Store of non initialised nonvolatile parameter values failed
1413  //! \par Override
1414  //! Not allowed
1415  //! @attention None
1416  //--------------------------------------------------------------------------
1417 
1419 
1420  //--------------------------------------------------------------------------
1421 
1422  BOOL Get_New_Parameter_Index( U32 *u32_Parameter_Storage_Index ); //!< Get new parameter index
1423 
1425 
1427 
1429 
1430  //--------------------------------------------------------------------------
1431 
1432  BOOL Media_Database_Invalidate_Record( U32 u32_Record_Index );
1433 
1434  BOOL Media_Database_Initialise_Record( U32 u32_Record_Index );
1435 
1436  BOOL Media_Database_Read_Record( U32 u32_Record_Index, TParameter_Table_Record *struct_Record );
1437 
1438  BOOL Media_Database_Write_Record( U32 u32_Record_Index, TParameter_Table_Record *struct_Record );
1439 
1440  //--------------------------------------------------------------------------
1441 
1443 
1444  BOOL Update_Empty_Block_Address( U32 u32_Block_Count );
1445 
1446  BOOL Verify_Writtern_Record( TParameter_Table_Record *struct_Record_Reference );
1447 
1448  //--------------------------------------------------------------------------
1449 
1451 
1452 // BOOL Media_Database_Read_Record_Header( U32 u32_Record_Index, TParameter_Table_Record *struct_Record );
1454 
1456 
1458 
1459  BOOL Allocate_Parameter_Media_Storege_Index( U32 *u32_New_Media_Storage_Index );
1460 
1461  //--------------------------------------------------------------------------
1462  // Private variables
1463  //--------------------------------------------------------------------------
1464 
1465  //! @brief FSM state variable
1466  TGlobal_FSM_State enum_FSM_State = TGlobal_FSM_State::enum_Idle;
1467 
1468  //! @brief Pointer to the SPI memory object
1470 
1471  //! @brief Storage for parameter objects pointers
1472  TParameter_Base *object_Parameter_Storage[ PARAMETER_STORAGE_SIZE ] = { (TParameter_Base*)NULL };
1473 
1474  //! @brief Parameter database hash value
1476 
1477  //! @brief Background loop counter
1478  U64 u64_Background_Loop_Counter = (U64)0x0000000000000000;
1479 
1480  //! @brief Virtual time stamp
1481  U64 u64_Virtual_Timestamp = (U64)0x0000000000000000;
1482 
1483  //! @brief Count of parameter registered in the parameter database
1484  U32 u32_Parameter_Count = (U32)0x00000000;
1485 
1486  //! @brief Amount of parameter not fitted in parameter storage
1488 
1489  //! @brief Double parameter ID flag, shows that same parameter has the identical ID.
1491 
1492  //! @brief Double parameter ID
1494 
1495  //! @brief Double parameter registration flag, shows that same parameter tried registered twice.
1497 
1498  //! @brief Parameter storage full flag, shows that no empty record present for parameter registration.
1500 
1501  //! @brief Parameter database media initialisation request flag
1503 
1504  //! @brief Parameter initialisation error flag
1506 
1507  //! @brief Nonvolatile parameter restore error flag
1509 
1510  //! @brief Nonvolatile parameter restore success count
1512 
1513  //! @brief Nonvolatile parameter rewrite success count
1515 
1516  //! @brief Parameter database update request counter
1518 
1519  //! @brief Parameter database media out of memory error flag
1521 
1522  //! @brief Parameter database media read error count
1524 
1525  //! @brief Parameter database media write error count
1527 
1528  //! @brief Parameter database media record body CRC error count
1530 
1531  //! @brief Pointer to the communication protocol object
1533 
1534  //! @brief Container for OS status
1536 
1537  //! @brief Fix empty block status
1539 
1540  //! @brief First empty media block index
1542 
1543  //! @brief Total record count
1545 
1546 };
1547 
1548 //------------------------------------------------------------------------------
1549 // Export global referencec
1550 //------------------------------------------------------------------------------
1551 
1552 //! @brief Export global parameter database object
1554 
1555 //------------------------------------------------------------------------------
1556 
1557 #endif
1558 
1559 //------------------------------------------------------------------------------
1560 // End of file
1561 //------------------------------------------------------------------------------
ConOpSys deploy target definitions file.
ConOpSys variant class header file.
int BOOL
Boolean datatype definition.
Definition: Defines.h:124
#define NULL
Definition: Defines.h:388
unsigned long long U64
Binary 64-Bit unsigned integer datatype defenition.
Definition: Defines.h:213
void VOID
Datatypesess datatype definition.
Definition: Defines.h:105
unsigned long U32
Binary 32-Bit unsigned integer datatype defenition.
Definition: Defines.h:203
unsigned short U16
Binary 16-Bit unsigned integer datatype defenition.
Definition: Defines.h:193
char C8
ASCII 8-Bit char datatype defenition.
Definition: Defines.h:156
Application background task alarm status parameter class header file.
Application background task critical status parameter class header file.
Application background task status information object header file.
Application background task trip status information object header file.
Application background task warning status information object header file.
Application control task alarm status information object header file.
Application control task critical status information object header file.
Application control task sample time object header file.
Application control task status information object header file.
Application control task trip status information object header file.
Application control task warning status information object header file.
Application error reset parameter object header file.
Device global FSM state. object header file.
Device hardware trip request 1 latch. object header file.
Device hardware trip request 1 status. object header file.
Device hardware trip request 2 latch. object header file.
Device hardware trip request 2 status. object header file.
Application executable image hash value object header file.
Application identifier object header file.
Device software trip request 1 latch. object header file.
Device software trip request 1 status. object header file.
Device software trip request 2 latch. object header file.
Device software trip request 2 status. object header file.
Application system task alarm status information object header file.
Application system task critical status information object header file.
Application system task sample time object header file.
Application system task status information object header file.
Application system task trip status information object header file.
Application system task warning status information object header file.
ConOpSys parameter base class header file.
Device type parameter object header file.
Error register parameter object header file.
CANopen node ID object header file.
Receive PDO1 data object header file.
Receive PDO2 data object header file.
Receive PDO3 data object header file.
Receive PDO4 data object header file.
Transmit PDO1 data object header file.
Transmit PDO2 data object header file.
Transmit PDO3 data object header file.
Transmit PDO4 data object header file.
Communication link COM1 MODBUS slave address parameter object header file.
Communication link COM2 MODBUS slave address parameter object header file.
Communication link COM3 MODBUS slave address parameter object header file.
GATEWAY address parameter object header file.
IPv4 address parameter object header file.
MAC address parameter object header file.
MASK address parameter object header file.
Device information access parameter object header file.
Device information application identifier parameter object header file.
Device information country identifier parameter object header file.
Device information customer identifier parameter object header file.
Device information firmware identifier parameter object header file.
Device information hardware identifier parameter object header file.
Device information identifier parameter object header file.
Device information language identifier parameter object header file.
Event database access parameter object header file.
Event database current index parameter object header file.
Event database event absolute timestamp parameter object header file.
Event database event description parameter object header file.
Event database event group identifier parameter object header file.
Event database event identifier parameter object header file.
Event database event relative timestamp parameter object header file.
Event database event task identifier parameter object header file.
Event database event task iteration parameter object header file.
Event database first index parameter object header file.
Event databse hash parameter object header file.
Event database identifier parameter object header file.
Event database last index parameter object header file.
TParameter_Manager object_Parameter_Manager
Export global parameter database object.
Definition: Parameter_Manager.cpp:82
Parameter database access parameter object header file.
Parameter value clear timeout parameter object header file.
Parameter databse hash parameter object header file.
Parameter database identifier parameter object header file.
Parameter database media state parameter object header file.
Parameter database password parameter object header file.
Parameter database size parameter object header file.
Parameter database user parameter object header file.
Scope access parameter object header file.
Scope channel count parameter object header file.
Scope channel data parameter object header file.
Scope schannel data decimation factor parameter object header file.
Scope channel data index parameter object header file.
Scope channel count parameter object header file.
Scope channel data timebase parameter object header file.
Scope channel index parameter object header file.
Scope channel parameter ID parameter object header file.
Scope identifier parameter object header file.
Scope trigger data parameter object header file.
Scope channel data parameter object header file.
Scope trigger parameter ID parameter object header file.
Scope trigger state parameter object header file.
VDC panel access parameter object header file.
VDC panel identifier parameter object header file.
SPI connected memory base class header file.
System resource header file.
Parameter base class.
Definition: Parameter_Base.h:60
Parameter database manager class.
Definition: Parameter_Manager.h:842
VOID Increment_Media_Read_Error_Count()
Definition: Parameter_Manager.cpp:2346
BOOL Restore_Nonvolatile_Parameter_Values()
Restore nonvolatile and quasinonvolatile parameter values from storage.
Definition: Parameter_Manager.cpp:3505
TSPI_Memory_Base * object_Media
Pointer to the SPI memory object.
Definition: Parameter_Manager.h:1469
~TParameter_Manager()
Class destructor method.
Definition: Parameter_Manager.cpp:116
BOOL Media_Database_Validate_Record(TParameter_Table_Record *struct_Record)
Definition: Parameter_Manager.cpp:2847
BOOL Allocate_Parameter_Media_Storege_Index(U32 *u32_New_Media_Storage_Index)
Definition: Parameter_Manager.cpp:3348
U32 Calculate_Database_Hash()
Calculate parameter descriptor database hash description.
Definition: Parameter_Manager.cpp:4278
BOOL Register(TParameter_Base *object_Parameter)
Register parameter in to the parameter database.
Definition: Parameter_Manager.cpp:2190
VOID Get_Usage(U32 *u32_Parameter_Capacity, U32 *u32_Parameter_Count)
Get parameter manages storage usage method.
Definition: Parameter_Manager.cpp:4175
U32 u32_Parameter_Storage_Overflow_Counter
Amount of parameter not fitted in parameter storage.
Definition: Parameter_Manager.h:1487
U32 Get_Not_Initialised_Parameter_Count()
Get count of not initialised parameters.
Definition: Parameter_Manager.cpp:1416
U32 u32_Nonvolatile_Parameter_Rewrite_Success_Count
Nonvolatile parameter rewrite success count.
Definition: Parameter_Manager.h:1514
U32 Get_OS_Status()
This method return OS status.
Definition: Parameter_Manager.cpp:4200
BOOL bool_Media_Out_Of_Memory
Parameter database media out of memory error flag.
Definition: Parameter_Manager.h:1520
BOOL bool_Double_Parameter_Registration
Double parameter registration flag, shows that same parameter tried registered twice.
Definition: Parameter_Manager.h:1496
BOOL Verify_Writtern_Record(TParameter_Table_Record *struct_Record_Reference)
Definition: Parameter_Manager.cpp:4488
BOOL bool_Media_Database_Initialisation_Request
Parameter database media initialisation request flag.
Definition: Parameter_Manager.h:1502
BOOL Recall_Nonvolatile_Parameter_Values()
Read nonvolatile and quasinonvolatile parameter values from storage.
Definition: Parameter_Manager.cpp:3611
U32 u32_Media_Database_Record_Body_CRC_Error_Count
Parameter database media record body CRC error count.
Definition: Parameter_Manager.h:1529
BOOL Get_Parameter_By_Index(U32 u32_Parameter_Index, TParameter_Base **object_Parameter)
Get pointer to the parameter referenced by parameter storage index.
Definition: Parameter_Manager.cpp:1887
U32 u32_Media_Database_Update_Request_Counter
Parameter database update request counter.
Definition: Parameter_Manager.h:1517
BOOL bool_First_Empty_Block_Index_Valid
Fix empty block status.
Definition: Parameter_Manager.h:1538
VOID Media_Database_Check()
U32 u32_Media_Write_Error_Count
Parameter database media write error count.
Definition: Parameter_Manager.h:1526
BOOL bool_Double_Parameter_ID
Double parameter ID flag, shows that same parameter has the identical ID.
Definition: Parameter_Manager.h:1490
BOOL bool_Nonvolatile_Parameter_Restore_Error
Nonvolatile parameter restore error flag.
Definition: Parameter_Manager.h:1508
BOOL Media_Database_Write_Parameter(TParameter_Base *object_Parameter)
Definition: Parameter_Manager.cpp:2947
BOOL Unregister(TParameter_Base *object_Parameter)
Unregister parameter from the parameter database.
Definition: Parameter_Manager.cpp:2295
U32 Get_Media_Initialised_Parameter_Count()
Get count of parameters initialised with values from nonvolatile media.
Definition: Parameter_Manager.cpp:1510
U32 u32_Double_Parameter_ID
Double parameter ID.
Definition: Parameter_Manager.h:1493
U32 Get_Parameter_Count()
Get count of parameter managed by parameter manager.
Definition: Parameter_Manager.cpp:1310
VOID Init()
Parameter database manager initialisation method.
Definition: Parameter_Manager.cpp:124
VOID Clear_Parameter_Storage_Indexis()
Definition: Parameter_Manager.cpp:4556
U32 Get_Parameter_Storage_Overflow_Counter()
Get amount of parameter not fitted into nonvolatile storage.
Definition: Parameter_Manager.cpp:4163
VOID Done()
Parameter database manager finalisation method.
Definition: Parameter_Manager.cpp:917
BOOL Store_Nonvolatile_Parameter_Values()
Store noninitialised nonvolatile and quasinonvolatile parameter values into storage.
Definition: Parameter_Manager.cpp:4014
VOID Increment_Media_Write_Error_Count()
Definition: Parameter_Manager.cpp:2358
BOOL bool_Parameter_Storage_Full
Parameter storage full flag, shows that no empty record present for parameter registration.
Definition: Parameter_Manager.h:1499
VOID Media_Database_Update()
???.
Definition: Parameter_Manager.cpp:4188
TOS_Status_Structure struct_OS_Status
Container for OS status.
Definition: Parameter_Manager.h:1535
BOOL Media_Database_Write_Record(U32 u32_Record_Index, TParameter_Table_Record *struct_Record)
Definition: Parameter_Manager.cpp:2781
U32 Get_Default_Initialised_Parameter_Count()
Get count of parameters initialised with default values.
Definition: Parameter_Manager.cpp:1463
U32 u32_Parameter_Database_Hash
Parameter database hash value.
Definition: Parameter_Manager.h:1475
BOOL Get_Parameter_By_Name(C8 *c8_Parameter_Name, TParameter_Base **object_Parameter)
Get pointer to the parameter referenced by parameter name.
Definition: Parameter_Manager.cpp:1950
U64 u64_Virtual_Timestamp
Virtual time stamp.
Definition: Parameter_Manager.h:1481
VOID Send_Information(TProtocol_Base *object_Protocol)
Send information about parameter manager over communication link protocol.
Definition: Parameter_Manager.cpp:1706
TParameter_Base * object_Parameter_Storage[PARAMETER_STORAGE_SIZE]
Storage for parameter objects pointers.
Definition: Parameter_Manager.h:1472
BOOL Resolve_Parameter_Index_By_Name(U32 *u32_Parameter_Index, C8 *c8_Parameter_Name)
Resolve parameter storage index referenced by parameter name.
Definition: Parameter_Manager.cpp:2003
TGlobal_FSM_State enum_FSM_State
FSM state variable.
Definition: Parameter_Manager.h:1466
BOOL Get_Parameter_Index(U32 *u32_Parameter_Index, TParameter_Base *object_Parameter)
Get parameter index referenced by parameter object.
Definition: Parameter_Manager.cpp:1763
BOOL Media_Database_Read_Record(U32 u32_Record_Index, TParameter_Table_Record *struct_Record)
Definition: Parameter_Manager.cpp:2715
VOID Assign_Media(TSPI_Memory_Base *object_Media_Pointer)
Assign nonvolatile media storage to the parameter manager.
Definition: Parameter_Manager.cpp:928
VOID Show_Boot_Information(TProtocol_Base *object_Protocol)
Send boot information about parameter manager over communication link protocol.
Definition: Parameter_Manager.cpp:1569
U32 u32_First_Empty_Block_Index
First empty media block index.
Definition: Parameter_Manager.h:1541
BOOL Get_New_Parameter_Index(U32 *u32_Parameter_Storage_Index)
Get new parameter index.
Definition: Parameter_Manager.cpp:1723
BOOL Media_Database_Invalidate_Record(U32 u32_Record_Index)
Definition: Parameter_Manager.cpp:2530
VOID Assign_Protocol(TProtocol_Base *object_Protocol)
Assign communication protocol link to the parameter manager.
Definition: Parameter_Manager.cpp:1557
BOOL Get_Parameter_By_ID(U32 u32_ID, TParameter_Base **object_Parameter)
Get pointer to the parameter referenced by parameter identifier.
Definition: Parameter_Manager.cpp:1834
U32 Get_Parameter_Database_Hash()
Get parameter database hash value.
Definition: Parameter_Manager.cpp:1298
BOOL Is_Registered_By_ID(TParameter_Base *object_Parameter)
Check for parameter registered in parameter database.
Definition: Parameter_Manager.cpp:2056
TGlobal_FSM_State
FSM state definition.
Definition: Parameter_Manager.h:1374
@ enum_Media_Flush
Media flish state.
Definition: Parameter_Manager.h:1383
@ enum_Idle
Idle state.
Definition: Parameter_Manager.h:1377
@ enum_Operation
Regular operation state.
Definition: Parameter_Manager.h:1386
@ enum_Media_Init
Media initialisation state.
Definition: Parameter_Manager.h:1380
BOOL Update_Empty_Block_Address(U32 u32_Block_Count)
Definition: Parameter_Manager.cpp:4373
U32 u32_Media_Read_Error_Count
Parameter database media read error count.
Definition: Parameter_Manager.h:1523
U32 Get_Volatile_Parameter_Count()
Get count of volatile parameters managed by parameter manager.
Definition: Parameter_Manager.cpp:1322
U64 u64_Background_Loop_Counter
Background loop counter.
Definition: Parameter_Manager.h:1478
BOOL Invalidate_Nonvolatile_Parameter_Storage()
Definition: Parameter_Manager.cpp:2433
BOOL Is_Media_Database_Available()
Definition: Parameter_Manager.cpp:2470
BOOL Format_Nonvolatile_Parameter_Storage()
Initialisation of nonvolatile parameter storage method.
Definition: Parameter_Manager.cpp:2370
VOID Clear_Quasivolatile_Parameter_Values()
Clear quasi volatile parameter values.
Definition: Parameter_Manager.cpp:4105
BOOL Start_Operation()
This method set parameter database in operation mode.
Definition: Parameter_Manager.cpp:4212
TProtocol_Base * object_Protocol
Pointer to the communication protocol object.
Definition: Parameter_Manager.h:1532
U32 u32_Total_Media_Record_Count
Total record count.
Definition: Parameter_Manager.h:1544
BOOL Media_Database_Initialise_Record(U32 u32_Record_Index)
Definition: Parameter_Manager.cpp:2618
TParameter_Manager()
Class constructor method.
Definition: Parameter_Manager.cpp:88
BOOL Verify_Database()
Verify database method.
Definition: Parameter_Manager.cpp:1186
VOID Execute()
Background cyclic execution method.
Definition: Parameter_Manager.cpp:1008
U32 u32_Parameter_Count
Count of parameter registered in the parameter database.
Definition: Parameter_Manager.h:1484
U32 Get_Nonvolatile_Parameter_Count()
Get count of nonvolatile parameters managed by parameter manager.
Definition: Parameter_Manager.cpp:1369
BOOL Is_Registered(TParameter_Base *object_Parameter)
Check for parameter registered in parameter database.
Definition: Parameter_Manager.cpp:2127
U32 u32_Nonvolatile_Parameter_Recall_Success_Count
Nonvolatile parameter restore success count.
Definition: Parameter_Manager.h:1511
BOOL bool_Parameter_Initialisation_Error
Parameter initialisation error flag.
Definition: Parameter_Manager.h:1505
Definition: Protocol_Base.h:57
SPI memory base class.
Definition: SPI_Memory_Base.h:55
Parameter table record body.
Definition: Parameter_Manager.h:1353
TConOpSys_Variant_Data struct_Data
Parameter table record data value.
Definition: Parameter_Manager.h:1356
Parameter table record header.
Definition: Parameter_Manager.h:1303
U16 u16_Reserved
Reserved (2 byte)
Definition: Parameter_Manager.h:1332
U64 u64_Timestamp
Timestamp (8 byte)
Definition: Parameter_Manager.h:1338
U64 u64_PUUID_High
Parameter universally unique identifier high.
Definition: Parameter_Manager.h:1342
U64 u64_PUUID_Low
Parameter universally unique identifier low.
Definition: Parameter_Manager.h:1346
U32 u32_CRC
Parameter data block CRC (4 byte)
Definition: Parameter_Manager.h:1306
U16 u16_Data_Type
Data type (2 byte)
Definition: Parameter_Manager.h:1329
U32 u32_Parameter_ID
Parameter ID (4 byte)
Definition: Parameter_Manager.h:1326
U32 u32_Application_ID
Appication ID (4 byte)
Definition: Parameter_Manager.h:1309
U32 u32_Parameter_Element_Index
Parameter element index (4 byte)
Definition: Parameter_Manager.h:1335
Parameter table record.
Definition: Parameter_Manager.h:1362
TParameter_Table_Record_Header struct_Header
Parameter table record header data.
Definition: Parameter_Manager.h:1365
TParameter_Table_Record_Body struct_Body
Parameter table record body data.
Definition: Parameter_Manager.h:1368
ConOpSys variant data storage structure.
Definition: ConOpSys_Variant.h:403
OS parameter status structure.
Definition: Defines.h:855
U32 u32_Raw_Data
Raw data representation.
Definition: Defines.h:858