/******************************************************************************
 *
 *	NDT Solutions RapiDAQ Software Development Kit v1.0beta
 *
 ******************************************************************************
 *
 *  File:        RQEnums.h.
 *
 *  Description: Secondary header file for RapiDAQ SDK containing enumerated 
 *               types. This file does not need to be explicitly included.
 *
 *	Revision:    07/09/05 - Mark Eastlick (mark.eastlick@ndtsolutions.com).
 *
 ******************************************************************************/

#ifndef RQENUMS_H
#define RQENUMS_H

#include "NDTSEnums.h"
#include "RQConstants.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
// 01 = pulser/receiver
// 02 = offline (extract) - listed in RQOfflineEnums.h

typedef enum
{
	RQ_SFV7StandardGates1CurvedGate = 0,
	RQ_SFV8StandardGates = 1,
	RQ_SFV00cStandardGates = 0x00c,
	RQ_SFV111CRCCheck = 0x111,
	RQ_SFV112CRCCheck = 0x112,
	RQ_SFV114CRCCheck = 0x114,
	RQ_SFV115CRCCheck = 0x115,
} RQ_SamplingFirmwareVersion ;

typedef enum
{
	RQ_PFVStandard6Encoders = 0,
	RQ_PFVUnfocusedDIUnit6Encoders = 0,
	RQ_PFV109UnfocusedDIUnit6Encoders = 0x009,
	RQ_PFVFocusedDIUnit6Encoders = 1
} RQ_PeripheralFirmwareVersion ;

typedef enum
{
	RQ_CTAScan,
	RQ_CTBScan,
	RQ_CTCScan
} RQ_CaptureType ;

typedef enum 
{
	RQ_RBipolar,
	RQ_RFullwave,
	RQ_RPosHalfwave,
	RQ_RNegHalfwave
} RQ_Rectification ;

typedef enum 
{
	RQ_TCGTEInterfaceGate,
	RQ_TCGTEAbsolute
} RQ_TCGTriggerEvent ;

typedef enum 
{
	RQ_ICDC,
	RQ_ICAC
} RQ_InputCoupling ; 

typedef enum 
{   // The older (pre March 05) Digitiser Design Document had this bit the wrong way round
	RQ_II1MOhm,
    RQ_II50Ohm
} RQ_InputImpedance ;

typedef enum 
{
	RQ_AIInput1,
	RQ_AIInput0,
	RQ_AIInputCalibration,
	RQ_AIInputGND
} RQ_AnalogueInput ;

typedef enum 
{
	RQ_AG100mV,
	RQ_AG200mV,
	RQ_AG500mV,
	RQ_AG1V,
	RQ_AG2V,
	RQ_AG5V,
	RQ_NUMBER_OF_ANALOGUE_GAIN_VALUES
} RQ_AnalogueInputRange ;

typedef enum 
{
	RQ_AxIInputNone,
	RQ_AxIInput0,
	RQ_AxIInput1,
	RQ_AxIInputBoth
} RQ_AuxInput ;

typedef enum 
{
	RQ_TExternal,
	RQ_TInternal,
	RQ_TEncoder,
	RQ_TFreeRunning,
} RQ_Trigger ;

typedef enum 
{
	RQ_AS8 = 0,
	RQ_AS16,
	RQ_AS24,
	RQ_AS32,
} RQ_ApertureSize ;

typedef enum
{
	RQ_SVAll,
	RQ_SVAllParameters,
	RQ_SVSystemParameters,
	RQ_SVSamplingParameters,
	RQ_SVPeripheralParameters,
	RQ_SVGates,
	RQ_SVTCG,
	RQ_SVPingPong,
	RQ_SVCurvedGate	
} RQ_StoreValues ;

typedef enum
{
	RQ_BOAdd,
	RQ_BOSubtract,
	RQ_BODivide,
	RQ_BOMultiply,
	RQ_BONop
} RQ_BinaryOperator ;

typedef enum
{
	RQ_GMAbsDistance = 256,
	RQ_GMAbsAmplitude,
	RQ_GM0Distance,
	RQ_GM0Amplitude,
	RQ_GM1Distance,
	RQ_GM1Amplitude,
	RQ_GM2Distance,
	RQ_GM2Amplitude,
	RQ_GM3Distance,
	RQ_GM3Amplitude,
	RQ_GM4Distance,
	RQ_GM4Amplitude,
	RQ_GM5Distance,
	RQ_GM5Amplitude,
	RQ_GM6Distance,
	RQ_GM6Amplitude,
	RQ_GM7Distance,
	RQ_GM7Amplitude,
	RQ_GM8Distance,
	RQ_GM8Amplitude,
	RQ_GM9Distance,
	RQ_GM9Amplitude,
	RQ_GMNull
} RQ_GateMetric ;

typedef enum 
{
	RQ_CV4096mV,
	RQ_CV1899mV,
	RQ_CV902mV,
	RQ_CV406mV,
	RQ_CV181mV,
	RQ_CV92mV
} RQ_CalibrationVoltage ;

typedef enum 
{
	RQ_FRSOAll,
	RQ_FRSOAScans,
	RQ_FRSOGates
} RQ_FreeRawScanMode ;

typedef enum
{
	RQ_MCCUEGood,
	RQ_MCCUERecovered,
	RQ_MCCUEPseudoRecovered,
	RQ_MCCUEUnrecovered,
	RQ_MCCUEDesynchronised,
} RQ_MemoryCheckCounterUpdateEvent ;

typedef enum
{
	RQ_PDSLatest,		// get the last ASCAN in the buffer
	RQ_PDSMax,			// get the ASCAN with the largest amplitude in gate N
	RQ_PDSMin,			// get the ASCAN with the smallest amplitude in gate N 
	RQ_PDSFurthest,		// get the ASCAN with the largest depth in gate N
	RQ_PDSNearest,		// get the ASCAN with the largest depth in gate N
	RQ_PDSIndexed		// get the ASCAN from BSCAN N in the buffer
} RQ_SnapshotDataSelection;

// NB this needs to correspond with the RQdefStringValues array
typedef enum
{
	RQdef_DSPversion = 0,
	RQdef_PERversion,
	RQdef_RepetitionRate,
	RQdef_AnalogueInputRange,
	RQdef_FileLogLevel,
	RQdef_AppLogLevel,
	RQdef_DebuggerLogLevel,
	RQdef_DCOffset,
	RQdef_ApertureSize,
	RQdef_PeripheralRegister,
	RQdef_DiagnosticsFilename,
	RQdef_GainTweakMinus20,
	RQdef_GainTweakMinus40,
	RQdef_GainTweakPlus20,
	RQdef_SonatestSerialMux,
	RQdef_SonatestSerialMuxGain1,
	RQdef_SonatestSerialMuxGain2,
	RQdef_SonatestSerialMuxGain3,
	RQdef_SonatestSerialMuxGain4,
	RQdef_SonatestSerialMuxGain5,
	RQdef_SonatestSerialMuxGain6,
	RQdef_SonatestSerialMuxGain7,
	RQdef_SonatestSerialMuxGain8,
	RQdef_SonatestSerialMuxFilter1,
	RQdef_SonatestSerialMuxFilter2,
	RQdef_SonatestSerialMuxFilter3,
	RQdef_SonatestSerialMuxFilter4,
	RQdef_SonatestSerialMuxFilter5,
	RQdef_SonatestSerialMuxFilter6,
	RQdef_SonatestSerialMuxFilter7,
	RQdef_SonatestSerialMuxFilter8,
	RQdef_SonatestSerialMuxVoltageClamp,
	RQdef_numberOfvalues
} RQdefaultEnum;


typedef enum
{
	RQ_SSStopped, // The app has not started the sequence
	RQ_SSPaused,  // The app has requested that a sequence runs but it has been paused whilst the SDK updates parameters
	RQ_SSRunning, // The sequence is running
} RQ_SequenceState ;

typedef enum
{
	RQ_ISStart,
	RQ_ISCheckDriversPresent,
	RQ_ISCheckFirmwarePresent,
	RQ_ISCheckPCICommunication,
	RQ_ISCheckFirmwareFunctioning,
	RQ_ISCheckSampleClockStabilisation,
	RQ_ISCalibrateDCOffset,
	RQ_ISCalibrateVoltageRange,
	RQ_ISEnd,
} RQ_InitialisationStep ;

typedef enum
{
	RQ_ISSChecking,
	RQ_ISSOK,
	RQ_ISSFail
} RQ_InitialisationStepStatus ;

#endif
