Changeset 330 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Jun 24, 1999, 4:26:47 PM (26 years ago)
Author:
ercodmgr
Message:

Amelioration du Help pour piapp (Groupe de Help) Reza 24/6/99

Location:
trunk/SophyaPI/PIext
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/basexecut.cc

    r326 r330  
    445445usage = "To load and initialize modules \n  Usage: loadmodule fnameso modulename";
    446446usage += "\n  Related commands: link"; 
    447 mpiac->RegisterCommand(kw, usage, this);
     447mpiac->RegisterCommand(kw, usage, this, "External Modules");
    448448kw = "link";
    449449usage = "Dynamic linking of compiled user functions \n  Usage: link fnameso f1 [f2 f3]";
    450450usage += "\n  fnameso: Shared-object file name, f1,f2,f3 : User function names ";
    451451usage += "\n  Related commands: call loadmodule"; 
    452 mpiac->RegisterCommand(kw, usage, this);
     452mpiac->RegisterCommand(kw, usage, this, "External Modules");
    453453kw = "call";
    454454usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]";
    455455usage += "\n  User function : f(vector<string>& args)";
    456456usage += "\n  Related commands: link"; 
    457 mpiac->RegisterCommand(kw, usage, this);
     457mpiac->RegisterCommand(kw, usage, this, "External Modules");
    458458
    459459kw = "zone";
    460460usage = "To Divide the Graphic window \n  Usage: zone nx ny";
    461 mpiac->RegisterCommand(kw, usage, this);
     461mpiac->RegisterCommand(kw, usage, this, "Graphics");
    462462kw = "newwin";
    463463usage = "To Create a New Graphic window, with zones \n  Usage: newwin nx ny";
    464 mpiac->RegisterCommand(kw, usage, this);
     464mpiac->RegisterCommand(kw, usage, this, "Graphics");
    465465kw = "stacknext";
    466466usage = "Displays the next widget on stack window \n  Usage: stacknext";
    467 mpiac->RegisterCommand(kw, usage, this);
     467mpiac->RegisterCommand(kw, usage, this, "Graphics");
    468468
    469469kw = "gratt";
     
    489489usage += "          fineaxes  grid=fineaxesgrid \n";
    490490usage += ">> DisplayWindow: next same win stack \n";
    491 mpiac->RegisterCommand(kw, usage, this);
     491mpiac->RegisterCommand(kw, usage, this, "Graphics");
    492492
    493493kw = "openfits";
    494494usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename";
    495495usage += "\n  Related commands: savefits openppf"; 
    496 mpiac->RegisterCommand(kw, usage, this);
     496mpiac->RegisterCommand(kw, usage, this, "FileIO");
    497497kw = "savefits";
    498498usage = "Save an object into a FITS file \n Usage: savefits nameobj filename";
    499499usage += "\n  Related commands: openfits saveall"; 
    500 mpiac->RegisterCommand(kw, usage, this);
     500mpiac->RegisterCommand(kw, usage, this, "FileIO");
    501501kw = "openppf";
    502502usage = "Reads all objects from a PPF file \n Usage: openppf filename";
    503503usage += "\n  Related commands: saveall openfits"; 
    504 mpiac->RegisterCommand(kw, usage, this);
     504mpiac->RegisterCommand(kw, usage, this, "FileIO");
    505505kw = "saveall";
    506506usage = "Saves all objects into a PPF file \n Usage: saveall filename";
    507507usage += "\n  Related commands: openppf savefits"; 
    508 mpiac->RegisterCommand(kw, usage, this);
     508mpiac->RegisterCommand(kw, usage, this, "FileIO");
    509509
    510510kw = "print";
    511511usage = "Prints an object \n Usage: print nameobj";
    512 mpiac->RegisterCommand(kw, usage, this);
     512mpiac->RegisterCommand(kw, usage, this, "FileIO");
    513513
    514514kw = "listobjs";
    515515usage = "Prints the list of objects";
    516516usage += "\n Usage: listobjs";
    517 mpiac->RegisterCommand(kw, usage, this);
     517mpiac->RegisterCommand(kw, usage, this, "Object Managment");
    518518kw = "rename";
    519519usage = "Rename an object \n Usage: rename nameobj namenew";
    520520usage += "\n  Related commands: del delobjs"; 
    521 mpiac->RegisterCommand(kw, usage, this);
     521mpiac->RegisterCommand(kw, usage, this, "Object Managment");
    522522kw = "del";
    523523usage = "Deletes an object \n Usage: del nameobj";
    524524usage += "\n  Related commands: delobjs  rename"; 
    525 mpiac->RegisterCommand(kw, usage, this);
     525mpiac->RegisterCommand(kw, usage, this, "Object Managment");
    526526kw = "delobjs";
    527527usage = "Delete a set of objects with names matching a pattern (x?y*)";
    528528usage += "\n Usage: delobjs nameobjpattern \n";
    529529usage += "\n  Related commands: del rename"; 
    530 mpiac->RegisterCommand(kw, usage, this);
     530mpiac->RegisterCommand(kw, usage, this, "Object Managment");
    531531
    532532kw = "newh1d";
    533533usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
    534534usage += "\n  Related commands: newh2d  newprof  newgfd "; 
    535 mpiac->RegisterCommand(kw, usage, this);
     535mpiac->RegisterCommand(kw, usage, this, "Histrograms");
    536536kw = "newh2d";
    537537usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
    538538usage += "\n  Related commands: newh1d  newprof  newgfd "; 
    539 mpiac->RegisterCommand(kw, usage, this);
     539mpiac->RegisterCommand(kw, usage, this, "Histrograms");
    540540kw = "newprof";
    541541usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
    542542usage += "\n  Related commands: newh1d  newh2d newgfd "; 
    543 mpiac->RegisterCommand(kw, usage, this);
     543mpiac->RegisterCommand(kw, usage, this, "Histrograms");
    544544kw = "newgfd";
    545545usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
    546546usage += "\n  Related commands: newh1d  newh2d  newprof "; 
    547 mpiac->RegisterCommand(kw, usage, this);
     547mpiac->RegisterCommand(kw, usage, this, "Histrograms");
    548548
    549549kw = "disp";
    550550usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]";
    551551usage += "\n  Related commands: surf nt2d nt3d "; 
    552 mpiac->RegisterCommand(kw, usage, this);
     552mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    553553kw = "imag";
    554554usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
    555555usage += "\n  Related commands: disp surf nt2d nt3d "; 
    556 mpiac->RegisterCommand(kw, usage, this);
     556mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    557557kw = "surf";
    558558usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]";
    559559usage += "\n  Related commands: disp nt2d nt3d "; 
    560 mpiac->RegisterCommand(kw, usage, this);
     560mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    561561kw = "nt2d";
    562562usage = "Displays Points (X-Y) [with error-bars] from an NTuple ";
    563563usage += "\n Usage : nt2d nameobj varx vary [errx erry] [graphic_attributes]";
    564564usage += "\n  Related commands: disp  surf  nt3d  gfd2d "; 
    565 mpiac->RegisterCommand(kw, usage, this);
     565mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    566566kw = "nt3d";
    567567usage = "Displays 3D-Points (X-Y-Z) [with error-bars] from an NTuple ";
    568568usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz] [graphic_attributes]";
    569569usage += "\n  Related commands: disp  surf  nt2d  gfd3d "; 
    570 mpiac->RegisterCommand(kw, usage, this);
     570mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    571571kw = "gfd2d";
    572572usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data ";
    573573usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]";
    574574usage += "\n  Related commands: gfd3d nt2d nt3d "; 
    575 mpiac->RegisterCommand(kw, usage, this);
     575mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    576576kw = "gfd3d";
    577577usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data ";
    578578usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]";
    579579usage += "\n  Related commands: gfd2d nt2d nt3d "; 
    580 mpiac->RegisterCommand(kw, usage, this);
     580mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
    581581
    582582kw = "func";
     
    584584usage += "\n Usage: func f(x) xmin xmax npt [graphic_attributes]";
    585585usage += "\n  Related commands: funcff func2d func2dff "; 
    586 mpiac->RegisterCommand(kw, usage, this);
     586mpiac->RegisterCommand(kw, usage, this, "Func Plot");
    587587kw = "funcff";
    588588usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
    589589usage += "\n Usage: funcff C-FileName FunctionName xmin xmax npt [graphic_attributes]";
    590590usage += "\n  Related commands: func func2d func2dff "; 
    591 mpiac->RegisterCommand(kw, usage, this);
     591mpiac->RegisterCommand(kw, usage, this, "Func Plot");
    592592kw = "func2d";
    593593usage = "Displays a function z=f(x,y) (Fills a matrix with function values)";
    594594usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]";
    595595usage += "\n  Related commands: func"; 
    596 mpiac->RegisterCommand(kw, usage, this);
     596mpiac->RegisterCommand(kw, usage, this, "Func Plot");
    597597kw = "func2dff";
    598598usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)";
    599599usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]";
    600600usage += "\n  Related commands: func funcff func2d "; 
    601 mpiac->RegisterCommand(kw, usage, this);
     601mpiac->RegisterCommand(kw, usage, this, "Func Plot");
    602602
    603603kw = "plot2d";
     
    607607usage += "\n Usage: plot2d nameobj f_X() g_Y() [ f_ErrX() f_ErrY() ] f_Cut() [graphic_attributes]";
    608608usage += "\n  Related commands: plot3d  projh1d  projh2d  projprof  fillnt fillvec fillgd1 ";
    609 mpiac->RegisterCommand(kw, usage, this);
     609mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    610610kw = "plot3d";
    611611usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
    612612usage += "\n Usage: plot2d nameobj f_X() g_Y() h_Z() Cut() [graphic_attributes]";
    613613usage += "\n  Related commands: plot2d  projh1d  projh2d  projprof  fillnt fillvec ";
    614 mpiac->RegisterCommand(kw, usage, this);
     614mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    615615
    616616kw = "projh1d";
     
    619619usage += "\n   Histo1D nameh1d is created if necessary ";
    620620usage += "\n  Related commands: plot2d  projh2d  projprof fillnt  fillvec ";
    621 mpiac->RegisterCommand(kw, usage, this);
     621mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    622622kw = "projh2d";
    623623usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
     
    625625usage += "\n   Histo2D nameh2d is created if necessary ";
    626626usage += "\n  Related commands: plot2d  projh1d projprof ";
    627 mpiac->RegisterCommand(kw, usage, this);
     627mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    628628kw = "projprof";
    629629usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
     
    631631usage += "\n   HProf nameprof is created if necessary ";
    632632usage += "\n  Related commands: plot2d  projh2d  ";
    633 mpiac->RegisterCommand(kw, usage, this);
     633mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    634634
    635635kw = "fillnt";
     
    637637usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() Cut() nameNt";
    638638usage += "\n  Related commands: plot2d  projh1d projh2d projprof ";
    639 mpiac->RegisterCommand(kw, usage, this);
     639mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    640640kw = "fillvec";
    641641usage = "Creates and Fills a Vector with X=f(Object)";
    642642usage += "\n Usage: fillvec nameobj f_X() Cut() nameVec [graphic_attributes]";
    643643usage += "\n  Related commands: plot2d  projh1d  fillnt ";
    644 mpiac->RegisterCommand(kw, usage, this);
     644mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    645645kw = "fillgd1";
    646646usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
    647647usage += "\n Usage: fillgd1 nameobj f_X() g_Y() h_ErrY() Cut() nameGfd";
    648648usage += "\n  Related commands: plot2d  fillnt ";
    649 mpiac->RegisterCommand(kw, usage, this);
     649mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    650650kw = "fillgd2";
    651651usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
    652652usage += "\n Usage: fillgd1 nameobj f_X() g_Y() h_Z() k_ErrZ() Cut() nameGfd";
    653653usage += "\n  Related commands: plot2d  fillgd2 ";
    654 mpiac->RegisterCommand(kw, usage, this);
     654mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    655655
    656656kw = "fit";
     
    658658usage += "\n Usage: fit nomobj func [Options]";
    659659usage += "\n [p:p1,...,pn s:s1,...,sn m:m1,...,mn M:M1,...,Mn o:... o:...]";
    660 mpiac->RegisterCommand(kw, usage, this);
     660mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
    661661
    662662
  • trunk/SophyaPI/PIext/nobjmgr.cc

    r326 r330  
    1919#include "nobjmgr.h"
    2020#include "servnobjm.h"
     21#include "nomgadapter.h"
    2122#include "pistdimgapp.h"
    2223
  • trunk/SophyaPI/PIext/piacmd.cc

    r324 r330  
    2424                PIAHelpWind(PIStdImgApp* par, PIACmd* piacmd);
    2525  virtual       ~PIAHelpWind();
     26  virtual void  Show();
    2627  virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
     28  inline  void  AddHelpGroup(const char * hgrp, int gid)
     29                    { hgrpom->AppendItem(hgrp, 20000+gid); }
     30  inline  void  ClearHelpList()
     31                    { mNitem=0; hitemlist->DeleteAllItems(); }
    2732  inline  void  AddHelpItem(const char * hitem)
    28                         { mNitem++;  hitemlist->AppendItem(hitem, 1000+mNitem); }
     33                    { mNitem++;  hitemlist->AppendItem(hitem, 100+mNitem); }
    2934protected :
    3035  PIStdImgApp* dap;
     
    3237  int mNitem;
    3338  PIList* hitemlist;
     39  PIOptMenu* hgrpom;
    3440  PIButton * mBut;
    3541  PILabel * mLab;
     
    4450piac = piacmd;
    4551mNitem = 0;
    46 SetMsg(777);
     52SetMsg(77);
    4753
    4854int bsx, bsy;
     
    5359tsx = 10*bsx+2*spx;  tsy = 7*bsy+3*spy;
    5460SetSize(tsx,tsy);
    55 hitemlist = new PIList(this, "hitemlist", bsx*2.0, tsy-2*spy, spx/2, spy);
     61hgrpom = new PIOptMenu(this, "hgrpoptmen", bsx*2.0, bsy, spx/2, spy);
     62hgrpom->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     63hitemlist = new PIList(this, "hitemlist", bsx*2.0, tsy-3*spy-bsy, spx/2, 2*spy+bsy);
    5664hitemlist->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    5765// hitemlist->SetBorderWidth(2);
     
    6573mLab->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    6674mLab->SetLabel("");
    67 mBut = new PIButton(this, "Close", 700, bsx, bsy, tsx-bsx*1.5-spx, tsy-spy-bsy);
     75mBut = new PIButton(this, "Close", 70, bsx, bsy, tsx-bsx*1.5-spx, tsy-spy-bsy);
    6876mBut->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    6977}
     
    7280PIAHelpWind::~PIAHelpWind()
    7381{
     82delete hgrpom;
    7483delete hitemlist;
    7584delete mTxt;
     
    8291{
    8392PIMessage um = UserMsg(msg);
    84 if (((um == 777) && (ModMsg(msg) == PIMsg_Close)) || (um == 700) ) {
     93if (((um == 77) && (ModMsg(msg) == PIMsg_Close)) || (um == 70) ) {
    8594  Hide();
    8695  return;
    8796  }
    88 else if ( (um > 1000) && (sender == hitemlist)) {
     97else if ( (um >= 20000) && (sender == hgrpom)) {  // Selection de groupe de Help
     98  mTxt->SetText("");
     99  mLab->SetLabel("");
     100  piac->UpdateHelpList(this, um-20000);
     101}
     102else if ( (um > 100) && (sender == hitemlist) && (ModMsg(msg) == PIMsg_Select) ) {
    89103  string s = hitemlist->GetSelectionStr();
    90104  mTxt->SetText(piac->GetUsage(s));
     
    93107}
    94108
     109/* --Methode-- */
     110void PIAHelpWind::Show()
     111{
     112hgrpom->SetValue(20000);   // Groupe All
     113mTxt->SetText("");
     114mLab->SetLabel("");
     115piac->UpdateHelpList(this, 0);
     116PIWindow::Show();
     117}
    95118
    96119static PIACmd* curpiacmd = NULL;
     
    105128gltimer = NULL;
    106129
     130cmdhgrp["All"] = 0;
     131cmdgrpid = 1;
     132cmdhgrp["Commands"] = 1;
    107133helpwin = new PIAHelpWind(app, this);
     134helpwin->AddHelpGroup("All", 0);
     135helpwin->AddHelpGroup("Commands", 1);
    108136
    109137string kw = "piacmd";
     
    120148usage += "  > help <command_name>  # <command_name> usage info \n";
    121149usage += "  > helpwindow           # Displays help window \n";
    122 RegisterCommand(kw, usage, NULL);
     150string grp = "Commands";
     151RegisterHelp(kw, usage, grp);
    123152
    124153basexec = new PIABaseExecutor(this, omg, app);
     
    156185
    157186/* --Methode-- */
    158 void PIACmd::RegisterCommand(string& keyw, string& usage, CmdExecutor * ce)
    159 {
    160   // if (!ce) return;
     187void PIACmd::RegisterCommand(string& keyw, string& usage, CmdExecutor * ce, string grp)
     188{
     189if (!ce) {
     190  RegisterHelp(keyw, usage, grp);
     191  return;
     192  }
     193int gid = CheckHelpGrp(grp);
    161194cmdex cme;
     195cme.group = gid;
    162196cme.us = usage;
    163197cme.cex = ce;
    164198cmdexmap[keyw] = cme;
    165 if (helpwin) helpwin->AddHelpItem(keyw.c_str());
     199}
     200
     201/* --Methode-- */
     202void PIACmd::RegisterHelp(string& keyw, string& usage, string& grp)
     203{
     204int gid = CheckHelpGrp(grp);
     205cmdex cme;
     206cme.group = gid;
     207cme.us = usage;
     208cme.cex = NULL;
     209helpexmap[keyw] = cme;
     210}
     211
     212/* --Methode-- */
     213int PIACmd::CheckHelpGrp(string& grp)
     214{
     215int gid=0;
     216CmdHGroup::iterator it = cmdhgrp.find(grp);
     217if (it == cmdhgrp.end()) {
     218  cmdgrpid++;   gid = cmdgrpid;
     219  cmdhgrp[grp] = gid;
     220  helpwin->AddHelpGroup(grp.c_str(), gid);
     221  }
     222else gid = (*it).second;
     223return(gid);
     224}
     225
     226/* --Methode-- */
     227void PIACmd::UpdateHelpList(PIAHelpWind* hw, int gid)
     228{
     229helpwin->ClearHelpList();
     230CmdExmap::iterator it;
     231for(it = helpexmap.begin(); it != helpexmap.end(); it++) {
     232  if ( (gid != 0) && ((*it).second.group != gid) ) continue;
     233  helpwin->AddHelpItem((*it).first.c_str());
     234  }
     235for(it = cmdexmap.begin(); it != cmdexmap.end(); it++) {
     236  if ( (gid != 0) && ((*it).second.group != gid) ) continue;
     237  helpwin->AddHelpItem((*it).first.c_str());
     238  }
    166239}
    167240
     
    252325if (kw == "helpwindow") ShowHelpWindow();
    253326else if (kw == "help") {
    254   if (tokens.size() > 0) {
    255     CmdExmap::iterator it = cmdexmap.find(tokens[0]);
    256     if (it == cmdexmap.end())  cout << "Nothing known about " << tokens[0] << " ?? " << endl;
    257     else cout << (*it).second.us << endl;
     327  if (tokens.size() > 0) cout << GetUsage(tokens[0]) << endl;
     328  else { 
     329    string kwh = "piacmd";
     330    cout << GetUsage(kwh) << endl;
    258331    }
    259   else { 
    260     cout << "\n -------- PIACmd::Interpret() ::::: Help ------------ \n";
    261     cout << ">>> Interpreter's keywords : \n";
    262     cout << "  timingon  timingoff traceon  traceoff \n";
    263     cout << "  set unset listvar listcommands exec shell \n";
    264     cout << "  > set varname 'string'   # To set a variable, $varname \n";
    265     cout << "  > unset varname          # clear variable definition \n";
    266     cout << "  > listvars   # List of variable names and values \n";
    267     cout << "  > listcommands # List of all known commands \n";
    268     cout << "  > exec filename  # Execute commands from file \n";
    269     cout << "  > shell comand_string  # Execute shell command \n";
    270     cout << "  > help <command_name>  # <command_name> usage info \n";
    271     cout << "  > helpwindow           # Displays help window \n" << endl;
    272     }
    273   }
    274 
     332  }
    275333
    276334else if (kw == "set") {
     
    292350  }
    293351else if (kw == "listvars") {
    294   cout << "---- PIACmd::Interpret()  Command keyword List ----- \n";
     352  cout << "---- PIACmd::Interpret()  Command Variable List ----- \n";
    295353  CmdExmap::iterator it;
    296354  int kc = 0;
     
    376434string& PIACmd::GetUsage(const string& kw)
    377435{
     436bool fndok = false;
    378437CmdExmap::iterator it = cmdexmap.find(kw);
    379 if (it == cmdexmap.end()) { 
    380   if (videstr == NULL) videstr = new string("");
    381   return(*videstr);
    382   }
    383 else return( (*it).second.us );
     438if (it == cmdexmap.end()) {
     439  it = helpexmap.find(kw);
     440  if (it != helpexmap.end())  fndok = true;
     441  }
     442  else  fndok = true;
     443if (fndok)   return( (*it).second.us );
     444// Keyword pas trouve
     445if (videstr == NULL) videstr = new string("");
     446*videstr =  "Nothing known about " + kw + " ?? ";
     447return(*videstr);
     448 
    384449}
    385450
  • trunk/SophyaPI/PIext/piacmd.h

    r293 r330  
    5353// ---------------------------------------------------------------------
    5454
     55class PIAHelpWind;   // Fenetre d'aide en ligne
     56
    5557class PIACmd : public CmdInterpreter  {
    5658public:
     
    6163  virtual string        Name();
    6264
    63   virtual void          RegisterCommand(string& keyw, string& usage, CmdExecutor * ce);
     65  virtual void          RegisterCommand(string& keyw, string& usage, CmdExecutor * ce,
     66                                        string grp="Command");
     67  virtual void          RegisterHelp(string& keyw, string& usage, string& grp);
    6468  virtual void          LoadModule(string& fnameso, string& name);
    6569
     
    7781  inline  PIStdImgApp*    GetImgApp() { return(mImgApp); }
    7882
     83//   Pour utilisation par PIAHelpWind uniquement
     84  virtual void          UpdateHelpList(PIAHelpWind* hw, int gid);
     85
    7986protected:
     87  virtual int           CheckHelpGrp(string& grp);
     88
    8089  NamedObjMgr* mObjMgr;
    8190  PIStdImgApp* mImgApp;
     
    8493  CmdExecutor* basexec;
    8594
    86 // Pour enregistrer la liste de commandes et leurs executeurs
    87   struct cmdex {string us; CmdExecutor * cex; } ;
     95// Pour enregistrer la liste de commandes et leurs executeurs et le help
     96  struct cmdex {int group; string us; CmdExecutor * cex; } ;
     97  typedef map<string, int, less<string> > CmdHGroup;   // Liste des groupes de commandes
     98  CmdHGroup cmdhgrp;
     99  int cmdgrpid;                                     // Numero de groupe courant
    88100  typedef map<string, cmdex, less<string> > CmdExmap;
    89101  CmdExmap cmdexmap;
     102  CmdExmap helpexmap;                               // Pour les helps sans commande
    90103
    91104// Pour garder la liste des modules
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r318 r330  
    381381
    382382//++
    383 PIH2DWdg::PIH2DWdg(PIContainerGen *par, char *nom, int sx, int sy, int px, int py)
     383PIH2DWdg::PIH2DWdg(PIContainerGen *par, const char *nom, int sx, int sy, int px, int py)
    384384//
    385385//      Createur d'un Widget de dessin d'histogramme 2D.
  • trunk/SophyaPI/PIext/pihisto2d.h

    r210 r330  
    6161class PIH2DWdg : public PIScDrawWdg {
    6262public:
    63                      PIH2DWdg(PIContainerGen *par, char *nom, int sx=300, int sy=300,
     63                     PIH2DWdg(PIContainerGen *par, const char *nom, int sx=300, int sy=300,
    6464                              int px=0, int py=0);
    6565                     ~PIH2DWdg();
  • trunk/SophyaPI/PIext/servnobjm.cc

    r326 r330  
    1818#include "nobjmgr.h"
    1919#include "servnobjm.h"
     20#include "nomgadapter.h"
    2021#include "pistdimgapp.h"
    2122
  • trunk/SophyaPI/PIext/servnobjm.h

    r327 r330  
    1919#include "pdlmgr.h"
    2020#include "dlftypes.h"
    21 #include "nomgadapter.h"
     21#include "anydataobj.h"
    2222
    2323class NTuple;
     
    2626class HProf;
    2727class PIStdImgApp;
     28class NObjMgrAdapter;
    2829
    2930class Services2NObjMgr {
Note: See TracChangeset for help on using the changeset viewer.