/* 
 * Thomas Pantzer: homeo_demo.h, 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) 
 * 
 */



#ifndef _homeo_DEMO_H
#define _homeo_DEMO_H

#include "t_runtime_obj.h"
#include "t_polynom.h"
#include "t_floating_avg.h"



#define n_sensors	18	// anzahl der im algorithmus eingebundenen 
				// pseudosensoren

#define t_depth		24	// max. zeitliche Tiefe bei gestackten Werten, 
				// (Länge des Schieberegisters)


class t_homeo_demo : public t_runtime_object {
public:
	virtual void Init(RobotContext *robot);
	void Done(void);

	virtual char start_module(void);
	virtual char stop_module(void);
	virtual char calculate_module(char allow_learn, char any_new);
	virtual char control_module(void);
//	virtual void make_logdata(void);
	virtual void make_logstring(void);

// graphic window method
//	virtual void Show(void);

// extra parameter handling
	virtual void Reset(void);
	virtual void Load(char *to_parse);
	virtual void Save(int fd);

//xforms callbacks
	virtual void button_cb(FL_OBJECT *ob,long data);
	virtual void slider_cb(FL_OBJECT *ob,long data);

private:

	t_Polynom	*Poly;
//	double 		tSensor[8][18];

	t_window_stack	sinus,Sin2,g_radius,Sensor[n_sensors];

	long 	step;
	char 	online, uselight, wakeup;
	double  period, epsilon;

	t_average q[n_sensors];

	char was_online;
	int free_steps ;
//	int log_count;

};


#ifdef _homeo_DEMO_G
#define m_extern
#else 
#define m_extern extern
#endif

m_extern t_homeo_demo Homeo_Demo;

#undef m_extern


#endif







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