#pragma once
#include "IntPropertyInternal.h"
#include "EventPropertyInternal.h"
#include "GroupPropertyInternal.h"
#include "SIShadowPropertyInternal.h"

#include "RQStructs.h"

namespace NDTS
{
	using namespace SCO;

namespace RS2A
{
	typedef enum 
	{
		GF_isEnabled,
		GF_start, 
		GF_stop,
		GF_threshold,
		GF_triggerGate,
		GF_polarity,
		GF_triggerMode,
		GF_distanceMetric,
		GF_amplitudePeakSelect,
		GF_distancePeakSelect,
	} GateField;

// Caches the RQ_Gate struct for a single gate and provides methods to set individual fields on the struct
class GateObject 
{
public:

	GateObject(int cardIndex, int gateIndex);
	~GateObject(void);

	bool setField(GateField GateField, int value);
	int getField(GateField GateField);
private:
	RQ_Gate rqGate;
	int cardIndex;
	int gateIndex;
};

// Represents a single field of a single gate (e.g. gate enable for gate 1 card 1)

class GateElement : public HardwareAccessClass 
{
public:
	GateElement(GateObject *pGateObject, GateField field);
	~GateElement(void);

	bool setValue(int newValue);
	int getValue();
private:
	GateField field;
	GateObject *pGateObject;
	
};



};
}