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

/// <summary>
///	Sets or gets the temperature measurements units on the specified channel.
/// </summary>
/// <remarks>
///	
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must contain only 1 entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_ReadingUnits(BSTR ChannelList, Agilent34980ATemperatureUnitsEnum* Val)
{
	HRESULT hr = S_OK;

	CString sList(ChannelList);
	if( -1 != sList.Find( ',' ) || -1!=sList.Find( ':' ) || -1 != sList.Find( '-' ) )
	{
		return ReportError( E_AGILENT34980A_MULTIPLE_CHANNELS_IN_GET, _T("IAgilent34980ATemperature_get_ReadingUnits"), _T("ChannelList"));
 	}
	CorrectChannelList( ChannelList, false );
	hr = InstrQueryCommandEnum(Val);

	return hr;
}

/// <summary>
///	Sets or gets the temperature measurements units on the specified channel.
/// </summary>
/// <remarks>
///	
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must contain only 1 entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_put_ReadingUnits(BSTR ChannelList, Agilent34980ATemperatureUnitsEnum Val)
{
	HRESULT hr = S_OK;

	CorrectChannelList( ChannelList );

	hr = InstrPrintCommand();

	return hr;
}



/// <summary>
///	Retrieves a pointer to the FRTD interface.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_FRTD(IAgilent34980AFRTD** Val)
{
	HRESULT hr = S_OK;

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

	return hr;
}


/// <summary>
///	Retrieves a pointer to the RTD interface.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_RTD(IAgilent34980ARTD** Val)
{
	HRESULT hr = S_OK;

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

	return hr;
}

/// <summary>
///	Retrieves a pointer to the Thermocouple interface.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_Thermocouple(IAgilent34980AThermocouple** Val)
{
	HRESULT hr = S_OK;

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

	return hr;
}

/// <summary>
///	Retrieves a pointer to the Thermistor interface.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_Thermistor(IAgilent34980AThermistor** Val)
{
	HRESULT hr = S_OK;

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

	return hr;
}


/// <summary>
///	Disables or enables the autozero mode on the specified channels. If you supply
/// an empty ChannelList, this property applies to the internal DMM, independent
/// of any channels or a scan list
/// </summary>
/// <remarks>
///	When autozero is ON (default), the instrument internally disconnects the input
/// signal following each measurement, and takes a zero reading. It then subtracts
/// the zero reading from the preceding reading. This prevents offset voltages present
/// on the instrument's input circuitry from affecting measurement accuracy.\r\n
/// When autozero is OFF, the instrument takes one zero reading and subtracts it
/// from all subsequent measurements. It takes a new zero reading each time you
/// change the function, range, or integration time.  The ONCE setting takes an
/// immediate zero reading and sets the autozero mode to OFF.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must contain only 1 entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_AutoZero(BSTR ChannelList, Agilent34980AAutoZeroEnum* Val)
{
	HRESULT hr = S_OK;

	CString sList(ChannelList);
	if( -1 != sList.Find( ',' ) || -1!=sList.Find( ':' ) || -1 != sList.Find( '-' ) )
	{
		return ReportInvalidValueError( _T("IAgilent34980ATemperature_get_AutoZero"), _T("ChannelList"), sList );
	}
	CorrectChannelList( ChannelList, false );
	hr = InstrQueryCommandEnum(Val);

	return hr;
}


/// <summary>
///	Disables or enables the autozero mode on the specified channels. If you supply
/// an empty ChannelList, this property applies to the internal DMM, independent
/// of any channels or a scan list
/// </summary>
/// <remarks>
///	When autozero is ON (default), the instrument internally disconnects the input
/// signal following each measurement, and takes a zero reading. It then subtracts
/// the zero reading from the preceding reading. This prevents offset voltages present
/// on the instrument's input circuitry from affecting measurement accuracy.\r\n
/// When autozero is OFF, the instrument takes one zero reading and subtracts it
/// from all subsequent measurements. It takes a new zero reading each time you
/// change the function, range, or integration time.  The ONCE setting takes an
/// immediate zero reading and sets the autozero mode to OFF.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must contain only 1 entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_put_AutoZero(BSTR ChannelList, Agilent34980AAutoZeroEnum val)
{
	HRESULT hr = S_OK;

	CorrectChannelList( ChannelList );

	hr = InstrPrintCommand();

	return hr;
}



/// <summary>
///	Sets or gets the measurement acquisition time (called integration time) in number
/// of power line cycles (PLCs) on the specified channels.
/// </summary>
/// <remarks>
/// Repeatable measurement accuracy is obtained by measuring in multiples of the
/// power line frequency; this eliminates noise injected by the power supply that
/// may be embedded inside the signal being measured.  The NPLC setting affects
/// the measurement resolution (for better resolution, use a larger NPLC value)
/// and measurement speed (for faster measurements, use a smaller NPLC value). 
/// The resolution settings from Configure and Measure routines map directly to
/// NPLC settings: BEST = 200 NPLC, LEAST = 0.02 NPLC, and DEFAULT = 1 NPLC. See
/// below for the measurement accuracies obtained with the various NPLC settings.
/// \r\n
/// If the ChannelList parameter is empty, this command applies to the internal
/// DMM, independent of any channels or a scan list.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must be a single entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_NPLC(BSTR ChannelList, double* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommand(val);

	return hr;
}


/// <summary>
///	Sets or gets the measurement acquisition time (called integration time) in number
/// of power line cycles (PLCs) on the specified channels.
/// </summary>
/// <remarks>
/// Repeatable measurement accuracy is obtained by measuring in multiples of the
/// power line frequency; this eliminates noise injected by the power supply that
/// may be embedded inside the signal being measured.  The NPLC setting affects
/// the measurement resolution (for better resolution, use a larger NPLC value)
/// and measurement speed (for faster measurements, use a smaller NPLC value). 
/// The resolution settings from Configure and Measure routines map directly to
/// NPLC settings: BEST = 200 NPLC, LEAST = 0.02 NPLC, and DEFAULT = 1 NPLC. See
/// below for the measurement accuracies obtained with the various NPLC settings.\r\n
///	|--------------------------------------------------------------------|\r\n
///	| Integration Time |     Resolution               |  Digits  | Bits  |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 0.02 PLC         | less than 0.0001 x Range     | 4 Digits |  15   |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 0.2 PLC          | less than 0.00001 x Range    | 5 Digits |  18   |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 1 PLC            | less than 0.000003  x Range  | 5 Digits |  20   |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 2 PLC            | less than 0.0000022 x Range  | 6 Digits |  21   |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 10 PLC           | less than 0.000001 x Range   | 6 Digits |  24   |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 20 PLC           | less than 0.0000008 x Range  | 6 Digits |  25   |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 100 PLC          | less than 0.0000003 x Range  | 6 Digits |  26   |\r\n
///	|--------------------------------------------------------------------|\r\n
///	| 200 PLC          | less than 0.00000022 x Range | 6 Digits |  26   |\r\n
///	|--------------------------------------------------------------------|
/// If the ChannelList parameter is empty, this command applies to the internal
/// DMM, independent of any channels or a scan list.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must be a single entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_put_NPLC(BSTR ChannelList, double val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}


/// <summary>
///	Sets or gets the temperature transducer probe type to use for measurements on
///  the specified channels.
/// </summary>
/// <remarks>
///	If you supply an empty channel list, applies to the internal DMM, independent
/// of  any channels or a scan list.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must contain only 1 entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_get_TransducerType(BSTR ChannelList, Agilent34980ATransducerEnum* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandEnum(val);

	return hr;
}


/// <summary>
///	Sets or gets the temperature transducer probe type to use for measurements on
///  the specified channels.
/// </summary>
/// <remarks>
///	If you supply an empty channel list, applies to the internal DMM, independent
/// of  any channels or a scan list.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc. Must contain only 1 entry for the getter.
/// </param>
HRESULT Agilent34980A::IAgilent34980ATemperature_put_TransducerType(BSTR ChannelList, Agilent34980ATransducerEnum val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}
