#ifndef DCTSNAPSHOTINTERNAL_H
#define DCTSNAPSHOTINTERNAL_H

#include "RawScanCardBlockDescriptionsProtected.h"

#define NUMBER_OF_SNAPSHOT_BANKS 2

typedef struct DC_SelectionParameters
{
	unsigned long gateIndex;  // Selection now stored as part of gate
} DC_SelectionParameters;


typedef struct
{
	NDTS_RawScan pRawScans[NUMBER_OF_SNAPSHOT_BANKS]; // Double buffered gate dataDC_API unsigned long CALL_CONV DC_ReturnNumberOfRapiDAQBoards() ;

	RawScan_CardBlockDescription *pDataBCardBlockDescriptions[NUMBER_OF_SNAPSHOT_BANKS]   ; 
	unsigned long numDataBCardBlockDescriptions[NUMBER_OF_SNAPSHOT_BANKS];
	unsigned long snapshotBeingRead;
	DC_SelectionParameters selectionParameters[NDTS_MAXIMUM_NUMBER_OF_STEPS];
	short aScanSamples[NUMBER_OF_SNAPSHOT_BANKS][NDTS_MAXIMUM_NUMBER_OF_STEPS][NDTS_MAXIMUM_NUMBER_OF_SAMPLES];
	short gateAmplitudes[NUMBER_OF_SNAPSHOT_BANKS][NDTS_MAXIMUM_NUMBER_OF_STEPS][NDTS_MAXIMUM_NUMBER_OF_GATES_COMPILE_TIME];
	short gateDepths[NUMBER_OF_SNAPSHOT_BANKS][NDTS_MAXIMUM_NUMBER_OF_STEPS][NDTS_MAXIMUM_NUMBER_OF_GATES_COMPILE_TIME];
	unsigned long bScansThisSnapshot;
	NDTS_Boolean clearAScanOnUpdate;  // If true - blank the A Scan on a sample parameters / init.  Should only be false if wanting to speed up multiple changes
	NDTS_Boolean doFullACapture;  // Defaults false.  Set true to do full A Scan capture.  Snapshot summary A Scan capture happens even if this is true
} DC_SnapshotState;


// Called from the thread when there is data available
NDTS_Boolean DC_UpdateSnapshot(unsigned long cardIndex);

// Create a new scatter list to match the current board layout.  Called from UpdateSampleParameters hook
// Must be void to be able to be used with the hook.
void DC_UpdateSnapshotSampleStorage(unsigned long cardIndex);

NDTS_Boolean DC_InitSnapshotDataBank(unsigned long cardIndex, unsigned long bank, NDTS_Boolean full);
NDTS_Boolean DC_ExtractSpecificAScan(unsigned long cardIndex,NDTS_RawScan *pRawScan, unsigned long channel, unsigned long gateIndex, short *pBuffer, unsigned long scanBufferBytes, short *pAmplitude, short *pDepth);

	// Bug 838
void DC_AdjustGateDepths(RawScanGateSettings *pGateSettings, unsigned char *pOurCScanRecordAddress);


#endif
