////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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  modsalocaladjv1.cpp
/// @brief Auto-generated Chromatix parameter file
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "modsalocaladjv1.h"
#include "parametersetmanager.h"

MODSALOCALADJV1_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool awbLocalTargetType::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 awbLocalTargetType::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 awbLocalTargetType::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 awbLocalSATargetConfigType::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, "attribute") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)attribute, __value, __size, 0);
        __result = true;
    }
    else 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;
        }
    }

    return __result;
}

bool awbLocalSATargetConfigType::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, "attribute") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            attribute = (awbLocalTargetCtrlType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "triggerType") == 0)
    {
        if (__index < 2)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                triggerType[__index] = (awbLocalSACtrlType)(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] = (awbLocalSACtrlType)(UINT32)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }

    return __result;
}

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

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

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

    return __result;
}

bool awbLocalTargetDataType::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, "commonData") == 0)
    {
        __result = commonData.GetValue(&__path[__pos], __value, __size);
    }
    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 awbLocalTargetDataType::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, "commonData") == 0)
    {
        __result = commonData.SetValue(&__path[__pos], __value);
    }
    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 awbLocalTargetDataType::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);

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

    // 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 awbLocalSATriggerConfigType::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, "attribute") == 0)
    {
        ParameterUtils::DoubleToString((double)attribute, __value, __size);
        __result = true;
    }
    else 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;
        }
    }

    return __result;
}

bool awbLocalSATriggerConfigType::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, "attribute") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            attribute = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "triggerType") == 0)
    {
        if (__index < 2)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                triggerType[__index] = (awbLocalSACtrlType)(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] = (awbLocalSACtrlType)(UINT32)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }

    return __result;
}

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

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

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

    return __result;
}

bool awbLocalSADataType::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, "commonData") == 0)
    {
        __result = commonData.GetValue(&__path[__pos], __value, __size);
    }
    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 awbLocalSADataType::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, "commonData") == 0)
    {
        __result = commonData.SetValue(&__path[__pos], __value);
    }
    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 awbLocalSADataType::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);

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

    // 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 chromatixSALocalAdjV1DataType::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, "Description") == 0)
    {
        PARAMETER_STRCPY(__value, __size, Description);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "ROISelection") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)ROISelection, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "ROICtrl") == 0)
    {
        __result = ROICtrl.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, "ROIAGWWeight") == 0)
    {
        if (__index < ROIAGWWeightCount)
        {
            __result = ROIAGWWeight[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "localTargetAdjustment") == 0)
    {
        __result = localTargetAdjustment.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool chromatixSALocalAdjV1DataType::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, "Description") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    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, "ROISelection") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            ROISelection = (awbLocalSAROICtrlType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "ROICtrl") == 0)
    {
        __result = ROICtrl.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, "ROIAGWWeight") == 0)
    {
        if (__index < ROIAGWWeightCount)
        {
            __result = ROIAGWWeight[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "localTargetAdjustment") == 0)
    {
        __result = localTargetAdjustment.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

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

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

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

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

    return __result;
}

bool chromatixSALocalAdjV1DataType::ROICtrlStruct::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, "ROIXScale") == 0)
    {
        ParameterUtils::DoubleToString((double)ROIXScale, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "ROIYScale") == 0)
    {
        ParameterUtils::DoubleToString((double)ROIYScale, __value, __size);
        __result = true;
    }

    return __result;
}

bool chromatixSALocalAdjV1DataType::ROICtrlStruct::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, "ROIXScale") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            ROIXScale = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "ROIYScale") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            ROIYScale = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

    return __result;
}

bool chromatixSALocalAdjV1Type::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, "SALocalAdjV1Data") == 0)
    {
        if (__index < SALocalAdjV1DataCount)
        {
            __result = SALocalAdjV1Data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool chromatixSALocalAdjV1Type::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, "SALocalAdjV1Data") == 0)
    {
        if (__index < SALocalAdjV1DataCount)
        {
            __result = SALocalAdjV1Data[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

    return __result;
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Read enum value
/// @param entry [in] Symbol table entry
/// @param enumValue [out] Enum value to read
/// @param alignment [in] Symbol table byte alignment
/// @return true if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool ReadEnum_awbLocalTargetCtrlType(
    ParameterFileSymbolTableEntry* const entry,
    awbLocalTargetCtrlType& enumValue,
    BYTE const alignment)
{
    bool result {false};

    UINT32 uintValue {entry->ReadEnum(&result, alignment)};

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(awbLocalTargetCtrlType::AWBLocalTargetFixed):
            enumValue = awbLocalTargetCtrlType::AWBLocalTargetFixed;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalTargetCtrlType::AWBLocalTargetRatioROIToAGW):
            enumValue = awbLocalTargetCtrlType::AWBLocalTargetRatioROIToAGW;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalTargetCtrlType::AWBLocalTargetMAX):
            enumValue = awbLocalTargetCtrlType::AWBLocalTargetMAX;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to awbLocalTargetCtrlType", uintValue);
            break;
        }
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Read enum value
/// @param entry [in] Symbol table entry
/// @param enumValue [out] Enum value to read
/// @param alignment [in] Symbol table byte alignment
/// @return true if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool ReadEnum_awbLocalSACtrlType(
    ParameterFileSymbolTableEntry* const entry,
    awbLocalSACtrlType& enumValue,
    BYTE const alignment)
{
    bool result {false};

    UINT32 uintValue {entry->ReadEnum(&result, alignment)};

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlLuxIdx):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlLuxIdx;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlAGWCCT):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlAGWCCT;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlROICCT):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlROICCT;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlROICCTDiffToAGWCCT):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlROICCTDiffToAGWCCT;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlROIStatsCntRatio):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlROIStatsCntRatio;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType0):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType0;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType1):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType1;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType2):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType2;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType3):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType3;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType4):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType4;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType5):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType5;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType6):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType6;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType7):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType7;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType8):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType8;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType9):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType9;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType10):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType10;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType11):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlInfomationType11;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSACtrlType::LocalAdjSATriggerCtrlMAX):
            enumValue = awbLocalSACtrlType::LocalAdjSATriggerCtrlMAX;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to awbLocalSACtrlType", uintValue);
            break;
        }
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Read enum value
/// @param entry [in] Symbol table entry
/// @param enumValue [out] Enum value to read
/// @param alignment [in] Symbol table byte alignment
/// @return true if successful
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool ReadEnum_awbLocalSAROICtrlType(
    ParameterFileSymbolTableEntry* const entry,
    awbLocalSAROICtrlType& enumValue,
    BYTE const alignment)
{
    bool result {false};

    UINT32 uintValue {entry->ReadEnum(&result, alignment)};

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(awbLocalSAROICtrlType::AWBLocalROIFace):
            enumValue = awbLocalSAROICtrlType::AWBLocalROIFace;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSAROICtrlType::AWBLocalROIRes0):
            enumValue = awbLocalSAROICtrlType::AWBLocalROIRes0;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSAROICtrlType::AWBLocalROIRes1):
            enumValue = awbLocalSAROICtrlType::AWBLocalROIRes1;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSAROICtrlType::AWBLocalROIRes2):
            enumValue = awbLocalSAROICtrlType::AWBLocalROIRes2;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSAROICtrlType::AWBLocalROIRes3):
            enumValue = awbLocalSAROICtrlType::AWBLocalROIRes3;
            result    = true;
            break;
        case static_cast<UINT32>(awbLocalSAROICtrlType::AWBLocalROIMAX):
            enumValue = awbLocalSAROICtrlType::AWBLocalROIMAX;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to awbLocalSAROICtrlType", uintValue);
            break;
        }
    }
    return result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixSALocalAdjV1TypeClass::chromatixSALocalAdjV1TypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(SALocalAdjV1DataCount);
    PARAMETER_INITIALIZE(SALocalAdjV1Data);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixSALocalAdjV1TypeClass::chromatixSALocalAdjV1TypeClass(
    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(enableFlag);
    PARAMETER_INITIALIZE(SALocalAdjV1Data);
}

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load awbLocalTargetType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool awbLocalTargetType::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 = (awbglobalelements::awbTriggerDataRGBType*)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::awbTriggerDataRGBType[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 awbLocalSATargetConfigType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool awbLocalSATargetConfigType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(attribute);
    PARAMETER_INITIALIZE(triggerType);

    result = modsalocaladjv1::ReadEnum_awbLocalTargetCtrlType(entry, attribute, alignment);
    for (UINT32 i = 0; result && i < 2; i++)
    {
        if (result)
        {
            result = modsalocaladjv1::ReadEnum_awbLocalSACtrlType(entry, triggerType[i], alignment);
        }
    }

    return result;
}

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

    PARAMETER_INITIALIZE(commonData);
    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

    result = commonData.Load(entry, 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 = (awbLocalTargetType*)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 awbLocalTargetType[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 awbLocalSATriggerConfigType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool awbLocalSATriggerConfigType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(attribute);
    PARAMETER_INITIALIZE(triggerType);

    SYMBOL_TABLE_ENTRY_READ(entry, result, attribute, alignment)
    for (UINT32 i = 0; result && i < 2; i++)
    {
        if (result)
        {
            result = modsalocaladjv1::ReadEnum_awbLocalSACtrlType(entry, triggerType[i], alignment);
        }
    }

    return result;
}

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

    PARAMETER_INITIALIZE(commonData);
    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

    result = commonData.Load(entry, 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 chromatixSALocalAdjV1DataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixSALocalAdjV1DataType::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(Description);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(ROISelection);
    PARAMETER_INITIALIZE(ROICtrl);
    PARAMETER_INITIALIZE(confidenceLevel);
    PARAMETER_INITIALIZE(ROIAGWWeight);
    PARAMETER_INITIALIZE(localTargetAdjustment);


    // Reading String Description 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, Description, count, alignment)
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, enableFlag, alignment)
    if (result)
    {
        result = modsalocaladjv1::ReadEnum_awbLocalSAROICtrlType(entry, ROISelection, alignment);
    }
    if (result)
    {
        result = ROICtrl.Load(entry, alignment);
    }

    // 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 = (awbLocalSADataType*)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 awbLocalSADataType[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 ROIAGWWeight from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        ROIAGWWeightCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, ROIAGWWeightCount, 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)
        {
            ROIAGWWeightID = pointerEntry->ID;
            DupObjInfo* ROIAGWWeightDupInfo = pointerEntry->GetDupObject(ROIAGWWeightCount, file, line);
            if (ROIAGWWeightDupInfo != nullptr && ROIAGWWeightDupInfo->Object != nullptr)
            {
                ROIAGWWeight = (awbLocalSADataType*)ROIAGWWeightDupInfo->Object;
                if (ROIAGWWeight == nullptr)
                {
                    if (ROIAGWWeightDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "ROIAGWWeight duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            ROIAGWWeightDupInfo->File, ROIAGWWeightDupInfo->Line, ROIAGWWeightDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "ROIAGWWeight duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            ROIAGWWeightDupInfo->Line, ROIAGWWeightDupInfo->RefCount);
                    }
                }
            }

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

    return result;
}

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

    PARAMETER_INITIALIZE(ROIXScale);
    PARAMETER_INITIALIZE(ROIYScale);

    SYMBOL_TABLE_ENTRY_READ(entry, result, ROIXScale, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, ROIYScale, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(SALocalAdjV1Data);

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

    // Reading Array SALocalAdjV1Data from symbol table
    // Do not check result value here because the count value needs to be initialized in this block
    {
        SALocalAdjV1DataCount = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, SALocalAdjV1DataCount, 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)
        {
            SALocalAdjV1DataID = pointerEntry->ID;
            DupObjInfo* SALocalAdjV1DataDupInfo = pointerEntry->GetDupObject(SALocalAdjV1DataCount, file, line);
            if (SALocalAdjV1DataDupInfo != nullptr && SALocalAdjV1DataDupInfo->Object != nullptr)
            {
                SALocalAdjV1Data = (chromatixSALocalAdjV1DataType*)SALocalAdjV1DataDupInfo->Object;
                if (SALocalAdjV1Data == nullptr)
                {
                    if (SALocalAdjV1DataDupInfo->File != nullptr)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "SALocalAdjV1Data duplicate found but object is nullptr: %s:%d, RefCount: %d\n",
                            SALocalAdjV1DataDupInfo->File, SALocalAdjV1DataDupInfo->Line, SALocalAdjV1DataDupInfo->RefCount);
                    }
                    else
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "SALocalAdjV1Data duplicate found but Object is nullptr: <nullptr file ptr>:%d, RefCount: %d\n",
                            SALocalAdjV1DataDupInfo->Line, SALocalAdjV1DataDupInfo->RefCount);
                    }
                }
            }

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

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixSALocalAdjV1Type::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;
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload awbLocalTargetDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void awbLocalTargetDataType::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 awbLocalSADataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void awbLocalSADataType::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 chromatixSALocalAdjV1DataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixSALocalAdjV1DataType::Unload(ParameterFileSymbolTable* const __table)
{
    if (__table != nullptr && __table->ReleaseDupObject(Description))
    {
        PARAMETER_DELETE[] Description;
    }
    Description = 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 < ROIAGWWeightCount; i++)
    {
        ROIAGWWeight[i].Unload(__table);
    }
    if (__table != nullptr && __table->ReleaseDupObject(ROIAGWWeight))
    {
        PARAMETER_DELETE[] ROIAGWWeight;
    }
    ROIAGWWeight = nullptr;
    localTargetAdjustment.Unload(__table);
}

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* chromatixSALocalAdjV1TypeClass::Create(
    ModuleData*    moduleData,
    DefaultModule* const defModule) const
{
    chromatixSALocalAdjV1TypeClass* 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 = (chromatixSALocalAdjV1TypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW chromatixSALocalAdjV1TypeClass(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 chromatixSALocalAdjV1TypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixSALocalAdjV1TypeClass, binary name (%s) does not match source name (%s)\n",
            moduleData->Type, Type);
    }

    return (ParameterModule*)cls;
}

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

    if (!Loaded)
    {
        BYTE const alignment = table->Alignment;
        chromatixSALocalAdjV1TypeClass* 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, "chromatixSALocalAdjV1TypeClass::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 chromatixSALocalAdjV1TypeClass::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 chromatixSALocalAdjV1TypeClass::Release()
{
    ParameterModule::Release();
}

MODSALOCALADJV1_NAMESPACE_END
