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

#include "aonaec.h"
#include "parametersetmanager.h"

AONAEC_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool ExpTableUnit::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, "gain") == 0)
    {
        ParameterUtils::DoubleToString((double)gain, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "expTime") == 0)
    {
        ParameterUtils::DoubleToString((double)expTime, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "incrementPriority") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)incrementPriority, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "expIndex") == 0)
    {
        ParameterUtils::DoubleToString((double)expIndex, __value, __size);
        __result = true;
    }

    return __result;
}

bool ExpTableUnit::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, "gain") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            gain = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "expTime") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            expTime = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "incrementPriority") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            incrementPriority = (AECExpIncPrioType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "expIndex") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            expIndex = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

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

    return __result;
}

bool TwoLevelTriggerSystemLevel2Type::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, "trigger") == 0)
    {
        __result = trigger.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "data") == 0)
    {
        ParameterUtils::DoubleToString((double)data, __value, __size);
        __result = true;
    }

    return __result;
}

bool TwoLevelTriggerSystemLevel2Type::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, "trigger") == 0)
    {
        __result = trigger.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "data") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            data = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

    return __result;
}

bool AONAECCoreArbitrationType::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, "expKneeEntries") == 0)
    {
        __result = expKneeEntries.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "digitalGain") == 0)
    {
        __result = digitalGain.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "antibandingmode") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)antibandingmode, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "StartUpExpIndexMap") == 0)
    {
        __result = StartUpExpIndexMap.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "startUpExpTableIndex") == 0)
    {
        ParameterUtils::DoubleToString((double)startUpExpTableIndex, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool AONAECCoreArbitrationType::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, "expKneeEntries") == 0)
    {
        __result = expKneeEntries.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "digitalGain") == 0)
    {
        __result = digitalGain.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "antibandingmode") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            antibandingmode = (AntiBandingModeType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "StartUpExpIndexMap") == 0)
    {
        __result = StartUpExpIndexMap.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "startUpExpTableIndex") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            startUpExpTableIndex = (INT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

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

    return __result;
}

bool AONAECCoreConvergenceType::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, "speed") == 0)
    {
        ParameterUtils::DoubleToString((double)speed, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "tolerance") == 0)
    {
        ParameterUtils::DoubleToString((double)tolerance, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "settleCntTh") == 0)
    {
        ParameterUtils::DoubleToString((double)settleCntTh, __value, __size);
        __result = true;
    }

    return __result;
}

bool AONAECCoreConvergenceType::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, "speed") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            speed = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "tolerance") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            tolerance = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "settleCntTh") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            settleCntTh = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

    return __result;
}

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

    // trigger
    if (__name[0] == '\0')
    {
        __result = true;
        __info.Add(ParameterParserInfo("trigger", ParameterParserDataType::Structure));
    }
    else if (PARAMETER_STRCMP(__name, "trigger") == 0)
    {
        __result = trigger.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 LUT::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, "trigger1") == 0)
    {
        if (__index < trigger1Count)
        {
            __result = trigger1[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

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

    return __result;
}

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

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

    return __result;
}

bool CenterWeightedMtrTable::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, "weight") == 0)
    {
        if (__index < weightCount)
        {
            ParameterUtils::DoubleToString((double)weight[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < weightCount; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)weight[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }

    return __result;
}

bool CenterWeightedMtrTable::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, "weight") == 0)
    {
        if (__index < weightCount)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                weight[__index] = (float)dblValue; 
            }
        }
        else
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

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

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

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    weight[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }

    return __result;
}

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

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

    return __result;
}

bool LumaWeightType::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, "weight") == 0)
    {
        if (__index < 3)
        {
            ParameterUtils::DoubleToString((double)weight[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < 3; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)weight[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }

    return __result;
}

bool LumaWeightType::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, "weight") == 0)
    {
        if (__index < 3)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                weight[__index] = (float)dblValue; 
            }
        }
        else
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

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

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

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    weight[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }

    return __result;
}

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

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

    return __result;
}

bool AONAECCoreMeteringType::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, "lumaWeight") == 0)
    {
        __result = lumaWeight.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "meteringTable") == 0)
    {
        __result = meteringTable.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "dynamicWeight") == 0)
    {
        __result = dynamicWeight.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "roiWeight") == 0)
    {
        ParameterUtils::DoubleToString((double)roiWeight, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "target") == 0)
    {
        __result = target.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "luxIndexConvFactor") == 0)
    {
        ParameterUtils::DoubleToString((double)luxIndexConvFactor, __value, __size);
        __result = true;
    }

    return __result;
}

bool AONAECCoreMeteringType::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, "lumaWeight") == 0)
    {
        __result = lumaWeight.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "meteringTable") == 0)
    {
        __result = meteringTable.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "dynamicWeight") == 0)
    {
        __result = dynamicWeight.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "roiWeight") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            roiWeight = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "target") == 0)
    {
        __result = target.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "luxIndexConvFactor") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            luxIndexConvFactor = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

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

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

    return __result;
}

bool AONAECCoreTuningType::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, "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, "metering") == 0)
    {
        __result = metering.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "convergence") == 0)
    {
        __result = convergence.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "arbitration") == 0)
    {
        __result = arbitration.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

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

    return __result;
}

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

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

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

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

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

    return __result;
}

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

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

    return __result;
}

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

    return __result;
}

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

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

    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_AntiBandingModeType(
    ParameterFileSymbolTableEntry* const entry,
    AntiBandingModeType& enumValue,
    BYTE const alignment)
{
    bool result {false};

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(AntiBandingModeType::Antibanding50Hz):
            enumValue = AntiBandingModeType::Antibanding50Hz;
            result    = true;
            break;
        case static_cast<UINT32>(AntiBandingModeType::Antibanding60Hz):
            enumValue = AntiBandingModeType::Antibanding60Hz;
            result    = true;
            break;
        case static_cast<UINT32>(AntiBandingModeType::AntibandingOff):
            enumValue = AntiBandingModeType::AntibandingOff;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to AntiBandingModeType", 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_AECExpIncPrioType(
    ParameterFileSymbolTableEntry* const entry,
    AECExpIncPrioType& enumValue,
    BYTE const alignment)
{
    bool result {false};

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

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AONAECCoreTuningTypeClass::AONAECCoreTuningTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(metering);
    PARAMETER_INITIALIZE(convergence);
    PARAMETER_INITIALIZE(arbitration);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AONAECCoreTuningTypeClass::AONAECCoreTuningTypeClass(
    const CHAR* const name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(metering);
    PARAMETER_INITIALIZE(convergence);
    PARAMETER_INITIALIZE(arbitration);
}

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

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

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

    PARAMETER_INITIALIZE(gain);
    PARAMETER_INITIALIZE(expTime);
    PARAMETER_INITIALIZE(incrementPriority);
    PARAMETER_INITIALIZE(expIndex);

    SYMBOL_TABLE_ENTRY_READ(entry, result, gain, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, expTime, alignment)
    if (result)
    {
        result = aonaec::ReadEnum_AECExpIncPrioType(entry, incrementPriority, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, expIndex, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(knee);


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

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

    return result;
}

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

    PARAMETER_INITIALIZE(start);
    PARAMETER_INITIALIZE(end);

    SYMBOL_TABLE_ENTRY_READ(entry, result, start, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, end, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(trigger);
    PARAMETER_INITIALIZE(data);

    result = trigger.Load(entry, alignment);
    SYMBOL_TABLE_ENTRY_READ(entry, result, data, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(trigger1);


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

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

    return result;
}

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

    PARAMETER_INITIALIZE(expKneeEntries);
    PARAMETER_INITIALIZE(digitalGain);
    PARAMETER_INITIALIZE(antibandingmode);
    PARAMETER_INITIALIZE(StartUpExpIndexMap);
    PARAMETER_INITIALIZE(startUpExpTableIndex);

    result = expKneeEntries.Load(entry, alignment);
    if (result)
    {
        result = digitalGain.Load(entry, alignment);
    }
    if (result)
    {
        result = aonaec::ReadEnum_AntiBandingModeType(entry, antibandingmode, alignment);
    }
    if (result)
    {
        result = StartUpExpIndexMap.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, startUpExpTableIndex, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(speed);
    PARAMETER_INITIALIZE(tolerance);
    PARAMETER_INITIALIZE(settleCntTh);

    SYMBOL_TABLE_ENTRY_READ(entry, result, speed, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, tolerance, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, settleCntTh, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(trigger);
    PARAMETER_INITIALIZE(triggerData);

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

    PARAMETER_INITIALIZE(trigger1);


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

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

    return result;
}

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

    PARAMETER_INITIALIZE(weight);


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

            if (weight == nullptr)
            {
                if (result && weightCount > 0)
                {
                    weight = pointerEntry->ReadArray<float>(weightCount, alignment);
                    result = weight != nullptr;
                }
                if (!result || weight == nullptr)
                {
                    if (weightCount > 0)
                    {
                        PARAMETER_LOG_ERROR(entry->SetManager, "Failed to allocate weight\n");
                    }
                    weightCount = 0;
                }
            }
        }
        if (weight == nullptr)
        {
            weightCount = 0;
        }
    }

    return result;
}

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

    PARAMETER_INITIALIZE(weight);

    result = entry->ReadArray(weight, 3, alignment);

    return result;
}

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

    PARAMETER_INITIALIZE(lumaWeight);
    PARAMETER_INITIALIZE(meteringTable);
    PARAMETER_INITIALIZE(dynamicWeight);
    PARAMETER_INITIALIZE(roiWeight);
    PARAMETER_INITIALIZE(target);
    PARAMETER_INITIALIZE(luxIndexConvFactor);

    result = lumaWeight.Load(entry, alignment);
    if (result)
    {
        result = meteringTable.Load(entry, alignment);
    }
    if (result)
    {
        result = dynamicWeight.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, roiWeight, alignment)
    if (result)
    {
        result = target.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, luxIndexConvFactor, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(metering);
    PARAMETER_INITIALIZE(convergence);
    PARAMETER_INITIALIZE(arbitration);

    result = module_version.Load(entry, alignment);
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    if (result)
    {
        result = metering.Load(entry, alignment);
    }
    if (result)
    {
        result = convergence.Load(entry, alignment);
    }
    if (result)
    {
        result = arbitration.Load(entry, alignment);
    }

    return result;
}

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

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

    PARAMETER_INITIALIZE(trigger2);


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

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

    return result;
}

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AONAECCoreArbitrationType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AONAECCoreArbitrationType::Unload(ParameterFileSymbolTable* const __table)
{
    expKneeEntries.Unload(__table);
    digitalGain.Unload(__table);
    StartUpExpIndexMap.Unload(__table);
}

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AONAECCoreMeteringType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AONAECCoreMeteringType::Unload(ParameterFileSymbolTable* const __table)
{
    meteringTable.Unload(__table);
    dynamicWeight.Unload(__table);
    target.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AONAECCoreTuningType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AONAECCoreTuningType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    metering.Unload(__table);
    arbitration.Unload(__table);
}

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

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

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

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

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

    return (ParameterModule*)cls;
}

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

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

AONAEC_NAMESPACE_END
