/*
 * Go2PartBoundingBoxY.c
 * 
 * Gocator system communication library
 * Copyright (C) 2013 by LMI Technologies Inc.
 * 
 * Licensed under The MIT License.
 * Redistributions of files must retain the above copyright notice.
 */

#include <z/Go2Measurements/zGo2PartBoundingBoxY.h>
#include <z/zGo2PartTypes.h>
#include <z/zGo2System.h>
#include <string.h>

/*
 * Go2PartBoundingBoxY Class 
 */

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_Construct(Go2PartBoundingBoxY* measurement, Go2UInt32 id, Go2Object system)
{
    Go2PartBoundingBoxY output = zNIL; 
    Go2Status status = zOK; 

    zCHECK(zCalloc(&output, 1, sizeof(Go2PartBoundingBoxYClass))); 

    if (!zSUCCESS(status = Go2PartBoundingBoxY_Init(output, id, system)))
    {
        zCHECK(Go2Object_Destroy(output)); 
        return status; 
    }

    *measurement = output; 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_Init(Go2PartBoundingBoxY measurement, Go2UInt32 id, Go2Object system)
{
    Go2PartBoundingBoxYClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2PartMeasurement_Init(measurement, GO2_TYPE_PART_BOUNDING_BOX_Y, id, system)); 

    obj->Read = Go2PartBoundingBoxY_VRead; 
    obj->Write = Go2PartBoundingBoxY_VWrite; 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_VRead(Go2PartBoundingBoxY measurement, zXml xml, zXmlItem item)
{
    Go2PartBoundingBoxYClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2PartMeasurement_VRead(measurement, xml, item)); 

    zCHECK(zXml_Child32s(xml, item, "RegionEnabled", &obj->regionEnabled)); 
    zCHECK(zXml_Child32s(xml, item, "RotationEnable", &obj->rotationEnabled)); 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_VWrite(Go2PartBoundingBoxY  measurement, zXml xml, zXmlItem item)
{
    Go2PartBoundingBoxYClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2PartMeasurement_VWrite(measurement, xml, item)); 

    zCHECK(zXml_SetChild32s(xml, item, "RegionEnabled", obj->regionEnabled)); 
    zCHECK(zXml_SetChild32s(xml, item, "RotationEnable", obj->rotationEnabled)); 

    return GO2_OK; 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetId(Go2PartBoundingBoxY measurement, Go2UInt32 id)
{
    return Go2Measurement_SetId(measurement, id); 
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxY_Id(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_Id(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetName(Go2PartBoundingBoxY measurement, const Go2Char* name)
{
    return Go2Measurement_SetName(measurement, name); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_Name(Go2PartBoundingBoxY measurement, Go2Char* name, Go2UInt32 capacity)
{
    return Go2Measurement_Name(measurement, name, capacity); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetDecisionMin(Go2PartBoundingBoxY measurement, Go2Double min)
{
    return Go2Measurement_SetDecisionMin(measurement, min); 
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxY_DecisionMin(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_DecisionMin(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetDecisionMax(Go2PartBoundingBoxY measurement, Go2Double max)
{
    return Go2Measurement_SetDecisionMax(measurement, max); 
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxY_DecisionMax(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_DecisionMax(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_EnableHold(Go2PartBoundingBoxY measurement, Go2Bool enable)
{
    return Go2Measurement_EnableHold(measurement, enable);  
} 

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxY_HoldEnabled(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_HoldEnabled(measurement);  
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_EnableSmoothing(Go2PartBoundingBoxY measurement, Go2Bool enable)
{
    return Go2Measurement_EnableSmoothing(measurement, enable);  
} 

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxY_SmoothingEnabled(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_SmoothingEnabled(measurement);  
} 

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxY_SmoothingWindowMin(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_SmoothingWindowMin(measurement);  
} 

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxY_SmoothingWindowMax(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_SmoothingWindowMax(measurement);  
} 

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetSmoothingWindow(Go2PartBoundingBoxY measurement, Go2UInt32 window)
{
    return Go2Measurement_SetSmoothingWindow(measurement, window);  
} 

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxY_SmoothingWindow(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_SmoothingWindow(measurement);  
} 

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_EnableRotation(Go2PartBoundingBoxY measurement, Go2Bool enable)
{
    Go2PartBoundingBoxYClass* obj = zHANDLE_POINTER(measurement);

    zCHECK(Go2System_CheckConfigurable(obj->system));
    obj->rotationEnabled = enable;
    zCHECK(Go2System_SetModified(obj->system));

    return GO2_OK;
}
 
GO2_EXPORT(Go2Bool) Go2PartBoundingBoxY_RotationEnabled(Go2PartBoundingBoxY measurement)
{
    Go2PartBoundingBoxYClass* obj = zHANDLE_POINTER(measurement);
    return obj->rotationEnabled;
}



GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetScale(Go2PartBoundingBoxY measurement, Go2Double scale){
    return Go2Measurement_SetScale(measurement, scale);
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxY_Scale(Go2PartBoundingBoxY measurement){
    return Go2Measurement_Scale(measurement);
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetOffset(Go2PartBoundingBoxY measurement, Go2Double offset){
    return Go2Measurement_SetOffset(measurement, offset);
}

GO2_EXPORT(Go2Double) Go2PartBoundingBoxY_Offset(Go2PartBoundingBoxY measurement){
    return Go2Measurement_Offset(measurement);
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_EnableLink(Go2PartBoundingBoxY measurement, Go2Bool enable)  
{
    return Go2Measurement_EnableLink(measurement, enable);  
}

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxY_LinkEnabled(Go2PartBoundingBoxY measurement)  
{
    return Go2Measurement_LinkEnabled(measurement);  
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_SetLink(Go2PartBoundingBoxY measurement, Go2UInt32 link) 
{
    return Go2Measurement_SetLink(measurement, link); 
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxY_Link(Go2PartBoundingBoxY measurement) 
{
    return Go2Measurement_Link(measurement); 
}

GO2_EXPORT(Go2Status) Go2PartBoundingBoxY_EnableRegion(Go2PartBoundingBoxY measurement, Go2Bool enable)  
{
    return Go2PartMeasurement_EnableRegion(measurement, enable);  
}

GO2_EXPORT(Go2Bool) Go2PartBoundingBoxY_RegionEnabled(Go2PartBoundingBoxY measurement)  
{
    return Go2PartMeasurement_RegionEnabled(measurement);  
}

GO2_EXPORT(Go2PartRegion3d) Go2PartBoundingBoxY_Region(Go2PartBoundingBoxY measurement)
{
    return Go2PartMeasurement_Region(measurement);
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxY_LinkOptionCount(Go2PartBoundingBoxY measurement)
{
    return Go2Measurement_LinkOptionCount(measurement);
}

GO2_EXPORT(Go2UInt32) Go2PartBoundingBoxY_LinkOptionAt(Go2PartBoundingBoxY measurement, Go2UInt32 index)
{
    return Go2Measurement_LinkOptionAt(measurement, index);
}
