Changeset 1297 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Nov 7, 2000, 2:08:10 PM (25 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/cxxexecutor.cc
r1291 r1297 19 19 mIncList.resize(0); 20 20 mCallArgs.resize(0); 21 22 mIncImportList.resize(0); 23 mModuleImportList.resize(0); 24 25 // La liste de tous les modules que l'on peut ajouter 26 mModuleImportDefaultList.resize(0); 27 mModuleImportDefaultList.push_back("Samba"); 28 mModuleImportDefaultList.push_back("SkyMap"); 29 mModuleImportDefaultList.push_back("PMixer"); 21 30 22 31 // Gestion des fichiers par default dans TmpDir … … 74 83 75 84 kw = "c++include"; 76 usage = "c++include: give personnal includes to be used\n";85 usage = "c++include: add personnal includes to be used by executor\n"; 77 86 usage+= "Usage: c++include myinc1.h myinc2.h ...\n"; 78 usage+= " c++include -? : give currentinclude files\n";79 usage+= " c++include : reset currentinclude files\n";80 usage+= "Warning: to be used before c++create ...c++exec...";87 usage+= " c++include -? : list current additionnal include files\n"; 88 usage+= " c++include : reset to no additionnal include files\n"; 89 usage+= "Warning: to be used before c++create c++compile c++exec..."; 81 90 mpiac->RegisterCommand(kw, usage, this, hgrp); 82 91 83 92 kw = "c++compileopt"; 84 usage = "c++compileopt: give additionnal compile options\n";93 usage = "c++compileopt: add personnal compile options\n"; 85 94 usage+= "Usage: c++compileopt -g -O5 -IMy_Inc_Dir ...\n"; 86 usage+= " c++compileopt -? : give currentcompile options\n";87 usage+= " c++compileopt : reset currentcompile options\n";88 usage+= "Warning: to be used before c++c ompile";95 usage+= " c++compileopt -? : list current additionnal compile options\n"; 96 usage+= " c++compileopt : reset to no additionnal compile options\n"; 97 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 89 98 mpiac->RegisterCommand(kw, usage, this, hgrp); 90 99 91 100 kw = "c++linkopt"; 92 usage = "c++linkopt: give additionnal link options\n";101 usage = "c++linkopt: add personnal link options\n"; 93 102 usage+= "Usage: c++linkopt -g -O5 ...\n"; 94 usage+= " c++linkopt -? : give currentlink options\n";95 usage+= " c++linkopt : reset currentlink options\n";96 usage+= "Warning: to be used before c++c ompile";103 usage+= " c++linkopt -? : list current additionnal link options\n"; 104 usage+= " c++linkopt : reset to no additionnal link options\n"; 105 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 97 106 mpiac->RegisterCommand(kw, usage, this, hgrp); 98 107 99 108 kw = "c++mylibs"; 100 usage = "c++mylibs: give additionnal libraries\n";109 usage = "c++mylibs: add personnal libraries\n"; 101 110 usage+= "Usage: c++mylibs -LMy_Lib_Dir -lmylib1 -lmylib2 ...\n"; 102 usage+= " c++mylibs -? : give current additionnal libraries\n"; 103 usage+= " c++mylibs : reset current additionnal libraries\n"; 104 usage+= "Warning: to be used before c++compile"; 105 mpiac->RegisterCommand(kw, usage, this, hgrp); 106 111 usage+= " c++mylibs -? : list current additionnal libraries\n"; 112 usage+= " c++mylibs : reset to no additionnal libraries\n"; 113 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 114 mpiac->RegisterCommand(kw, usage, this, hgrp); 115 116 kw = "c++import"; 117 usage = "c++import: Sophya additionnal modules to be use in C++ executor\n"; 118 usage+= "Usage: c++import module1 ... : set list of modules to be used by executor\n"; 119 usage+= " c++import all : set all modules known by executor\n"; 120 usage+= " c++import : reset to no additionnal module\n"; 121 usage+= " c++import -? : list modules currently used in executor\n"; 122 usage+= " c++import -?? : list of available modules for executor\n"; 123 usage+= "Warning: to be used before c++create c++compile c++exec ..."; 124 mpiac->RegisterCommand(kw, usage, this, hgrp); 107 125 108 126 kw = "c++prtlevel"; … … 202 220 FillLinkLibs(tokens); 203 221 222 } else if(kw == "c++import") { 223 if(tokens.size()==1) { 224 if(tokens[0]=="-?") 225 {cout<<"c++import "<<GetModuleImport()<<endl; return(0);} 226 if(tokens[0]=="-??") { 227 cout<<"c++import possibilities :"<<endl; 228 if(mModuleImportDefaultList.size()>0) { 229 for(uint_4 i=0;i<mModuleImportDefaultList.size();i++) 230 cout<<" "<<mModuleImportDefaultList[i]; 231 cout<<endl; 232 } 233 return(0); 234 } 235 } 236 FillModuleImport(tokens); 237 204 238 } else if(kw == "c++prtlevel") { 205 239 if(tokens.size()==1) if(tokens[0]=="-?") … … 291 325 void CxxExecutor::PutInclude(ofstream& os) 292 326 { 293 os<<"#include \"machdefs.h\""<<endl 294 <<endl 295 296 <<"//---- System et stdc++ include files"<<endl 327 os<<"#include \"machdefs.h\""<<endl<<endl; 328 329 os<<"//---- System et stdc++ include files"<<endl 297 330 <<"#include <stdio.h>"<<endl 298 331 <<"#include <stdlib.h>"<<endl … … 323 356 <<"#include \"nobjmgr.h\""<<endl 324 357 <<"#include \"servnobjm.h\""<<endl 325 <<endl 326 358 <<endl; 359 360 os<<"//---- Include files from additionnal modules"<<endl; 361 if(mIncImportList.size()>0) 362 for(uint_4 i=0;i<mIncImportList.size();i++) 363 os<<"#include \""<<mIncImportList[i]<<"\""<<endl; 364 os<<endl; 365 366 os<<"//---- Objects and variables saving"<<endl 327 367 <<"#define KeepObj(obj) ___nomobj = #obj; omg.AddObj(obj,___nomobj);"<<endl 328 368 <<"#define KeepVar(var) ___nomobj = #var; omg.GetVarList().Get(___nomobj) = var ;"<<endl … … 708 748 return mMyLibs; 709 749 } 750 751 /* --Methode-- */ 752 void CxxExecutor::FillModuleImport(vector<string>& import) 753 { 754 mModuleImportList.resize(0); 755 mIncImportList.resize(0); 756 if(import.size()<1) return; 757 758 if(import[0]=="all" || import[0]=="All" || import[0]=="ALL") { 759 mModuleImportList = mModuleImportDefaultList; 760 } else { 761 for(uint_4 i=0;i<import.size();i++) mModuleImportList.push_back(import[i]); 762 } 763 764 // Set additionnal Includes 765 if(mModuleImportList.size()>0) 766 for(uint_4 i=0;i<mModuleImportList.size();i++) { 767 if( mModuleImportList[i]=="Samba") mIncImportList.push_back("samba.h"); 768 else if(mModuleImportList[i]=="SkyMap") mIncImportList.push_back("skymap.h"); 769 else if(mModuleImportList[i]=="PMixer") mIncImportList.push_back("pmixer.h"); 770 } 771 772 return; 773 } 774 775 void CxxExecutor::FillModuleImport(string& import) 776 { 777 mModuleImportList.resize(0); 778 vector<string> vsimport; 779 FillVStringFrString(import,vsimport,' '); 780 FillModuleImport(vsimport); 781 } 782 783 string CxxExecutor::GetModuleImport(void) 784 { 785 string dum = ""; 786 if(mModuleImportList.size()<1) return dum; 787 for(uint_4 i=0;i<mModuleImportList.size();i++) dum += mModuleImportList[i] + " "; 788 return dum; 789 } -
trunk/SophyaPI/PIext/cxxexecutor.h
r1289 r1297 67 67 string GetLinkLibs(void); 68 68 69 void FillModuleImport(vector<string>& import); 70 void FillModuleImport(string& import); 71 string GetModuleImport(void); 72 69 73 private: 70 74 string mUserCodeFn; … … 76 80 vector<string> mCallArgs; 77 81 82 // Import des modules 83 vector<string> mIncImportList; 84 vector<string> mModuleImportList; 85 vector<string> mModuleImportDefaultList; 86 87 78 88 string mDefTmp; 79 89 string mDefRoot; -
trunk/SophyaPI/PIext/cxxexecwin.cc
r1285 r1297 289 289 xtext = 7*bsx; 290 290 szx = (int)(xtext+1.5*bsx+3*spx); 291 szy = 6*bsy+7*spy;291 szy = 7*bsy+8*spy; 292 292 SetSize(szx, szy); 293 293 … … 326 326 mText[3] = new PIText(this,"LinkLib",xtext,bsy,px,py); 327 327 mText[3]->SetText(""); 328 329 px = spx; 330 py += spy+bsy; 331 mLab[4] = new PILabel(this,"Modules",1.5*bsx,bsy,px,py); 332 px += (int)(1.5*bsx+spx); 333 mText[4] = new PIText(this,"ModImp",xtext,bsy,px,py); 334 mText[4]->SetText(""); 328 335 329 336 // Creation de bouton d'action … … 353 360 delete mTit; 354 361 int i; 355 for(i=0; i< 4; i++) delete mLab[i];362 for(i=0; i<5; i++) delete mLab[i]; 356 363 for(i=0; i<3; i++) delete mBut[i]; 357 for(i=0; i< 4; i++) delete mText[i];364 for(i=0; i<5; i++) delete mText[i]; 358 365 } 359 366 … … 365 372 mText[2]->SetText(cxxex->GetLinkOpt()); 366 373 mText[3]->SetText(cxxex->GetLinkLibs()); 374 mText[4]->SetText(cxxex->GetModuleImport()); 367 375 PIWindow::Show(); 368 376 } … … 382 390 opt = mText[3]->GetText(); 383 391 cxxex->FillLinkLibs(opt); 392 opt = mText[4]->GetText(); 393 cxxex->FillModuleImport(opt); 384 394 break; 385 395 case 600: // Bouton Get Options … … 388 398 mText[2]->SetText(cxxex->GetLinkOpt()); 389 399 mText[3]->SetText(cxxex->GetLinkLibs()); 400 mText[4]->SetText(cxxex->GetModuleImport()); 390 401 break; 391 402 case 700: // Bouton Dismiss - On cache la fenetre -
trunk/SophyaPI/PIext/cxxexecwin.h
r1269 r1297 54 54 CxxExecutor * cxxex; 55 55 PILabel * mTit; 56 PILabel * mLab[ 4];56 PILabel * mLab[5]; 57 57 PIButton * mBut[3]; 58 PIText * mText[ 4];58 PIText * mText[5]; 59 59 }; 60 60 -
trunk/SophyaPI/PIext/pihisto2d.cc
r1091 r1297 611 611 SetSize(wszx, wszy); 612 612 613 // menu s bar613 // menu du style de display des bins 614 614 int cpx = 2*spx, cpy = 2*spy; 615 615 mOPop[0] = new PIOptMenu(this, "optmen-h2d-1" ,2*bsx,bsy,cpx,cpy); … … 621 621 mOPop[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 622 622 623 // Menu du choix de la dynamique 623 624 cpy += bsy+spy; 624 625 mOPop[1] = new PIOptMenu(this, "optmen-h2d-2",2*bsx,bsy,cpx,cpy); … … 628 629 mOPop[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 629 630 631 // Menu du choix des couleurs 630 632 cpy += bsy+spy; 631 633 mOPop[2] = new PIOptMenu(this, "optmen-h2d-3",2*bsx,bsy,cpx,cpy); 632 mOPop[2]->AppendItem("Black&White", 6301); 633 mOPop[2]->AppendItem("Grey32" , 6302); 634 mOPop[2]->AppendItem("GreyInv32" , 6303); 635 mOPop[2]->AppendItem("ColRJ32" , 6304); 636 mOPop[2]->AppendItem("ColBR32" , 6305); 637 mOPop[2]->AppendItem("ColRV32" , 6306); 638 mOPop[2]->AppendItem("Grey128" , 6307); 639 mOPop[2]->AppendItem("GreyInv128", 6308); 640 mOPop[2]->AppendItem("ColRJ128" , 6309); 641 mOPop[2]->AppendItem("ColBR128" , 6310); 642 mOPop[2]->AppendItem("Col16" , 6311); 643 sdum = "Black&White"; mOPop[2]->SetValueStr(sdum); 634 mOPop[2]->AppendItem("Black&White",7000); 635 mCasc[0] = new PIMenu(mOPop[2]->Menu(), "PIStd-128Col"); 636 mCasc[1] = new PIMenu(mOPop[2]->Menu(), "MIDAS-CMap"); 637 int kcc,nsct1=5,nsct2=9,nsct3=PIColorMap::NumberStandardColorMaps()-1; 638 for(kcc=0; kcc<nsct1; kcc++) 639 mOPop[2]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(),7001+kcc); 640 for(kcc=nsct1; kcc<nsct2; kcc++) 641 mCasc[0]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(),7001+kcc); 642 mOPop[2]->AppendPDMenu(mCasc[0]); 643 for(kcc=nsct2; kcc<nsct3; kcc++) 644 mCasc[1]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(),7001+kcc); 645 mOPop[2]->AppendPDMenu(mCasc[1]); 646 for(kcc=nsct3; kcc<PIColorMap::NumberStandardColorMaps(); kcc++) 647 mOPop[2]->AppendItem(PIColorMap::GetStandardColorMapName(kcc).c_str(),7001+kcc); 648 mOPop[2]->SetValue(7000); 644 649 mOPop[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 645 650 646 // Labels et zone de saisie texte651 // Labels et zones de saisie texte 647 652 cpy += 2*(bsy+spy); 648 653 mLab[0] = new PILabel(this, " Dyn: ",bsx,bsy,cpx,cpy); … … 696 701 int i; 697 702 if(dbg) printf("H2WinArg::~H2WinArg %lx\n",(long)this); 703 for(i=0;i<2;i++) delete mCasc[i]; 698 704 for(i=0;i<3;i++) delete mOPop[i]; 699 705 for(i=0;i<4;i++) delete mBut[i]; … … 706 712 void H2WinArg::SetText() 707 713 // 708 // Gestion des fenetres de saisie de texte .714 // Gestion des fenetres de saisie de texte et des pop-menus. 709 715 //-- 710 716 { … … 726 732 else if(mTypScal==1) { sdum="Log10"; mOPop[1]->SetValueStr(sdum);} 727 733 728 if(!mFgCol) { sdum="Black&White";mOPop[2]->SetValueStr(sdum);}734 if(!mFgCol) {mOPop[2]->SetValue(7000);} 729 735 else { 730 if(mCmap==CMAP_GREY32) { sdum="Grey32"; mOPop[2]->SetValueStr(sdum);} 731 else if(mCmap==CMAP_GREYINV32) { sdum="GreyInv32"; mOPop[2]->SetValueStr(sdum);} 732 else if(mCmap==CMAP_COLRJ32) { sdum="ColRJ32"; mOPop[2]->SetValueStr(sdum);} 733 else if(mCmap==CMAP_COLBR32) { sdum="ColBR32"; mOPop[2]->SetValueStr(sdum);} 734 else if(mCmap==CMAP_COLRV32) { sdum="ColRV32"; mOPop[2]->SetValueStr(sdum);} 735 else if(mCmap==CMAP_GREY128) { sdum="Grey128"; mOPop[2]->SetValueStr(sdum);} 736 else if(mCmap==CMAP_GREYINV128) { sdum="GreyInv128"; mOPop[2]->SetValueStr(sdum);} 737 else if(mCmap==CMAP_COLRJ128) { sdum="ColRJ128"; mOPop[2]->SetValueStr(sdum);} 738 else if(mCmap==CMAP_COLBR128) { sdum="ColBR128"; mOPop[2]->SetValueStr(sdum);} 739 else if(mCmap==CMAP_COL16) { sdum="Col16"; mOPop[2]->SetValueStr(sdum);} 736 for(int kk=0;kk<PIColorMap::NumberStandardColorMaps();kk++) 737 if(mCmap == PIColorMap::GetStandardColorMapId(kk)) 738 {mOPop[2]->SetValue(7001+kk); break;} 740 739 } 741 740 … … 788 787 else if (opt == 6202) { mTypScal = 1; } 789 788 790 else if (opt == 6301) { mFgCol = false; } 791 else if (opt == 6302) { mFgCol = true; mCmap = CMAP_GREY32; } 792 else if (opt == 6303) { mFgCol = true; mCmap = CMAP_GREYINV32; } 793 else if (opt == 6304) { mFgCol = true; mCmap = CMAP_COLRJ32; } 794 else if (opt == 6305) { mFgCol = true; mCmap = CMAP_COLBR32; } 795 else if (opt == 6306) { mFgCol = true; mCmap = CMAP_COLRV32; } 796 else if (opt == 6307) { mFgCol = true; mCmap = CMAP_GREY128; } 797 else if (opt == 6308) { mFgCol = true; mCmap = CMAP_GREYINV128; } 798 else if (opt == 6309) { mFgCol = true; mCmap = CMAP_COLRJ128; } 799 else if (opt == 6310) { mFgCol = true; mCmap = CMAP_COLBR128; } 800 else if (opt == 6311) { mFgCol = true; mCmap = CMAP_COL16; } 789 else if (opt == 7000) { mFgCol = false; } 790 791 else if (opt >= 7001 && opt <8000) { 792 int k = opt-7001; 793 mFgCol = true; 794 mCmap = PIColorMap::GetStandardColorMapId(k); 795 } 801 796 802 797 else if (opt == 6401) mFPoints = mPScal->GetValue()/100.; -
trunk/SophyaPI/PIext/pihisto2d.h
r330 r1297 92 92 93 93 PIOptMenu * mOPop[3]; 94 PIMenu * mCasc[2]; 94 95 PIButton * mBut[4]; 95 96 PILabel * mLab[4];
Note:
See TracChangeset
for help on using the changeset viewer.