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

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

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

[		
	implements_category("CATID_IviSwtch"),

	implements(interfaces=IIviSwtchChannel,dispinterfaces=IIviSwtchChannel),
	implements(interfaces=IIviSwtchCharacteristics,dispinterfaces=IIviSwtchCharacteristics),

	// General attributes
	coclass,
	threading(both),
	vi_progid("Agilent34980A.Agilent34980AChannel"),
	progid("Agilent34980A.Agilent34980AChannel.1"),
	uuid("956122d3-692f-4c8e-a9b8-126c7e28a10a"),
	helpstring("Agilent34980AChannel Class"),
	default(IIviSwtchChannel)
]
class ATL_NO_VTABLE Agilent34980AChannel : 
	public CRepCap<Agilent34980AChannel, Agilent34980A, Agilent34980A>,
	public ISupportErrorInfo,
	public _IIviSwtchChannel,
	public _IIviSwtchCharacteristics
{
	SwitchUtils::PModuleInfo m_pModule;
	SwitchUtils::PModuleInfo GetModule()
	{
		if( m_pModule ) return m_pModule;
		CString name = TranslateVirtualName( GetInstanceName() );
		UINT nSlot = name[0]-'0';
		if( name[0]=='s' )
			nSlot = name[1]-'0'; // matrix name: sXmXrX
		else if( name[0]=='D' )
			nSlot = 0; // DmmMeasure and DmmSense
		m_pModule = SwitchUtils::GetModuleInfo( nSlot );
		//ATLASSERT( m_pModule!=NULL );
		return m_pModule;
	}
public:
	Agilent34980AChannel::Agilent34980AChannel():m_pModule(NULL) {};
#define m_pModule
	HRESULT FinalConstruct();
	void FinalRelease();

	DECLARE_PROTECT_FINAL_CONSTRUCT()

public:
	// ISupportsErrorInfo
	STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
	// IIviSwtchChannel
	STDMETHOD(IIviSwtchChannel_get_IsConfigurationChannel)(VARIANT_BOOL* Val);
	STDMETHOD(IIviSwtchChannel_put_IsConfigurationChannel)(VARIANT_BOOL Val);
	STDMETHOD(IIviSwtchChannel_get_IsSourceChannel)(VARIANT_BOOL* Val);
	STDMETHOD(IIviSwtchChannel_put_IsSourceChannel)(VARIANT_BOOL Val);
	STDMETHOD(IIviSwtchChannel_get_Characteristics)(IIviSwtchCharacteristics** Val);
	// IIviSwtchCharacteristics
	STDMETHOD(IIviSwtchCharacteristics_get_ACCurrentCarryMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_ACCurrentSwitchingMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_ACPowerCarryMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_ACPowerSwitchingMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_ACVoltageMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_Bandwidth)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_DCCurrentCarryMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_DCCurrentSwitchingMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_DCPowerCarryMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_DCPowerSwitchingMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_DCVoltageMax)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_Impedance)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_SettlingTime)(double* Val);
	STDMETHOD(IIviSwtchCharacteristics_get_WireMode)(long* Val);
};

