summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/ui/ui.hh
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/ovision/ui/ui.hh')
-rw-r--r--2005/i/robert/src/ovision/ui/ui.hh118
1 files changed, 118 insertions, 0 deletions
diff --git a/2005/i/robert/src/ovision/ui/ui.hh b/2005/i/robert/src/ovision/ui/ui.hh
new file mode 100644
index 0000000..049ac6d
--- /dev/null
+++ b/2005/i/robert/src/ovision/ui/ui.hh
@@ -0,0 +1,118 @@
+// robert - programme du robot 2005
+//
+// Copyright (C) 2005 Olivier Gaillard
+//
+// Robot APB Team/Efrei 2005.
+// Web: http://assos.efrei.fr/robot/
+// Email: robot AT efrei DOT fr
+//
+// 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.
+
+#ifndef UI_h
+#define UI_h
+
+// Realisé a l'aide du "NCURSES Programming HOWTO"
+
+
+#include <menu.h>
+#include "ovision/see/oconfig.hh"
+#include "ovision/see/group.hh"
+
+
+#define NUM_COULEUR 1
+#define NB_COULEUR 2
+
+
+/// Interface ncurses permettant de piloter adjust
+class UI {
+
+ /// Variable utilisees pour ncurses
+ ITEM **item;
+ MENU *mainMenu;
+ WINDOW *mainWindow;
+
+ /// Id du fifo
+ int fifo;
+
+ /// PID du prog
+ long pid;
+
+ /// Sauvegarde la valeur de sorties du NN
+ int savedNNColorNumber;
+
+ /// liste des images
+ char **fileList;
+
+ /// id de l'image actuel
+ int curImage;
+
+ /// taille de la liste
+ int lengthFileList;
+
+ OConfig *oconfig;
+
+
+ public:
+ /// Constructeurs.
+ UI (const char *filename = "");
+
+ /// Destructeur.
+ ~UI (void);
+
+ /// Affiche le menu principale
+ void menu ();
+
+ /// reponse du programme adjust
+ int uiReady;
+
+ protected:
+ /// Cree la liste d'images a ouvrir
+ void parseFileList();
+
+ /// Menu de selection de couleur
+ int chooseColor (const int type, const int current = 0);
+
+ /// Affiche un msg dans la barre d'etat
+ void printStatus (const char *str);
+
+ /// Menu de suppression de couleur
+ void goDelColor ();
+
+ /// menu de selection d'objet
+ int chooseObject (const int current);
+
+ /// Menu de selection du group a former
+ void goSelectGroup (const int type);
+
+ /// Menu de melange de couleurs
+ void goMergeWindow ();
+
+ /// Menu de changements des composantes d'un poid du NN
+ void goChangeColor ();
+
+ /// Synchronisation des poids locaux et de ceux du programme adjust
+ void updateNodes ();
+
+ /// Envoie une donnee au prog adjust
+ void sendSignal (const char *buf);
+
+ // Affiche les objets et poteaux trouvés
+ void showObjectsFound ();
+
+ void newNN (const int nbColor);
+};
+
+
+#endif // UI_h