////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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 V7.4.1 (8cca6579792b9fcef3bc725ff070c5ec453c7c85)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

#include "afdciafelements.h"
#include "parametersetmanager.h"

AFDCIAFELEMENTS_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixAFDCIAFFineSearchStepInfoType::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;

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

    if (PARAMETER_STRCMP(__name, "stepSize") == 0)
    {
        ParameterUtils::DoubleToString((double)stepSize, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "farSteps") == 0)
    {
        ParameterUtils::DoubleToString((double)farSteps, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "nearSteps") == 0)
    {
        ParameterUtils::DoubleToString((double)nearSteps, __value, __size, 0);
        __result = true;
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "stepSize") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            stepSize = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "farSteps") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            farSteps = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "nearSteps") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            nearSteps = (INT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

bool chromatixDCIAFType::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, "monitorEnable") == 0)
    {
        ParameterUtils::DoubleToString((double)monitorEnable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "monitorFrequency") == 0)
    {
        ParameterUtils::DoubleToString((double)monitorFrequency, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "searchFrequency") == 0)
    {
        ParameterUtils::DoubleToString((double)searchFrequency, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "baselineMM") == 0)
    {
        ParameterUtils::DoubleToString((double)baselineMM, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "auxDirection") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)auxDirection, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "macroEstimateLimitCM") == 0)
    {
        ParameterUtils::DoubleToString((double)macroEstimateLimitCM, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "alignmentCheckEnable") == 0)
    {
        ParameterUtils::DoubleToString((double)alignmentCheckEnable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "jumpToStartLimit") == 0)
    {
        ParameterUtils::DoubleToString((double)jumpToStartLimit, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "numNearSteps") == 0)
    {
        ParameterUtils::DoubleToString((double)numNearSteps, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "numFarSteps") == 0)
    {
        ParameterUtils::DoubleToString((double)numFarSteps, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "dciafStepSize") == 0)
    {
        ParameterUtils::DoubleToString((double)dciafStepSize, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "motionDataUseEnable") == 0)
    {
        ParameterUtils::DoubleToString((double)motionDataUseEnable, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "sceneChangeLensPositionThreshold") == 0)
    {
        ParameterUtils::DoubleToString((double)sceneChangeLensPositionThreshold, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "panningStableLensPositionThreshold") == 0)
    {
        ParameterUtils::DoubleToString((double)panningStableLensPositionThreshold, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "panningStableDurationMSBright") == 0)
    {
        ParameterUtils::DoubleToString((double)panningStableDurationMSBright, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "panningStableDurationMSLow") == 0)
    {
        ParameterUtils::DoubleToString((double)panningStableDurationMSLow, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "maxLowLightWaitMs") == 0)
    {
        ParameterUtils::DoubleToString((double)maxLowLightWaitMs, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "maxNormalLightWaitMs") == 0)
    {
        ParameterUtils::DoubleToString((double)maxNormalLightWaitMs, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "jumpWithNoSkip") == 0)
    {
        ParameterUtils::DoubleToString((double)jumpWithNoSkip, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "skipframesBeforeFineSearch") == 0)
    {
        ParameterUtils::DoubleToString((double)skipframesBeforeFineSearch, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "distanceThresholdMacroRegionInMM") == 0)
    {
        ParameterUtils::DoubleToString((double)distanceThresholdMacroRegionInMM, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "distanceThresholdNonMacroFactor") == 0)
    {
        ParameterUtils::DoubleToString((double)distanceThresholdNonMacroFactor, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "lowLightThreshold") == 0)
    {
        ParameterUtils::DoubleToString((double)lowLightThreshold, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "useFineSearchExtension") == 0)
    {
        ParameterUtils::DoubleToString((double)useFineSearchExtension, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "macroRegionThresholdInMM") == 0)
    {
        ParameterUtils::DoubleToString((double)macroRegionThresholdInMM, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "farRegionThresholdInMM") == 0)
    {
        ParameterUtils::DoubleToString((double)farRegionThresholdInMM, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "normalLightFineSearchInfo") == 0)
    {
        if (__index < normalLightFineSearchInfoCount)
        {
            __result = normalLightFineSearchInfo[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "lowLightFineSearchInfo") == 0)
    {
        if (__index < lowLightFineSearchInfoCount)
        {
            __result = lowLightFineSearchInfo[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool chromatixDCIAFType::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, "monitorEnable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            monitorEnable = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "monitorFrequency") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            monitorFrequency = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "searchFrequency") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            searchFrequency = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "baselineMM") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            baselineMM = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "auxDirection") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            auxDirection = (chromatixAFCameraOrientationType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "macroEstimateLimitCM") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            macroEstimateLimitCM = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "alignmentCheckEnable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            alignmentCheckEnable = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "jumpToStartLimit") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            jumpToStartLimit = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "numNearSteps") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            numNearSteps = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "numFarSteps") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            numFarSteps = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "dciafStepSize") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            dciafStepSize = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "motionDataUseEnable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            motionDataUseEnable = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "sceneChangeLensPositionThreshold") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            sceneChangeLensPositionThreshold = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "panningStableLensPositionThreshold") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            panningStableLensPositionThreshold = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "panningStableDurationMSBright") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            panningStableDurationMSBright = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "panningStableDurationMSLow") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            panningStableDurationMSLow = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "maxLowLightWaitMs") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            maxLowLightWaitMs = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "maxNormalLightWaitMs") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            maxNormalLightWaitMs = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "jumpWithNoSkip") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            jumpWithNoSkip = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "skipframesBeforeFineSearch") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            skipframesBeforeFineSearch = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "distanceThresholdMacroRegionInMM") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            distanceThresholdMacroRegionInMM = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "distanceThresholdNonMacroFactor") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            distanceThresholdNonMacroFactor = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "lowLightThreshold") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            lowLightThreshold = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "useFineSearchExtension") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            useFineSearchExtension = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "macroRegionThresholdInMM") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            macroRegionThresholdInMM = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "farRegionThresholdInMM") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            farRegionThresholdInMM = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "normalLightFineSearchInfo") == 0)
    {
        if (__index < normalLightFineSearchInfoCount)
        {
            __result = normalLightFineSearchInfo[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "lowLightFineSearchInfo") == 0)
    {
        if (__index < lowLightFineSearchInfoCount)
        {
            __result = lowLightFineSearchInfo[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    return __result;
}

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

    (void)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 chromatixDCIAFType::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;

    (void)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 chromatixDCIAFType::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;

    (void)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 chromatixDCIAFType::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;

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

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

    return __result;
}

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

    (void)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 chromatixDCIAFType::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;

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

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

    return __result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixDCIAFTypeClass::chromatixDCIAFTypeClass(
    const CHAR* name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(monitorEnable);
    PARAMETER_INITIALIZE(monitorFrequency);
    PARAMETER_INITIALIZE(searchFrequency);
    PARAMETER_INITIALIZE(baselineMM);
    PARAMETER_INITIALIZE(auxDirection);
    PARAMETER_INITIALIZE(macroEstimateLimitCM);
    PARAMETER_INITIALIZE(alignmentCheckEnable);
    PARAMETER_INITIALIZE(jumpToStartLimit);
    PARAMETER_INITIALIZE(numNearSteps);
    PARAMETER_INITIALIZE(numFarSteps);
    PARAMETER_INITIALIZE(dciafStepSize);
    PARAMETER_INITIALIZE(motionDataUseEnable);
    PARAMETER_INITIALIZE(sceneChangeLensPositionThreshold);
    PARAMETER_INITIALIZE(panningStableLensPositionThreshold);
    PARAMETER_INITIALIZE(panningStableDurationMSBright);
    PARAMETER_INITIALIZE(panningStableDurationMSLow);
    PARAMETER_INITIALIZE(maxLowLightWaitMs);
    PARAMETER_INITIALIZE(maxNormalLightWaitMs);
    PARAMETER_INITIALIZE(jumpWithNoSkip);
    PARAMETER_INITIALIZE(skipframesBeforeFineSearch);
    PARAMETER_INITIALIZE(distanceThresholdMacroRegionInMM);
    PARAMETER_INITIALIZE(distanceThresholdNonMacroFactor);
    PARAMETER_INITIALIZE(lowLightThreshold);
    PARAMETER_INITIALIZE(useFineSearchExtension);
    PARAMETER_INITIALIZE(macroRegionThresholdInMM);
    PARAMETER_INITIALIZE(farRegionThresholdInMM);
    PARAMETER_INITIALIZE(normalLightFineSearchInfoCount);
    PARAMETER_INITIALIZE(normalLightFineSearchInfo);
    PARAMETER_INITIALIZE(lowLightFineSearchInfoCount);
    PARAMETER_INITIALIZE(lowLightFineSearchInfo);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixDCIAFTypeClass::chromatixDCIAFTypeClass(
    const CHAR*       name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(monitorEnable);
    PARAMETER_INITIALIZE(monitorFrequency);
    PARAMETER_INITIALIZE(searchFrequency);
    PARAMETER_INITIALIZE(baselineMM);
    PARAMETER_INITIALIZE(auxDirection);
    PARAMETER_INITIALIZE(macroEstimateLimitCM);
    PARAMETER_INITIALIZE(alignmentCheckEnable);
    PARAMETER_INITIALIZE(jumpToStartLimit);
    PARAMETER_INITIALIZE(numNearSteps);
    PARAMETER_INITIALIZE(numFarSteps);
    PARAMETER_INITIALIZE(dciafStepSize);
    PARAMETER_INITIALIZE(motionDataUseEnable);
    PARAMETER_INITIALIZE(sceneChangeLensPositionThreshold);
    PARAMETER_INITIALIZE(panningStableLensPositionThreshold);
    PARAMETER_INITIALIZE(panningStableDurationMSBright);
    PARAMETER_INITIALIZE(panningStableDurationMSLow);
    PARAMETER_INITIALIZE(maxLowLightWaitMs);
    PARAMETER_INITIALIZE(maxNormalLightWaitMs);
    PARAMETER_INITIALIZE(jumpWithNoSkip);
    PARAMETER_INITIALIZE(skipframesBeforeFineSearch);
    PARAMETER_INITIALIZE(distanceThresholdMacroRegionInMM);
    PARAMETER_INITIALIZE(distanceThresholdNonMacroFactor);
    PARAMETER_INITIALIZE(lowLightThreshold);
    PARAMETER_INITIALIZE(useFineSearchExtension);
    PARAMETER_INITIALIZE(macroRegionThresholdInMM);
    PARAMETER_INITIALIZE(farRegionThresholdInMM);
    PARAMETER_INITIALIZE(normalLightFineSearchInfo);
    PARAMETER_INITIALIZE(lowLightFineSearchInfo);
}

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatixAFDCIAFFineSearchStepInfoType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAFDCIAFFineSearchStepInfoType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(stepSize);
    PARAMETER_INITIALIZE(farSteps);
    PARAMETER_INITIALIZE(nearSteps);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xbac98264f4c39ff8;
        entry->ReadSimpleTypeFixedArray(&stepSize, 1, localParams);
        localParams.NameHash = 0xeac8ec0da71d061f;
        entry->ReadSimpleTypeFixedArray(&farSteps, 1, localParams);
        localParams.NameHash = 0x83c3f876c52844bf;
        entry->ReadSimpleTypeFixedArray(&nearSteps, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void chromatixAFDCIAFFineSearchStepInfoType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        chromatixAFDCIAFFineSearchStepInfoType* arrayPtr = (chromatixAFDCIAFFineSearchStepInfoType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* chromatixAFDCIAFFineSearchStepInfoType::AllocArray(
    UINT32 __count)
{
    chromatixAFDCIAFFineSearchStepInfoType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW chromatixAFDCIAFFineSearchStepInfoType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load chromatixDCIAFType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixDCIAFType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(monitorEnable);
    PARAMETER_INITIALIZE(monitorFrequency);
    PARAMETER_INITIALIZE(searchFrequency);
    PARAMETER_INITIALIZE(baselineMM);
    PARAMETER_INITIALIZE(auxDirection);
    PARAMETER_INITIALIZE(macroEstimateLimitCM);
    PARAMETER_INITIALIZE(alignmentCheckEnable);
    PARAMETER_INITIALIZE(jumpToStartLimit);
    PARAMETER_INITIALIZE(numNearSteps);
    PARAMETER_INITIALIZE(numFarSteps);
    PARAMETER_INITIALIZE(dciafStepSize);
    PARAMETER_INITIALIZE(motionDataUseEnable);
    PARAMETER_INITIALIZE(sceneChangeLensPositionThreshold);
    PARAMETER_INITIALIZE(panningStableLensPositionThreshold);
    PARAMETER_INITIALIZE(panningStableDurationMSBright);
    PARAMETER_INITIALIZE(panningStableDurationMSLow);
    PARAMETER_INITIALIZE(maxLowLightWaitMs);
    PARAMETER_INITIALIZE(maxNormalLightWaitMs);
    PARAMETER_INITIALIZE(jumpWithNoSkip);
    PARAMETER_INITIALIZE(skipframesBeforeFineSearch);
    PARAMETER_INITIALIZE(distanceThresholdMacroRegionInMM);
    PARAMETER_INITIALIZE(distanceThresholdNonMacroFactor);
    PARAMETER_INITIALIZE(lowLightThreshold);
    PARAMETER_INITIALIZE(useFineSearchExtension);
    PARAMETER_INITIALIZE(macroRegionThresholdInMM);
    PARAMETER_INITIALIZE(farRegionThresholdInMM);
    PARAMETER_INITIALIZE(normalLightFineSearchInfoCount);
    PARAMETER_INITIALIZE(normalLightFineSearchInfo);
    PARAMETER_INITIALIZE(lowLightFineSearchInfoCount);
    PARAMETER_INITIALIZE(lowLightFineSearchInfo);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xe11cd9f365a2599f;
        module_version.Load(localParams);
        localParams.NameHash        = 0xca3106e199a12935;
        parameter_version.Load(localParams);
        localParams.NameHash = 0xcdcfa0fffb145228;
        entry->ReadSimpleTypeFixedArray(&monitorEnable, 1, localParams);
        localParams.NameHash = 0x83bd9ba53640ad2c;
        entry->ReadSimpleTypeFixedArray(&monitorFrequency, 1, localParams);
        localParams.NameHash = 0xa655d56ecdb4e160;
        entry->ReadSimpleTypeFixedArray(&searchFrequency, 1, localParams);
        localParams.NameHash = 0xf8a4a9dfbd500e8b;
        entry->ReadSimpleTypeFixedArray(&baselineMM, 1, localParams);
        localParams.NameHash = 0x8682c7d7740bfa22;
        entry->ReadEnumFixedArray(&auxDirection, 1, localParams);
        localParams.NameHash = 0xfadef83a47856fcd;
        entry->ReadSimpleTypeFixedArray(&macroEstimateLimitCM, 1, localParams);
        localParams.NameHash = 0xa46c2a4bf4368c35;
        entry->ReadSimpleTypeFixedArray(&alignmentCheckEnable, 1, localParams);
        localParams.NameHash = 0x89b4defcd815b026;
        entry->ReadSimpleTypeFixedArray(&jumpToStartLimit, 1, localParams);
        localParams.NameHash = 0x99b2f13b5723d568;
        entry->ReadSimpleTypeFixedArray(&numNearSteps, 1, localParams);
        localParams.NameHash = 0xdac0a8bbc5e115f7;
        entry->ReadSimpleTypeFixedArray(&numFarSteps, 1, localParams);
        localParams.NameHash = 0xc412ae16cf5fe4db;
        entry->ReadSimpleTypeFixedArray(&dciafStepSize, 1, localParams);
        localParams.NameHash = 0xce97da0c6c45fcf3;
        entry->ReadSimpleTypeFixedArray(&motionDataUseEnable, 1, localParams);
        localParams.NameHash = 0x91fa01d049c2c463;
        entry->ReadSimpleTypeFixedArray(&sceneChangeLensPositionThreshold, 1, localParams);
        localParams.NameHash = 0x8a73461b0e1186a8;
        entry->ReadSimpleTypeFixedArray(&panningStableLensPositionThreshold, 1, localParams);
        localParams.NameHash = 0x831495faa21c0415;
        entry->ReadSimpleTypeFixedArray(&panningStableDurationMSBright, 1, localParams);
        localParams.NameHash = 0xaf1cda280166a339;
        entry->ReadSimpleTypeFixedArray(&panningStableDurationMSLow, 1, localParams);
        localParams.NameHash = 0xf001035d2e897580;
        entry->ReadSimpleTypeFixedArray(&maxLowLightWaitMs, 1, localParams);
        localParams.NameHash = 0xc2eb713381b3a0a9;
        entry->ReadSimpleTypeFixedArray(&maxNormalLightWaitMs, 1, localParams);
        localParams.NameHash = 0xd9490c0a96c88b3d;
        entry->ReadSimpleTypeFixedArray(&jumpWithNoSkip, 1, localParams);
        localParams.NameHash = 0xa80d91e44aebef5c;
        entry->ReadSimpleTypeFixedArray(&skipframesBeforeFineSearch, 1, localParams);
        localParams.NameHash = 0xf890d1e5381f9a1e;
        entry->ReadSimpleTypeFixedArray(&distanceThresholdMacroRegionInMM, 1, localParams);
        localParams.NameHash = 0xfdff951352a98cb8;
        entry->ReadSimpleTypeFixedArray(&distanceThresholdNonMacroFactor, 1, localParams);
        localParams.NameHash = 0x816db31adab80ec7;
        entry->ReadSimpleTypeFixedArray(&lowLightThreshold, 1, localParams);
        localParams.NameHash = 0x84c91c67febf656e;
        entry->ReadSimpleTypeFixedArray(&useFineSearchExtension, 1, localParams);
        localParams.NameHash = 0x87a2a1b62c8e0535;
        entry->ReadSimpleTypeFixedArray(&macroRegionThresholdInMM, 1, localParams);
        localParams.NameHash = 0xbc5b41ff42f366ff;
        entry->ReadSimpleTypeFixedArray(&farRegionThresholdInMM, 1, localParams);
        localParams.NameHash = 0x975b96353f50ff20;
        entry->ReadStructureArray(normalLightFineSearchInfo, normalLightFineSearchInfoCount, normalLightFineSearchInfoID, 1, localParams, __COUNTER__);
        localParams.NameHash = 0xf0fb319b2575ec99;
        entry->ReadStructureArray(lowLightFineSearchInfo, lowLightFineSearchInfoCount, lowLightFineSearchInfoID, 1, localParams, __COUNTER__);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void chromatixDCIAFType::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        chromatixDCIAFType* arrayPtr = (chromatixDCIAFType*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* chromatixDCIAFType::AllocArray(
    UINT32 __count)
{
    chromatixDCIAFType* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW chromatixDCIAFType[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixDCIAFType::module_versionStruct::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(major_revision);
    PARAMETER_INITIALIZE(minor_revision);
    PARAMETER_INITIALIZE(incr_revision);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xcd66249477636693;
        entry->ReadSimpleTypeFixedArray(&major_revision, 1, localParams);
        localParams.NameHash = 0xc5497493137a9c25;
        entry->ReadSimpleTypeFixedArray(&minor_revision, 1, localParams);
        localParams.NameHash = 0xb27b8a668efb2a56;
        entry->ReadSimpleTypeFixedArray(&incr_revision, 1, localParams);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void chromatixDCIAFType::module_versionStruct::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        module_versionStruct* arrayPtr = (module_versionStruct*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* chromatixDCIAFType::module_versionStruct::AllocArray(
    UINT32 __count)
{
    module_versionStruct* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW module_versionStruct[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixDCIAFType::parameter_versionStruct::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(revision);

    ParameterFileSymbolTableEntry* const entry = parentParams.Entry;
    ParameterLoadParameters localParams(parentParams);
    localParams.Element   = nullptr;
    localParams.UseParent = false;
    localParams.Index     = 0;

    if (parentParams.Element != nullptr)
    {
        bool _posChanged = false;
        localParams.Element = entry->AdjustPositionAndGetElement(parentParams, true, _posChanged);
    }

    // If parentParams.Element != null && localParams.Element == null, then this element is not defined in the binary file.
    // If parentParams.Element == null then this binary file does not contain a definition table or
    // the full backwards compatibility feature is disabled (for memory or performance reasons)
    if (parentParams.Element == nullptr || parentParams.Element->Verified || localParams.Element != nullptr)
    {
        localParams.Position      = entry->Position;
        localParams.LoadDataLimit = entry->ReadLoadDataLimit(parentParams.LoadDataLimit);

        localParams.NameHash = 0xd594eed07a5650c5;
        entry->ReadStringFixedArray(&revision, 1, localParams, __COUNTER__);

        entry->UpdatePosition(localParams.LoadDataLimit);
    }
    else
    {
        PARAMETER_LOG_ERROR(entry->Table->SetManager, "%s: 0x%llx entry not found in the binary file, all values will be 0\n",
            __FUNCTION__, parentParams.NameHash);
    }
}

void chromatixDCIAFType::parameter_versionStruct::LoadArray(
    ParameterLoadParameters& __params,
    void*                    __array,
    UINT32                   __count)
{
    if (__array != nullptr)
    {
        parameter_versionStruct* arrayPtr = (parameter_versionStruct*)__array;
        for (UINT32 i = 0; i < __count; i++)
        {
            __params.Index = i;
            arrayPtr[i].Load(__params);
        }
    }
}

void* chromatixDCIAFType::parameter_versionStruct::AllocArray(
    UINT32 __count)
{
    parameter_versionStruct* result = nullptr;
    if (__count > 0)
    {
        result = PARAMETER_NEW parameter_versionStruct[__count];
    }
    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload chromatixDCIAFType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixDCIAFType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    ParameterFileSymbolTable::ReleaseObject(__table, normalLightFineSearchInfo);
    ParameterFileSymbolTable::ReleaseObject(__table, lowLightFineSearchInfo);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixDCIAFType::parameter_versionStruct::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, revision);
}

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetModuleName: Returns ParameterModule::Name variable
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const CHAR* chromatixDCIAFType::GetModuleName()
{
    return ((chromatixDCIAFTypeClass*)this)->Name;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GetModuleName: Returns ParameterModule::NameHash variable
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
UINT64 chromatixDCIAFType::GetModuleNameHash()
{
    return ((chromatixDCIAFTypeClass*)this)->NameHash;
}

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

    if (IsModuleMatch(moduleData) && 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 = (chromatixDCIAFTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW chromatixDCIAFTypeClass(Name, moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixDCIAFTypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create chromatixDCIAFTypeClass, binary name hash (0x%016llx) does not match source name hash (0x%016llx)\n",
            moduleData->NameHash, NameHash);
    }

    return (ParameterModule*)cls;
}

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

#ifdef PARAMETER_USE_MUTEX
    ParameterMutexLocker lock(Mutex); // Unique LOCK
#endif

    if (!Loaded)
    {
        chromatixDCIAFTypeClass* 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 & 0x00ffffffU);

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


        ParameterDefinitionElement* _element = nullptr;
        if (table->ModuleDefinitions != nullptr && !table->ModuleDefinitions->empty())
        {
            _element = table->BuildModuleElement(NameHash);
        }

        ParameterLoadParameters parentParams(entry, NameHash, true, true, _element, entry->Position, 0, ParameterFileSymbolTableEntry::LOAD_LIMIT_MAX);
        cls->Load(parentParams);
        PARAMETER_DELETE _element;
        Modified++;
        Loaded = true;
    }

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

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload module data
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixDCIAFTypeClass::UnloadModule()
{
#ifdef PARAMETER_USE_MUTEX
    ParameterMutexLocker lock(Mutex); // Unique LOCK
#endif

    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 chromatixDCIAFTypeClass::Release()
{
    ParameterModule::Release();
}

AFDCIAFELEMENTS_NAMESPACE_END
