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

#include "afsoftwarestatelements.h"
#include "parametersetmanager.h"

AFSOFTWARESTATELEMENTS_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixAFVFESoftwareIIRHighPassType::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, "filterCoeffA") == 0)
    {
        if (__index < 6)
        {
            ParameterUtils::DoubleToString((double)filterCoeffA[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < 6; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)filterCoeffA[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "filterCoeffB") == 0)
    {
        if (__index < 6)
        {
            ParameterUtils::DoubleToString((double)filterCoeffB[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < 6; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)filterCoeffB[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "FVMinHigh") == 0)
    {
        ParameterUtils::DoubleToString((double)FVMinHigh, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "FVMinLow") == 0)
    {
        ParameterUtils::DoubleToString((double)FVMinLow, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "coefficientlength") == 0)
    {
        ParameterUtils::DoubleToString((double)coefficientlength, __value, __size, 0);
        __result = true;
    }

    return __result;
}

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

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

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

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    filterCoeffA[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "filterCoeffB") == 0)
    {
        if (__index < 6)
        {
            const double dblValue = ParameterUtils::StringToDouble(__value, __result);
            if (__result)
            {
                filterCoeffB[__index] = (float)dblValue; 
            }
        }
        else
        {
            SIZE_T __valueLen = PARAMETER_STRLEN(__value);
            UINT32 __pos = 0;

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

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

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    filterCoeffB[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "FVMinHigh") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            FVMinHigh = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "FVMinLow") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            FVMinLow = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "coefficientlength") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            coefficientlength = (INT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

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

    return __result;
}

bool chromatixAFVFESoftwareFIRHighPassType::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, "filterCoeffA") == 0)
    {
        if (__index < 11)
        {
            ParameterUtils::DoubleToString((double)filterCoeffA[__index], __value, __size);
            __result = true;
        }
        else
        {
            SIZE_T __valuePos = 0;
            for (UINT32 i = 0; i < 11; i++)
            {
                if (i > 0)
                {
                    PARAMETER_STRCAT(__value, __size, ",");
                    __valuePos = PARAMETER_STRLEN(__value);
                }
                ParameterUtils::DoubleToString((double)filterCoeffA[i], &__value[__valuePos], (INT32)(__size - __valuePos));
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "FVMinHigh") == 0)
    {
        ParameterUtils::DoubleToString((double)FVMinHigh, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "FVMinLow") == 0)
    {
        ParameterUtils::DoubleToString((double)FVMinLow, __value, __size);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "coefficientlength") == 0)
    {
        ParameterUtils::DoubleToString((double)coefficientlength, __value, __size, 0);
        __result = true;
    }

    return __result;
}

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

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

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

                const double dblValue = ParameterUtils::StringToDouble(__valueStr, __result);
                if (__result)
                {
                    filterCoeffA[__index] = (float)dblValue; 
                }
                __index++;
            }
            __result = true;
        }
    }
    else if (PARAMETER_STRCMP(__name, "FVMinHigh") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            FVMinHigh = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "FVMinLow") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            FVMinLow = (float)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "coefficientlength") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            coefficientlength = (INT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "enable") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enable = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "filterType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            filterType = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "FIR") == 0)
    {
        __result = FIR.SetValue(&__path[__pos], __value);
    }
    else if (PARAMETER_STRCMP(__name, "IIR") == 0)
    {
        __result = IIR.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

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

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

    return __result;
}

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

    return __result;
}

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

    return __result;
}

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

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

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

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

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

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

    return __result;
}

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixAFTuningSoftwareStatisticsTypeClass::chromatixAFTuningSoftwareStatisticsTypeClass(
    const CHAR* const name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(SWFilterDefault);
    PARAMETER_INITIALIZE(SWFilterFace);
    PARAMETER_INITIALIZE(SWFilterLowLight);
    PARAMETER_INITIALIZE(SWFVMinimumLuxTriggerHigh);
    PARAMETER_INITIALIZE(SWFVMinimumLuxTriggerLow);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
chromatixAFTuningSoftwareStatisticsTypeClass::chromatixAFTuningSoftwareStatisticsTypeClass(
    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(SWFilterDefault);
    PARAMETER_INITIALIZE(SWFilterFace);
    PARAMETER_INITIALIZE(SWFilterLowLight);
    PARAMETER_INITIALIZE(SWFVMinimumLuxTriggerHigh);
    PARAMETER_INITIALIZE(SWFVMinimumLuxTriggerLow);
}

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

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

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

    PARAMETER_INITIALIZE(filterCoeffA);
    PARAMETER_INITIALIZE(filterCoeffB);
    PARAMETER_INITIALIZE(FVMinHigh);
    PARAMETER_INITIALIZE(FVMinLow);
    PARAMETER_INITIALIZE(coefficientlength);

    result = entry->ReadArray(filterCoeffA, 6, alignment);
    if (result)
    {
        result = entry->ReadArray(filterCoeffB, 6, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, FVMinHigh, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, FVMinLow, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, coefficientlength, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(filterCoeffA);
    PARAMETER_INITIALIZE(FVMinHigh);
    PARAMETER_INITIALIZE(FVMinLow);
    PARAMETER_INITIALIZE(coefficientlength);

    result = entry->ReadArray(filterCoeffA, 11, alignment);
    SYMBOL_TABLE_ENTRY_READ(entry, result, FVMinHigh, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, FVMinLow, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, coefficientlength, alignment)

    return result;
}

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

    PARAMETER_INITIALIZE(enable);
    PARAMETER_INITIALIZE(filterType);
    PARAMETER_INITIALIZE(FIR);
    PARAMETER_INITIALIZE(IIR);

    SYMBOL_TABLE_ENTRY_READ(entry, result, enable, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, filterType, alignment)
    if (result)
    {
        result = FIR.Load(entry, alignment);
    }
    if (result)
    {
        result = IIR.Load(entry, alignment);
    }

    return result;
}

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

    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(SWFilterDefault);
    PARAMETER_INITIALIZE(SWFilterFace);
    PARAMETER_INITIALIZE(SWFilterLowLight);
    PARAMETER_INITIALIZE(SWFVMinimumLuxTriggerHigh);
    PARAMETER_INITIALIZE(SWFVMinimumLuxTriggerLow);

    result = module_version.Load(entry, alignment);
    if (result)
    {
        result = parameter_version.Load(entry, alignment);
    }
    if (result)
    {
        result = SWFilterDefault.Load(entry, alignment);
    }
    if (result)
    {
        result = SWFilterFace.Load(entry, alignment);
    }
    if (result)
    {
        result = SWFilterLowLight.Load(entry, alignment);
    }
    SYMBOL_TABLE_ENTRY_READ(entry, result, SWFVMinimumLuxTriggerHigh, alignment)
    SYMBOL_TABLE_ENTRY_READ(entry, result, SWFVMinimumLuxTriggerLow, alignment)

    return result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load module_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool chromatixAFTuningSoftwareStatisticsType::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 chromatixAFTuningSoftwareStatisticsType::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 chromatixAFTuningSoftwareStatisticsType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAFTuningSoftwareStatisticsType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload parameter_versionStruct
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void chromatixAFTuningSoftwareStatisticsType::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 chromatixAFTuningSoftwareStatisticsType::Release()
{
    ((chromatixAFTuningSoftwareStatisticsTypeClass*)this)->Release();
}

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

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

    return (ParameterModule*)cls;
}

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

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

AFSOFTWARESTATELEMENTS_NAMESPACE_END
