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

/// <summary>
/// Configures the thermocouple Type and RefJunctionType properties of a thermocouple.
///  Applies only when the Temperature Transducer Type is Thermocouple.
/// </summary>
/// <remarks>
/// 
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="Type">
///	The type of thermocouple used to measure the temperature.
/// </param>
/// <param name="RefJunctionType">
///	The type of reference junction used in the reference junction compensation.
/// </param>
HRESULT Agilent34980A::IIviDmmThermocouple_Configure(IviDmmThermocoupleTypeEnum Type, IviDmmRefJunctionTypeEnum RefJunctionType)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	The external reference junction temperature when a fixed reference junction
/// thermocouple is used to measure temperature, or the thermocouple junction temperature
/// of an instrument without an internal temperature sensor, in degrees Celcius.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmThermocouple_get_FixedRefJunction(double* Val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommand(Val);

	return hr;
}

/// <summary>
///	The external reference junction temperature when a fixed reference junction
/// thermocouple is used to measure temperature, or the thermocouple junction temperature
/// of an instrument without an internal temperature sensor, in degrees Celcius.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmThermocouple_put_FixedRefJunction(double Val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	The type of reference junction to be used in the reference junction compensation
/// of a thermocouple measurement. Applies only when the Temperature Transducer
/// Type is Thermocouple.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmThermocouple_get_RefJunctionType(IviDmmRefJunctionTypeEnum* Val)
{
	HRESULT hr = S_OK;

	CString sResp;
	hr = InstrQueryCommand( sResp, DEFAULT_STRING_LENGTH );
	sResp.Remove( '+' );
	sResp.Remove( '-' );
	sResp.Remove( '.' );
	if( sResp=="FIX" )
		*Val = IviDmmRefJunctionTypeFixed;
	else if( sResp=="INT" )
		*Val = IviDmmRefJunctionTypeInternal;
	else 
		return ReportError( IDS_E_IVI_UNEXPECTED_RESPONSE );
	return hr;
}

/// <summary>
///	The type of reference junction to be used in the reference junction compensation
/// of a thermocouple measurement. Applies only when the Temperature Transducer
/// Type is Thermocouple.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmThermocouple_put_RefJunctionType(IviDmmRefJunctionTypeEnum Val)
{
	HRESULT hr = S_OK;
	
	if( Val==IviDmmRefJunctionTypeInternal )
		return ReportInvalidValueError( "put_RefJunctionType", "Val", "IviDmmRefJunctionTypeInternal" );
	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	The type of thermocouple used to measure the temperature. Applies only when
/// the Temperature Transducer Type is Thermocouple.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmThermocouple_get_Type(IviDmmThermocoupleTypeEnum* Val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandEnum(Val);

	return hr;
}

/// <summary>
///	The type of thermocouple used to measure the temperature. Applies only when
/// the Temperature Transducer Type is Thermocouple.
/// </summary>
/// <remarks>
///	
/// </remarks>
HRESULT Agilent34980A::IIviDmmThermocouple_put_Type(IviDmmThermocoupleTypeEnum Val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}


