#ifndef RAWSCANERROR_H
#define RAWSCANERROR_H

#include "RawScan.h"

// In the XXX_ReturnCode types we use the following convention:
// low 8 bits = specific error value from this function
// next 8 bits = function returning error
// next 8 bits = SDK number
// top 8 bits reserved, currently always zero
// SDK values are:
// 00 = RQ  - in RawScanEnums.h
// 01 = pulser/receiver 
// ... 
// 09 = RawScan 



typedef enum
{
	RawScan_Extract_OK										= 0x00090000,
	RawScan_ExtractAScan_InvalidBScanIndex					= 0x00095e00,
	RawScan_ExtractAScan_InvalidAScanIndex					= 0x00095e01,
	RawScan_ExtractAScan_InternalDataFormatError				= 0x00095e02,
	RawScan_ExtractAScan_AScanDesynchronisation				= 0x00095e03,
	RawScan_ExtractAScan_RawScanDoesNotContainAScanData		= 0x00095e07,

	RawScan_ExtractBScan_InvalidBScanIndex					= 0x00095e04,
	RawScan_ExtractBScan_InternalDataFormatError				= 0x00095e05,
	RawScan_ExtractBScan_AScanDesynchronisation				= 0x00095e06,
	RawScan_ExtractBScan_RawScanDoesNotContainBScanData		= 0x00095e08,

	RawScan_ExtractCScan_InvalidBScanBounds					= 0x00095f00,
	RawScan_ExtractCScan_MissingCScan						= 0x00095f01,
	RawScan_ExtractCScan_InvalidGate							= 0x00095f02,
	RawScan_ExtractCScan_InvalidRPNSequence					= 0x00095f03,
	RawScan_ExtractCScan_OutOfMemory						    = 0x00095f04,
	RawScan_ExtractCScan_RawScanDoesNotContainGateData	    = 0x00095f05,
	RawScan_ExtractCScan_CScanDesynchronisation			    = 0x00095f06,
	RawScan_ExtractCScan_InternalDataFormatError			    = 0x00095f07,
	RawScan_ExtractCScan_NotCompatibleWithSequencedFPGA      = 0x00095f08,


	RawScan_ExtractGateValues_InvalidBScanIndex			    = 0x00096100,
	RawScan_ExtractGateValues_InvalidAScanIndex			    = 0x00096101,
	RawScan_ExtractGateValues_RawScanDoesNotContainGateData  = 0x00096102,

	RawScan_ExtractEncoderValue_MissingEncoderValues		    = 0x00096200,
	RawScan_ExtractEncoderValue_InvalidBScanIndex			= 0x00096201,
	RawScan_ExtractEncoderValue_InvalidEncoderIndex			= 0x00096202,
	RawScan_ExtractEncoderValue_RawScanDoesNotContainEncoderData = 0x00096203,

	RawScan_Alloc_OutOfMemory, 
	RawScan_MoveData_TooManyBScans, 

	RawScan_LastError
} RawScan_ReturnCode ;

RAW_SCAN_API const char * CALL_CONV RawScan_GetCodeString(int errorCode);

#endif
