/******************************************************************************
 *                                                                         
 *               Copyright 2004-2006 Agilent Technologies
 *               All rights reserved.
 *
 *****************************************************************************/

#pragma once
#include "resource.h"       // main symbols

#include "ErrorMessages.nimbus.h"
#include "ntlres.h"

#include "Interfaces.nimbus.h"
#include "Catids.nimbus.h"
#include "ForwardingShims.nimbus.h"

[	
	// COM component categories
	implements_category("CATID_IVI_COM_DRIVER_PERSONALITY"),

	// Instrument personality support

	// Supported instrument models

	// General attributes
	coclass,
	threading(both),
	vi_progid("Agilent34950A.Agilent34950A"),
	progid("Agilent34950A.Agilent34950A.1"),
	uuid("b2dcbb31-20e5-4620-9176-e7f3f60514e8"),
	helpstring("Agilent34950A Class"),
	default(IAgilent34950A)
]
class ATL_NO_VTABLE Agilent34950A : 
	public CPersonality<Agilent34950A, CVisaComIOProvider>,
	public ISupportErrorInfo,
				public _IAgilent34950AHandshake,
	public _IAgilent34950AInput,
	public _IAgilent34950AInputMemory,
	public _IAgilent34950AOutput,
	public _IAgilent34950AOutputMemory,
	public _IAgilent34950ATrace,
	public _IAgilent34950ACounter,
	public _IAgilent34950ATotalizer,
	public _IAgilent34950AMeasurement,
	public _IAgilent34950AOutputClock,
	public _IAgilent34950ADigital,
	public _IAgilent34950A
{
public:
	HRESULT FinalConstruct();
	void FinalRelease();

	// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

	HRESULT FinalInitialize();
	HRESULT FinalClose();

	CString GetSelectCommand()
	{
		return "";	
	}

	DECLARE_PROTECT_FINAL_CONSTRUCT()
	DECLARE_NIMBUS_CLASS(Agilent34950A)

public:

public:
	// IAgilent34950AHandshake
	STDMETHOD(IAgilent34950AHandshake_Configure)(BSTR ChannelList, Agilent34950AHandshakeModeEnum Mode, double Threshold, double Level);
	STDMETHOD(IAgilent34950AHandshake_get_AsyncTimeout)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AHandshake_put_AsyncTimeout)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950AHandshake_get_CycleTime)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AHandshake_put_CycleTime)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950AHandshake_get_Level)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AHandshake_put_Level)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950AHandshake_get_Mode)(BSTR ChannelList, Agilent34950AHandshakeModeEnum* val);
	STDMETHOD(IAgilent34950AHandshake_put_Mode)(BSTR ChannelList, Agilent34950AHandshakeModeEnum val);
	STDMETHOD(IAgilent34950AHandshake_get_Rate)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AHandshake_put_Rate)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950AHandshake_get_State)(BSTR ChannelList, Agilent34950AStateEnum* val);
	STDMETHOD(IAgilent34950AHandshake_put_State)(BSTR ChannelList, Agilent34950AStateEnum val);
	STDMETHOD(IAgilent34950AHandshake_get_SyncStrobe)(BSTR ChannelList, Agilent34950AHandshakeStrobeSourceEnum* val);
	STDMETHOD(IAgilent34950AHandshake_put_SyncStrobe)(BSTR ChannelList, Agilent34950AHandshakeStrobeSourceEnum val);
	STDMETHOD(IAgilent34950AHandshake_get_Threshold)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AHandshake_put_Threshold)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950AHandshake_GetPolarity)(BSTR ChannelList, Agilent34950AHandshakeLineIDEnum Mode, Agilent34950APolarityEnum* val);
	STDMETHOD(IAgilent34950AHandshake_SetPolarity)(BSTR ChannelList, Agilent34950AHandshakeLineIDEnum Mode, Agilent34950APolarityEnum Polarity);
	STDMETHOD(IAgilent34950AHandshake_put_Drive)(BSTR ChannelList, Agilent34950AHandshakeLineTypeEnum val);
	STDMETHOD(IAgilent34950AHandshake_get_Drive)(BSTR ChannelList, Agilent34950AHandshakeLineTypeEnum* val);
	// IAgilent34950AInput
	STDMETHOD(IAgilent34950AInput_Configure)(BSTR ChannelList, Agilent34950AChannelWidthEnum Width, double Threshold);
	STDMETHOD(IAgilent34950AInput_get_Threshold)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AInput_put_Threshold)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950AInput_get_Memory)(IAgilent34950AInputMemory** val);
	// IAgilent34950AInputMemory
	STDMETHOD(IAgilent34950AInputMemory_Configure)(BSTR ChannelList, Agilent34950AActionEnum Action, long Count);
	STDMETHOD(IAgilent34950AInputMemory_Clear)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AInputMemory_get_CompareAction)(BSTR ChannelList, Agilent34950AActionEnum* val);
	STDMETHOD(IAgilent34950AInputMemory_put_CompareAction)(BSTR ChannelList, Agilent34950AActionEnum val);
	STDMETHOD(IAgilent34950AInputMemory_get_DataFormat)(BSTR Channel, Agilent34950ADataFormatEnum* val);
	STDMETHOD(IAgilent34950AInputMemory_put_DataFormat)(BSTR Channel, Agilent34950ADataFormatEnum val);
	STDMETHOD(IAgilent34950AInputMemory_get_DataPoints)(BSTR Channel, long* val);
	STDMETHOD(IAgilent34950AInputMemory_get_Enable)(BSTR ChannelList, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950AInputMemory_put_Enable)(BSTR ChannelList, VARIANT_BOOL val);
	STDMETHOD(IAgilent34950AInputMemory_InterruptSettings)(BSTR ChannelList, VARIANT_BOOL State, Agilent34950AReportConditionEnum Mode, Agilent34950AHandshakeLineTypeEnum Drive);
	STDMETHOD(IAgilent34950AInputMemory_get_InterruptMode)(BSTR ChannelList, Agilent34950AReportConditionEnum* val);
	STDMETHOD(IAgilent34950AInputMemory_put_InterruptMode)(BSTR ChannelList, Agilent34950AReportConditionEnum val);
	STDMETHOD(IAgilent34950AInputMemory_get_InterruptEnable)(BSTR ChannelList, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950AInputMemory_put_InterruptEnable)(BSTR ChannelList, VARIANT_BOOL val);
	STDMETHOD(IAgilent34950AInputMemory_get_InterruptPolarity)(BSTR ChannelList, Agilent34950APolarityEnum* val);
	STDMETHOD(IAgilent34950AInputMemory_put_InterruptPolarity)(BSTR ChannelList, Agilent34950APolarityEnum val);
	STDMETHOD(IAgilent34950AInputMemory_get_InterruptStatus)(BSTR ChannelList, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950AInputMemory_ReadAllData)(BSTR Channel, SAFEARRAY** val);
	STDMETHOD(IAgilent34950AInputMemory_ReadSelectedData)(BSTR Channel, long Index, long Count, SAFEARRAY** val);
	STDMETHOD(IAgilent34950AInputMemory_get_SampleCount)(BSTR ChannelList, long* val);
	STDMETHOD(IAgilent34950AInputMemory_put_SampleCount)(BSTR ChannelList, long val);
	STDMETHOD(IAgilent34950AInputMemory_Start)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AInputMemory_get_Status)(BSTR Channel, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950AInputMemory_Step)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AInputMemory_Stop)(BSTR ChannelList);
	// IAgilent34950AOutput
	STDMETHOD(IAgilent34950AOutput_Configure)(BSTR ChannelList, Agilent34950AChannelWidthEnum Width, double VoltageLevel);
	STDMETHOD(IAgilent34950AOutput_get_Drive)(BSTR ChannelList, Agilent34950AHandshakeLineTypeEnum* val);
	STDMETHOD(IAgilent34950AOutput_put_Drive)(BSTR ChannelList, Agilent34950AHandshakeLineTypeEnum val);
	STDMETHOD(IAgilent34950AOutput_get_VoltLevel)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AOutput_put_VoltLevel)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950AOutput_get_Memory)(IAgilent34950AOutputMemory** val);
	// IAgilent34950AOutputMemory
	STDMETHOD(IAgilent34950AOutputMemory_Configure)(BSTR Channel, BSTR TraceName, long Cycles);
	STDMETHOD(IAgilent34950AOutputMemory_Abort)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AOutputMemory_get_CycleCount)(BSTR ChannelList, long* val);
	STDMETHOD(IAgilent34950AOutputMemory_put_CycleCount)(BSTR ChannelList, long val);
	STDMETHOD(IAgilent34950AOutputMemory_get_Enable)(BSTR ChannelList, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950AOutputMemory_put_Enable)(BSTR ChannelList, VARIANT_BOOL val);
	STDMETHOD(IAgilent34950AOutputMemory_InterruptSettings)(BSTR ChannelList, VARIANT_BOOL State, Agilent34950AOutputModeEnum Mode);
	STDMETHOD(IAgilent34950AOutputMemory_get_InterruptEnable)(BSTR ChannelList, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950AOutputMemory_put_InterruptEnable)(BSTR ChannelList, VARIANT_BOOL val);
	STDMETHOD(IAgilent34950AOutputMemory_get_InterruptMode)(BSTR ChannelList, Agilent34950AOutputModeEnum* val);
	STDMETHOD(IAgilent34950AOutputMemory_put_InterruptMode)(BSTR ChannelList, Agilent34950AOutputModeEnum val);
	STDMETHOD(IAgilent34950AOutputMemory_get_InterruptPolarity)(BSTR ChannelList, Agilent34950APolarityEnum* val);
	STDMETHOD(IAgilent34950AOutputMemory_put_InterruptPolarity)(BSTR ChannelList, Agilent34950APolarityEnum val);
	STDMETHOD(IAgilent34950AOutputMemory_Start)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AOutputMemory_Step)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AOutputMemory_Stop)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AOutputMemory_get_TraceSelect)(BSTR Channel, BSTR* val);
	STDMETHOD(IAgilent34950AOutputMemory_put_TraceSelect)(BSTR Channel, BSTR val);
	STDMETHOD(IAgilent34950AOutputMemory_get_Status)(BSTR Channel, VARIANT_BOOL* val);
	// IAgilent34950ATrace
	STDMETHOD(IAgilent34950ATrace_CreateCustom)(BSTR Channel, BSTR Name, SAFEARRAY** Data, Agilent34950AChannelWidthEnum Width, long Points);
	STDMETHOD(IAgilent34950ATrace_CreateStandard)(BSTR Channel, Agilent34950ATraceTypeEnum Type, BSTR Name, long Points);
	STDMETHOD(IAgilent34950ATrace_Delete)(BSTR Channel, BSTR Name);
	STDMETHOD(IAgilent34950ATrace_DeleteAll)(BSTR Channel);
	STDMETHOD(IAgilent34950ATrace_get_Catalog)(BSTR Channel, BSTR* val);
	STDMETHOD(IAgilent34950ATrace_get_MemoryFree)(BSTR Channel, long* val);
	STDMETHOD(IAgilent34950ATrace_GetPoints)(BSTR Channel, BSTR TraceName, long* val);
	// IAgilent34950ACounter
	STDMETHOD(IAgilent34950ACounter_Configure)(BSTR ChannelList, Agilent34950AFunctionEnum Function, double GateTime);
	STDMETHOD(IAgilent34950ACounter_get_Function)(BSTR ChannelList, Agilent34950AFunctionEnum* val);
	STDMETHOD(IAgilent34950ACounter_put_Function)(BSTR ChannelList, Agilent34950AFunctionEnum val);
	STDMETHOD(IAgilent34950ACounter_get_GateTime)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950ACounter_put_GateTime)(BSTR ChannelList, double val);
	STDMETHOD(IAgilent34950ACounter_get_GateSource)(BSTR ChannelList, Agilent34950AGateSourceEnum* val);
	STDMETHOD(IAgilent34950ACounter_put_GateSource)(BSTR ChannelList, Agilent34950AGateSourceEnum val);
	STDMETHOD(IAgilent34950ACounter_get_GatePolarity)(BSTR ChannelList, Agilent34950APolarityEnum* val);
	STDMETHOD(IAgilent34950ACounter_put_GatePolarity)(BSTR ChannelList, Agilent34950APolarityEnum val);
	STDMETHOD(IAgilent34950ACounter_get_GateThreshold)(long SlotNumber, double* val);
	STDMETHOD(IAgilent34950ACounter_put_GateThreshold)(long SlotNumber, double val);
	STDMETHOD(IAgilent34950ACounter_get_Slope)(BSTR ChannelList, Agilent34950ATotalizeSlopeEnum* val);
	STDMETHOD(IAgilent34950ACounter_put_Slope)(BSTR ChannelList, Agilent34950ATotalizeSlopeEnum val);
	STDMETHOD(IAgilent34950ACounter_get_Totalizer)(IAgilent34950ATotalizer** val);
	STDMETHOD(IAgilent34950ACounter_get_Measurement)(IAgilent34950AMeasurement** val);
	STDMETHOD(IAgilent34950ACounter_get_Threshold)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950ACounter_put_Threshold)(BSTR ChannelList, double val);
	// IAgilent34950ATotalizer
	STDMETHOD(IAgilent34950ATotalizer_Configure)(BSTR ChannelList, Agilent34950AGateSourceEnum GateSource, Agilent34950ATotalizeTypeEnum ReadType);
	STDMETHOD(IAgilent34950ATotalizer_Clear)(BSTR ChannelList);
	STDMETHOD(IAgilent34950ATotalizer_ReadData)(BSTR ChannelList, long* val);
	STDMETHOD(IAgilent34950ATotalizer_get_ReadType)(BSTR ChannelList, Agilent34950ATotalizeTypeEnum* val);
	STDMETHOD(IAgilent34950ATotalizer_put_ReadType)(BSTR ChannelList, Agilent34950ATotalizeTypeEnum val);
	// IAgilent34950AMeasurement
	STDMETHOD(IAgilent34950AMeasurement_Abort)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AMeasurement_Initiate)(BSTR ChannelList);
	STDMETHOD(IAgilent34950AMeasurement_get_Frequency)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AMeasurement_get_Period)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AMeasurement_get_PulseWidth)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AMeasurement_get_PulseDutyCycle)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AMeasurement_ReadData)(BSTR ChannelList, double* val);
	STDMETHOD(IAgilent34950AMeasurement_get_TotalizeCount)(BSTR ChannelList, long* val);
	// IAgilent34950AOutputClock
	STDMETHOD(IAgilent34950AOutputClock_Configure)(double Frequency, long Slot, double Voltage);
	STDMETHOD(IAgilent34950AOutputClock_get_Frequency)(long Slot, double* val);
	STDMETHOD(IAgilent34950AOutputClock_put_Frequency)(long Slot, double val);
	STDMETHOD(IAgilent34950AOutputClock_get_State)(long Slot, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950AOutputClock_put_State)(long Slot, VARIANT_BOOL val);
	STDMETHOD(IAgilent34950AOutputClock_get_Level)(long Slot, double* val);
	STDMETHOD(IAgilent34950AOutputClock_put_Level)(long Slot, double val);
	// IAgilent34950ADigital
	STDMETHOD(IAgilent34950ADigital_QueryLastByte)(BSTR ChannelList, BYTE* val);
	STDMETHOD(IAgilent34950ADigital_QueryLastWord)(BSTR ChannelList, short* val);
	STDMETHOD(IAgilent34950ADigital_ReadBit)(BSTR ChannelList, long BitNumber, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950ADigital_ReadByte)(BSTR ChannelList, BYTE* val);
	STDMETHOD(IAgilent34950ADigital_ReadWord)(BSTR ChannelList, short* val);
	STDMETHOD(IAgilent34950ADigital_ReadLongWord)(BSTR ChannelList, long* val);
	STDMETHOD(IAgilent34950ADigital_WriteBit)(BSTR ChannelList, long Data, long BitNumber);
	STDMETHOD(IAgilent34950ADigital_WriteByte)(BSTR ChannelList, long Data);
	STDMETHOD(IAgilent34950ADigital_WriteWord)(BSTR ChannelList, long Data);
	STDMETHOD(IAgilent34950ADigital_WriteLongWord)(BSTR ChannelList, long Data);
	STDMETHOD(IAgilent34950ADigital_QueryLastBit)(BSTR ChannelList, long BitNumber, BYTE* val);
	STDMETHOD(IAgilent34950ADigital_QueryLastLongWord)(BSTR ChannelList, long* val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonEnable)(BSTR ChannelList, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonEnable)(BSTR ChannelList, VARIANT_BOOL val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonType)(BSTR ChannelList, Agilent34950AComparisonTypeEnum* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonType)(BSTR ChannelList, Agilent34950AComparisonTypeEnum val);
	STDMETHOD(IAgilent34950ADigital_get_Direction)(BSTR ChannelList, Agilent34950ADirectionEnum* val);
	STDMETHOD(IAgilent34950ADigital_put_Direction)(BSTR ChannelList, Agilent34950ADirectionEnum val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonDataByte)(BSTR ChannelList, BYTE* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonDataByte)(BSTR ChannelList, BYTE val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonDataWord)(BSTR ChannelList, short* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonDataWord)(BSTR ChannelList, short val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonDataLongWord)(BSTR ChannelList, long* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonDataLongWord)(BSTR ChannelList, long val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonAlarmEnable)(BSTR ChannelList, VARIANT_BOOL* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonAlarmEnable)(BSTR ChannelList, VARIANT_BOOL val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonMaskByte)(BSTR ChannelList, BYTE* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonMaskByte)(BSTR ChannelList, BYTE val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonMaskWord)(BSTR ChannelList, short* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonMaskWord)(BSTR ChannelList, short val);
	STDMETHOD(IAgilent34950ADigital_get_ComparisonMaskLongWord)(BSTR ChannelList, long* val);
	STDMETHOD(IAgilent34950ADigital_put_ComparisonMaskLongWord)(BSTR ChannelList, long val);
	STDMETHOD(IAgilent34950ADigital_get_Width)(BSTR ChannelList, Agilent34950AChannelWidthEnum* val);
	STDMETHOD(IAgilent34950ADigital_put_Width)(BSTR ChannelList, Agilent34950AChannelWidthEnum val);
	STDMETHOD(IAgilent34950ADigital_get_Polarity)(BSTR ChannelList, Agilent34950APolarityEnum* val);
	STDMETHOD(IAgilent34950ADigital_put_Polarity)(BSTR ChannelList, Agilent34950APolarityEnum val);
	STDMETHOD(IAgilent34950ADigital_get_Handshake)(IAgilent34950AHandshake** val);
	STDMETHOD(IAgilent34950ADigital_get_Input)(IAgilent34950AInput** val);
	STDMETHOD(IAgilent34950ADigital_get_Output)(IAgilent34950AOutput** val);
	STDMETHOD(IAgilent34950ADigital_get_Trace)(IAgilent34950ATrace** val);
	// IAgilent34950A
	STDMETHOD(IAgilent34950A_get_Digital)(IAgilent34950ADigital** val);
	STDMETHOD(IAgilent34950A_get_Counter)(IAgilent34950ACounter** val);
	STDMETHOD(IAgilent34950A_get_OutputClock)(IAgilent34950AOutputClock** val);
};

