/* 
 * Thomas Pantzer: neuronal_demo.cc, v0.4.7  8.6.99 16:32 
 * 
 * 
 * Copyright 1999 by Thomas Pantzer
 * 
 * Permission to use, copy, modify, and distribute this software for noncommercial 
 * use and without fee is hereby granted, provided that the above copyright notice 
 * appear in all copies and that both that copyright notice and this permission 
 * notice appear in supporting documentation, and that the name of the Author not be 
 * used in advertising or publicity pertaining to distribution of the software 
 * without specific, written prior permission. The Author makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is" 
 * without expressed or implied warranty. 
 * 
 * 
 * pantec@isys2.informatik.uni-leipzig.de   (Thomas Pantzer) 
 * 
 */





#include "copyright.h"


// #include "t_runtime_obj.h"
#include "net2robot.h"
#include "graphix.h"


#define _NEURONAL_DEMO_G
#include "neuronal_demo.h"







void t_neuronal_demo::Init(RobotContext *robot)
{
	t_runtime_object::Init("Neuronal",robot);
	
	Neuronal_Net.Init(robot,&robot_netspeed);

	props |= _p_control;
	props |= _p_show;
}


/*
char t_neuronal_demo::start_module(void) 
{
//	log_fd = open("homeo_log.txt",O_RDWR|O_CREAT|O_TRUNC,0644);
	if (t_runtime_object::start_module() == false)
	   return false;
	
	// **********


	return true;
}
*/

/*
char t_neuronal_demo::stop_module(void)
{
	if (t_runtime_object::stop_module() == false)
	   return false;
	
	// **********

	return true;
}
*/

// char t_homeo_demo::calculate_module(char allow_learn)
// {
// 	if (t_runtime_object::calculate_module(allow_learn) == false)
// 	   return false;
// 
// 	// put your calculations here
// 	
// 	return true;
// }



char t_neuronal_demo::control_module(void)
{
//	char st[256],s2[256];

	if (t_runtime_object::control_module() == false)
	   return false;

//	fprintf(stderr,""
//	fprintf(stderr,"control_module(%s)\n",Name);

	Robot->MsgQueue.request_proximity();
	Neuronal_Net.Processing();

	return true;
}



void t_neuronal_demo::Show(void)
{
	if (visible == false)
	   return;
	
	// *********
	SetColor(FL_MCOL);
	Neuronal_Net.Show();
}










/**/
/**/
/**/
/**/
/**/
/**/
/**/
/**/
/*****  End Of File  ****************************/
