Changeset 3370 in Sophya for trunk/SophyaPI
- Timestamp:
- Oct 31, 2007, 11:49:04 PM (18 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pistdimgapp.cc
r3366 r3370 162 162 m[5] = new PIMenu(Menubar(),"Special"); 163 163 m[5]->AppendItem("CloseAll", 10601); 164 m[5]->AppendCheckItem("Red.Out/Err", 10602);164 // m[5]->AppendCheckItem("Red.Out/Err", 10602); 165 165 m[5]->AppendCheckItem("Catch SigFPE", 10603); 166 166 m[5]->AppendCheckItem("Catch SigSEGV", 10604); … … 257 257 mCons->AcceptCmd(true, 50); 258 258 consolecont->Show(); 259 redirecout = false;260 // RedirectStdOutErr(true); paspar defaut259 redirecout = NORED_OE; 260 RedirectStdOutErr(NORED_OE); // pas de redirect par defaut 261 261 262 262 mFgScSz = sfgsz; … … 1739 1739 1740 1740 /* --Methode-- */ 1741 void PIStdImgApp::RedirectStdOutErr(bool fg) 1742 { 1743 if (fg) { 1744 RedirectOutStream(mCons); 1745 RedirectErrStream(mCons); 1746 m[5]->SetStateMsg(10602, true); 1747 redirecout = true; 1748 } 1749 else { 1750 RedirectOutStream(NULL); 1751 RedirectErrStream(NULL); 1752 m[5]->SetStateMsg(10602, false); 1753 redirecout = false; 1754 } 1741 void PIStdImgApp::RedirectStdOutErr(RED_OUTERR_FLG redflg) 1742 { 1743 if (redflg == redirecout) return; 1744 string fnout = ObjMgr()->GetTmpDir() + "/sout.log"; 1745 string fnerr = ObjMgr()->GetTmpDir() + "/serr.log"; 1746 bool drfg = false; 1747 PIConsole* pcons = NULL; 1748 switch (redflg) { 1749 case NORED_OE : 1750 pcons = NULL; 1751 break; 1752 case CONSRED_OE : 1753 pcons = mCons; 1754 drfg = false; 1755 break; 1756 case DOUBLERED_OE: 1757 pcons = mCons; 1758 drfg = true; 1759 break; 1760 } 1761 1762 char piva = PIVA_Def; 1763 RedirectOutStream(pcons, fnout, drfg, piva); 1764 // ancienne maniere redirect, avec pipe : RedirectOutStream(pcons, piva); 1765 piva = PIVA_Red; 1766 RedirectErrStream(pcons, fnerr, drfg, piva); 1767 // ancienne maniere redirect, avec pipe : RedirectErrStream(pcons, piva); 1768 1769 // m[5]->SetStateMsg(10602, false); 1770 redirecout = redflg; 1755 1771 return; 1756 1772 } … … 2316 2332 CloseAllWindows(); 2317 2333 break; 2318 case 10602: 2334 /* 2335 case 10602: 2319 2336 RedirectStdOutErr(*((bool*)data)); 2320 2337 break; 2338 */ 2321 2339 case 10603: 2322 2340 case 10604: -
trunk/SophyaPI/PIext/pistdimgapp.h
r3366 r3370 39 39 40 40 enum DispWinEnum {Disp_Default, Disp_Next, Disp_Win, Disp_Same, Disp_Stack, Disp_Inset}; 41 // Flag de redirection stdout/stderr 42 enum RED_OUTERR_FLG { NORED_OE, CONSRED_OE, DOUBLERED_OE }; 43 41 44 42 45 typedef map<long, PIWindow*, less<long> > WindMList; … … 150 153 151 154 // Redirection ou Non de StdOut/StdErr 152 void RedirectStdOutErr( bool fg = true);153 inline boolHasRedirectedStdOutErr() { return(redirecout); }155 void RedirectStdOutErr(RED_OUTERR_FLG redflg=CONSRED_OE); 156 inline RED_OUTERR_FLG HasRedirectedStdOutErr() { return(redirecout); } 154 157 // Gestion des signaux 155 158 void CatchSignals(bool fgfpe=true, bool fgsegv=true); … … 213 216 PIContainer* consolecont; // Container pour la PIConsole 214 217 PIConsole* mCons; 215 bool redirecout; // true if stdout/err redirected to mCons;218 RED_OUTERR_FLG redirecout; // flag de redirection vers mCons, ou NORED ou vers mCons+terminal; 216 219 217 220 WindMList mWList; -
trunk/SophyaPI/PIext/servnobjm.cc
r3279 r3370 999 999 for(i=0; i<10; i++) xnt[i] = 0.; 1000 1000 1001 1002 // $CHECK$ A virer des que possible - Pb blocage application quand trop d'impression1003 // redirige - On redirige la sortie sur le terminal1004 bool red = mImgapp->HasRedirectedStdOutErr();1005 mImgapp->RedirectStdOutErr(false);1006 1007 1001 int_8 k1,k2,dk; 1008 1002 k1 = 0; k2 = objnt->NbLines(); dk = 1; … … 1042 1036 if (adel) delete objnt; // Delete de l'objet NTupleInterface si necessaire 1043 1037 CloseDLL(); 1044 1045 // $CHECK$ A virer des que possible On redirige la sortie sur la fenetre PIConsole1046 mImgapp->RedirectStdOutErr(red);1047 1038 1048 1039 if (fgnnt) MyObjMgr()->AddObj(nt, nomnt);
Note:
See TracChangeset
for help on using the changeset viewer.