Changeset 3370 in Sophya for trunk/SophyaPI/PIext/pistdimgapp.cc
- Timestamp:
- Oct 31, 2007, 11:49:04 PM (18 years ago)
- File:
-
- 1 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:
Note:
See TracChangeset
for help on using the changeset viewer.