#ifndef RQTSNAPSHOTINTERNAL_H
#define RQTSNAPSHOTINTERNAL_H

#include "RQProtected.h"

#define NUMBER_OF_SNAPSHOT_BANKS 2

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


typedef struct
{
	RQ_RawScan pRawScans[NUMBER_OF_SNAPSHOT_BANKS]; // Double buffered gate data
	RQ_CardBlockDescription *pDataBCardBlockDescriptions[NUMBER_OF_SNAPSHOT_BANKS]   ; 
	unsigned long numDataBCardBlockDescriptions[NUMBER_OF_SNAPSHOT_BANKS];
	unsigned long snapshotBeingRead;
	RQT_SelectionParameters selectionParameters[RQ_MAXIMUM_NUMBER_OF_STEPS];
	short aScanSamples[NUMBER_OF_SNAPSHOT_BANKS][RQ_MAXIMUM_NUMBER_OF_STEPS][RQ_SRAM_MAXIMUM_NUMBER_OF_SAMPLES];
	short gateAmplitudes[NUMBER_OF_SNAPSHOT_BANKS][RQ_MAXIMUM_NUMBER_OF_STEPS][RQ_MAXIMUM_NUMBER_OF_GATES_COMPILE_TIME];
	short gateDepths[NUMBER_OF_SNAPSHOT_BANKS][RQ_MAXIMUM_NUMBER_OF_STEPS][RQ_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
} RQT_SnapshotState;


// Called from the thread when there is data available
NDTS_Boolean RQT_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 RQT_UpdateSnapshotSampleStorage(unsigned long cardIndex);

NDTS_Boolean RQT_InitSnapshotDataBank(unsigned long cardIndex, unsigned long bank, NDTS_Boolean full);

#endif
