// nono2 - programme du robot 2005 // // Copyright (C) 2004 Olivier Gaillard // // Robot APB Team/Efrei 2004. // 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" #define NUM_COULEUR 1 #define NB_COULEUR 2 /// Interface ncurses permettant de piloter adjust class UI { /// Variable utilisees pour ncurses ITEM **item; MENU *menu; 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; public: /// Constructeurs. UI (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 inline int ChooseColor(int type) {return ChooseColor(type, 0);} /// Menu de selection de couleur int ChooseColor(int type, int current); /// Affiche un msg dans la barre d'etat void PrintStatus(char *str); /// Menu de suppression de couleur void GoDelColor(); /// Menu de selection du group a former void GoSelectGroup(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(char *buf); // Affiche les objets et poteaux trouvés void ShowObjetsFound (); void NewNN (int nbColor); }; #endif // UI_h