////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
// All rights reserved.
// Confidential and Proprietary - Qualcomm Technologies, Inc.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// THIS IS AUTO-GENERATED CODE.  PLEASE DO NOT EDIT (File bug reports against tools).
///
/// Auto-generated by: Parameter Parser V7.4.1 (8cca6579792b9fcef3bc725ff070c5ec453c7c85)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

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

#include "aecgyro.h"
#include "parametersetmanager.h"

AECGYRO_NAMESPACE_BEGIN

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// SetValue/GetValue Functions
/// Gets or sets the requested value
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool GyroExpCtrlValueMonitorType::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, "name") == 0)
    {
        PARAMETER_STRCPY(__value, __size, name);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "sensitivity") == 0)
    {
        ParameterUtils::DoubleToString((double)sensitivity, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "valueMonitor") == 0)
    {
        __result = valueMonitor.GetValue(&__path[__pos], __value, __size);
    }

    return __result;
}

bool GyroExpCtrlValueMonitorType::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, "name") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }
    else if (PARAMETER_STRCMP(__name, "sensitivity") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            sensitivity = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "valueMonitor") == 0)
    {
        __result = valueMonitor.SetValue(&__path[__pos], __value);
    }

    return __result;
}

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

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "data") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            data = (float)dblValue; 
        }
    }

    return __result;
}

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

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

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

    return __result;
}

bool AECGyroType::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, "enableFlag") == 0)
    {
        ParameterUtils::DoubleToString((double)enableFlag, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "movingAvgFilterLength") == 0)
    {
        ParameterUtils::DoubleToString((double)movingAvgFilterLength, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "level2ZoneType") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)level2ZoneType, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "triggerDataType") == 0)
    {
        ParameterUtils::DoubleToString((double)(UINT32)triggerDataType, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "gyroExpCtrlTrigger") == 0)
    {
        if (__index < gyroExpCtrlTriggerCount)
        {
            __result = gyroExpCtrlTrigger[__index].GetValue(&__path[__pos], __value, __size);
        }
    }
    else if (PARAMETER_STRCMP(__name, "gyroExpCtrlValueMonitors") == 0)
    {
        if (__index < gyroExpCtrlValueMonitorsCount)
        {
            __result = gyroExpCtrlValueMonitors[__index].GetValue(&__path[__pos], __value, __size);
        }
    }

    return __result;
}

bool AECGyroType::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, "enableFlag") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            enableFlag = (BOOL)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "movingAvgFilterLength") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            movingAvgFilterLength = (UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "level2ZoneType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            level2ZoneType = (aecglobalelements::AECGyroExpCtrlKeyLevelZoneType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "triggerDataType") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            triggerDataType = (aecglobalelements::AECGyroExpCtrlTriggerDataType)(UINT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "gyroExpCtrlTrigger") == 0)
    {
        if (__index < gyroExpCtrlTriggerCount)
        {
            __result = gyroExpCtrlTrigger[__index].SetValue(&__path[__pos], __value);
        }
    }
    else if (PARAMETER_STRCMP(__name, "gyroExpCtrlValueMonitors") == 0)
    {
        if (__index < gyroExpCtrlValueMonitorsCount)
        {
            __result = gyroExpCtrlValueMonitors[__index].SetValue(&__path[__pos], __value);
        }
    }

    return __result;
}

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

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

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

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

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)major_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)minor_revision, __value, __size, 0);
        __result = true;
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        ParameterUtils::DoubleToString((double)incr_revision, __value, __size, 0);
        __result = true;
    }

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "major_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            major_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "minor_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            minor_revision = (INT32)dblValue; 
        }
    }
    else if (PARAMETER_STRCMP(__name, "incr_revision") == 0)
    {
        const double dblValue = ParameterUtils::StringToDouble(__value, __result);
        if (__result)
        {
            incr_revision = (INT32)dblValue; 
        }
    }

    return __result;
}

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

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

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

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

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

    return __result;
}

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

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

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

    return __result;
}

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

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

    if (PARAMETER_STRCMP(__name, "revision") == 0)
    {
        // Cannot modify strings, risk of memory leaks or corruption
    }

    return __result;
}

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

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

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

    return __result;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Default Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECGyroTypeClass::AECGyroTypeClass(
    const CHAR* name)
    : ParameterModule(name, MAJOR, MINOR, PATCH, nullptr)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(movingAvgFilterLength);
    PARAMETER_INITIALIZE(level2ZoneType);
    PARAMETER_INITIALIZE(triggerDataType);
    PARAMETER_INITIALIZE(gyroExpCtrlTriggerCount);
    PARAMETER_INITIALIZE(gyroExpCtrlTrigger);
    PARAMETER_INITIALIZE(gyroExpCtrlValueMonitorsCount);
    PARAMETER_INITIALIZE(gyroExpCtrlValueMonitors);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AECGyroTypeClass::AECGyroTypeClass(
    const CHAR*       name,
    ModuleData* const moduleData)
    : ParameterModule(name, MAJOR, MINOR, PATCH, moduleData)
{
    PARAMETER_INITIALIZE(SymbolTableID);
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(movingAvgFilterLength);
    PARAMETER_INITIALIZE(level2ZoneType);
    PARAMETER_INITIALIZE(triggerDataType);
    PARAMETER_INITIALIZE(gyroExpCtrlTrigger);
    PARAMETER_INITIALIZE(gyroExpCtrlValueMonitors);
}

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


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load GyroExpCtrlValueMonitorType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void GyroExpCtrlValueMonitorType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(name);
    PARAMETER_INITIALIZE(sensitivity);
    PARAMETER_INITIALIZE(valueMonitor);

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

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

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

        localParams.NameHash = 0x8fde98e3965ec31d;
        entry->ReadStringFixedArray(&name, 1, localParams, __COUNTER__);
        localParams.NameHash = 0x8aa3592494dd1625;
        entry->ReadSimpleTypeFixedArray(&sensitivity, 1, localParams);
        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0x823fe70ca3905ae1;
        valueMonitor.Load(localParams);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load GyroExpCtrlAuxZoneDataType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void GyroExpCtrlAuxZoneDataType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(data);

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

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

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

        localParams.NameHash = 0x8c93b82417321453;
        entry->ReadSimpleTypeFixedArray(&data, 1, localParams);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load GyroExpCtrlAuxZoneType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void GyroExpCtrlAuxZoneType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(zoneTrigger);
    PARAMETER_INITIALIZE(zoneData);

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

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

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

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0x9d49dd7376f3949b;
        zoneTrigger.Load(localParams);
        localParams.NameHash        = 0xd47d0038091ab64b;
        zoneData.Load(localParams);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load GyroExpCtrlZoneType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void GyroExpCtrlZoneType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(zoneTrigger);
    PARAMETER_INITIALIZE(zoneDataCount);
    PARAMETER_INITIALIZE(zoneData);

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

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

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

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0x9d49dd7376f3949b;
        zoneTrigger.Load(localParams);
        localParams.NameHash = 0xd47d0038091ab64b;
        entry->ReadStructureArray(zoneData, zoneDataCount, zoneDataID, 1, localParams, __COUNTER__);

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Load AECGyroType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECGyroType::Load(
    ParameterLoadParameters& parentParams)
{
    PARAMETER_INITIALIZE(module_version);
    PARAMETER_INITIALIZE(parameter_version);
    PARAMETER_INITIALIZE(enableFlag);
    PARAMETER_INITIALIZE(movingAvgFilterLength);
    PARAMETER_INITIALIZE(level2ZoneType);
    PARAMETER_INITIALIZE(triggerDataType);
    PARAMETER_INITIALIZE(gyroExpCtrlTriggerCount);
    PARAMETER_INITIALIZE(gyroExpCtrlTrigger);
    PARAMETER_INITIALIZE(gyroExpCtrlValueMonitorsCount);
    PARAMETER_INITIALIZE(gyroExpCtrlValueMonitors);

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

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

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

        localParams.UseParent       = false;
        localParams.UseParentOffset = true;
        localParams.NameHash        = 0xe11cd9f365a2599f;
        module_version.Load(localParams);
        localParams.NameHash        = 0xca3106e199a12935;
        parameter_version.Load(localParams);
        localParams.NameHash = 0x89a1d7b1468113d1;
        entry->ReadSimpleTypeFixedArray(&enableFlag, 1, localParams);
        localParams.NameHash = 0xa0c284eb4cefc9bf;
        entry->ReadSimpleTypeFixedArray(&movingAvgFilterLength, 1, localParams);
        localParams.NameHash = 0xdf26dab06daf5da4;
        entry->ReadEnumFixedArray(&level2ZoneType, 1, localParams);
        localParams.NameHash = 0xdbe7b9d599f7d3ae;
        entry->ReadEnumFixedArray(&triggerDataType, 1, localParams);
        localParams.NameHash = 0x974944fdd1853a14;
        entry->ReadStructureArray(gyroExpCtrlTrigger, gyroExpCtrlTriggerCount, gyroExpCtrlTriggerID, 1, localParams, __COUNTER__);
        localParams.NameHash = 0xbffa9d5b9f3abd84;
        entry->ReadStructureArray(gyroExpCtrlValueMonitors, gyroExpCtrlValueMonitorsCount, gyroExpCtrlValueMonitorsID, 1, localParams, __COUNTER__);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload GyroExpCtrlValueMonitorType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void GyroExpCtrlValueMonitorType::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, name);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload GyroExpCtrlZoneType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void GyroExpCtrlZoneType::Unload(ParameterFileSymbolTable* const __table)
{
    ParameterFileSymbolTable::ReleaseObject(__table, zoneData);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Unload AECGyroType
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECGyroType::Unload(ParameterFileSymbolTable* const __table)
{
    parameter_version.Unload(__table);
    for (UINT32 i = 0; gyroExpCtrlTrigger != nullptr && i < gyroExpCtrlTriggerCount; i++)
    {
        gyroExpCtrlTrigger[i].Unload(__table);
    }
    ParameterFileSymbolTable::ReleaseObject(__table, gyroExpCtrlTrigger);
    for (UINT32 i = 0; gyroExpCtrlValueMonitors != nullptr && i < gyroExpCtrlValueMonitorsCount; i++)
    {
        gyroExpCtrlValueMonitors[i].Unload(__table);
    }
    ParameterFileSymbolTable::ReleaseObject(__table, gyroExpCtrlValueMonitors);
}

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

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

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

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

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

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

    if (IsModuleMatch(moduleData) && Version.Value == moduleData->Version.Value)
    {
        const UINT32 id = moduleData->DuplicateID > 0 ? moduleData->DuplicateID : moduleData->ID;

        ParameterModule* const module = defModule->Find(id);
        if (module != nullptr)
        {
            cls = (AECGyroTypeClass*)module;
        }
        else
        {
            cls = PARAMETER_NEW AECGyroTypeClass(Name, moduleData);
            cls->SymbolTableID = id;
            defModule->AddModule((ParameterModule*)cls);
        }
    }
    else if (Version.Value != moduleData->Version.Value)
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create AECGyroTypeClass, binary version (%lld) does not match source version (%lld)\n",
            moduleData->Version.Value, Version.Value);
    }
    else
    {
        PARAMETER_LOG_ERROR(moduleData->SetManager, "Unable to create AECGyroTypeClass, binary name hash (0x%016llx) does not match source name hash (0x%016llx)\n",
            moduleData->NameHash, NameHash);
    }

    return (ParameterModule*)cls;
}

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

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

    if (!Loaded)
    {
        AECGyroTypeClass* const cls = this;

        ParameterFileSymbolTableEntry  entryObj;
        ParameterFileSymbolTableEntry* const entry = &entryObj;
        // With EzTune enabled, the unused upper byte of SymbolTableID value can change, so clear it
        result = table->Find(entryObj, SymbolTableID & 0x00ffffffU);

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


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

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

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

    return result;
}

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

    if (Loaded)
    {
        if (Data != nullptr && Data->SymbolTable != nullptr)
        {
            Unload(Data->SymbolTable);
        }
        else
        {
            PARAMETER_LOG_ERROR(Data != nullptr ? Data->SetManager : nullptr, "UnloadModule %s called with nullptr "
                "Data->SymbolTable object\n", Name);
            Unload(nullptr);
        }
        Loaded = false;
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// /// Release the ParameterModule object
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void AECGyroTypeClass::Release()
{
    ParameterModule::Release();
}

AECGYRO_NAMESPACE_END
