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

    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;

    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;

    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;

    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;

    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;

    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;

    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;

    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;

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

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

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(chromatixAFCameraOrientationType::AF_CAM_ORIENT_LEFT):
            enumValue = chromatixAFCameraOrientationType::AF_CAM_ORIENT_LEFT;
            result    = true;
            break;
        case static_cast<UINT32>(chromatixAFCameraOrientationType::AF_CAM_ORIENT_RIGHT):
            enumValue = chromatixAFCameraOrientationType::AF_CAM_ORIENT_RIGHT;
            result    = true;
            break;
        case static_cast<UINT32>(chromatixAFCameraOrientationType::AF_CAM_ORIENT_UP):
            enumValue = chromatixAFCameraOrientationType::AF_CAM_ORIENT_UP;
            result    = true;
            break;
        case static_cast<UINT32>(chromatixAFCameraOrientationType::AF_CAM_ORIENT_DOWN):
            enumValue = chromatixAFCameraOrientationType::AF_CAM_ORIENT_DOWN;
            result    = true;
            break;
        case static_cast<UINT32>(chromatixAFCameraOrientationType::AF_CAM_ORIENT_MAX):
            enumValue = chromatixAFCameraOrientationType::AF_CAM_ORIENT_MAX;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to chromatixAFCameraOrientationType", uintValue);
            break;
        }
    }
    return result;
}

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

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

    if (result)
    {
        switch (uintValue)
        {
        case static_cast<UINT32>(chromatixAFDCIAFDistanceRange::AF_DCIAF_MACRO_RANGE):
            enumValue = chromatixAFDCIAFDistanceRange::AF_DCIAF_MACRO_RANGE;
            result    = true;
            break;
        case static_cast<UINT32>(chromatixAFDCIAFDistanceRange::AF_DCIAF_MID_RANGE):
            enumValue = chromatixAFDCIAFDistanceRange::AF_DCIAF_MID_RANGE;
            result    = true;
            break;
        case static_cast<UINT32>(chromatixAFDCIAFDistanceRange::AF_DCIAF_FAR_RANGE):
            enumValue = chromatixAFDCIAFDistanceRange::AF_DCIAF_FAR_RANGE;
            result    = true;
            break;
        case static_cast<UINT32>(chromatixAFDCIAFDistanceRange::AF_DCIAF_MAX_RANGE):
            enumValue = chromatixAFDCIAFDistanceRange::AF_DCIAF_MAX_RANGE;
            result    = true;
            break;
        default:
            PARAMETER_LOG_ERROR(entry->SetManager, "Invalid value(% u) converting UINT32 to chromatixAFDCIAFDistanceRange", uintValue);
            break;
        }
    }
    return result;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixDCIAFTypeClass::chromatixDCIAFTypeClass(
    const CHAR* const 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* const 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();
    }
}

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

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

    PARAMETER_INITIALIZE(stepSize);
    PARAMETER_INITIALIZE(farSteps);
    PARAMETER_INITIALIZE(nearSteps);

    SYMBOL_TABLE_ENTRY_READ(entry, result, stepSize, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, farSteps, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, nearSteps, alignment)

    return result;
}

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

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

    result = module_version.Load(entry, alignment);
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, monitorEnable, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, monitorFrequency, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, searchFrequency, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, baselineMM, alignment)
    if (result)
    {
        result = afdciafelements::ReadEnum_chromatixAFCameraOrientationType(entry, auxDirection, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, macroEstimateLimitCM, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, alignmentCheckEnable, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, jumpToStartLimit, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, numNearSteps, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, numFarSteps, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, dciafStepSize, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, motionDataUseEnable, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, sceneChangeLensPositionThreshold, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, panningStableLensPositionThreshold, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, panningStableDurationMSBright, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, panningStableDurationMSLow, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, maxLowLightWaitMs, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, maxNormalLightWaitMs, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, jumpWithNoSkip, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, skipframesBeforeFineSearch, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, distanceThresholdMacroRegionInMM, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, distanceThresholdNonMacroFactor, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, lowLightThreshold, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, useFineSearchExtension, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, macroRegionThresholdInMM, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, farRegionThresholdInMM, alignment)

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

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

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

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

    return result;
}

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

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

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

    return result;
}

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

    PARAMETER_INITIALIZE(revision);


    // Reading String revision from symbol table
    {
        UINT32 count = 0;
        SYMBOL_TABLE_ENTRY_READ(entry, result, count, alignment)
        ParameterFileSymbolTableEntry stringPointerEntryCls;
        ParameterFileSymbolTableEntry* const stringPointerEntry = &stringPointerEntryCls;
        if (result)
        {
            result = entry->Table->ReadPointerEntry(stringPointerEntryCls, entry, alignment);
        }
        SYMBOL_TABLE_ENTRY_READ_STRING(stringPointerEntry, result, revision, count, alignment)
    }

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload chromatixDCIAFType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixDCIAFType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    if (__table != nullptr && __table->ReleaseDupObject(normalLightFineSearchInfo))
    {
        PARAMETER_DELETE[] normalLightFineSearchInfo;
    }
    normalLightFineSearchInfo = nullptr;
    if (__table != nullptr && __table->ReleaseDupObject(lowLightFineSearchInfo))
    {
        PARAMETER_DELETE[] lowLightFineSearchInfo;
    }
    lowLightFineSearchInfo = nullptr;
}

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Release the ParameterModule object
/// Requires that this object was created via a ParameterSetManager::GetModule call
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void 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;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Create module, and return a new object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ParameterModule* chromatixDCIAFTypeClass::Create(
    ModuleData*    moduleData,
    DefaultModule* const defModule) const
{
    chromatixDCIAFTypeClass* 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 = (chromatixDCIAFTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW chromatixDCIAFTypeClass(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 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 (%s) does not match source name (%s)\n",
            moduleData->Type, Type);
    }

    return (ParameterModule*)cls;
}

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

    if (!Loaded)
    {
        BYTE const alignment = table->Alignment;
        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 & 0x00ffffff);

        if (!result)
        {
            PARAMETER_LOG_ERROR(entry->SetManager, "chromatixDCIAFTypeClass::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 chromatixDCIAFTypeClass::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 chromatixDCIAFTypeClass::Release()
{
    ParameterModule::Release();
}

AFDCIAFELEMENTS_NAMESPACE_END
