Changeset 330 in Sophya
- Timestamp:
- Jun 24, 1999, 4:26:47 PM (26 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r326 r330 445 445 usage = "To load and initialize modules \n Usage: loadmodule fnameso modulename"; 446 446 usage += "\n Related commands: link"; 447 mpiac->RegisterCommand(kw, usage, this );447 mpiac->RegisterCommand(kw, usage, this, "External Modules"); 448 448 kw = "link"; 449 449 usage = "Dynamic linking of compiled user functions \n Usage: link fnameso f1 [f2 f3]"; 450 450 usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names "; 451 451 usage += "\n Related commands: call loadmodule"; 452 mpiac->RegisterCommand(kw, usage, this );452 mpiac->RegisterCommand(kw, usage, this, "External Modules"); 453 453 kw = "call"; 454 454 usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]"; 455 455 usage += "\n User function : f(vector<string>& args)"; 456 456 usage += "\n Related commands: link"; 457 mpiac->RegisterCommand(kw, usage, this );457 mpiac->RegisterCommand(kw, usage, this, "External Modules"); 458 458 459 459 kw = "zone"; 460 460 usage = "To Divide the Graphic window \n Usage: zone nx ny"; 461 mpiac->RegisterCommand(kw, usage, this );461 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 462 462 kw = "newwin"; 463 463 usage = "To Create a New Graphic window, with zones \n Usage: newwin nx ny"; 464 mpiac->RegisterCommand(kw, usage, this );464 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 465 465 kw = "stacknext"; 466 466 usage = "Displays the next widget on stack window \n Usage: stacknext"; 467 mpiac->RegisterCommand(kw, usage, this );467 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 468 468 469 469 kw = "gratt"; … … 489 489 usage += " fineaxes grid=fineaxesgrid \n"; 490 490 usage += ">> DisplayWindow: next same win stack \n"; 491 mpiac->RegisterCommand(kw, usage, this );491 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 492 492 493 493 kw = "openfits"; 494 494 usage = "Loads a FITS file into an Image<T> \n Usage: openfits filename"; 495 495 usage += "\n Related commands: savefits openppf"; 496 mpiac->RegisterCommand(kw, usage, this );496 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 497 497 kw = "savefits"; 498 498 usage = "Save an object into a FITS file \n Usage: savefits nameobj filename"; 499 499 usage += "\n Related commands: openfits saveall"; 500 mpiac->RegisterCommand(kw, usage, this );500 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 501 501 kw = "openppf"; 502 502 usage = "Reads all objects from a PPF file \n Usage: openppf filename"; 503 503 usage += "\n Related commands: saveall openfits"; 504 mpiac->RegisterCommand(kw, usage, this );504 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 505 505 kw = "saveall"; 506 506 usage = "Saves all objects into a PPF file \n Usage: saveall filename"; 507 507 usage += "\n Related commands: openppf savefits"; 508 mpiac->RegisterCommand(kw, usage, this );508 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 509 509 510 510 kw = "print"; 511 511 usage = "Prints an object \n Usage: print nameobj"; 512 mpiac->RegisterCommand(kw, usage, this );512 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 513 513 514 514 kw = "listobjs"; 515 515 usage = "Prints the list of objects"; 516 516 usage += "\n Usage: listobjs"; 517 mpiac->RegisterCommand(kw, usage, this );517 mpiac->RegisterCommand(kw, usage, this, "Object Managment"); 518 518 kw = "rename"; 519 519 usage = "Rename an object \n Usage: rename nameobj namenew"; 520 520 usage += "\n Related commands: del delobjs"; 521 mpiac->RegisterCommand(kw, usage, this );521 mpiac->RegisterCommand(kw, usage, this, "Object Managment"); 522 522 kw = "del"; 523 523 usage = "Deletes an object \n Usage: del nameobj"; 524 524 usage += "\n Related commands: delobjs rename"; 525 mpiac->RegisterCommand(kw, usage, this );525 mpiac->RegisterCommand(kw, usage, this, "Object Managment"); 526 526 kw = "delobjs"; 527 527 usage = "Delete a set of objects with names matching a pattern (x?y*)"; 528 528 usage += "\n Usage: delobjs nameobjpattern \n"; 529 529 usage += "\n Related commands: del rename"; 530 mpiac->RegisterCommand(kw, usage, this );530 mpiac->RegisterCommand(kw, usage, this, "Object Managment"); 531 531 532 532 kw = "newh1d"; 533 533 usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin"; 534 534 usage += "\n Related commands: newh2d newprof newgfd "; 535 mpiac->RegisterCommand(kw, usage, this );535 mpiac->RegisterCommand(kw, usage, this, "Histrograms"); 536 536 kw = "newh2d"; 537 537 usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny"; 538 538 usage += "\n Related commands: newh1d newprof newgfd "; 539 mpiac->RegisterCommand(kw, usage, this );539 mpiac->RegisterCommand(kw, usage, this, "Histrograms"); 540 540 kw = "newprof"; 541 541 usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]"; 542 542 usage += "\n Related commands: newh1d newh2d newgfd "; 543 mpiac->RegisterCommand(kw, usage, this );543 mpiac->RegisterCommand(kw, usage, this, "Histrograms"); 544 544 kw = "newgfd"; 545 545 usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]"; 546 546 usage += "\n Related commands: newh1d newh2d newprof "; 547 mpiac->RegisterCommand(kw, usage, this );547 mpiac->RegisterCommand(kw, usage, this, "Histrograms"); 548 548 549 549 kw = "disp"; 550 550 usage = "Displays an object \n Usage: disp nameobj [graphic_attributes]"; 551 551 usage += "\n Related commands: surf nt2d nt3d "; 552 mpiac->RegisterCommand(kw, usage, this );552 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 553 553 kw = "imag"; 554 554 usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]"; 555 555 usage += "\n Related commands: disp surf nt2d nt3d "; 556 mpiac->RegisterCommand(kw, usage, this );556 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 557 557 kw = "surf"; 558 558 usage = "Displays an object as a 3D surface \n Usage: surf nameobj [graphic_attributes]"; 559 559 usage += "\n Related commands: disp nt2d nt3d "; 560 mpiac->RegisterCommand(kw, usage, this );560 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 561 561 kw = "nt2d"; 562 562 usage = "Displays Points (X-Y) [with error-bars] from an NTuple "; 563 563 usage += "\n Usage : nt2d nameobj varx vary [errx erry] [graphic_attributes]"; 564 564 usage += "\n Related commands: disp surf nt3d gfd2d "; 565 mpiac->RegisterCommand(kw, usage, this );565 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 566 566 kw = "nt3d"; 567 567 usage = "Displays 3D-Points (X-Y-Z) [with error-bars] from an NTuple "; 568 568 usage += "\n Usage : nt3d nameobj varx vary varz [errx erry errz] [graphic_attributes]"; 569 569 usage += "\n Related commands: disp surf nt2d gfd3d "; 570 mpiac->RegisterCommand(kw, usage, this );570 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 571 571 kw = "gfd2d"; 572 572 usage = "Displays Points (X-Y) with error-bars from a GeneralFit Data "; 573 573 usage += "\n Usage : gfd2d nameobj numvarx erreur=(x y xy) [graphic_attributes]"; 574 574 usage += "\n Related commands: gfd3d nt2d nt3d "; 575 mpiac->RegisterCommand(kw, usage, this );575 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 576 576 kw = "gfd3d"; 577 577 usage = "Displays 3D-Points (X-Y-Z) with error-bars from a GeneralFit Data "; 578 578 usage += "\n Usage : gfd3d nameobj numvarx numvary erreur=(x y z xy xz yz xyz) [graphic_attributes]"; 579 579 usage += "\n Related commands: gfd2d nt2d nt3d "; 580 mpiac->RegisterCommand(kw, usage, this );580 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 581 581 582 582 kw = "func"; … … 584 584 usage += "\n Usage: func f(x) xmin xmax npt [graphic_attributes]"; 585 585 usage += "\n Related commands: funcff func2d func2dff "; 586 mpiac->RegisterCommand(kw, usage, this );586 mpiac->RegisterCommand(kw, usage, this, "Func Plot"); 587 587 kw = "funcff"; 588 588 usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)"; 589 589 usage += "\n Usage: funcff C-FileName FunctionName xmin xmax npt [graphic_attributes]"; 590 590 usage += "\n Related commands: func func2d func2dff "; 591 mpiac->RegisterCommand(kw, usage, this );591 mpiac->RegisterCommand(kw, usage, this, "Func Plot"); 592 592 kw = "func2d"; 593 593 usage = "Displays a function z=f(x,y) (Fills a matrix with function values)"; 594 594 usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]"; 595 595 usage += "\n Related commands: func"; 596 mpiac->RegisterCommand(kw, usage, this );596 mpiac->RegisterCommand(kw, usage, this, "Func Plot"); 597 597 kw = "func2dff"; 598 598 usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)"; 599 599 usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]"; 600 600 usage += "\n Related commands: func funcff func2d "; 601 mpiac->RegisterCommand(kw, usage, this );601 mpiac->RegisterCommand(kw, usage, this, "Func Plot"); 602 602 603 603 kw = "plot2d"; … … 607 607 usage += "\n Usage: plot2d nameobj f_X() g_Y() [ f_ErrX() f_ErrY() ] f_Cut() [graphic_attributes]"; 608 608 usage += "\n Related commands: plot3d projh1d projh2d projprof fillnt fillvec fillgd1 "; 609 mpiac->RegisterCommand(kw, usage, this );609 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 610 610 kw = "plot3d"; 611 611 usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs "; 612 612 usage += "\n Usage: plot2d nameobj f_X() g_Y() h_Z() Cut() [graphic_attributes]"; 613 613 usage += "\n Related commands: plot2d projh1d projh2d projprof fillnt fillvec "; 614 mpiac->RegisterCommand(kw, usage, this );614 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 615 615 616 616 kw = "projh1d"; … … 619 619 usage += "\n Histo1D nameh1d is created if necessary "; 620 620 usage += "\n Related commands: plot2d projh2d projprof fillnt fillvec "; 621 mpiac->RegisterCommand(kw, usage, this );621 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 622 622 kw = "projh2d"; 623 623 usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram "; … … 625 625 usage += "\n Histo2D nameh2d is created if necessary "; 626 626 usage += "\n Related commands: plot2d projh1d projprof "; 627 mpiac->RegisterCommand(kw, usage, this );627 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 628 628 kw = "projprof"; 629 629 usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram "; … … 631 631 usage += "\n HProf nameprof is created if necessary "; 632 632 usage += "\n Related commands: plot2d projh2d "; 633 mpiac->RegisterCommand(kw, usage, this );633 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 634 634 635 635 kw = "fillnt"; … … 637 637 usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() Cut() nameNt"; 638 638 usage += "\n Related commands: plot2d projh1d projh2d projprof "; 639 mpiac->RegisterCommand(kw, usage, this );639 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 640 640 kw = "fillvec"; 641 641 usage = "Creates and Fills a Vector with X=f(Object)"; 642 642 usage += "\n Usage: fillvec nameobj f_X() Cut() nameVec [graphic_attributes]"; 643 643 usage += "\n Related commands: plot2d projh1d fillnt "; 644 mpiac->RegisterCommand(kw, usage, this );644 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 645 645 kw = "fillgd1"; 646 646 usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))"; 647 647 usage += "\n Usage: fillgd1 nameobj f_X() g_Y() h_ErrY() Cut() nameGfd"; 648 648 usage += "\n Related commands: plot2d fillnt "; 649 mpiac->RegisterCommand(kw, usage, this );649 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 650 650 kw = "fillgd2"; 651 651 usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)"; 652 652 usage += "\n Usage: fillgd1 nameobj f_X() g_Y() h_Z() k_ErrZ() Cut() nameGfd"; 653 653 usage += "\n Related commands: plot2d fillgd2 "; 654 mpiac->RegisterCommand(kw, usage, this );654 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 655 655 656 656 kw = "fit"; … … 658 658 usage += "\n Usage: fit nomobj func [Options]"; 659 659 usage += "\n [p:p1,...,pn s:s1,...,sn m:m1,...,mn M:M1,...,Mn o:... o:...]"; 660 mpiac->RegisterCommand(kw, usage, this );660 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting"); 661 661 662 662 -
trunk/SophyaPI/PIext/nobjmgr.cc
r326 r330 19 19 #include "nobjmgr.h" 20 20 #include "servnobjm.h" 21 #include "nomgadapter.h" 21 22 #include "pistdimgapp.h" 22 23 -
trunk/SophyaPI/PIext/piacmd.cc
r324 r330 24 24 PIAHelpWind(PIStdImgApp* par, PIACmd* piacmd); 25 25 virtual ~PIAHelpWind(); 26 virtual void Show(); 26 27 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(); } 27 32 inline void AddHelpItem(const char * hitem) 28 { mNitem++; hitemlist->AppendItem(hitem, 1000+mNitem); }33 { mNitem++; hitemlist->AppendItem(hitem, 100+mNitem); } 29 34 protected : 30 35 PIStdImgApp* dap; … … 32 37 int mNitem; 33 38 PIList* hitemlist; 39 PIOptMenu* hgrpom; 34 40 PIButton * mBut; 35 41 PILabel * mLab; … … 44 50 piac = piacmd; 45 51 mNitem = 0; 46 SetMsg(77 7);52 SetMsg(77); 47 53 48 54 int bsx, bsy; … … 53 59 tsx = 10*bsx+2*spx; tsy = 7*bsy+3*spy; 54 60 SetSize(tsx,tsy); 55 hitemlist = new PIList(this, "hitemlist", bsx*2.0, tsy-2*spy, spx/2, spy); 61 hgrpom = new PIOptMenu(this, "hgrpoptmen", bsx*2.0, bsy, spx/2, spy); 62 hgrpom->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 63 hitemlist = new PIList(this, "hitemlist", bsx*2.0, tsy-3*spy-bsy, spx/2, 2*spy+bsy); 56 64 hitemlist->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 57 65 // hitemlist->SetBorderWidth(2); … … 65 73 mLab->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 66 74 mLab->SetLabel(""); 67 mBut = new PIButton(this, "Close", 70 0, bsx, bsy, tsx-bsx*1.5-spx, tsy-spy-bsy);75 mBut = new PIButton(this, "Close", 70, bsx, bsy, tsx-bsx*1.5-spx, tsy-spy-bsy); 68 76 mBut->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 69 77 } … … 72 80 PIAHelpWind::~PIAHelpWind() 73 81 { 82 delete hgrpom; 74 83 delete hitemlist; 75 84 delete mTxt; … … 82 91 { 83 92 PIMessage um = UserMsg(msg); 84 if (((um == 77 7) && (ModMsg(msg) == PIMsg_Close)) || (um == 700) ) {93 if (((um == 77) && (ModMsg(msg) == PIMsg_Close)) || (um == 70) ) { 85 94 Hide(); 86 95 return; 87 96 } 88 else if ( (um > 1000) && (sender == hitemlist)) { 97 else if ( (um >= 20000) && (sender == hgrpom)) { // Selection de groupe de Help 98 mTxt->SetText(""); 99 mLab->SetLabel(""); 100 piac->UpdateHelpList(this, um-20000); 101 } 102 else if ( (um > 100) && (sender == hitemlist) && (ModMsg(msg) == PIMsg_Select) ) { 89 103 string s = hitemlist->GetSelectionStr(); 90 104 mTxt->SetText(piac->GetUsage(s)); … … 93 107 } 94 108 109 /* --Methode-- */ 110 void PIAHelpWind::Show() 111 { 112 hgrpom->SetValue(20000); // Groupe All 113 mTxt->SetText(""); 114 mLab->SetLabel(""); 115 piac->UpdateHelpList(this, 0); 116 PIWindow::Show(); 117 } 95 118 96 119 static PIACmd* curpiacmd = NULL; … … 105 128 gltimer = NULL; 106 129 130 cmdhgrp["All"] = 0; 131 cmdgrpid = 1; 132 cmdhgrp["Commands"] = 1; 107 133 helpwin = new PIAHelpWind(app, this); 134 helpwin->AddHelpGroup("All", 0); 135 helpwin->AddHelpGroup("Commands", 1); 108 136 109 137 string kw = "piacmd"; … … 120 148 usage += " > help <command_name> # <command_name> usage info \n"; 121 149 usage += " > helpwindow # Displays help window \n"; 122 RegisterCommand(kw, usage, NULL); 150 string grp = "Commands"; 151 RegisterHelp(kw, usage, grp); 123 152 124 153 basexec = new PIABaseExecutor(this, omg, app); … … 156 185 157 186 /* --Methode-- */ 158 void PIACmd::RegisterCommand(string& keyw, string& usage, CmdExecutor * ce) 159 { 160 // if (!ce) return; 187 void PIACmd::RegisterCommand(string& keyw, string& usage, CmdExecutor * ce, string grp) 188 { 189 if (!ce) { 190 RegisterHelp(keyw, usage, grp); 191 return; 192 } 193 int gid = CheckHelpGrp(grp); 161 194 cmdex cme; 195 cme.group = gid; 162 196 cme.us = usage; 163 197 cme.cex = ce; 164 198 cmdexmap[keyw] = cme; 165 if (helpwin) helpwin->AddHelpItem(keyw.c_str()); 199 } 200 201 /* --Methode-- */ 202 void PIACmd::RegisterHelp(string& keyw, string& usage, string& grp) 203 { 204 int gid = CheckHelpGrp(grp); 205 cmdex cme; 206 cme.group = gid; 207 cme.us = usage; 208 cme.cex = NULL; 209 helpexmap[keyw] = cme; 210 } 211 212 /* --Methode-- */ 213 int PIACmd::CheckHelpGrp(string& grp) 214 { 215 int gid=0; 216 CmdHGroup::iterator it = cmdhgrp.find(grp); 217 if (it == cmdhgrp.end()) { 218 cmdgrpid++; gid = cmdgrpid; 219 cmdhgrp[grp] = gid; 220 helpwin->AddHelpGroup(grp.c_str(), gid); 221 } 222 else gid = (*it).second; 223 return(gid); 224 } 225 226 /* --Methode-- */ 227 void PIACmd::UpdateHelpList(PIAHelpWind* hw, int gid) 228 { 229 helpwin->ClearHelpList(); 230 CmdExmap::iterator it; 231 for(it = helpexmap.begin(); it != helpexmap.end(); it++) { 232 if ( (gid != 0) && ((*it).second.group != gid) ) continue; 233 helpwin->AddHelpItem((*it).first.c_str()); 234 } 235 for(it = cmdexmap.begin(); it != cmdexmap.end(); it++) { 236 if ( (gid != 0) && ((*it).second.group != gid) ) continue; 237 helpwin->AddHelpItem((*it).first.c_str()); 238 } 166 239 } 167 240 … … 252 325 if (kw == "helpwindow") ShowHelpWindow(); 253 326 else 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; 258 331 } 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 } 275 333 276 334 else if (kw == "set") { … … 292 350 } 293 351 else if (kw == "listvars") { 294 cout << "---- PIACmd::Interpret() Command keywordList ----- \n";352 cout << "---- PIACmd::Interpret() Command Variable List ----- \n"; 295 353 CmdExmap::iterator it; 296 354 int kc = 0; … … 376 434 string& PIACmd::GetUsage(const string& kw) 377 435 { 436 bool fndok = false; 378 437 CmdExmap::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 ); 438 if (it == cmdexmap.end()) { 439 it = helpexmap.find(kw); 440 if (it != helpexmap.end()) fndok = true; 441 } 442 else fndok = true; 443 if (fndok) return( (*it).second.us ); 444 // Keyword pas trouve 445 if (videstr == NULL) videstr = new string(""); 446 *videstr = "Nothing known about " + kw + " ?? "; 447 return(*videstr); 448 384 449 } 385 450 -
trunk/SophyaPI/PIext/piacmd.h
r293 r330 53 53 // --------------------------------------------------------------------- 54 54 55 class PIAHelpWind; // Fenetre d'aide en ligne 56 55 57 class PIACmd : public CmdInterpreter { 56 58 public: … … 61 63 virtual string Name(); 62 64 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); 64 68 virtual void LoadModule(string& fnameso, string& name); 65 69 … … 77 81 inline PIStdImgApp* GetImgApp() { return(mImgApp); } 78 82 83 // Pour utilisation par PIAHelpWind uniquement 84 virtual void UpdateHelpList(PIAHelpWind* hw, int gid); 85 79 86 protected: 87 virtual int CheckHelpGrp(string& grp); 88 80 89 NamedObjMgr* mObjMgr; 81 90 PIStdImgApp* mImgApp; … … 84 93 CmdExecutor* basexec; 85 94 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 88 100 typedef map<string, cmdex, less<string> > CmdExmap; 89 101 CmdExmap cmdexmap; 102 CmdExmap helpexmap; // Pour les helps sans commande 90 103 91 104 // Pour garder la liste des modules -
trunk/SophyaPI/PIext/pihisto2d.cc
r318 r330 381 381 382 382 //++ 383 PIH2DWdg::PIH2DWdg(PIContainerGen *par, c har *nom, int sx, int sy, int px, int py)383 PIH2DWdg::PIH2DWdg(PIContainerGen *par, const char *nom, int sx, int sy, int px, int py) 384 384 // 385 385 // Createur d'un Widget de dessin d'histogramme 2D. -
trunk/SophyaPI/PIext/pihisto2d.h
r210 r330 61 61 class PIH2DWdg : public PIScDrawWdg { 62 62 public: 63 PIH2DWdg(PIContainerGen *par, c har *nom, int sx=300, int sy=300,63 PIH2DWdg(PIContainerGen *par, const char *nom, int sx=300, int sy=300, 64 64 int px=0, int py=0); 65 65 ~PIH2DWdg(); -
trunk/SophyaPI/PIext/servnobjm.cc
r326 r330 18 18 #include "nobjmgr.h" 19 19 #include "servnobjm.h" 20 #include "nomgadapter.h" 20 21 #include "pistdimgapp.h" 21 22 -
trunk/SophyaPI/PIext/servnobjm.h
r327 r330 19 19 #include "pdlmgr.h" 20 20 #include "dlftypes.h" 21 #include " nomgadapter.h"21 #include "anydataobj.h" 22 22 23 23 class NTuple; … … 26 26 class HProf; 27 27 class PIStdImgApp; 28 class NObjMgrAdapter; 28 29 29 30 class Services2NObjMgr {
Note:
See TracChangeset
for help on using the changeset viewer.