/******************************************************************************
 *                                                                         
 *               Copyright 2004-2006 Agilent Technologies
 *               All rights reserved.
 *
 *****************************************************************************/
 
#include "stdafx.h"
#include "CoAgilent34980A.h"

/// <summary>
/// Configures the trigger Source and Delay properties.
/// </summary>
/// <remarks>
/// 
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="TriggerSource">
///	Trigger source.
/// </param>
/// <param name="TriggerDelay">
///	The length of time between when the DMM receives the trigger and when it takes
/// a measurement. Use positive values to set the trigger delay in seconds. Negative
/// values are reserved for the auto delay mode.
/// </param>
HRESULT Agilent34980A::IIviDmmTrigger_Configure(IviDmmTriggerSourceEnum TriggerSource, double TriggerDelay)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	The polarity of the external trigger slope, which determines whether the DMM
/// triggers on either the rising or the falling edge of the external trigger source.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmTrigger_get_Slope(IviDmmTriggerSlopeEnum* Val)
{
	HRESULT hr = S_OK;

	//No SCPI;  SLOPe is always NEGative (when EXTernal source selected)
	*Val = IviDmmTriggerSlopeNegative;
	return hr;
}

/// <summary>
///	The polarity of the external trigger slope, which determines whether the DMM
/// triggers on either the rising or the falling edge of the external trigger source.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmTrigger_put_Slope(IviDmmTriggerSlopeEnum Val)
{
	HRESULT hr = S_OK;

	//No SCPI;  SLOPe is always NEGative (when EXTernal source selected)
	
	return hr;
}

/// <summary>
///	The interval between the time when the DMM receives the trigger and the time
/// when it takes a measurement. Positive values set the trigger delay in seconds.
/// Negative values set auto delay mode.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmTrigger_get_Delay(double* Val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommand(Val);

	return hr;
}

/// <summary>
///	The interval between the time when the DMM receives the trigger and the time
/// when it takes a measurement. Positive values set the trigger delay in seconds.
/// Negative values set auto delay mode.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmTrigger_put_Delay(double Val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	The trigger source.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmTrigger_get_Source(IviDmmTriggerSourceEnum* Val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandEnum(Val);

	return hr;
}

/// <summary>
///	The trigger source.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmTrigger_put_Source(IviDmmTriggerSourceEnum Val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Pointer to the class-compliant IIviDmmMultipoint interface
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmTrigger_get_MultiPoint(IIviDmmMultiPoint** Val)
{
	HRESULT hr = S_OK;

	hr = InternalQueryInterface(this, _GetEntries(), __uuidof(*Val), reinterpret_cast<void**>(Val));

	return hr;
}


