diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala index 8b0f9dcab..bdffdb7bb 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentCppWriter.scala @@ -144,11 +144,14 @@ case class ComponentCppWriter ( } private def getCppIncludes: CppDoc.Member = { - val userHeaders = List( - "Fw/Types/Assert.hpp", - "Fw/Types/ExternalString.hpp", - "Fw/Types/String.hpp", - s.getIncludePath(componentSymbol, fileName) + val userHeaders = List.concat( + guardedList (hasParameters) (List("Fw/Prm/ParamValid.hpp")), + List( + "Fw/Types/Assert.hpp", + "Fw/Types/ExternalString.hpp", + "Fw/Types/String.hpp", + s.getIncludePath(componentSymbol, fileName) + ) ).sorted.map(CppWriter.headerString).flatMap({ case s: "#include \"Fw/Types/String.hpp\"" => lines( diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentParameters.scala b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentParameters.scala index 2f0707435..3f10a5a61 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentParameters.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/ComponentCppWriter/ComponentParameters.scala @@ -130,7 +130,8 @@ case class ComponentParameters ( "Parameter hook functions", List( getParamUpdateHookFunction, - getParamLoadHookFunction + getParamLoadHookFunction, + getParamsLoadHookFunction ) ) } @@ -225,7 +226,9 @@ case class ComponentParameters ( Some( s"""|\\brief Called whenever parameters are loaded | - |This function does nothing by default. You may override it. + |By default this notifies the component of each parameter via + |parameterUpdated. You may override it, for example to suppress + |notification on load. |""" ), "parametersLoaded", @@ -235,6 +238,36 @@ case class ComponentParameters ( CppDoc.Function.Virtual ) + private def getParamsLoadHookFunction = functionClassMember( + Some( + s"""|\\brief Called for each parameter when parameters are loaded + | + |By default this notifies the component via parameterUpdated when + |the parameter loaded successfully (valid or default). You may + |override it, for example to distinguish load from update. + |""" + ), + "parameterLoaded", + List( + CppDoc.Function.Param( + CppDoc.Type("FwPrmIdType"), + "id", + Some("The parameter ID") + ), + CppDoc.Function.Param( + CppDoc.Type("Fw::ParamValid"), + "valid", + Some("The parameter validity status") + ) + ), + CppDoc.Type("void"), + wrapInIf( + "FW_PARAM_OK(valid)", + lines("this->parameterUpdated(id);") + ), + CppDoc.Function.Virtual + ) + private def getParamUpdateHookFunction = functionClassMember( Some( s"""|\\brief Called whenever a parameter is updated @@ -448,6 +481,9 @@ case class ComponentParameters ( lines( """| |this->m_paramLock.unlock();""" + ), + lines( + s"this->parameterLoaded(${paramIdConstantName(param.getName)}, this->${paramValidityFlagName(param.getName)});" ) ) } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.cpp index f15245577..c8913e2b3 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.cpp @@ -5,6 +5,7 @@ // ====================================================================== #include "ActiveExternalParamsComponentAc.hpp" +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1689,6 +1690,7 @@ void ActiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -1714,6 +1716,7 @@ void ActiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -1760,6 +1763,7 @@ void ActiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -1785,6 +1789,7 @@ void ActiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -1831,6 +1836,7 @@ void ActiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -1856,6 +1862,7 @@ void ActiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -3495,6 +3502,17 @@ void ActiveExternalParamsComponentBase :: // Do nothing by default } +void ActiveExternalParamsComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.hpp index c1060e249..30a465ad9 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveExternalParamsComponentAc.ref.hpp @@ -1544,9 +1544,21 @@ class ActiveExternalParamsComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp index ea5c714e9..61e6fad61 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.cpp @@ -5,6 +5,7 @@ // ====================================================================== #include "ActiveParamsComponentAc.hpp" +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1685,6 +1686,7 @@ void ActiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -1706,6 +1708,7 @@ void ActiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -1733,6 +1736,7 @@ void ActiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -1754,6 +1758,7 @@ void ActiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -1781,6 +1786,7 @@ void ActiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -1802,6 +1808,7 @@ void ActiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); // Call notifier this->parametersLoaded(); @@ -3441,6 +3448,17 @@ void ActiveParamsComponentBase :: // Do nothing by default } +void ActiveParamsComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.hpp index 469a84e3e..33f13fc3f 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.hpp @@ -1543,9 +1543,21 @@ class ActiveParamsComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp index f11b4f9b5..0bd9a380d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.cpp @@ -5,6 +5,7 @@ // ====================================================================== #include "ActiveSerialComponentAc.hpp" +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -2147,6 +2148,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -2168,6 +2170,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -2195,6 +2198,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -2216,6 +2220,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -2243,6 +2248,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -2264,6 +2270,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); _id = _baseId + PARAMID_PARAMI32EXT; @@ -2289,6 +2296,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -2314,6 +2322,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -2360,6 +2369,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -2385,6 +2395,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -2431,6 +2442,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -2456,6 +2468,7 @@ void ActiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -7120,6 +7133,17 @@ void ActiveSerialComponentBase :: // Do nothing by default } +void ActiveSerialComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.hpp index d8efe1c96..0a3e28e2e 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveSerialComponentAc.ref.hpp @@ -2550,9 +2550,21 @@ class ActiveSerialComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp index 489a6ca43..c70ae1d36 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.cpp @@ -5,6 +5,7 @@ // ====================================================================== #include "ActiveTestComponentAc.hpp" +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -2225,6 +2226,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -2246,6 +2248,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -2273,6 +2276,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -2294,6 +2298,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -2321,6 +2326,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -2342,6 +2348,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); _id = _baseId + PARAMID_PARAMI32EXT; @@ -2367,6 +2374,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -2392,6 +2400,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -2438,6 +2447,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -2463,6 +2473,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -2509,6 +2520,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -2534,6 +2546,7 @@ namespace M { } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -6952,6 +6965,17 @@ namespace M { // Do nothing by default } + void ActiveTestComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) + { + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } + } + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp index a1a8df7e6..f054b703d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/ActiveTestComponentAc.ref.hpp @@ -2490,9 +2490,21 @@ namespace M { //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.cpp index ac9efcea7..55973b619 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for PassiveExternalParams component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1404,6 +1405,7 @@ void PassiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -1429,6 +1431,7 @@ void PassiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -1475,6 +1478,7 @@ void PassiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -1500,6 +1504,7 @@ void PassiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -1546,6 +1551,7 @@ void PassiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -1571,6 +1577,7 @@ void PassiveExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -2541,6 +2548,17 @@ void PassiveExternalParamsComponentBase :: // Do nothing by default } +void PassiveExternalParamsComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.hpp index d7a1ef0f3..c53421586 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveExternalParamsComponentAc.ref.hpp @@ -1248,9 +1248,21 @@ class PassiveExternalParamsComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp index 005a7c362..567ba2931 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for PassiveParams component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1400,6 +1401,7 @@ void PassiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -1421,6 +1423,7 @@ void PassiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -1448,6 +1451,7 @@ void PassiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -1469,6 +1473,7 @@ void PassiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -1496,6 +1501,7 @@ void PassiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -1517,6 +1523,7 @@ void PassiveParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); // Call notifier this->parametersLoaded(); @@ -2487,6 +2494,17 @@ void PassiveParamsComponentBase :: // Do nothing by default } +void PassiveParamsComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.hpp index 7ee448ff3..7cc5958dc 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveParamsComponentAc.ref.hpp @@ -1247,9 +1247,21 @@ class PassiveParamsComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp index 2d3caa437..80f62f799 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for PassiveSerial component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1645,6 +1646,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -1666,6 +1668,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -1693,6 +1696,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -1714,6 +1718,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -1741,6 +1746,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -1762,6 +1768,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); _id = _baseId + PARAMID_PARAMI32EXT; @@ -1787,6 +1794,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -1812,6 +1820,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -1858,6 +1867,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -1883,6 +1893,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -1929,6 +1940,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -1954,6 +1966,7 @@ void PassiveSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -5026,6 +5039,17 @@ void PassiveSerialComponentBase :: // Do nothing by default } +void PassiveSerialComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.hpp index 6b1a89ae4..8b66825ab 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveSerialComponentAc.ref.hpp @@ -1904,9 +1904,21 @@ class PassiveSerialComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp index 3326a875f..7b3b88821 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for PassiveTest component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1877,6 +1878,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -1898,6 +1900,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -1925,6 +1928,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -1946,6 +1950,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -1973,6 +1978,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -1994,6 +2000,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); _id = _baseId + PARAMID_PARAMI32EXT; @@ -2019,6 +2026,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -2044,6 +2052,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -2090,6 +2099,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -2115,6 +2125,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -2161,6 +2172,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -2186,6 +2198,7 @@ void PassiveTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -5206,6 +5219,17 @@ void PassiveTestComponentBase :: // Do nothing by default } +void PassiveTestComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp index f20cdc2b7..88a0816a3 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/PassiveTestComponentAc.ref.hpp @@ -1967,9 +1967,21 @@ class PassiveTestComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.cpp index 8575cfdf0..b60f6122f 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for QueuedExternalParams component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1689,6 +1690,7 @@ void QueuedExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -1714,6 +1716,7 @@ void QueuedExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -1760,6 +1763,7 @@ void QueuedExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -1785,6 +1789,7 @@ void QueuedExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -1831,6 +1836,7 @@ void QueuedExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -1856,6 +1862,7 @@ void QueuedExternalParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -3495,6 +3502,17 @@ void QueuedExternalParamsComponentBase :: // Do nothing by default } +void QueuedExternalParamsComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.hpp index d43cd070c..887af58ff 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedExternalParamsComponentAc.ref.hpp @@ -1544,9 +1544,21 @@ class QueuedExternalParamsComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp index f283e4918..5943dd727 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for QueuedParams component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -1685,6 +1686,7 @@ void QueuedParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -1706,6 +1708,7 @@ void QueuedParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -1733,6 +1736,7 @@ void QueuedParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -1754,6 +1758,7 @@ void QueuedParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -1781,6 +1786,7 @@ void QueuedParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -1802,6 +1808,7 @@ void QueuedParamsComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); // Call notifier this->parametersLoaded(); @@ -3441,6 +3448,17 @@ void QueuedParamsComponentBase :: // Do nothing by default } +void QueuedParamsComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.hpp index 74aeb0086..a6bb1950c 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedParamsComponentAc.ref.hpp @@ -1543,9 +1543,21 @@ class QueuedParamsComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp index e4831a3b8..18967420d 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for QueuedSerial component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -2147,6 +2148,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -2168,6 +2170,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -2195,6 +2198,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -2216,6 +2220,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -2243,6 +2248,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -2264,6 +2270,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); _id = _baseId + PARAMID_PARAMI32EXT; @@ -2289,6 +2296,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -2314,6 +2322,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -2360,6 +2369,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -2385,6 +2395,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -2431,6 +2442,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -2456,6 +2468,7 @@ void QueuedSerialComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -7120,6 +7133,17 @@ void QueuedSerialComponentBase :: // Do nothing by default } +void QueuedSerialComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.hpp index 80e1cbb85..5910798c8 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedSerialComponentAc.ref.hpp @@ -2550,9 +2550,21 @@ class QueuedSerialComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp index 34f689989..d08eb6598 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.cpp @@ -4,6 +4,7 @@ // \brief cpp file for QueuedTest component base class // ====================================================================== +#include "Fw/Prm/ParamValid.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #if FW_ENABLE_TEXT_LOGGING @@ -2223,6 +2224,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMU32, this->m_param_ParamU32_valid); _id = _baseId + PARAMID_PARAMF64; @@ -2244,6 +2246,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64, this->m_param_ParamF64_valid); _id = _baseId + PARAMID_PARAMSTRING; @@ -2271,6 +2274,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRING, this->m_param_ParamString_valid); _id = _baseId + PARAMID_PARAMENUM; @@ -2292,6 +2296,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUM, this->m_param_ParamEnum_valid); _id = _baseId + PARAMID_PARAMARRAY; @@ -2319,6 +2324,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAY, this->m_param_ParamArray_valid); _id = _baseId + PARAMID_PARAMSTRUCT; @@ -2340,6 +2346,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCT, this->m_param_ParamStruct_valid); _id = _baseId + PARAMID_PARAMI32EXT; @@ -2365,6 +2372,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMI32EXT, this->m_param_ParamI32Ext_valid); _id = _baseId + PARAMID_PARAMF64EXT; @@ -2390,6 +2398,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMF64EXT, this->m_param_ParamF64Ext_valid); _id = _baseId + PARAMID_PARAMSTRINGEXT; @@ -2436,6 +2445,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRINGEXT, this->m_param_ParamStringExt_valid); _id = _baseId + PARAMID_PARAMENUMEXT; @@ -2461,6 +2471,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMENUMEXT, this->m_param_ParamEnumExt_valid); _id = _baseId + PARAMID_PARAMARRAYEXT; @@ -2507,6 +2518,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMARRAYEXT, this->m_param_ParamArrayExt_valid); _id = _baseId + PARAMID_PARAMSTRUCTEXT; @@ -2532,6 +2544,7 @@ void QueuedTestComponentBase :: } this->m_paramLock.unlock(); + this->parameterLoaded(PARAMID_PARAMSTRUCTEXT, this->m_param_ParamStructExt_valid); // Call notifier this->parametersLoaded(); @@ -6950,6 +6963,17 @@ void QueuedTestComponentBase :: // Do nothing by default } +void QueuedTestComponentBase :: + parameterLoaded( + FwPrmIdType id, + Fw::ParamValid valid + ) +{ + if (FW_PARAM_OK(valid)) { + this->parameterUpdated(id); + } +} + // ---------------------------------------------------------------------- // Parameter get functions // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp index 7ce9a341d..0d477b930 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/QueuedTestComponentAc.ref.hpp @@ -2488,9 +2488,21 @@ class QueuedTestComponentBase : //! \brief Called whenever parameters are loaded //! - //! This function does nothing by default. You may override it. + //! By default this notifies the component of each parameter via + //! parameterUpdated. You may override it, for example to suppress + //! notification on load. virtual void parametersLoaded(); + //! \brief Called for each parameter when parameters are loaded + //! + //! By default this notifies the component via parameterUpdated when + //! the parameter loaded successfully (valid or default). You may + //! override it, for example to distinguish load from update. + virtual void parameterLoaded( + FwPrmIdType id, //!< The parameter ID + Fw::ParamValid valid //!< The parameter validity status + ); + protected: // ----------------------------------------------------------------------