
//-- There is NO need for a header
//-- Simply use the reference in the Project::Properties::Common Properties::Reference
//-- to add Euvis_Module_V1p1.DLL (the API file) as reference
using	namespace	MOL;
using	namespace	MOL::AWG;
using	namespace	MOL::DSM;
using	namespace	System::Threading;

//-- If you use the traditional unmanaged codes
//-- You can also include the header
//-- Unmanaged Header
#include <stdio.h>

//==============================================================================
//==============================================================================
char	type_name( int i )
{
	switch( i )
	{
	case	Waveform_Parameter_Type::d:		return	'D';	// Decimal is double
	case	Waveform_Parameter_Type::h:		return	'H';	// Hexadecimal is unsigned
	case	Waveform_Parameter_Type::i:		return	'I';	// Integer is unsigned
	case	Waveform_Parameter_Type::u:		return	'U';	// Unsigned is unsigned
	}
	return	'U';
}
	
int		main( )
{
	AWG_API		awg;
	DSMX		dsm;
	int			i,j,k,nd,nu;
	char		ud;

	FILE	*f = fopen( "AWG_Waveform_Explorer.dat", "w+" );

	for( i=0; i<256; i++ )
	{
		k =awg.waveform_specific_parameter_n( i ) ;
		if( !k ) continue;
		fprintf( f, "Code=%3d\n", i );
		fprintf( f, "\tStyle: %s\n", awg.waveform_style( i ) );
		fprintf( f, "\tParameter number: %d\n", k );

		for( j=nd=nu=0; j<k; j++ )
		{
			ud = type_name( awg.waveform_specific_parameter_type( i, j ) );
			fprintf( f, "\t\tparameter[%d]: %24s (%c)\twaveform_parameter_%c%d\n", 
				j, awg.waveform_specific_parameter_name( i, j ), ud=='D' ? 'd' : 'u', ud=='D' ? 'd' : 'u', ud=='D' ? nd : nu );
			if( ud=='D' )	nd++;
			else			nu++;
		}
		fprintf( f, "\n" );
	}
}