////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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 V5.5.1 (2411131018)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

#include "modsaagwv2.h"
#include "parametersetmanager.h"

MODSAAGWV2_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool modIlluWVCtrlV1CCTTriggerDataType::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, "triggerPt") == 0)
    {
        __result = triggerPt.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool modIlluWVCtrlV1CCTTriggerDataType::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, "triggerPt") == 0)
    {
        __result = triggerPt.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.SetValue(&__path[__pos], __value);
    }

    return __result;
}

bool modIlluWVCtrlV1CCTTriggerDataType::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);

    // 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));
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.GetInfo(&__path[__pos], __info);
    }

    return __result;
}

bool modIlluWVCtrlV1LuxTriggerDataType::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, "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 modIlluWVCtrlV1LuxTriggerDataType::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, "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 modIlluWVCtrlV1LuxTriggerDataType::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);

    // 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 modAGWWeightDataTypeV1::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 < 2)
        {
            ParameterUtils::DoubleToString((double)(UINT32)triggerType[__index], __value, __size, 0);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < 2; 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 modAGWWeightDataTypeV1::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 < 2)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                triggerType[__index] = (awbglobalelements::awbTriggerCtrlType)(UINT32)dblValue; 
            }
        }
        else
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

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

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

                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 modAGWWeightDataTypeV1::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, 2));
    }

    // 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 chromatixSAAGWV2Type::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, "parameter_version") == 0)
    {
        __result = parameter_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, "outdoorWeightCtrl") == 0)
    {
        if (__index < outdoorWeightCtrlCount)
        {
            __result = outdoorWeightCtrl[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "AHLightWeightCtrl") == 0)
    {
        if (__index < AHLightWeightCtrlCount)
        {
            __result = AHLightWeightCtrl[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "confidenceLevel") == 0)
    {
        if (__index < confidenceLevelCount)
        {
            __result = confidenceLevel[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "outdoorInterpWeight") == 0)
    {
        if (__index < outdoorInterpWeightCount)
        {
            __result = outdoorInterpWeight[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "AHLightInterpWeight") == 0)
    {
        if (__index < AHLightInterpWeightCount)
        {
            __result = AHLightInterpWeight[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool chromatixSAAGWV2Type::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, "parameter_version") == 0)
    {
        __result = parameter_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, "outdoorWeightCtrl") == 0)
    {
        if (__index < outdoorWeightCtrlCount)
        {
            __result = outdoorWeightCtrl[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "AHLightWeightCtrl") == 0)
    {
        if (__index < AHLightWeightCtrlCount)
        {
            __result = AHLightWeightCtrl[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "confidenceLevel") == 0)
    {
        if (__index < confidenceLevelCount)
        {
            __result = confidenceLevel[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "outdoorInterpWeight") == 0)
    {
        if (__index < outdoorInterpWeightCount)
        {
            __result = outdoorInterpWeight[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "AHLightInterpWeight") == 0)
    {
        if (__index < AHLightInterpWeightCount)
        {
            __result = AHLightInterpWeight[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

bool chromatixSAAGWV2Type::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);
    }

    // parameter_version
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("parameter_version", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "parameter_version") == 0)
    {
        __result = parameter_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));
    }

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

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

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

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

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

    return __result;
}

bool chromatixSAAGWV2Type::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;

    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 chromatixSAAGWV2Type::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;

    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 chromatixSAAGWV2Type::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;

    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;
}

bool chromatixSAAGWV2Type::parameter_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;

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

    if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        PARAMETER_STRCPY(__value, __size, revision);
        __result = true;
    }

    return __result;
}

bool chromatixSAAGWV2Type::parameter_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;

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

    if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }

    return __result;
}

bool chromatixSAAGWV2Type::parameter_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;

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

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

    return __result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixSAAGWV2TypeClass::chromatixSAAGWV2TypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(outdoorWeightCtrlCount);
    PARAMETER_INITIALIZE(outdoorWeightCtrl);
    PARAMETER_INITIALIZE(AHLightWeightCtrlCount);
    PARAMETER_INITIALIZE(AHLightWeightCtrl);
    PARAMETER_INITIALIZE(confidenceLevelCount);
    PARAMETER_INITIALIZE(confidenceLevel);
    PARAMETER_INITIALIZE(outdoorInterpWeightCount);
    PARAMETER_INITIALIZE(outdoorInterpWeight);
    PARAMETER_INITIALIZE(AHLightInterpWeightCount);
    PARAMETER_INITIALIZE(AHLightInterpWeight);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixSAAGWV2TypeClass::chromatixSAAGWV2TypeClass(
    const CHAR* const name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(outdoorWeightCtrl);
    PARAMETER_INITIALIZE(AHLightWeightCtrl);
    PARAMETER_INITIALIZE(confidenceLevel);
    PARAMETER_INITIALIZE(outdoorInterpWeight);
    PARAMETER_INITIALIZE(AHLightInterpWeight);
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetName
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CHAR* chromatixSAAGWV2TypeClass::GetName(
    const CHAR* const type)
{
    const CHAR* name = type;
    CHAR temp[ParameterFileSymbolTableEntry::TYPE_LEN + 1];
    if (PARAMETER_STRCMP(type, ModuleData::GetType(temp, "SAAGWV2")) == 0)
    {
        name = "SAAGWV2";
    }
    return name;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load modIlluWVCtrlV1CCTTriggerDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool modIlluWVCtrlV1CCTTriggerDataType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

    result = triggerPt.Load(entry, alignment);
    if (result)
    {
        result = triggerData.Load(entry, alignment);
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load modIlluWVCtrlV1LuxTriggerDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool modIlluWVCtrlV1LuxTriggerDataType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

    result = triggerPt.Load(entry, alignment);

    // Reading Array triggerData from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        triggerDataCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, triggerDataCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            triggerDataID = pointerEntry->ID;
            DupObjInfo* triggerDataDupInfo = pointerEntry->GetDupObject(triggerDataCount, file, line);
            if (triggerDataDupInfo != nullptr && triggerDataDupInfo->Object != nullptr)
            {
                triggerData = (modIlluWVCtrlV1CCTTriggerDataType*)triggerDataDupInfo->Object;
                if (triggerData == nullptr)
                {
                    if (triggerDataDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "triggerData duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            triggerDataDupInfo->File, triggerDataDupInfo->Line, triggerDataDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "triggerData duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            triggerDataDupInfo->Line, triggerDataDupInfo->RefCount);
                    }
                }
            }

            if (triggerData == nullptr)
            {
                if (result && triggerDataCount > 0)
                {
                    triggerData = PARAMETER_NEW modIlluWVCtrlV1CCTTriggerDataType[triggerDataCount];
                    (void)pointerEntry->SetDupObject(triggerData, triggerDataCount, file, line);
                }
                if (!result || triggerData == nullptr)
                {
                    if (triggerDataCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate triggerData\n");
                    }
                    triggerDataCount = 0;
                }
                for (UINT32 i = 0; result && i < triggerDataCount; i++)
                {
                    result = triggerData[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (triggerData == nullptr)
        {
            triggerDataCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load modAGWWeightDataTypeV1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool modAGWWeightDataTypeV1::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(triggerType);
    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

    for (UINT32 i = 0; result && i < 2; i++)
    {
        result = awbglobalelements::ReadEnum_awbTriggerCtrlType(entry, triggerType[i], alignment);
    }
    if (result)
    {
        result = triggerPt.Load(entry, alignment);
    }

    // Reading Array triggerData from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        triggerDataCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, triggerDataCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            triggerDataID = pointerEntry->ID;
            DupObjInfo* triggerDataDupInfo = pointerEntry->GetDupObject(triggerDataCount, file, line);
            if (triggerDataDupInfo != nullptr && triggerDataDupInfo->Object != nullptr)
            {
                triggerData = (awbglobalelements::awbSAConfidenceLevel2Type*)triggerDataDupInfo->Object;
                if (triggerData == nullptr)
                {
                    if (triggerDataDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "triggerData duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            triggerDataDupInfo->File, triggerDataDupInfo->Line, triggerDataDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "triggerData duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            triggerDataDupInfo->Line, triggerDataDupInfo->RefCount);
                    }
                }
            }

            if (triggerData == nullptr)
            {
                if (result && triggerDataCount > 0)
                {
                    triggerData = PARAMETER_NEW awbglobalelements::awbSAConfidenceLevel2Type[triggerDataCount];
                    (void)pointerEntry->SetDupObject(triggerData, triggerDataCount, file, line);
                }
                if (!result || triggerData == nullptr)
                {
                    if (triggerDataCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate triggerData\n");
                    }
                    triggerDataCount = 0;
                }
                for (UINT32 i = 0; result && i < triggerDataCount; i++)
                {
                    result = triggerData[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (triggerData == nullptr)
        {
            triggerDataCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatixSAAGWV2Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixSAAGWV2Type::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(outdoorWeightCtrl);
    PARAMETER_INITIALIZE(AHLightWeightCtrl);
    PARAMETER_INITIALIZE(confidenceLevel);
    PARAMETER_INITIALIZE(outdoorInterpWeight);
    PARAMETER_INITIALIZE(AHLightInterpWeight);

    result = moduleID.Load(entry, alignment);
    if (result)
    {
        result = module_version.Load(entry, alignment);
    }
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, enableFlag, alignment)

    // Reading Array outdoorWeightCtrl from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        outdoorWeightCtrlCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, outdoorWeightCtrlCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            outdoorWeightCtrlID = pointerEntry->ID;
            DupObjInfo* outdoorWeightCtrlDupInfo = pointerEntry->GetDupObject(outdoorWeightCtrlCount, file, line);
            if (outdoorWeightCtrlDupInfo != nullptr && outdoorWeightCtrlDupInfo->Object != nullptr)
            {
                outdoorWeightCtrl = (modIlluWVCtrlV1LuxTriggerDataType*)outdoorWeightCtrlDupInfo->Object;
                if (outdoorWeightCtrl == nullptr)
                {
                    if (outdoorWeightCtrlDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "outdoorWeightCtrl duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            outdoorWeightCtrlDupInfo->File, outdoorWeightCtrlDupInfo->Line, outdoorWeightCtrlDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "outdoorWeightCtrl duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            outdoorWeightCtrlDupInfo->Line, outdoorWeightCtrlDupInfo->RefCount);
                    }
                }
            }

            if (outdoorWeightCtrl == nullptr)
            {
                if (result && outdoorWeightCtrlCount > 0)
                {
                    outdoorWeightCtrl = PARAMETER_NEW modIlluWVCtrlV1LuxTriggerDataType[outdoorWeightCtrlCount];
                    (void)pointerEntry->SetDupObject(outdoorWeightCtrl, outdoorWeightCtrlCount, file, line);
                }
                if (!result || outdoorWeightCtrl == nullptr)
                {
                    if (outdoorWeightCtrlCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate outdoorWeightCtrl\n");
                    }
                    outdoorWeightCtrlCount = 0;
                }
                for (UINT32 i = 0; result && i < outdoorWeightCtrlCount; i++)
                {
                    result = outdoorWeightCtrl[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (outdoorWeightCtrl == nullptr)
        {
            outdoorWeightCtrlCount = 0;
        }
    }

    // Reading Array AHLightWeightCtrl from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        AHLightWeightCtrlCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, AHLightWeightCtrlCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            AHLightWeightCtrlID = pointerEntry->ID;
            DupObjInfo* AHLightWeightCtrlDupInfo = pointerEntry->GetDupObject(AHLightWeightCtrlCount, file, line);
            if (AHLightWeightCtrlDupInfo != nullptr && AHLightWeightCtrlDupInfo->Object != nullptr)
            {
                AHLightWeightCtrl = (modIlluWVCtrlV1LuxTriggerDataType*)AHLightWeightCtrlDupInfo->Object;
                if (AHLightWeightCtrl == nullptr)
                {
                    if (AHLightWeightCtrlDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "AHLightWeightCtrl duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            AHLightWeightCtrlDupInfo->File, AHLightWeightCtrlDupInfo->Line, AHLightWeightCtrlDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "AHLightWeightCtrl duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            AHLightWeightCtrlDupInfo->Line, AHLightWeightCtrlDupInfo->RefCount);
                    }
                }
            }

            if (AHLightWeightCtrl == nullptr)
            {
                if (result && AHLightWeightCtrlCount > 0)
                {
                    AHLightWeightCtrl = PARAMETER_NEW modIlluWVCtrlV1LuxTriggerDataType[AHLightWeightCtrlCount];
                    (void)pointerEntry->SetDupObject(AHLightWeightCtrl, AHLightWeightCtrlCount, file, line);
                }
                if (!result || AHLightWeightCtrl == nullptr)
                {
                    if (AHLightWeightCtrlCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate AHLightWeightCtrl\n");
                    }
                    AHLightWeightCtrlCount = 0;
                }
                for (UINT32 i = 0; result && i < AHLightWeightCtrlCount; i++)
                {
                    result = AHLightWeightCtrl[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (AHLightWeightCtrl == nullptr)
        {
            AHLightWeightCtrlCount = 0;
        }
    }

    // Reading Array confidenceLevel from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        confidenceLevelCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, confidenceLevelCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            confidenceLevelID = pointerEntry->ID;
            DupObjInfo* confidenceLevelDupInfo = pointerEntry->GetDupObject(confidenceLevelCount, file, line);
            if (confidenceLevelDupInfo != nullptr && confidenceLevelDupInfo->Object != nullptr)
            {
                confidenceLevel = (awbglobalelements::awbSAConfidenceDataType*)confidenceLevelDupInfo->Object;
                if (confidenceLevel == nullptr)
                {
                    if (confidenceLevelDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "confidenceLevel duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            confidenceLevelDupInfo->File, confidenceLevelDupInfo->Line, confidenceLevelDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "confidenceLevel duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            confidenceLevelDupInfo->Line, confidenceLevelDupInfo->RefCount);
                    }
                }
            }

            if (confidenceLevel == nullptr)
            {
                if (result && confidenceLevelCount > 0)
                {
                    confidenceLevel = PARAMETER_NEW awbglobalelements::awbSAConfidenceDataType[confidenceLevelCount];
                    (void)pointerEntry->SetDupObject(confidenceLevel, confidenceLevelCount, file, line);
                }
                if (!result || confidenceLevel == nullptr)
                {
                    if (confidenceLevelCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate confidenceLevel\n");
                    }
                    confidenceLevelCount = 0;
                }
                for (UINT32 i = 0; result && i < confidenceLevelCount; i++)
                {
                    result = confidenceLevel[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (confidenceLevel == nullptr)
        {
            confidenceLevelCount = 0;
        }
    }

    // Reading Array outdoorInterpWeight from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        outdoorInterpWeightCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, outdoorInterpWeightCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            outdoorInterpWeightID = pointerEntry->ID;
            DupObjInfo* outdoorInterpWeightDupInfo = pointerEntry->GetDupObject(outdoorInterpWeightCount, file, line);
            if (outdoorInterpWeightDupInfo != nullptr && outdoorInterpWeightDupInfo->Object != nullptr)
            {
                outdoorInterpWeight = (modAGWWeightDataTypeV1*)outdoorInterpWeightDupInfo->Object;
                if (outdoorInterpWeight == nullptr)
                {
                    if (outdoorInterpWeightDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "outdoorInterpWeight duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            outdoorInterpWeightDupInfo->File, outdoorInterpWeightDupInfo->Line, outdoorInterpWeightDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "outdoorInterpWeight duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            outdoorInterpWeightDupInfo->Line, outdoorInterpWeightDupInfo->RefCount);
                    }
                }
            }

            if (outdoorInterpWeight == nullptr)
            {
                if (result && outdoorInterpWeightCount > 0)
                {
                    outdoorInterpWeight = PARAMETER_NEW modAGWWeightDataTypeV1[outdoorInterpWeightCount];
                    (void)pointerEntry->SetDupObject(outdoorInterpWeight, outdoorInterpWeightCount, file, line);
                }
                if (!result || outdoorInterpWeight == nullptr)
                {
                    if (outdoorInterpWeightCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate outdoorInterpWeight\n");
                    }
                    outdoorInterpWeightCount = 0;
                }
                for (UINT32 i = 0; result && i < outdoorInterpWeightCount; i++)
                {
                    result = outdoorInterpWeight[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (outdoorInterpWeight == nullptr)
        {
            outdoorInterpWeightCount = 0;
        }
    }

    // Reading Array AHLightInterpWeight from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        AHLightInterpWeightCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, AHLightInterpWeightCount, alignment)
        constexpr const CHAR* const file {__FILE__};
        constexpr INT32 line {LINE_CONST};
        ParameterFileSymbolTableEntry  pointerEntryCls;
        ParameterFileSymbolTableEntry* const pointerEntry = &pointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(pointerEntryCls, entry, alignment);
        }

        if (result)
        {
            AHLightInterpWeightID = pointerEntry->ID;
            DupObjInfo* AHLightInterpWeightDupInfo = pointerEntry->GetDupObject(AHLightInterpWeightCount, file, line);
            if (AHLightInterpWeightDupInfo != nullptr && AHLightInterpWeightDupInfo->Object != nullptr)
            {
                AHLightInterpWeight = (modAGWWeightDataTypeV1*)AHLightInterpWeightDupInfo->Object;
                if (AHLightInterpWeight == nullptr)
                {
                    if (AHLightInterpWeightDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "AHLightInterpWeight duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            AHLightInterpWeightDupInfo->File, AHLightInterpWeightDupInfo->Line, AHLightInterpWeightDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "AHLightInterpWeight duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            AHLightInterpWeightDupInfo->Line, AHLightInterpWeightDupInfo->RefCount);
                    }
                }
            }

            if (AHLightInterpWeight == nullptr)
            {
                if (result && AHLightInterpWeightCount > 0)
                {
                    AHLightInterpWeight = PARAMETER_NEW modAGWWeightDataTypeV1[AHLightInterpWeightCount];
                    (void)pointerEntry->SetDupObject(AHLightInterpWeight, AHLightInterpWeightCount, file, line);
                }
                if (!result || AHLightInterpWeight == nullptr)
                {
                    if (AHLightInterpWeightCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate AHLightInterpWeight\n");
                    }
                    AHLightInterpWeightCount = 0;
                }
                for (UINT32 i = 0; result && i < AHLightInterpWeightCount; i++)
                {
                    result = AHLightInterpWeight[i].Load(pointerEntry, alignment);
                }
            }
        }
        if (AHLightInterpWeight == nullptr)
        {
            AHLightInterpWeightCount = 0;
        }
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixSAAGWV2Type::module_versionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(major_revision);
    PARAMETER_INITIALIZE(minor_revision);
    PARAMETER_INITIALIZE(incr_revision);

    SYMBOL_TABLE_ENTRY_READ(entry, result, major_revision, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, minor_revision, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, incr_revision, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixSAAGWV2Type::parameter_versionStruct::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(revision);


    // Reading String revision from symbol table
    {
        UINT32 count = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, count, alignment)
        ParameterFileSymbolTableEntry stringPointerEntryCls;
        ParameterFileSymbolTableEntry* const stringPointerEntry = &stringPointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(stringPointerEntryCls, entry, alignment);
        }
        SYMBOL_TABLE_ENTRY_READ_STRING(stringPointerEntry, result, revision, count, alignment)
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload modIlluWVCtrlV1LuxTriggerDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modIlluWVCtrlV1LuxTriggerDataType::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(triggerData))
    {
        PARAMETER_DELETE[] triggerData;
    }
    triggerData = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload modAGWWeightDataTypeV1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void modAGWWeightDataTypeV1::Unload(ParameterFileSymbolTable* const __table)
{
    for (UINT32 i = 0; i < triggerDataCount; i++)
    {
        triggerData[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(triggerData))
    {
        PARAMETER_DELETE[] triggerData;
    }
    triggerData = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload chromatixSAAGWV2Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSAAGWV2Type::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    for (UINT32 i = 0; i < outdoorWeightCtrlCount; i++)
    {
        outdoorWeightCtrl[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(outdoorWeightCtrl))
    {
        PARAMETER_DELETE[] outdoorWeightCtrl;
    }
    outdoorWeightCtrl = nullptr;
    for (UINT32 i = 0; i < AHLightWeightCtrlCount; i++)
    {
        AHLightWeightCtrl[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(AHLightWeightCtrl))
    {
        PARAMETER_DELETE[] AHLightWeightCtrl;
    }
    AHLightWeightCtrl = nullptr;
    for (UINT32 i = 0; i < confidenceLevelCount; i++)
    {
        confidenceLevel[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(confidenceLevel))
    {
        PARAMETER_DELETE[] confidenceLevel;
    }
    confidenceLevel = nullptr;
    for (UINT32 i = 0; i < outdoorInterpWeightCount; i++)
    {
        outdoorInterpWeight[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(outdoorInterpWeight))
    {
        PARAMETER_DELETE[] outdoorInterpWeight;
    }
    outdoorInterpWeight = nullptr;
    for (UINT32 i = 0; i < AHLightInterpWeightCount; i++)
    {
        AHLightInterpWeight[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(AHLightInterpWeight))
    {
        PARAMETER_DELETE[] AHLightInterpWeight;
    }
    AHLightInterpWeight = nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSAAGWV2Type::parameter_versionStruct::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(revision))
    {
        PARAMETER_DELETE[] revision;
    }
    revision = nullptr;
}

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

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

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

    if (PARAMETER_STRCMP(Type, moduleData->Type) == 0 && 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 = (chromatixSAAGWV2TypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW chromatixSAAGWV2TypeClass(GetName(moduleData->Type), moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixSAAGWV2TypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixSAAGWV2TypeClass, binary name (%s) does not match source name (%s)\n",
            moduleData->Type, Type);
    }

    return (ParameterModule*)cls;
}

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

    if (!Loaded)
    {
        BYTE const alignment = table->Alignment;
        chromatixSAAGWV2TypeClass* 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 & 0x00ffffff);

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

        if (result)
        {
            result = cls->Load(entry, alignment);
        }
        Modified++;
        Loaded = true;
    }

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

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload module data
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSAAGWV2TypeClass::UnloadModule()
{
    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 chromatixSAAGWV2TypeClass::Release()
{
    ParameterModule::Release();
}

MODSAAGWV2_NAMESPACE_END
