c't

c't-Projekte - Mailinglisten


[Voriger (Datum)] [Nächster (Datum)] [Voriger (Thread)] [Nächster (Thread)]
[Nach Datum][Nach Thread]

[ct-bot] Stackimplementation und Verhalten bot_drive_stack

Absender: Frank Menzel
Datum: Fr, 14.12.2007 20:47:10
In-reply-to: <6679D1F9-3EE6-4EF2-A26B-A4EDB36758F9@xxxxxxxxxxxxxxx>


Hallo,
anbei mal ein Patch zur Implementation eines Stacks. Es können
Int16-Punktkoordinaten abgespeichert werden mittels push_pos oder von
dort mittels pop_pos wieder entnommen werden.
Ein kleines Verhalten bot_drive_stack fährt die vom Stack entnommenen
Punkte der Reihe nach wieder an mittels dem relativ neuen Verhalten
behaviour_goto_pos (Taste 4 auf dem neuen Screen). Wenn der Bot durch
die Gegend gefahren wird, so können mittels der Taste 3 die
Botpositionen jeweils auf dem Stack gebracht werden. Die Wegstrecke wird
somit rückwärts wieder abgefahren. Das Ganze funktioniert bei mir auch
bestens mit dem echten bot. Da behaviour_goto_pos nur mit der
Motorregelung funktioniert, so muß dies auch eingeschaltet werden.
Das Setzen der Koordinaten als auch das Abfahren der Stackpunkte wurden
als kleine Verhalten geschrieben und sind somit via Remotecall
aufrufbar.
Somit kann der Punkt aus der todo-Liste gestrichen werden.
Bin schon dabei, den Stack für ein anderes Verhalten zu benutzen, aber
dazu in wenigen Wochen...

Gruß, Frank Menzel
Index: C:/botneu/ct-Bot/bot-logic/behaviour_drive_stack.c
===================================================================
--- C:/botneu/ct-Bot/bot-logic/behaviour_drive_stack.c	(revision 0)
+++ C:/botneu/ct-Bot/bot-logic/behaviour_drive_stack.c	(revision 0)
@@ -0,0 +1,140 @@
+/*
+ * c't-Bot
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ * This program is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307, USA.
+ *
+ */
+
+
+/*!
+ * @file 	behaviour_drive_stack.c
+ * @brief 	Anfahren aller auf dem Stack befindlichen Punkte
+ * @author 	Frank Menzel (Menzelfr@xxxxxxx)
+ * @date 	13.12.2007
+ */
+
+
+#include "bot-logic/bot-logik.h"
+#ifdef BEHAVIOUR_DRIVE_STACK_AVAILABLE
+#include "display.h"
+#include "rc5.h"
+#include "rc5-codes.h"
+#include "stack.h"
+
+static uint8 drivestack_state = 0;	/*!< Status des drive_stack-Verhaltens */
+
+static int16 posx=0;  /*!< hier die vom Stack geholten oder zu sichernden xy-Koordinaten; werden im Display angezeigt */
+static int16 posy=0;
+	
+
+/*!
+ * Verhalten zum Anfahren aller auf dem Stack befindlichen Punkte, wobei das Fahr-Unterverhalten bot_goto_pos benutzt wird
+ * @param data Verhaltensdatensatz
+ */
+void bot_drive_stack_behaviour(Behaviour_t *data) {
+	switch (drivestack_state) {
+	case 0:
+	    // Koordinaten werden vom Stack geholt und angefahren; Ende nach nicht mehr erfolgreichem Pop
+	    if (!pop_pos(&posx,&posy))
+	      drivestack_state++;
+	    else
+		  bot_goto_pos(data,posx,posy,999);
+		break;
+
+	default:
+	    clear_stack(); // sicherheitshalber bereinigen und auf Null
+		return_from_behaviour(data);
+		break;
+	}
+}
+
+/*!
+ * Botenfunktion: Verhalten zum Anfahren aller auf dem Stack befindlichen Punkte
+ * @param caller der Verhaltensdatensatz
+ */
+void bot_drive_stack(Behaviour_t * caller) {
+	switch_to_behaviour(caller,bot_drive_stack_behaviour,OVERRIDE);
+	drivestack_state = 0;	
+}
+
+
+/*!
+ * Verhalten zum Abspeichern eines Koordinatenpunktes auf dem Stack; Implementierung als kleines Verhalten 
+ * zur Verwendung via remotecall; nach erfolgtem Push wird das Verhalten sofort wieder beendet
+ * @param data Verhaltensdatensatz
+ */
+void bot_set_stackpos_behaviour(Behaviour_t *data) {
+	push_pos(posx,posy);
+	return_from_behaviour(data);
+}
+
+
+/*!
+ * Botenfunktion: Speichern einer Position auf dem Stack; entweder die aktuelle Botpositon oder der Punkt laut Parametern
+ * @param caller der Verhaltensdatensatz
+ * @param x X-Koordinate; bei xy 0 wird die aktuelle Botposition auf dem Stack gesichert
+ * @param y Y-Koordinate; bei xy 0 wird die aktuelle Botposition auf dem Stack gesichert
+ */
+void bot_set_stackpos(Behaviour_t * caller, int16 x, int16 y) {
+	
+	// setzen der richtigen Koordinaten
+	posx=(x==0&&y==0)? x_pos: x;
+	posy=(x==0&&y==0)? y_pos: y;
+	
+	// Umschalten zum Verhalten
+	switch_to_behaviour(caller,bot_set_stackpos_behaviour,OVERRIDE);
+
+}
+
+/*!
+ * Keyhandler zur Verwendung via Fernbedienung auf dem Display zum Stackanfahren
+*/
+#ifdef DISPLAY_DRIVE_STACK_AVAILABLE
+	static void drivestack_disp_key_handler(void) {
+		switch (RC5_Code) {
+			case RC5_CODE_3:
+			    /* Speichern der aktuellen Botposition */
+				RC5_Code = 0;
+				bot_set_stackpos(0,0,0);
+				break;
+
+			case RC5_CODE_4:
+			    /* Verhalten starten zum Anfahren der Stackpunkte */
+				RC5_Code = 0;
+				bot_drive_stack(0);
+				break;
+
+		}	// switch
+	}  // Ende Keyhandler
+
+
+	/*!
+	 * @brief	Display zum Setzen und Anfahren der Stackpunkte 
+	 */
+	void drive_stack_display(void) {
+		display_cursor(1,1);
+		display_printf("Bot-Pos   %1d %1d",(int16)x_pos,(int16)y_pos);
+		display_cursor(2,1);
+		display_printf("Stack-Pos %1d %1d",posx,posy);
+		display_cursor(4,1);
+		display_printf("Pos Save/Goto: 3/4");	
+
+		drivestack_disp_key_handler();		  // aufrufen des Key-Handlers
+	}
+#endif	// DISPLAY_DRIVE_STACK_AVAILABLE
+
+
+
+#endif
Index: C:/botneu/ct-Bot/bot-logic/bot-logik.c
===================================================================
--- C:/botneu/ct-Bot/bot-logic/bot-logik.c	(revision 1321)
+++ C:/botneu/ct-Bot/bot-logic/bot-logik.c	(working copy)
@@ -243,6 +243,11 @@
 	#ifdef BEHAVIOUR_FOLLOW_OBJECT_AVAILABLE
 		insert_behaviour_to_list(&behaviour, new_behaviour(40, bot_follow_object_behaviour, INACTIVE));
 	#endif
+	
+	#ifdef BEHAVIOUR_DRIVE_STACK_AVAILABLE
+		insert_behaviour_to_list(&behaviour, new_behaviour(33, bot_drive_stack_behaviour, INACTIVE));
+		insert_behaviour_to_list(&behaviour, new_behaviour(32, bot_set_stackpos_behaviour, INACTIVE));
+	#endif
 		
 	#ifdef BEHAVIOUR_CALIBRATE_PID_AVAILABLE
 		insert_behaviour_to_list(&behaviour, new_behaviour(30, bot_calibrate_pid_behaviour, INACTIVE));		
Index: C:/botneu/ct-Bot/bot-logic/behaviour_remotecall.c
===================================================================
--- C:/botneu/ct-Bot/bot-logic/behaviour_remotecall.c	(revision 1321)
+++ C:/botneu/ct-Bot/bot-logic/behaviour_remotecall.c	(working copy)
@@ -155,6 +155,10 @@
 	#ifdef BEHAVIOUR_TRANSPORT_PILLAR_AVAILABLE
 		PREPARE_REMOTE_CALL(bot_transport_pillar,0,""),
 	#endif
+	#ifdef BEHAVIOUR_DRIVE_STACK_AVAILABLE
+		    PREPARE_REMOTE_CALL(bot_set_stackpos, 2, "int16 x, int16 y", 2, 2),
+		    PREPARE_REMOTE_CALL(bot_drive_stack,0,""),
+	#endif
 };
 
 #define STORED_CALLS (sizeof(calls)/sizeof(call_t)) /*!< Anzahl der Remote-Calls im Array */
Index: C:/botneu/ct-Bot/stack.c
===================================================================
--- C:/botneu/ct-Bot/stack.c	(revision 0)
+++ C:/botneu/ct-Bot/stack.c	(revision 0)
@@ -0,0 +1,149 @@
+/*
+ * c't-Bot
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ * This program is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307, USA.
+ *
+ */
+
+/*!
+ * @file 	stack.c
+ * @brief 	Implementierung eines Stacks mit den ueblichen Stackbefehlen push(_pos), pop(_pos),...
+ * @author 	Frank Menzel (Menzelfr@xxxxxxx)
+ * @date 	13.12.2007
+ */
+ 
+
+#include <stdlib.h>  /* for dynamic allocation */
+#include "stack.h"   
+
+#ifdef STACK_AVAILABLE     
+    
+
+/*!
+ * Initialisierung des Stacks; Routine muss vor der ersten Benutzung des Stacks aufgerufen worden sein
+ */
+void create_stack(void) {  
+  Point_Stack = (STACK) malloc(sizeof(struct node));
+  if (Point_Stack != NULL) 
+  	Point_Stack->next = NULL;
+}
+
+
+/*!
+ * Implementierung der Push-Routine, nur fuer interne Verwendung
+ * @param ele Variable der Punkt-Element-Struktur
+ */
+void push_element(element_type ele) {  
+  node_ptr tmp_cell;
+  tmp_cell = (node_ptr) malloc(sizeof(struct node));
+  if (tmp_cell != NULL) {
+    tmp_cell->element = ele;
+    tmp_cell->next = Point_Stack->next;
+    Point_Stack->next = tmp_cell;
+  }
+} 
+
+
+/*!
+ * Implementierung der internen Pop-Routine; Rueckgabe nach LIFO des ersten Element-Typs, d.h. des letzten gepoppten Punktes
+ * @param first_cell Rueckgabe des letzten Pop-Elemetes (LIFO)
+ */
+void pop_element(node_ptr *first_cell) {                  
+  if (Point_Stack->next != NULL) {
+    *first_cell = Point_Stack->next;
+    Point_Stack->next = Point_Stack->next->next;
+  }
+}
+
+
+/*!
+ * Speicherfreigabe der noch im Stack befindlichen Elemente und Ruecksetzen des Stacks auf NULL
+ */
+void clear_stack(void) {
+	int16 x;int16 y;
+	while (pop_pos(&x,&y)){}
+	Point_Stack->next = NULL; 	
+}
+
+/*!
+ * Pop-Routine zur Rueckgabe des letzten auf dem Stack gepushten Punktes
+ * @param x zuletzt gepoppte X-Koordinate
+ * @param y zuletzt gepoppte Y-Koordinate
+ * @return 	False falls Pop nicht erfolgreich, d.h. kein Punkt mehr auf dem Stack, sonst True nach erfolgreichem Pop
+ */
+uint8 pop_pos(int16 *x, int16 *y) {
+	node_ptr first_cell=NULL;
+	pop_element(&first_cell);
+	*x=0;*y=0;
+	if (first_cell!=NULL) {
+	  *x=first_cell->element->posx;
+	  *y=first_cell->element->posy;
+	  free(first_cell);
+	  return True;
+	}
+	return False;
+}
+
+
+/*!
+ * Speichern einer Koordinate auf dem Stack
+ * @param x X-Koordinate des zu sichernden Punktes
+ * @param y Y-Koordinate des zu sichernden Punktes
+ */
+void push_pos(int16 x, int16 y) {
+	element_type element;
+	element = malloc(sizeof(struct ele));
+	element->posx=x;element->posy=y;
+	push_element(element);
+} 
+
+
+/*!
+ * Rueckgabe der beiden zuletzt gespeicherten Stackkoordinaten, welche zu einer Linie gehoeren
+ * @param x1 X-Koordinate des zuletzt gespeicherten Linienpunktes
+ * @param y1 Y-Koordinate des zuletzt gespeicherten Linienpunktes
+ * @param x2 X-Koordinate des ersten Linienpunktes
+ * @param y2 Y-Koordinate des ersten Linienpunktes
+ * @return 	True nach erfolgreichem Pop beider Punkte sonst False wenn kein Pop mehr moeglich war 
+ */
+uint8 pop_line(int16 *x1, int16 *y1, int16 *x2, int16 *y2) {
+	
+	pop_pos(x1,y1);
+	return pop_pos(x2,y2);	
+}
+
+/*!
+ * Speichern zweier koordinaten auf dem Stack, welche zu einer Linie gehoeren
+ * @param x1 X-Koordinate des ersten Linienpunktes
+ * @param y1 Y-Koordinate des ersten Linienpunktes
+ * @param x2 X-Koordinate des zweiten Linienpunktes
+ * @param y2 Y-Koordinate des zweiten Linienpunktes
+ */
+void push_line(int16 x1, int16 y1, int16 x2, int16 y2) {
+	push_pos(x1,y1);
+	push_pos(x2,y2);
+}
+
+#endif
+
+
+
+
+
+
+
+
+
+
Index: C:/botneu/ct-Bot/Changelog.txt
===================================================================
--- C:/botneu/ct-Bot/Changelog.txt	(revision 1321)
+++ C:/botneu/ct-Bot/Changelog.txt	(working copy)
@@ -1,5 +1,7 @@
 CHANGELOG fuer c't-Bot
 ======================
+2007-12-14 Frank Menzel [Menzelfr@xxxxxxx]: Stack-Implementierung und Stackverhalten bot_drive_stack (laut ToDo-Liste)
+
 2007-12-10 Timo Sandmann [mail@xxxxxxxxxxxxxxx]: bot_goto_pos() erweitert, so dass es anstelle von bot_drive_distance() und bot_gotoxy() verwendet werden kann und Rueckwaertsgang ergaenzt.
 												 Ist bot_goto_pos() vorhanden, werden alle bot_drive_distance()- und bot_gotoxy()-Aufrufe dorthin umgeleitet. Moechte man das nicht, stellt man in include/bot-logic/behaviour_drive_distance.h / behaviour_gotoxy.h den Schalter USE_GOTO_POS_ aus.
 												 Neues Verhalten bot_goto_obstacle(distance) ergaenzt, das den Bot auf distance mm an ein erkanntes Hindernis heranfahren laesst (benutzt bot_goto_pos() und bot_measure_distance()).
Index: C:/botneu/ct-Bot/ct-Bot.c
===================================================================
--- C:/botneu/ct-Bot/ct-Bot.c	(revision 1321)
+++ C:/botneu/ct-Bot/ct-Bot.c	(working copy)
@@ -85,6 +85,7 @@
 #include "gui.h"
 #include "ui/available_screens.h"
 #include "os_thread.h"
+#include "stack.h"
 
 /*!
  * Der Mikrocontroller und der PC-Simulator brauchen ein paar Einstellungen, 
@@ -192,6 +193,10 @@
 	#ifdef DISPLAY_AVAILABLE
 		gui_init();
 	#endif	
+	
+	#ifdef STACK_AVAILABLE
+		 create_stack();
+    #endif
 }
 
 #ifdef TEST_AVAILABLE
Index: C:/botneu/ct-Bot/ct-Bot.h
===================================================================
--- C:/botneu/ct-Bot/ct-Bot.h	(revision 1321)
+++ C:/botneu/ct-Bot/ct-Bot.h	(working copy)
@@ -53,6 +53,7 @@
 #define MEASURE_MOUSE_AVAILABLE			/*!< Geschwindigkeiten werden aus den Maussensordaten berechnet */
 //#define MEASURE_COUPLED_AVAILABLE		/*!< Geschwindigkeiten werden aus Maus- und Encoderwerten ermittelt und gekoppelt */
 
+#define STACK_AVAILABLE  /*!< Stack wird verfuegbar*/
 
 //#define WELCOME_AVAILABLE	/*!< kleiner Willkommensgruss */
 
@@ -71,7 +72,7 @@
 
 //#define MAP_AVAILABLE /*!< Aktiviere die Kartographie */
 
-//#define SPEED_CONTROL_AVAILABLE /*!< Aktiviert die Motorregelung */
+#define SPEED_CONTROL_AVAILABLE /*!< Aktiviert die Motorregelung */
 //#define ADJUST_PID_PARAMS		/*!< macht PID-Paramter zur Laufzeit per FB einstellbar */
 //#define SPEED_LOG_AVAILABLE 	/*!< Zeichnet Debug-Infos der Motorregelung auf MMC auf */
 
Index: C:/botneu/ct-Bot/include/bot-logic/behaviour_drive_stack.h
===================================================================
--- C:/botneu/ct-Bot/include/bot-logic/behaviour_drive_stack.h	(revision 0)
+++ C:/botneu/ct-Bot/include/bot-logic/behaviour_drive_stack.h	(revision 0)
@@ -0,0 +1,71 @@
+/*
+ * c't-Bot
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ * This program is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307, USA.
+ *
+ */
+
+
+/*!
+ * @file 	behaviour_drive_stack.h
+ * @brief 	Anfahren aller auf dem Stack befindlichen Punkte
+ * @author 	Frank Menzel (Menzelfr@xxxxxxx)
+ * @date 	13.12.2007
+ */
+
+#ifndef BEHAVIOUR_DRIVESTACK_H_
+#define BEHAVIOUR_DRIVESTACK_H_
+
+#include "ct-Bot.h"
+#include "bot-logic/bot-logik.h"
+
+
+#ifdef BEHAVIOUR_DRIVE_STACK_AVAILABLE
+
+/*!
+ * Verhalten zum Anfahren aller auf dem Stack befindlichen Punkte, wobei das Fahr-Unterverhalten bot_goto_pos benutzt wird
+ * @param data Verhaltensdatensatz
+ */
+void bot_drive_stack_behaviour(Behaviour_t *data);
+
+/*!
+ * Botenfunktion: Verhalten zum Anfahren aller auf dem Stack befindlichen Punkte
+ * @param caller der Verhaltensdatensatz
+ */
+void bot_drive_stack(Behaviour_t * caller);
+/*!
+ * Verhalten zum Abspeichern eines Koordinatenpunktes auf dem Stack; Implementierung als kleines Verhalten 
+ * zur Verwendung via remotecall; nach erfolgtem Push wird das Verhalten sofort wieder beendet
+ * @param data Verhaltensdatensatz
+ */
+void bot_set_stackpos_behaviour(Behaviour_t *data);
+
+/*!
+ * Botenfunktion: Speichern einer Position auf dem Stack; entweder die aktuelle Botpositon oder der Punkt laut Parametern
+ * @param caller der Verhaltensdatensatz
+ * @param x X-Koordinate; bei xy 0 wird die aktuelle Botposition auf dem Stack gesichert
+ * @param y Y-Koordinate; bei xy 0 wird die aktuelle Botposition auf dem Stack gesichert
+ */
+void bot_set_stackpos(Behaviour_t * caller, int16 x, int16 y);
+
+	/*!
+	 * @brief	Display zum Setzen und Anfahren der Stackpunkte 
+	 */
+	void drive_stack_display(void);
+	
+	
+
+#endif	// BEHAVIOUR_DRIVE_STACK_AVAILABLE
+#endif /*BEHAVIOUR_DRIVESTACK_H_*/
Index: C:/botneu/ct-Bot/include/bot-logic/available_behaviours.h
===================================================================
--- C:/botneu/ct-Bot/include/bot-logic/available_behaviours.h	(revision 1321)
+++ C:/botneu/ct-Bot/include/bot-logic/available_behaviours.h	(working copy)
@@ -33,6 +33,8 @@
 
 #define BEHAVIOUR_SERVO_AVAILABLE 	/*!< Kontrollverhalten fuer die Servos */
 
+#define BEHAVIOUR_DRIVE_STACK_AVAILABLE /*!< Abfahren der auf dem Stack gesicherten Koordinaten */
+
 //#define BEHAVIOUR_OLYMPIC_AVAILABLE	/*!< Olympiadenverhalten vorhanden? */
 
 //#define BEHAVIOUR_CATCH_PILLAR_AVAILABLE /*!< Suche eine Dose und fange sie ein */
@@ -60,6 +62,14 @@
 	#undef BEHAVIOUR_MAP_GO_DESTINATION_AVAILABLE
 #endif
 
+#ifndef STACK_AVAILABLE
+ #undef BEHAVIOUR_DRIVE_STACK_AVAILABLE
+#endif
+
+#ifdef BEHAVIOUR_DRIVE_STACK_AVAILABLE
+  #define BEHAVIOUR_GOTO_POS_AVAILABLE
+#endif
+
 #ifdef BEHAVIOUR_GOTOXY_AVAILABLE
 	#define BEHAVIOUR_TURN_AVAILABLE
 #endif	
@@ -135,6 +145,7 @@
 #ifndef SPEED_CONTROL_AVAILABLE
 	// goto_pos geht nur, wenn wir uns auf die eingestellte Geschwindigkeit verlassen koennen
 	#undef BEHAVIOUR_GOTO_POS_AVAILABLE
+	#undef BEHAVIOUR_DRIVE_STACK_AVAILABLE
 #endif
 #endif
 
@@ -186,5 +197,7 @@
 
 #include "bot-logic/behaviour_transport_pillar.h"
 
+#include "bot-logic/behaviour_drive_stack.h"
+
 #endif	// BEHAVIOUR_AVAILABLE
 #endif	/*AVAILABLE_BEHAVIOURS_H_*/
Index: C:/botneu/ct-Bot/include/stack.h
===================================================================
--- C:/botneu/ct-Bot/include/stack.h	(revision 0)
+++ C:/botneu/ct-Bot/include/stack.h	(revision 0)
@@ -0,0 +1,95 @@
+/*
+ * c't-Bot
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ * This program is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307, USA.
+ *
+ */
+
+/*!
+ * @file 	stack.h
+ * @brief 	Implementierung eines Stacks mit den ueblichen Stackbefehlen push(_pos), pop(_pos),...
+ * @author 	Frank Menzel (Menzelfr@xxxxxxx)
+ * @date 	13.12.2007
+ */
+
+#ifndef STACK_H_
+#define STACK_H_
+
+#include "global.h"
+
+/*! Datenstruktur eines Koordinatenpunktes */
+typedef struct ele *element_type;
+struct ele {
+  int16 posx;
+  int16 posy;
+};
+
+/*! Stack-Datenstruktur zur Speicherung aller Koordinatenpunktes nach LIFO */
+typedef struct node *node_ptr;
+struct node {
+  element_type element;
+  node_ptr next;
+};
+typedef node_ptr STACK;
+
+/*! die eigentlich zu verwendende Stack-Variable */
+STACK Point_Stack;
+
+
+/*!
+ * Initialisierung des Stacks; Routine muss vor der ersten Benutzung des Stacks aufgerufen worden sein
+ */
+void create_stack(void);
+
+/*!
+ * Speicherfreigabe der noch im Stack befindlichen Elemente und Ruecksetzen des Stacks auf NULL
+ */
+void clear_stack(void);
+
+/*!
+ * Pop-Routine zur Rueckgabe des letzten auf dem Stack gepushten Punktes
+ * @param x zuletzt gepoppte X-Koordinate
+ * @param y zuletzt gepoppte Y-Koordinate
+ * @return 	False falls Pop nicht erfolgreich, d.h. kein Punkt mehr auf dem Stack, sonst True nach erfolgreichem Pop
+ */
+uint8 pop_pos(int16 *x, int16 *y);
+
+/*!
+ * Speichern einer Koordinate auf dem Stack
+ * @param x X-Koordinate des zu sichernden Punktes
+ * @param y Y-Koordinate des zu sichernden Punktes
+ */
+void push_pos(int16 x, int16 y);
+
+/*!
+ * Rueckgabe der beiden zuletzt gespeicherten Stackkoordinaten, welche zu einer Linie gehoeren
+ * @param x1 X-Koordinate des zuletzt gespeicherten Linienpunktes
+ * @param y1 Y-Koordinate des zuletzt gespeicherten Linienpunktes
+ * @param x2 X-Koordinate des ersten Linienpunktes
+ * @param y2 Y-Koordinate des ersten Linienpunktes
+ * @return 	True nach erfolgreichem Pop beider Punkte sonst False wenn kein Pop mehr moeglich war 
+ */
+uint8 pop_line(int16 *x1, int16 *y1, int16 *x2, int16 *y2);
+
+/*!
+ * Speichern zweier koordinaten auf dem Stack, welche zu einer Linie gehoeren
+ * @param x1 X-Koordinate des ersten Linienpunktes
+ * @param y1 Y-Koordinate des ersten Linienpunktes
+ * @param x2 X-Koordinate des zweiten Linienpunktes
+ * @param y2 Y-Koordinate des zweiten Linienpunktes
+ */
+void push_line(int16 x1, int16 y1, int16 x2, int16 y2); 
+
+#endif	/*STACK_H_*/
Index: C:/botneu/ct-Bot/include/rc5-codes.h
===================================================================
--- C:/botneu/ct-Bot/include/rc5-codes.h	(revision 1321)
+++ C:/botneu/ct-Bot/include/rc5-codes.h	(working copy)
@@ -63,11 +63,11 @@
 #ifdef MCU
 
 	// Dies ist die Standard-Fernbedienung unter anderem fuer den Sim
-	#define RC_HAVE_HQ_RC_UNIVERS29_334
+	//#define RC_HAVE_HQ_RC_UNIVERS29_334
 	
 	//#define RC_HAVE_HAUPPAUGE_WINTV
 	//#define RC_HAVE_HAUPPAUGE_MediaMPV
-	//#define RC_HAVE_CONRAD_PROMO8
+	#define RC_HAVE_CONRAD_PROMO8
 	//#define RC_HAVE_VIVANCO_UR89
 	//#define RC_HAVE_VIVANCO_UR89_TV_CODE_089
 	//#define RC_HAVE_Technisat_TTS35AI
Index: C:/botneu/ct-Bot/ui/gui.c
===================================================================
--- C:/botneu/ct-Bot/ui/gui.c	(revision 1321)
+++ C:/botneu/ct-Bot/ui/gui.c	(working copy)
@@ -137,6 +137,9 @@
 	#ifdef DISPLAY_TRANSPORT_PILLAR
 		register_screen(&transportpillar_display);
 	#endif
+	#ifdef DISPLAY_DRIVE_STACK_AVAILABLE
+		  register_screen(&drive_stack_display);
+	#endif
 }
 
 #endif	// DISPLAY_AVAILABLE
Index: C:/botneu/ct-Bot/ui/available_screens.h
===================================================================
--- C:/botneu/ct-Bot/ui/available_screens.h	(revision 1321)
+++ C:/botneu/ct-Bot/ui/available_screens.h	(working copy)
@@ -45,8 +45,12 @@
 #define DISPLAY_MAP_GO_DESTINATION      /*!< Steuerung Map-Verhalten auf diesem Screen */
 #define DISPLAY_MAP_AVAILABLE			/*!< Zeigt Map-Display an */
 #define DISPLAY_TRANSPORT_PILLAR        /*!< Steuerung Transport-Pillar-Verhalten auf diesem Screen */
+ 
+#define DISPLAY_DRIVE_STACK_AVAILABLE /*!< Steuerung Stack-Verhalten auf diesem Screen */
 
-
+#ifndef STACK_AVAILABLE
+	#undef DISPLAY_DRIVE_STACK_AVAILABLE
+#endif
 #ifndef SPEED_CONTROL_AVAILABLE
 	#undef DISPLAY_REGELUNG_AVAILABLE
 #endif
Index: C:/botneu/ct-Bot/.settings/org.eclipse.cdt.core.prefs
===================================================================
--- C:/botneu/ct-Bot/.settings/org.eclipse.cdt.core.prefs	(revision 0)
+++ C:/botneu/ct-Bot/.settings/org.eclipse.cdt.core.prefs	(revision 0)
@@ -0,0 +1,3 @@
+#Fri Dec 14 19:32:56 CET 2007
+eclipse.preferences.version=1
+indexerId=org.eclipse.cdt.core.fastIndexer
Index: C:/botneu/ct-Bot/.settings/org.eclipse.cdt.managedbuilder.core.prefs
===================================================================
--- C:/botneu/ct-Bot/.settings/org.eclipse.cdt.managedbuilder.core.prefs	(revision 1321)
+++ C:/botneu/ct-Bot/.settings/org.eclipse.cdt.managedbuilder.core.prefs	(working copy)
@@ -1,13 +1,17 @@
-#Thu Mar 29 15:23:55 CEST 2007
-cdt.managedbuild.config.gnu.exe.debug.1197043799/internalBuilder/enabled=false
-cdt.managedbuild.config.gnu.exe.debug.1197043799/internalBuilder/ignoreErr=true
-eclipse.preferences.version=1
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1077176217=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="C_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1197043799=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="C_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
-environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1197043799.2016949464=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="C_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1077176217=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1197043799=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
-environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1197043799.2016949464=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
-environment/project=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n
-environment/project/cdt.managedbuild.config.gnu.exe.debug.1077176217=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n
-environment/project/cdt.managedbuild.config.gnu.exe.debug.1197043799=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable delimiter\="\:" name\="PATH" operation\="append" value\="/usr/local/avr/bin"/>\n</environment>\n
+#Fri Dec 14 20:19:16 CET 2007
+cdt.managedbuild.config.gnu.exe.debug.1150677647/internalBuilder/enabled=false
+cdt.managedbuild.config.gnu.exe.debug.1150677647/internalBuilder/ignoreErr=true
+cdt.managedbuild.config.gnu.exe.debug.1197043799/internalBuilder/enabled=false
+cdt.managedbuild.config.gnu.exe.debug.1197043799/internalBuilder/ignoreErr=true
+eclipse.preferences.version=1
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1077176217=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="C_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1150677647=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<environment>\r\n<variable name\="CPATH" operation\="remove"/>\r\n<variable name\="C_INCLUDE_PATH" operation\="remove"/>\r\n</environment>\r\n
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1197043799=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="C_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1197043799.2016949464=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="CPATH" operation\="remove"/>\n<variable name\="C_INCLUDE_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1077176217=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1150677647=<?xml version\="1.0" encoding\="UTF-8"?>\r\n<environment>\r\n<variable name\="LIBRARY_PATH" operation\="remove"/>\r\n</environment>\r\n
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1197043799=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
+environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1197043799.2016949464=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable name\="LIBRARY_PATH" operation\="remove"/>\n</environment>\n
+environment/project=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n
+environment/project/cdt.managedbuild.config.gnu.exe.debug.1077176217=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment/>\n
+environment/project/cdt.managedbuild.config.gnu.exe.debug.1197043799=<?xml version\="1.0" encoding\="UTF-8"?>\n<environment>\n<variable delimiter\="\:" name\="PATH" operation\="append" value\="/usr/local/avr/bin"/>\n</environment>\n