/*
 * Go2Measurement.h
 * 
 * Gocator system communication library
 * Copyright (C) 2010 by LMI Technologies Inc.
 * 
 * Licensed under The MIT License.
 * Redistributions of files must retain the above copyright notice.
 */
#ifndef LMITECH_GO2_MEASUREMENT_H_INCLUDED
#define LMITECH_GO2_MEASUREMENT_H_INCLUDED

#include <Go2Object.h>
#include <Go2ApiBegin.h>


typedef enum Go2MeasurementType
{
    GO2_MEASUREMENT_TYPE_RANGE_POSITION_Z           = 0x80,                 // Range position Z measurement data id.
    GO2_MEASUREMENT_TYPE_RANGE_DIFFERENCE           = 0x81,                 // Range difference measurement data id.

    GO2_MEASUREMENT_TYPE_PROFILE_WIDTH              = 0x00,                 // Profile width measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_HEIGHT             = 0x01,                 // Profile height measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_DISTANCE           = 0x02,                 // Profile distance measurement data id. 
    GO2_MEASUREMENT_TYPE_PROFILE_CENTER_X           = 0x03,                 // Profile center X measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_CENTER_Z           = 0x04,                 // Profile center Z measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_POSITION_X         = 0x05,                 // Profile position X measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_POSITION_Z         = 0x06,                 // Profile position Z measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_ANGLE_X            = 0x13,                 // Profile angle X measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_ISECT_X            = 0x10,                 // Profile intersect X measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_ISECT_Z            = 0x11,                 // Profile intersect Z measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_ISECT_ANGLE        = 0x12,                 // Profile intersect angle measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_ISECT_AREA         = 0x20,                 // Profile intesect area measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_BOX_AREA           = 0x21,                 // Profile box area measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_DIFF_AREA          = 0x23,                 // Profile difference area measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_DIFF_PEAK          = 0x24,                 // Profile difference peak measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_GAP                = 0x25,                 // Profile gap measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_FLUSH              = 0x26,                 // Profile flush measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_CIRCLE_RADIUS      = 0x27,                 // Profile circle radius measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_CIRCLE_X           = 0x28,                 // Profile circle X measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_CIRCLE_Z           = 0x29,                 // Profile circle Z measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_LINE_STD_DEV       = 0x2A,                 // Profile line std dev measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_LINE_ERROR_MIN     = 0x2B,                 // Profile line error min measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_LINE_ERROR_MAX     = 0x2C,                 // Profile line error max measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_LINE_PERCENTILE    = 0x2D,                 // Profile line percentile measurement data id.
    GO2_MEASUREMENT_TYPE_PROFILE_GROOVE_X           = 0x2E,                 // Profile groove X data id.
    GO2_MEASUREMENT_TYPE_PROFILE_GROOVE_Z           = 0x2F,                 // Profile groove Z data id.
    GO2_MEASUREMENT_TYPE_PROFILE_GROOVE_WIDTH       = 0x31,                 // Profile groove width data id.
    GO2_MEASUREMENT_TYPE_PROFILE_GROOVE_DEPTH       = 0x37,                 // Profile groove width data id.    
    GO2_MEASUREMENT_TYPE_PROFILE_BRIDGE_VALUE       = 0x32,                 // Profile bridge value data id.
    GO2_MEASUREMENT_TYPE_PROFILE_STRIP_WIDTH        = 0x33,                 // Profile strip width data id.
    GO2_MEASUREMENT_TYPE_PROFILE_STRIP_HEIGHT       = 0x34,                 // Profile strip height data id.
    GO2_MEASUREMENT_TYPE_PROFILE_STRIP_X            = 0x35,                 // Profile strip X data id.
    GO2_MEASUREMENT_TYPE_PROFILE_STRIP_Z            = 0x36,                 // Profile strip Z data id.
    
    GO2_MEASUREMENT_TYPE_SCRIPT                     = 0x30,                 // Script measurement output.

    GO2_MEASUREMENT_TYPE_PART_AREA                  = 0x40,                 // Part area measurement data id.
    GO2_MEASUREMENT_TYPE_PART_VOLUME                = 0x41,                 // Part volume measurement data id.
    GO2_MEASUREMENT_TYPE_PART_HEIGHT                = 0x42,                 // Part height measurement data id.
    GO2_MEASUREMENT_TYPE_PART_ELLIPSE_MAJOR         = 0x46,                 // Part ellipse major measurement data id.
    GO2_MEASUREMENT_TYPE_PART_ELLIPSE_MINOR         = 0x47,                 // Part ellipse minor measurement data id.
    GO2_MEASUREMENT_TYPE_PART_ELLIPSE_ANGLE         = 0x48,                 // Part ellipse angle measurement data id.
    GO2_MEASUREMENT_TYPE_PART_ELLIPSE_RATIO         = 0x49,                 // Part ellipse ratio measurement data id.
    GO2_MEASUREMENT_TYPE_PART_BOUNDING_BOX_X        = 0x4A,                 // Part bounding box X measurement data id.
    GO2_MEASUREMENT_TYPE_PART_BOUNDING_BOX_Y        = 0x4B,                 // Part bounding box Y measurement data id.
    GO2_MEASUREMENT_TYPE_PART_BOUNDING_BOX_WIDTH    = 0x4C,                 // Part bounding box width measurement data id.
    GO2_MEASUREMENT_TYPE_PART_BOUNDING_BOX_LENGTH   = 0x4D,                 // Part bounding box length measurement data id.   

    GO2_MEASUREMENT_TYPE_PART_HOLE_X                = 0x4E,                 // Part hole x measurement data id.   
    GO2_MEASUREMENT_TYPE_PART_HOLE_Y                = 0x4F,                 // Part hole y measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_HOLE_Z                = 0x50,                 // Part hole z measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_HOLE_RADIUS           = 0x51,                 // Part hole radius measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_STUD_TIP_X            = 0x52,                 // Part stud tip x measurement data id.   
    GO2_MEASUREMENT_TYPE_PART_STUD_TIP_Y            = 0x53,                 // Part stud tip y measurement data id.   
    GO2_MEASUREMENT_TYPE_PART_STUD_TIP_Z            = 0x54,                 // Part stud tip z measurement data id.   
    GO2_MEASUREMENT_TYPE_PART_STUD_BASE_X           = 0x55,                 // Part stud base x measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_STUD_BASE_Y           = 0x56,                 // Part stud base y measurement data id.
    GO2_MEASUREMENT_TYPE_PART_STUD_BASE_Z           = 0x57,                 // Part stud base z measurement data id.
    GO2_MEASUREMENT_TYPE_PART_STUD_RADIUS           = 0x58,                 // Part stud radius measurement data id.
    GO2_MEASUREMENT_TYPE_PART_OPENING_X             = 0x59,                 // Part opening x measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_OPENING_Y             = 0x5A,                 // Part opening y measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_OPENING_Z             = 0x5B,                 // Part opening z measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_OPENING_ANGLE         = 0x5C,                 // Part opening angle measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_OPENING_LENGTH        = 0x5D,                 // Part opening width measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_OPENING_WIDTH         = 0x5E,                 // Part opening length measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_POSITION_X            = 0x5F,                 // Part opening position X measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_POSITION_Y            = 0x60,                 // Part opening position Y measurement data id. 
    GO2_MEASUREMENT_TYPE_PART_POSITION_Z            = 0x61,                 // Part opening position Z measurement data id.
    GO2_MEASUREMENT_TYPE_PART_PLANE_X_ANGLE         = 0x62,                 // Part plane X angle measurement data id.
    GO2_MEASUREMENT_TYPE_PART_PLANE_Y_ANGLE         = 0x63,                 // Part plane Y angle measurement data id.
    GO2_MEASUREMENT_TYPE_PART_PLANE_Z_OFFSET        = 0x64,                 // Part plane Z offset measurement data id.
    GO2_MEASUREMENT_TYPE_PART_TEXTURE_ROUGHNESS     = 0x65,                 // Part texture roughness measurement data id.
    GO2_MEASUREMENT_TYPE_PART_TEXTURE_INVALID_COUNT     = 0x66                  // Part texture invalid count measurement data id.
    
} Go2MeasurementType;                                                  /* Represents an identifier that can be used to distinguish measurement types within a Go2MeasurementData message.

                                                                            Please note that profile and part measurements are not supported on 1x00 family of sensors.
                                                                            Also, Range measurements are not supported on the 2x00 family of sensors.
                                                                        */



#define GO2_MEASUREMENT_SOURCE_TEXT_CAPACITY          (2048)

/* 
 * Go2Measurement Class
 */

typedef Go2Object Go2Measurement;      // Base class for measurement configuration classes.

GO2_EXPORT(Go2Status) Go2Measurement_SetId(Go2Measurement measurement, Go2UInt32 id); //
//
//  Description:
//      Sets the unique measurement identifier for the measurement.
//  Arguments:
//      measurement - Go2Measurement object. 
//      id - Unique measurement identifier. 
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2UInt32) Go2Measurement_Id(Go2Measurement measurement); //
//
//  Description:
//      Gets the unique measurement identifier for the measurement.
//  Arguments:
//      measurement - Go2Measurement object. 
//  Returns:
//      Unique measurement identifier

GO2_EXPORT(Go2Status) Go2Measurement_SetName(Go2Measurement measurement, const Go2Char* name); //
//
//  Description:
//      Sets the descriptive name for the measurement.
//  Arguments:
//      measurement - Go2Measurement object. 
//      name - Descriptive name. 
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2Status) Go2Measurement_Name(Go2Measurement measurement, Go2Char* name, Go2UInt32 capacity); //
//
//  Description:
//      Gets the descriptive name for the measurement.
//  Arguments:
//      measurement - Go2Measurement object. 
//      name - Receives descriptive name. 
//      capacity - Capacity of name buffer. 
//  Returns:
//      Operation status. 

/* 
 * Go2PartMeasurement Class
 */

typedef Go2Measurement Go2PartMeasurement;      // Base class for part measurement configuration classes.


/* 
 * Go2Script Class
 */

typedef Go2Measurement Go2Script;          // Represents script measurement configuration.

GO2_EXPORT(Go2Status) Go2Script_SetId(Go2Script measurement, Go2UInt32 id); //
//
//  Description:
//      Sets the unique measurement identifier for the measurement.
//  Arguments:
//      measurement - Go2Script object. 
//      id - Unique measurement identifier. 
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2Double) Go2Script_Id(Go2Script measurement); //
//
//  Description:
//      Gets the unique measurement identifier for the measurement.
//  Arguments:
//      measurement - Go2Script object. 
//  Returns:
//      Unique measurement identifier

GO2_EXPORT(Go2Status) Go2Script_SetName(Go2Script measurement, const Go2Char* name); //
//
//  Description:
//      Sets the descriptive name for the measurement.
//  Arguments:
//      measurement - Go2Script object. 
//      name - Descriptive name. 
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2Status) Go2Script_Name(Go2Script measurement, Go2Char* name, Go2UInt32 capacity); //
//
//  Description:
//      Gets the descriptive name for the measurement.
//  Arguments:
//      measurement - Go2Script object. 
//      name - Receives descriptive name. 
//      capacity - Capacity of name buffer. 
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2Status) Go2Script_AddOutput(Go2Script measurement, Go2UInt32 id); //
//
//  Description:
//      Sets the number of script outputs.
//  Arguments:
//      measurement - Go2Script object. 
//      id - The id of the new output to be added.
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2UInt32) Go2Script_OutputCount(Go2Script measurement); //
//
//  Description:
//      Gets the number of script outputs.
//  Arguments:
//      measurement - Go2Script object. 
//  Returns:
//      Returns the number of script outputs.

GO2_EXPORT(Go2Status) Go2Script_RemoveOutputAt( Go2Script measurement, Go2UInt32 index); //
//
//  Description:
//      Gets the number of script outputs.
//  Arguments:
//      measurement - Go2Script object. 
//      index - The array index from which to remove a output id.
//  Returns:
//      Operation status.


GO2_EXPORT(Go2Status) Go2Script_SetOutputIdAt(Go2Script measurement, Go2UInt32 index, Go2UInt32 id); //
//
//  Description:
//      Sets the output ID associated with the given script output index.
//  Arguments:
//      measurement - Go2Script object. 
//      index - The index of the script output to update the ID for.
//      id - The ID to assign to the script output index.
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2Status) Go2Script_OutputIdAt(Go2Script measurement, Go2UInt32 index, Go2UInt32* id); //
//
//  Description:
//      Gets the output ID associated with the given script output index.
//  Arguments:
//      measurement - Go2Script object. 
//      index - The index of the script output to retrieve the ID for.
//      id - The ID value of the given index will be stored here provided that the index is valid.
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2Status) Go2Script_FindOutputIndex(Go2Script measurement, Go2UInt32 id, Go2UInt32* index); //
//
//  Description:
//      Gets the script output index associated with the given ID.
//  Arguments:
//      measurement - Go2Script object. 
//      id - The ID value to be found in the script output list.
//      index - A pointer to that will hold the script output index.
//  Returns:
//      Operation status. 


GO2_EXPORT(Go2Status) Go2Script_SetCode(Go2Script measurement, const Go2Char* sourceCode); //
//
//  Description:
//      Sets the source code for the script.
//  Arguments:
//      measurement - Go2Script object. 
//      name - Source code script.
//  Returns:
//      Operation status. 

GO2_EXPORT(Go2Status) Go2Script_Code(Go2Script measurement, Go2Char** sourceCode); //
//
//  Description:
//      Gets the source code for the script.
//  Arguments:
//      measurement - Go2Script object. 
//      sourceCode - Receives a null-terminated string containing the script code. 
//  Returns:
//      Operation status. 
//  Remarks: 
//      Use the Go2Free function to free the sourceCode string returned by this function.

#include <Go2ApiEnd.h>

#endif      /* #ifndef LMITECH_GO2_MEASUREMENT_H_INCLUDED */

