////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// THIS IS AUTO-GENERATED CODE.  PLEASE DO NOT EDIT (File bug reports against tools).
///
/// Auto-generated by: Parameter Parser V7.4.1 (8cca6579792b9fcef3bc725ff070c5ec453c7c85)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file  modawbinitv1.cpp
/// @brief Auto-generated Chromatix parameter file
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "modawbinitv1.h"
#include "parametersetmanager.h"

MODAWBINITV1_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool modAWBInitV1BGStatsConfType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "BGStatMode") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)BGStatMode, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool modAWBInitV1BGStatsConfType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "BGStatMode") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            BGStatMode = (modAWBInitV1BGStatsModeType)(UINT32)dblValue; 
        }
    }

    return __result;
}

bool modAWBInitV1BGStatsConfType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // BGStatMode
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("BGStatMode", ParameterParserDataType::Enum, (double)(UINT32)BGStatMode, 0));
    }
    else if (PARAMETER_STRCMP(__name, "BGStatMode") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Enum, (double)(UINT32)BGStatMode, 0));
    }

    return __result;
}

bool modAWBInitV1GlobalEnvConfType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "DepthMapEnable") == 0)
    {
        ParameterUtils::DoubleToString((double)DepthMapEnable, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool modAWBInitV1GlobalEnvConfType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "DepthMapEnable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            DepthMapEnable = (awbglobalelements::enableFlagType)dblValue; 
        }
    }

    return __result;
}

bool modAWBInitV1GlobalEnvConfType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // DepthMapEnable
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("DepthMapEnable", ParameterParserDataType::Int32, (double)DepthMapEnable, 0));
    }
    else if (PARAMETER_STRCMP(__name, "DepthMapEnable") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)DepthMapEnable, 0));
    }

    return __result;
}

bool modAWBAONFaceTargetDataType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "triggerType") == 0)
    {
        if (__index < triggerTypeFixedCount)
        {
            ParameterUtils::DoubleToString((double)(UINT32)triggerType[__index], __value, __size, 0);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < triggerTypeFixedCount; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)(UINT32)triggerType[i], &__value[__valuePos], (INT32)(__size - __valuePos), 0);
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        if (__index < triggerDataCount)
        {
            __result = triggerData[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool modAWBAONFaceTargetDataType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "triggerType") == 0)
    {
        if (__index < triggerTypeFixedCount)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                triggerType[__index] = (awbglobalelements::awbTriggerCtrlType)(UINT32)dblValue; 
            }
        }
        else
        {
            const SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __valuePos = 0;

            __index = 0;
            while (__valuePos < __valueLen && __index < triggerTypeFixedCount)
            {
                CHAR __valueStr[MAX_SIZE];

                __valuePos += ParameterUtils::GetSubString(&__value[__valuePos], ',', __valueStr, MAX_SIZE);
                __valuePos++;

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    triggerType[__index] = (awbglobalelements::awbTriggerCtrlType)(UINT32)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        if (__index < triggerDataCount)
        {
            __result = triggerData[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

bool modAWBAONFaceTargetDataType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // triggerType
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("triggerType", ParameterParserDataType::Enum, true, false, triggerTypeFixedCount));
    }

    // triggerPt
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("triggerPt", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.GetInfo(&__path[__pos], __info);
    }

    // triggerData
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("triggerData", ParameterParserDataType::Structure, true, false, triggerDataCount));
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        if (__index < triggerDataCount)
        {
            __result = triggerData[__index].GetInfo(&__path[__pos], __info);
        }
        else
        {
            __result = true;
            __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Structure, true, false, triggerDataCount));
        }
    }

    return __result;
}

bool modAWBAONSensorAssitType::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        ParameterUtils::DoubleToString((double)enable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "aonLuxIndexAdaptOffset") == 0)
    {
        ParameterUtils::DoubleToString((double)aonLuxIndexAdaptOffset, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "aonCCTDiffThres") == 0)
    {
        __result = aonCCTDiffThres.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "aonFaceDecisionRatio") == 0)
    {
        __result = aonFaceDecisionRatio.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "skinTargetPt") == 0)
    {
        __result = skinTargetPt.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool modAWBAONSensorAssitType::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enable = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "aonLuxIndexAdaptOffset") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            aonLuxIndexAdaptOffset = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "aonCCTDiffThres") == 0)
    {
        __result = aonCCTDiffThres.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "aonFaceDecisionRatio") == 0)
    {
        __result = aonFaceDecisionRatio.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "skinTargetPt") == 0)
    {
        __result = skinTargetPt.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool modAWBAONSensorAssitType::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // enable
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("enable", ParameterParserDataType::Boolean, (double)enable, 0));
    }
    else if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Boolean, (double)enable, 0));
    }

    // aonLuxIndexAdaptOffset
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("aonLuxIndexAdaptOffset", ParameterParserDataType::Float, (double)aonLuxIndexAdaptOffset));
    }
    else if (PARAMETER_STRCMP(__name, "aonLuxIndexAdaptOffset") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)aonLuxIndexAdaptOffset));
    }

    // aonCCTDiffThres
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("aonCCTDiffThres", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "aonCCTDiffThres") == 0)
    {
        __result = aonCCTDiffThres.GetInfo(&__path[__pos], __info);
    }

    // aonFaceDecisionRatio
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("aonFaceDecisionRatio", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "aonFaceDecisionRatio") == 0)
    {
        __result = aonFaceDecisionRatio.GetInfo(&__path[__pos], __info);
    }

    // skinTargetPt
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("skinTargetPt", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "skinTargetPt") == 0)
    {
        __result = skinTargetPt.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool chromatixAWBInitV1Type::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = moduleID.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "initialGain") == 0)
    {
        __result = initialGain.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "initialCCT") == 0)
    {
        ParameterUtils::DoubleToString((double)initialCCT, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "BGStatConf") == 0)
    {
        __result = BGStatConf.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "GlobalEnvConf") == 0)
    {
        __result = GlobalEnvConf.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "aonSensorAssitStart") == 0)
    {
        __result = aonSensorAssitStart.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool chromatixAWBInitV1Type::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = moduleID.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableFlag = (awbglobalelements::enableFlagType)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "initialGain") == 0)
    {
        __result = initialGain.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "initialCCT") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            initialCCT = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "BGStatConf") == 0)
    {
        __result = BGStatConf.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "GlobalEnvConf") == 0)
    {
        __result = GlobalEnvConf.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "aonSensorAssitStart") == 0)
    {
        __result = aonSensorAssitStart.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool chromatixAWBInitV1Type::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    const UINT32 __pos = ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // moduleID
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("moduleID", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = moduleID.GetInfo(&__path[__pos], __info);
    }

    // module_version
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("module_version", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.GetInfo(&__path[__pos], __info);
    }

    // enableFlag
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("enableFlag", ParameterParserDataType::Int32, (double)enableFlag, 0));
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)enableFlag, 0));
    }

    // initialGain
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("initialGain", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "initialGain") == 0)
    {
        __result = initialGain.GetInfo(&__path[__pos], __info);
    }

    // initialCCT
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("initialCCT", ParameterParserDataType::Float, (double)initialCCT));
    }
    else if (PARAMETER_STRCMP(__name, "initialCCT") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Float, (double)initialCCT));
    }

    // BGStatConf
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("BGStatConf", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "BGStatConf") == 0)
    {
        __result = BGStatConf.GetInfo(&__path[__pos], __info);
    }

    // GlobalEnvConf
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("GlobalEnvConf", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "GlobalEnvConf") == 0)
    {
        __result = GlobalEnvConf.GetInfo(&__path[__pos], __info);
    }

    // aonSensorAssitStart
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("aonSensorAssitStart", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "aonSensorAssitStart") == 0)
    {
        __result = aonSensorAssitStart.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool chromatixAWBInitV1Type::module_versionStruct::GetValue(
    const CHAR* const __path,
    CHAR* const       __value,
    UINT32 const      __size)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)major_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)minor_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)incr_revision, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool chromatixAWBInitV1Type::module_versionStruct::SetValue(
    const CHAR* const __path,
    const CHAR* const __value)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            major_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            minor_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            incr_revision = (INT32)dblValue; 
        }
    }

    return __result;
}

bool chromatixAWBInitV1Type::module_versionStruct::GetInfo(
    const CHAR* const           __path,
    PList<ParameterParserInfo>& __info)
{
    constexpr SIZE_T MAX_SIZE = 129;
    CHAR   __name[MAX_SIZE] = "";
    UINT32 __index          = MAX_UINT;
    bool   __result         = false;

    (void)ParameterUtils::GetVariable(__path, __name, __index, MAX_SIZE);

    // major_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("major_revision", ParameterParserDataType::Int32, (double)major_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)major_revision, 0));
    }

    // minor_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("minor_revision", ParameterParserDataType::Int32, (double)minor_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)minor_revision, 0));
    }

    // incr_revision
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("incr_revision", ParameterParserDataType::Int32, (double)incr_revision, 0));
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        __result = true;
        __info.Add(ParameterParserInfo(nullptr, ParameterParserDataType::Int32, (double)incr_revision, 0));
    }

    return __result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixAWBInitV1TypeClass::chromatixAWBInitV1TypeClass(
    const CHAR* name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(initialGain);
    PARAMETER_INITIALIZE(initialCCT);
    PARAMETER_INITIALIZE(BGStatConf);
    PARAMETER_INITIALIZE(GlobalEnvConf);
    PARAMETER_INITIALIZE(aonSensorAssitStart);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixAWBInitV1TypeClass::chromatixAWBInitV1TypeClass(
    const CHAR*       name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(initialGain);
    PARAMETER_INITIALIZE(initialCCT);
    PARAMETER_INITIALIZE(BGStatConf);
    PARAMETER_INITIALIZE(GlobalEnvConf);
    PARAMETER_INITIALIZE(aonSensorAssitStart);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Destructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixAWBInitV1TypeClass::~chromatixAWBInitV1TypeClass()
{
    if (Loaded)
    {
        UnloadModule();
    }
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load modAWBInitV1BGStatsConfType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modAWBInitV1BGStatsConfType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(BGStatMode);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0x948c375310f964b5;
        entry->ReadEnumFixedArray(&BGStatMode, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void modAWBInitV1BGStatsConfType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        modAWBInitV1BGStatsConfType* arrayPtr = (modAWBInitV1BGStatsConfType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* modAWBInitV1BGStatsConfType::AllocArray(
    UINT32 __count)
{
    modAWBInitV1BGStatsConfType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW modAWBInitV1BGStatsConfType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load modAWBInitV1GlobalEnvConfType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modAWBInitV1GlobalEnvConfType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(DepthMapEnable);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xfbd40f992b80ecd1;
        entry->ReadSimpleTypeFixedArray(&DepthMapEnable, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void modAWBInitV1GlobalEnvConfType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        modAWBInitV1GlobalEnvConfType* arrayPtr = (modAWBInitV1GlobalEnvConfType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* modAWBInitV1GlobalEnvConfType::AllocArray(
    UINT32 __count)
{
    modAWBInitV1GlobalEnvConfType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW modAWBInitV1GlobalEnvConfType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load modAWBAONFaceTargetDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modAWBAONFaceTargetDataType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(triggerType);
    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerDataCount);
    PARAMETER_INITIALIZE(triggerData);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0x8eed18ac845832a6;
        entry->ReadEnumFixedArray(triggerType, triggerTypeFixedCount,
            localParams);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xcb944a716851ffce;
        triggerPt.Load(localParams);
        localParams.NameHash = 0xd5dc9fcb428af073;
        entry->ReadStructureArray(triggerData, triggerDataCount, triggerDataID, 1, localParams, __COUNTER__);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void modAWBAONFaceTargetDataType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        modAWBAONFaceTargetDataType* arrayPtr = (modAWBAONFaceTargetDataType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* modAWBAONFaceTargetDataType::AllocArray(
    UINT32 __count)
{
    modAWBAONFaceTargetDataType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW modAWBAONFaceTargetDataType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load modAWBAONSensorAssitType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modAWBAONSensorAssitType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(aonLuxIndexAdaptOffset);
    PARAMETER_INITIALIZE(aonCCTDiffThres);
    PARAMETER_INITIALIZE(aonFaceDecisionRatio);
    PARAMETER_INITIALIZE(skinTargetPt);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xb3c00adf8e304e57;
        entry->ReadSimpleTypeFixedArray(&enable, 1, localParams);
        localParams.NameHash = 0xd6fcab0ba47a0665;
        entry->ReadSimpleTypeFixedArray(&aonLuxIndexAdaptOffset, 1, localParams);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0x906a15fbe37565bd;
        aonCCTDiffThres.Load(localParams);
        localParams.NameHash        = 0x81ce22a322d97c79;
        aonFaceDecisionRatio.Load(localParams);
        localParams.NameHash        = 0xefde4fd679360e4a;
        skinTargetPt.Load(localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void modAWBAONSensorAssitType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        modAWBAONSensorAssitType* arrayPtr = (modAWBAONSensorAssitType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* modAWBAONSensorAssitType::AllocArray(
    UINT32 __count)
{
    modAWBAONSensorAssitType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW modAWBAONSensorAssitType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatixAWBInitV1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAWBInitV1Type::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(initialGain);
    PARAMETER_INITIALIZE(initialCCT);
    PARAMETER_INITIALIZE(BGStatConf);
    PARAMETER_INITIALIZE(GlobalEnvConf);
    PARAMETER_INITIALIZE(aonSensorAssitStart);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xb5bb6c7a408ed007;
        moduleID.Load(localParams);
        localParams.NameHash        = 0xe11cd9f365a2599f;
        module_version.Load(localParams);
        localParams.NameHash = 0x89a1d7b1468113d1;
        entry->ReadSimpleTypeFixedArray(&enableFlag, 1, localParams);
        localParams.NameHash        = 0xe6bb12d7b5a29f03;
        initialGain.Load(localParams);
        localParams.NameHash = 0xfe53b509f1f8b696;
        entry->ReadSimpleTypeFixedArray(&initialCCT, 1, localParams);
        localParams.NameHash        = 0x9fc64aee22de0768;
        BGStatConf.Load(localParams);
        localParams.NameHash        = 0xb1da54dd245df269;
        GlobalEnvConf.Load(localParams);
        localParams.NameHash        = 0xad3306bc9e0ce527;
        aonSensorAssitStart.Load(localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void chromatixAWBInitV1Type::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        chromatixAWBInitV1Type* arrayPtr = (chromatixAWBInitV1Type*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* chromatixAWBInitV1Type::AllocArray(
    UINT32 __count)
{
    chromatixAWBInitV1Type* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW chromatixAWBInitV1Type[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAWBInitV1Type::module_versionStruct::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(major_revision);
    PARAMETER_INITIALIZE(minor_revision);
    PARAMETER_INITIALIZE(incr_revision);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xcd66249477636693;
        entry->ReadSimpleTypeFixedArray(&major_revision, 1, localParams);
        localParams.NameHash = 0xc5497493137a9c25;
        entry->ReadSimpleTypeFixedArray(&minor_revision, 1, localParams);
        localParams.NameHash = 0xb27b8a668efb2a56;
        entry->ReadSimpleTypeFixedArray(&incr_revision, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void chromatixAWBInitV1Type::module_versionStruct::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        module_versionStruct* arrayPtr = (module_versionStruct*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* chromatixAWBInitV1Type::module_versionStruct::AllocArray(
    UINT32 __count)
{
    module_versionStruct* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW module_versionStruct[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload modAWBAONFaceTargetDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modAWBAONFaceTargetDataType::Unload(ParameterFileSymbolTable* const __table)
{
    for (UINT32 i = 0; triggerData != nullptr && i < triggerDataCount; i++)
    {
        triggerData[i].Unload(__table);
    }
    ParameterFileSymbolTable::ReleaseObject(__table, triggerData);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload modAWBAONSensorAssitType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modAWBAONSensorAssitType::Unload(ParameterFileSymbolTable* const __table)
{
    skinTargetPt.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload chromatixAWBInitV1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAWBInitV1Type::Unload(ParameterFileSymbolTable* const __table)
{
    aonSensorAssitStart.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Release the ParameterModule object
/// Requires that this object was created via a ParameterSetManager::GetModule call
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAWBInitV1Type::Release()
{
    ((chromatixAWBInitV1TypeClass*)this)->Release();
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Returns the ParameterModule::Modified value
/// The Modified value is incremented when the module's data or pointer values change
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
UINT32 chromatixAWBInitV1Type::GetModified()
{
    return ((chromatixAWBInitV1TypeClass*)this)->Modified;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetModuleName: Returns ParameterModule::Name variable
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CHAR* chromatixAWBInitV1Type::GetModuleName()
{
    return ((chromatixAWBInitV1TypeClass*)this)->Name;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetModuleName: Returns ParameterModule::NameHash variable
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
UINT64 chromatixAWBInitV1Type::GetModuleNameHash()
{
    return ((chromatixAWBInitV1TypeClass*)this)->NameHash;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* chromatixAWBInitV1TypeClass::Create(
    ModuleData* const    moduleData,
    DefaultModule* const defModule) const
{
    chromatixAWBInitV1TypeClass* cls = nullptr;

    if (IsModuleMatch(moduleData) && Version.Value == moduleData->Version.Value)
    {
        const UINT32 id = moduleData->DuplicateID > 0 ? moduleData->DuplicateID : moduleData->ID;

        ParameterModule* const module = defModule->Find(id);
        if (module != nullptr)
        {
            cls = (chromatixAWBInitV1TypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW chromatixAWBInitV1TypeClass(Name, moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixAWBInitV1TypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixAWBInitV1TypeClass, binary name hash (0x%016llx) does not match source name hash (0x%016llx)\n",
            moduleData->NameHash, NameHash);
    }

    return (ParameterModule*)cls;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module data, return true is successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixAWBInitV1TypeClass::LoadModule(
    ParameterFileSymbolTable* const table)
{
    bool result = true;

#ifdef PARAMETER_USE_MUTEX
    ParameterMutexLocker lock(Mutex); // Unique LOCK
#endif

    if (!Loaded)
    {
        chromatixAWBInitV1TypeClass* const cls = this;

        ParameterFileSymbolTableEntry  entryObj;
        ParameterFileSymbolTableEntry* const entry = &entryObj;
        // With EzTune enabled, the unused upper byte of SymbolTableID value can change, so clear it
        result = table->Find(entryObj, SymbolTableID & 0x00ffffffU);

        if (!result)
        {
            PARAMETER_LOG_ERROR(entry->Table->SetManager, "chromatixAWBInitV1TypeClass::LoadModule Failed to find module ID (%d) in Symbol Table\n", SymbolTableID);
        }


        ParameterDefinitionElement* _element = nullptr;
        if (table->ModuleDefinitions != nullptr && !table->ModuleDefinitions->empty())
        {
            _element = table->BuildModuleElement(NameHash);
        }

        ParameterLoadParameters parentParams(entry, NameHash, true, true, _element, entry->Position, 0, ParameterFileSymbolTableEntry::LOAD_LIMIT_MAX);
        cls->Load(parentParams);
        PARAMETER_DELETE _element;
        Modified++;
        Loaded = true;
    }

    if (!result)
    {
        /// Module failed to fully load, unload it
        UnloadModule();
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload module data
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAWBInitV1TypeClass::UnloadModule()
{
#ifdef PARAMETER_USE_MUTEX
    ParameterMutexLocker lock(Mutex); // Unique LOCK
#endif

    if (Loaded)
    {
        if (Data != nullptr && Data->SymbolTable != nullptr)
        {
            Unload(Data->SymbolTable);
        }
        else
        {
            PARAMETER_LOG_ERROR(Data != nullptr ? Data->SetManager : nullptr, "UnloadModule %s called with nullptr "
                "Data->SymbolTable object\n", Name);
            Unload(nullptr);
        }
        Loaded = false;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// /// Release the ParameterModule object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAWBInitV1TypeClass::Release()
{
    ParameterModule::Release();
}

MODAWBINITV1_NAMESPACE_END
