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

#include "awbrmulticamsync.h"
#include "parametersetmanager.h"

AWBRMULTICAMSYNC_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool camSyncTriangleInfoType::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, "vertexIdx") == 0)
    {
        if (__index < 3)
        {
            ParameterUtils::DoubleToString((double)vertexIdx[__index], __value, __size, 0);
            __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)vertexIdx[i], &__value[__valuePos], (INT32)(__size - __valuePos), 0);
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "sideIdx") == 0)
    {
        if (__index < 3)
        {
            ParameterUtils::DoubleToString((double)sideIdx[__index], __value, __size, 0);
            __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)sideIdx[i], &__value[__valuePos], (INT32)(__size - __valuePos), 0);
            }
            __result = true;
        }
    }

    return __result;
}

bool camSyncTriangleInfoType::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, "vertexIdx") == 0)
    {
        if (__index < 3)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                vertexIdx[__index] = (INT32)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)
                {
                    vertexIdx[__index] = (INT32)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "sideIdx") == 0)
    {
        if (__index < 3)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                sideIdx[__index] = (INT32)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)
                {
                    sideIdx[__index] = (INT32)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }

    return __result;
}

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

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

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

    return __result;
}

bool camSyncTriangleDataType::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, "triangleData") == 0)
    {
        if (__index < triangleDataCount)
        {
            __result = triangleData[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "vertexData") == 0)
    {
        if (__index < vertexDataCount)
        {
            __result = vertexData[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool camSyncTriangleDataType::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, "triangleData") == 0)
    {
        if (__index < triangleDataCount)
        {
            __result = triangleData[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "vertexData") == 0)
    {
        if (__index < vertexDataCount)
        {
            __result = vertexData[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        if (__index < triggerDataCount)
        {
            __result = triggerData[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        if (__index < triggerDataCount)
        {
            __result = triggerData[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "triggerPt") == 0)
    {
        __result = triggerPt.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triggerData") == 0)
    {
        __result = triggerData.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

    return __result;
}

bool MultiCamSyncDataType::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, "modeSelection") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            modeSelection = (camSyncModeType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "mixWeights") == 0)
    {
        __result = mixWeights.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "triangleFcmData") == 0)
    {
        __result = triangleFcmData.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = moduleID.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.GetValue(&__path[__pos], __value, __size);
    }
    else if (PARAMETER_STRCMP(__name, "MultiCamSyncData") == 0)
    {
        __result = MultiCamSyncData.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "moduleID") == 0)
    {
        __result = moduleID.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "module_version") == 0)
    {
        __result = module_version.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "MultiCamSyncData") == 0)
    {
        __result = MultiCamSyncData.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

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

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

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

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

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

    return __result;
}

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

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(camSyncModeType::Independent):
            enumValue = camSyncModeType::Independent;
            result    = true;
            break;
        case static_cast<UINT32>(camSyncModeType::FollowRunAWB):
            enumValue = camSyncModeType::FollowRunAWB;
            result    = true;
            break;
        case static_cast<UINT32>(camSyncModeType::Follow):
            enumValue = camSyncModeType::Follow;
            result    = true;
            break;
        case static_cast<UINT32>(camSyncModeType::Mix):
            enumValue = camSyncModeType::Mix;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to camSyncModeType", uintValue);
            break;
        }
    }
    return result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
awbrMultiCamSyncTypeClass::awbrMultiCamSyncTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(MultiCamSyncData);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
awbrMultiCamSyncTypeClass::awbrMultiCamSyncTypeClass(
    const CHAR* const name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(MultiCamSyncData);
}

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

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

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

    PARAMETER_INITIALIZE(vertexIdx);
    PARAMETER_INITIALIZE(sideIdx);

    result = entry->ReadArray(vertexIdx, 3, alignment);
    if (result)
    {
        result = entry->ReadArray(sideIdx, 3, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(triangleData);
    PARAMETER_INITIALIZE(vertexData);


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

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

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

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

    return result;
}

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

    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

    result = triggerPt.Load(entry, alignment);

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

        if (result)
        {
            triggerDataID = pointerEntry->ID;
            DupObjInfo* triggerDataDupInfo = pointerEntry->GetDupObject(triggerDataCount, file, line);
            if (triggerDataDupInfo != nullptr && triggerDataDupInfo->Object != nullptr)
            {
                triggerData = (camSyncTriggerLevel3Type*)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 camSyncTriggerLevel3Type[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 camSyncTriggerLevel1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool camSyncTriggerLevel1Type::Load(
    ParameterFileSymbolTableEntry* const entry,
    BYTE const alignment)
{
    bool result = true;

    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

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

    return result;
}

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

    PARAMETER_INITIALIZE(triggerPt);
    PARAMETER_INITIALIZE(triggerData);

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

    return result;
}

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

    PARAMETER_INITIALIZE(modeSelection);
    PARAMETER_INITIALIZE(mixWeights);
    PARAMETER_INITIALIZE(triangleFcmData);

    result = awbrmulticamsync::ReadEnum_camSyncModeType(entry, modeSelection, alignment);
    if (result)
    {
        result = mixWeights.Load(entry, alignment);
    }
    if (result)
    {
        result = triangleFcmData.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(moduleID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(MultiCamSyncData);

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

    return result;
}

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

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

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

    return result;
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload camSyncTriggerLevel3Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void camSyncTriggerLevel3Type::Unload(ParameterFileSymbolTable* const __table)
{
    triggerData.Unload(__table);
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload camSyncTriggerLevel1Type
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void camSyncTriggerLevel1Type::Unload(ParameterFileSymbolTable* const __table)
{
    triggerData.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload camSyncTriangleFcmDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void camSyncTriangleFcmDataType::Unload(ParameterFileSymbolTable* const __table)
{
    triggerData.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload MultiCamSyncDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void MultiCamSyncDataType::Unload(ParameterFileSymbolTable* const __table)
{
    mixWeights.Unload(__table);
    triangleFcmData.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload awbrMultiCamSyncType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void awbrMultiCamSyncType::Unload(ParameterFileSymbolTable* const __table)
{
    MultiCamSyncData.Unload(__table);
}

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

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

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

    return (ParameterModule*)cls;
}

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

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

AWBRMULTICAMSYNC_NAMESPACE_END
