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

#include "aecxsync.h"
#include "parametersetmanager.h"

AECXSYNC_NAMESPACE_BEGIN

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

    return __result;
}

bool StaticMixingConfigType::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, "staticWeight") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            staticWeight = (float)dblValue; 
        }
    }

    return __result;
}

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

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

    return __result;
}

bool DynamicMixingConfigType::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, "dynamicWeightTrigger") == 0)
    {
        if (__index < dynamicWeightTriggerCount)
        {
            __result = dynamicWeightTrigger[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "postExpCompTrigger") == 0)
    {
        if (__index < postExpCompTriggerCount)
        {
            __result = postExpCompTrigger[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool DynamicMixingConfigType::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, "dynamicWeightTrigger") == 0)
    {
        if (__index < dynamicWeightTriggerCount)
        {
            __result = dynamicWeightTrigger[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "postExpCompTrigger") == 0)
    {
        if (__index < postExpCompTriggerCount)
        {
            __result = postExpCompTrigger[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

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

    return __result;
}

bool AECExposureSyncConfigType::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, "globalExpComp") == 0)
    {
        __result = globalExpComp.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "cctBasedExpComp") == 0)
    {
        __result = cctBasedExpComp.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "enableExposureTimeMatch") == 0)
    {
        ParameterUtils::DoubleToString((double)enableExposureTimeMatch, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "bLockExpWhenSwitch") == 0)
    {
        ParameterUtils::DoubleToString((double)bLockExpWhenSwitch, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "minFrameNumToLock") == 0)
    {
        ParameterUtils::DoubleToString((double)minFrameNumToLock, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "SCDID") == 0)
    {
        ParameterUtils::DoubleToString((double)SCDID, __value, __size, 0);
        __result = true;
    }

    return __result;
}

bool AECExposureSyncConfigType::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, "globalExpComp") == 0)
    {
        __result = globalExpComp.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "cctBasedExpComp") == 0)
    {
        __result = cctBasedExpComp.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "enableExposureTimeMatch") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableExposureTimeMatch = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "bLockExpWhenSwitch") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            bLockExpWhenSwitch = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "minFrameNumToLock") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            minFrameNumToLock = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "SCDID") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            SCDID = (UINT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        ParameterUtils::DoubleToString((double)enable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "useTuning") == 0)
    {
        ParameterUtils::DoubleToString((double)useTuning, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "trigger1Data") == 0)
    {
        if (__index < trigger1DataCount)
        {
            __result = trigger1Data[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enable = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "useTuning") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            useTuning = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "trigger1Data") == 0)
    {
        if (__index < trigger1DataCount)
        {
            __result = trigger1Data[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        ParameterUtils::DoubleToString((double)enable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "cctCompTrigger") == 0)
    {
        if (__index < cctCompTriggerCount)
        {
            __result = cctCompTrigger[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enable = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "cctCompTrigger") == 0)
    {
        if (__index < cctCompTriggerCount)
        {
            __result = cctCompTrigger[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

    return __result;
}

bool MtrExpType::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, "meteirngType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            meteirngType = (AECMtrConfigType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "exposureType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            exposureType = (AECExpConfigType)(UINT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

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

    return __result;
}

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

    return __result;
}

bool AECXSyncType::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, "masterAndSlaveConfig") == 0)
    {
        __result = masterAndSlaveConfig.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "luxSyncConfig") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            luxSyncConfig = (AECDualCamSlaveLuxType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "expSyncConfig") == 0)
    {
        __result = expSyncConfig.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "mtrMixConfig") == 0)
    {
        __result = mtrMixConfig.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

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

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

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

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

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

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

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

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXSyncTypeClass::AECXSyncTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(masterAndSlaveConfig);
    PARAMETER_INITIALIZE(luxSyncConfig);
    PARAMETER_INITIALIZE(expSyncConfig);
    PARAMETER_INITIALIZE(mtrMixConfig);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECXSyncTypeClass::AECXSyncTypeClass(
    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(masterAndSlaveConfig);
    PARAMETER_INITIALIZE(luxSyncConfig);
    PARAMETER_INITIALIZE(expSyncConfig);
    PARAMETER_INITIALIZE(mtrMixConfig);
}

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

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

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

    PARAMETER_INITIALIZE(staticWeight);

    SYMBOL_TABLE_ENTRY_READ(entry, result, staticWeight, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(dynamicWeightTrigger);
    PARAMETER_INITIALIZE(postExpCompTrigger);


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

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

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(dynamicMixingConfig);
    PARAMETER_INITIALIZE(staticMixingConfig);

    result = dynamicMixingConfig.Load(entry, alignment);
    if (result)
    {
        result = staticMixingConfig.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(globalExpComp);
    PARAMETER_INITIALIZE(cctBasedExpComp);
    PARAMETER_INITIALIZE(enableExposureTimeMatch);
    PARAMETER_INITIALIZE(bLockExpWhenSwitch);
    PARAMETER_INITIALIZE(minFrameNumToLock);
    PARAMETER_INITIALIZE(SCDID);

    result = globalExpComp.Load(entry, alignment);
    if (result)
    {
        result = cctBasedExpComp.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, enableExposureTimeMatch, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, bLockExpWhenSwitch, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, minFrameNumToLock, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, SCDID, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(useTuning);
    PARAMETER_INITIALIZE(trigger1Data);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enable, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, useTuning, alignment)

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(cctCompTrigger);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enable, alignment)

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(meteirngType);
    PARAMETER_INITIALIZE(exposureType);

    result = aecxsync::ReadEnum_AECMtrConfigType(entry, meteirngType, alignment);
    if (result)
    {
        result = aecxsync::ReadEnum_AECExpConfigType(entry, exposureType, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(master);
    PARAMETER_INITIALIZE(slave);

    result = master.Load(entry, alignment);
    if (result)
    {
        result = slave.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(masterAndSlaveConfig);
    PARAMETER_INITIALIZE(luxSyncConfig);
    PARAMETER_INITIALIZE(expSyncConfig);
    PARAMETER_INITIALIZE(mtrMixConfig);

    result = module_version.Load(entry, alignment);
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    if (result)
    {
        result = masterAndSlaveConfig.Load(entry, alignment);
    }
    if (result)
    {
        result = aecxsync::ReadEnum_AECDualCamSlaveLuxType(entry, luxSyncConfig, alignment);
    }
    if (result)
    {
        result = expSyncConfig.Load(entry, alignment);
    }
    if (result)
    {
        result = mtrMixConfig.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(zoneTrigger);
    PARAMETER_INITIALIZE(zoneData);

    result = zoneTrigger.Load(entry, alignment);
    SYMBOL_TABLE_ENTRY_READ(entry, result, zoneData, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(zoneTrigger);
    PARAMETER_INITIALIZE(zoneData);

    result = zoneTrigger.Load(entry, alignment);
    SYMBOL_TABLE_ENTRY_READ(entry, result, zoneData, alignment)

    return result;
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AECMeteringMixConfigType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECMeteringMixConfigType::Unload(ParameterFileSymbolTable* const __table)
{
    dynamicMixingConfig.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AECExposureSyncConfigType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECExposureSyncConfigType::Unload(ParameterFileSymbolTable* const __table)
{
    globalExpComp.Unload(__table);
    cctBasedExpComp.Unload(__table);
}

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AECXSyncType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECXSyncType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    expSyncConfig.Unload(__table);
    mtrMixConfig.Unload(__table);
}

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

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

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

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

    return (ParameterModule*)cls;
}

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

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

AECXSYNC_NAMESPACE_END
