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



/// <summary>
/// Configures the output memory.
/// </summary>
/// <remarks>
/// 
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="Channel">
///	Single channel in the form sccc.
/// </param>
/// <param name="TraceName">
///	Specifies the trace name.
/// </param>
/// <param name="Cycles">
///	Specifies the number of cycles.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_Configure(BSTR Channel, BSTR TraceName, long Cycles)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
/// Aborts the buffered output.
/// </summary>
/// <remarks>
/// After an abort, a subsequent start will restart the trace output from the beginning
/// of the trace. Can be sent at anytime.
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_Abort(BSTR ChannelList)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Sets or gets the number of times to output the trace.
/// </summary>
/// <remarks>
///	If set to infinite (default; INF or 0), the bank will handshake out samples
/// until a STOP indication is received.  If finite, it can range from 1 to 255.
///  The bank will automatically stop after outputting the trace the specified times.
/// Can be sent at any time, but won’t take affect until the next enable or abort/start.
///  The query form returns the current setting.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_get_CycleCount(BSTR ChannelList, long* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommand(val);

	return hr;
}

/// <summary>
///	Sets or gets the number of times to output the trace.
/// </summary>
/// <remarks>
///	If set to infinite (default; INF or 0), the bank will handshake out samples
/// until a STOP indication is received.  If finite, it can range from 1 to 255.
///  The bank will automatically stop after outputting the trace the specified times.
/// Can be sent at any time, but won’t take affect until the next enable or abort/start.
///  The query form returns the current setting.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_put_CycleCount(BSTR ChannelList, long val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Enables or disables the bank for buffered write.
/// </summary>
/// <remarks>
///	The output can be started with a STARS, STEP, or the PINTR hardware line (if
/// configured).  The first channel of the bank must be an output with a valid trace
/// assigned to it when ENABle is called.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_get_Enable(BSTR ChannelList, VARIANT_BOOL* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandBool(val);

	return hr;
}

/// <summary>
///	Enables or disables the bank for buffered write.
/// </summary>
/// <remarks>
///	The output can be started with a STARS, STEP, or the PINTR hardware line (if
/// configured).  The first channel of the bank must be an output with a valid trace
/// assigned to it when ENABle is called.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_put_Enable(BSTR ChannelList, VARIANT_BOOL val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}




/// <summary>
/// Configures the interrupt settings.
/// </summary>
/// <remarks>
/// 
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
/// <param name="State">
///	Enable or disables the interrupt line as an input for controlling the buffered
/// output.
/// </param>
/// <param name="Mode">
///	Desired behavior of the interrupt line when the bank is enabled for buffered
/// output.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_InterruptSettings(BSTR ChannelList, VARIANT_BOOL State, Agilent34950AOutputModeEnum Mode)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Enables (ON) or disables (OFF) the interrupt line as an input for controlling
/// the buffered output.
/// </summary>
/// <remarks>
///	Can be sent at any time, but applies only when the bank is in buffered output
/// mode . The query form returns 0 or 1.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_get_InterruptEnable(BSTR ChannelList, VARIANT_BOOL* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandBool(val);

	return hr;
}

/// <summary>
///	Enables (ON) or disables (OFF) the interrupt line as an input for controlling
/// the buffered output.
/// </summary>
/// <remarks>
///	Can be sent at any time, but applies only when the bank is in buffered output
/// mode . The query form returns 0 or 1.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_put_InterruptEnable(BSTR ChannelList, VARIANT_BOOL val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Sets or gets the behavior of the interrupt line when the bank is enabled for
/// buffered output.
/// </summary>
/// <remarks>
///	Can be sent at any time, but applies only when the bank is in buffered output
/// mode and the interrupt is enabled .
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_get_InterruptMode(BSTR ChannelList, Agilent34950AOutputModeEnum* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandEnum(val);

	return hr;
}

/// <summary>
///	Sets or gets the behavior of the interrupt line when the bank is enabled for
/// buffered output.
/// </summary>
/// <remarks>
///	Can be sent at any time, but applies only when the bank is in buffered output
/// mode and the interrupt is enabled .
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_put_InterruptMode(BSTR ChannelList, Agilent34950AOutputModeEnum val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Sets or gets the polarity of the interrupt line on the bank.
/// </summary>
/// <remarks>
///	This setting affects the polarity for both input and output modes of the interrupt
/// line. Can be sent at any time, but applies only when the bank is in buffered
/// I/O mode.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_get_InterruptPolarity(BSTR ChannelList, Agilent34950APolarityEnum* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommandEnum(val);

	return hr;
}

/// <summary>
///	Sets or gets the polarity of the interrupt line on the bank.
/// </summary>
/// <remarks>
///	This setting affects the polarity for both input and output modes of the interrupt
/// line. Can be sent at any time, but applies only when the bank is in buffered
/// I/O mode.
/// </remarks>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_put_InterruptPolarity(BSTR ChannelList, Agilent34950APolarityEnum val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
/// Starts the buffered write.
/// </summary>
/// <remarks>
/// If memory is disabled, it will enable memory and start the transfer.  Repeated
/// calls will be ignored if memory is already running.  The method can be used
/// to trigger the transfer even if the bank is configured to start on PINTR.  STARt
/// can be used to resume a STOP’d transfer.  The first channel must be an output
/// with a valid trace when the method is called.
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_Start(BSTR ChannelList)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
/// Steps a buffered write.
/// </summary>
/// <remarks>
/// This method handshakes one sample onto the data lines, and then puts the memory
/// into the stopped state.  (This works like most debuggers).  If memory is disabled,
/// it will enable memory, output the first sample and stop.  If memory is enabled
/// and already running, the method will stop memory, and step once.  The first
/// channel must be an output with a valid trace when step is called.
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_Step(BSTR ChannelList)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
/// Stops a buffered write.
/// </summary>
/// <remarks>
/// The transfer can be resumed via the Start method. This method can be sent anytime.
///  It will be ignored if it does not apply.
/// </remarks>
/// <returns>
///	
/// </returns>
/// <param name="ChannelList">
///	One or more channels in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_Stop(BSTR ChannelList)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}

/// <summary>
///	Sets or gets the trace assigned to the bank.
/// </summary>
/// <remarks>
///	The user may download up to 20 traces into a bank.  This command allows the
/// user to switch between the traces. The bank must have a trace assigned to it
/// before memory can be enabled. The query form returns the name of the trace currently
/// assigned to the bank.
/// </remarks>
/// <param name="Channel">
///	Single channel in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_get_TraceSelect(BSTR Channel, BSTR* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommand(val);

	return hr;
}

/// <summary>
///	Sets or gets the trace assigned to the bank.
/// </summary>
/// <remarks>
///	The user may download up to 20 traces into a bank.  This command allows the
/// user to switch between the traces. The bank must have a trace assigned to it
/// before memory can be enabled. The query form returns the name of the trace currently
/// assigned to the bank.
/// </remarks>
/// <param name="Channel">
///	Single channel in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_put_TraceSelect(BSTR Channel, BSTR val)
{
	HRESULT hr = S_OK;

	hr = InstrPrintCommand();

	return hr;
}





/// <summary>
///	This query returns 1 if currently reading data into memory or waiting on a handshake,
/// 0 if memory is disabled or stopped.
/// </summary>
/// <remarks>
///	This query is valid at all times.
/// </remarks>
/// <param name="Channel">
///	A single channel in the form sccc.
/// </param>
HRESULT Agilent34950A::IAgilent34950AOutputMemory_get_Status(BSTR Channel, VARIANT_BOOL* val)
{
	HRESULT hr = S_OK;

	hr = InstrQueryCommand(val);

	return hr;
}
