source: Sophya/trunk/SophyaPI/PIext/piacmd.h@ 2764

Last change on this file since 2764 was 2536, checked in by ansari, 21 years ago

Correction bug ds PIACmd : remplacement stack<string> par queue<string> pour empilement de commandes soumises a l'interpreteur et ajout commande bargraph pour drawer PIBarGraph - Reza 13 Mai 2004

File size: 2.9 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2// Classe interpreteur de commande pour piapp
3// Reza Aout 97 , Juillet,Aout 98
4// LAL-IN2P3/CNRS
5
6#ifndef PIACMD_H_SEEN
7#define PIACMD_H_SEEN
8
9#include "machdefs.h"
10#include "commander.h"
11#include <string>
12#include <vector>
13#include <queue>
14#include "zthread.h"
15
16#include "dlftypes.h"
17
18// Forward declaration of some classes ...
19class NamedObjMgr;
20class PIStdImgApp;
21
22class PIAHelpWind; // Fenetre d'aide en ligne
23class CxxExecWind; // Fenetre pour CxxExecutor
24class CxxOptionWind; // Option de CxxExecutor
25
26// ---------------------------------------------------------------------
27// Classe Interpreteur de commande, gestionnaire de module chargeable,
28// et de fonctions dynamiquement linke pour PIStdImgApp
29// Permet de gerer plusieurs Interpreter differents
30// ---------------------------------------------------------------------
31
32
33class PIACmd : public Commander, public ZThread {
34public:
35 // static PIACmd* GetInterpreter();
36
37 PIACmd(PIStdImgApp* app);
38 virtual ~PIACmd();
39
40 // Thread execution <ZThread>
41 virtual void run();
42 void AddInputLine(string const & line);
43 void StopThread();
44 inline bool isRunning(int& ninp)
45 { ninp = inputlines.size(); return fg_threxe; }
46 // ---- FIN ---- Thread execution <ZThread>
47
48 void ShowHelpWindow();
49 void ShowCxxOptionWindow();
50 void ShowCxxExecWindow();
51
52 // inline CmdInterpreter* CurrentInterpreter() { return(curcmdi); }
53
54 inline CmdExecutor* BaseExecutor() { return(basexec); }
55 inline CmdExecutor* ContExecutor() { return(cntexec); } //_OP_
56 inline PIStdImgApp* GetImgApp() { return(mImgApp); }
57
58// Pour utilisation par PIAHelpWind uniquement
59 virtual void UpdateHelpList(PIAHelpWind* hw, int gid);
60
61protected:
62 virtual int ExecuteCommandLine(string & kw, vector<string> & tokens,
63 string & toks);
64
65 virtual bool CheckHelpGrp(string& grp, int& gid, string& desc);
66 virtual void InitializeHelpWindowMenu();
67
68 virtual void SetCurrentPrompt(const char* pr);
69 virtual void ShowMessage(const char * msg, int att);
70
71 NamedObjMgr* mObjMgr;
72 PIStdImgApp* mImgApp;
73
74 CmdExecutor* basexec; // basic command executor
75 CmdExecutor* fitexec; // Fit command executor
76 CmdExecutor* pawexec; // paw-like command executor
77 CmdExecutor* cxxexec; // on-line c++ compile/execution command executor
78
79 CmdExecutor *cntexec; // contour executor _OP_
80 CmdExecutor *flwexec; // flow chart executor _OP_
81
82// Fenetre d'aide interactive
83 PIAHelpWind* helpwin;
84 bool helpwin_initdone;
85// Fenetres d'execution interactive de C++ , options correspondantes
86 CxxExecWind* cxxexwin;
87 CxxOptionWind* cxxoptwin;
88
89// Queue des entrees et controle de thread
90 queue<string> inputlines;
91 bool fg_thrstop;
92 ZMutex mutx_inps;
93 bool fg_threxe;
94
95};
96
97
98
99#endif
Note: See TracBrowser for help on using the repository browser.