/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1991 by John E. Lloyd.				    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#include "../h/cdefs.h"
#include "../h/robotClass.h"

#include "../h/puma_kynvar.h"
#include "../h/scara_kynvar.h"
#include "../h/stan_kynvar.h"
#include "../h/elbow_kynvar.h"

#include "robotData.h"

extern puma_jls();
extern puma_kyn();
extern puma_startup();
extern puma_input();
extern puma_output();
extern puma_release();

extern sim_puma_startup();
extern sim_puma_input();
extern sim_puma_output();
extern sim_puma_release();

extern elbow_jls();
extern elbow_kyn();

extern stan_jls();
extern stan_kyn();

extern scara_jls();
extern scara_kyn();

extern gen_startup();
extern gen_input();
extern gen_output();
extern gen_release();

ROBOT_DATA_ENTRY rciRobotDataTable[] =
{
	"puma260",	PUMA, puma_jls, puma_kyn,
			sizeof(PUMA_KYN), sizeof(PUMA_VAR),
			puma_startup, puma_input, 
			puma_output, puma_release,

	"puma560",	PUMA, puma_jls, puma_kyn,
			sizeof(PUMA_KYN), sizeof(PUMA_VAR),
			puma_startup, puma_input, 
			puma_output, puma_release,

	"puma760",	PUMA, puma_jls, puma_kyn,
			sizeof(PUMA_KYN), sizeof(PUMA_VAR),
			puma_startup, puma_input, 
			puma_output, puma_release,

	"goldenChild",	PUMA, puma_jls, puma_kyn,
			sizeof(PUMA_KYN), sizeof(PUMA_VAR),
			puma_startup, puma_input, 
			puma_output, puma_release,

	"frank",	PUMA, puma_jls, puma_kyn,
			sizeof(PUMA_KYN), sizeof(PUMA_VAR),
			puma_startup, puma_input, 
			puma_output, puma_release,

	"elbow",	ELBOW, elbow_jls, elbow_kyn,
			sizeof(ELBOW_KYN), sizeof(ELBOW_VAR),
			gen_startup, gen_input, 
			gen_output, gen_release,

	"stan",		STAN,  stan_jls, stan_kyn,
			sizeof(STAN_KYN), sizeof(STAN_VAR),
			gen_startup, gen_input, 
			gen_output, gen_release,

	"scara",	SCARA, scara_jls, scara_kyn,
			sizeof(SCARA_KYN), sizeof(SCARA_VAR),
			NULLF, NULLF, NULLF, NULLF, 

	"puma",	        PUMA, puma_jls, puma_kyn,
			sizeof(PUMA_KYN), sizeof(PUMA_VAR),
			puma_startup, puma_input, 
			puma_output, puma_release,

	"simpuma560",	PUMA, puma_jls, puma_kyn,
			sizeof(PUMA_KYN), sizeof(PUMA_VAR),
			sim_puma_startup, sim_puma_input, 
			sim_puma_output, sim_puma_release,
	0,		0, NULLF, NULLF, /* zero denotes the end */
			0, 0, NULLF, NULLF, NULLF, NULLF, 
			
};

typedef struct {
	char *name;
	int value;
} NAME_VALUE_DESC;

static NAME_VALUE_DESC classNameList[] = {
	"PUMA", PUMA,
	"XRAY", XRAY,
};

static NAME_VALUE_DESC typeNameList[] = {
	"Puma_260", Puma_260,
	"Puma_560", Puma_560,
	"Puma_760", Puma_760,
};

int rbtGetClassByName(name)
char *name;
{
	register int i;

	for (i=0; i<ARRAY_SIZE(classNameList); i++)
	 { if (strcmp(classNameList[i].name,name)==0)
	    { return(classNameList[i].value);
	    }
	 }
	return(UNDEF);
}

int rbtGetTypeByName(name)
char *name;
{
	register int i;

	for (i=0; i<ARRAY_SIZE(typeNameList); i++)
	 { if (strcmp(typeNameList[i].name,name)==0)
	    { return(typeNameList[i].value);
	    }
	 }
	return(UNDEF);
}

char *rbtGetNameOfClass(value)
int value;
{
	register int i;

	for (i=0; i<ARRAY_SIZE(classNameList); i++)
	 { if (classNameList[i].value == value)
	    { return(classNameList[i].name);
	    }
	 }
	return(NULL);
}

char *rbtGetNameOfType(value)
int value;
{
	register int i;

	for (i=0; i<ARRAY_SIZE(typeNameList); i++)
	 { if (typeNameList[i].value == value)
	    { return(typeNameList[i].name);
	    }
	 }
	return(NULL);
}



       
	
