Changeset 2490 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Jan 2, 2004, 12:31:36 AM (22 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r2460 r2490 108 108 109 109 /* --Methode-- */ 110 NamedObjMgr::NamedObjMgr() 111 { 110 NamedObjMgr::NamedObjMgr(bool fgimgapp) 111 { 112 _fgimgapp = fgimgapp; 112 113 if (fgOInit == 0) { 113 114 myNObj = 0; … … 302 303 if (myImgApp) { 303 304 string str = '/' + dirname; 305 if ( !_fgimgapp ) ZSync(myImgApp->getMutex(),2); 304 306 (myImgApp->ObjMgrW())->AddDirectory(str.c_str(), myDirId); 305 307 } … … 333 335 } 334 336 335 if (myImgApp) 337 if (myImgApp) { 338 if ( !_fgimgapp ) ZSync(myImgApp->getMutex(),2); 336 339 (myImgApp->ObjMgrW())->DelDirectory((*it).second.id); 340 } 337 341 myDirs->erase(it); 338 342 if (verbeux) cout << "NamedObjMgr::DeleteDir() " << dirname << " deleted " << endl; … … 459 463 list<string>::iterator ii; 460 464 for(ii=odel.begin(); ii != odel.end(); ii++) DelObj(*ii,true); 461 if (myImgApp) 465 if (myImgApp) { 466 if ( !_fgimgapp ) ZSync(myImgApp->getMutex(),2); 462 467 (myImgApp->ObjMgrW())->UpdateList(did); 468 } 463 469 } 464 470 … … 561 567 (*itr).second.nobj++; 562 568 563 if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) { 564 string oln = nobj + " (T= " + no.obja->GetDataObjType() + ")" ; 565 (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid); 566 } 569 if (myImgApp != NULL) { 570 if ( !_fgimgapp ) ZSync(myImgApp->getMutex(),2); 571 if ( (myImgApp->ObjMgrW())->Visible() ) { 572 string oln = nobj + " (T= " + no.obja->GetDataObjType() + ")" ; 573 (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid); 574 } 575 } 567 576 if (verbeux) cout << "NamedObjMgr::AddObj() Object " << nom << " ( " 568 577 << typeid(*obj).name() << " ) added (Total= " << myObjs->size() << ")" << endl; … … 632 641 (*itr).second.nobj++; 633 642 634 if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) { 635 (myImgApp->ObjMgrW())->DelObjList(dids, no.oid); 636 string oln = n2 + " (T= " + no.obja->GetDataObjType() + ")" ; 637 (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid); 643 if (myImgApp != NULL) { 644 if ( !_fgimgapp ) ZSync(myImgApp->getMutex(),2); 645 if ( (myImgApp->ObjMgrW())->Visible() ) { 646 (myImgApp->ObjMgrW())->DelObjList(dids, no.oid); 647 string oln = n2 + " (T= " + no.obja->GetDataObjType() + ")" ; 648 (myImgApp->ObjMgrW())->AddObjList(did, oln.c_str(), no.oid); 649 } 638 650 } 639 651 if (verbeux) … … 681 693 if (fgd) delete (*it).second.obj; 682 694 683 if ( (myImgApp != NULL) && (myImgApp->ObjMgrW())->Visible() ) { 684 int olid = (*it).second.oid; 685 (myImgApp->ObjMgrW())->DelObjList(did, olid); 695 if (myImgApp != NULL) { 696 if ( !_fgimgapp ) ZSync(myImgApp->getMutex(),2); 697 if ( (myImgApp->ObjMgrW())->Visible() ) { 698 int olid = (*it).second.oid; 699 (myImgApp->ObjMgrW())->DelObjList(did, olid); 700 } 686 701 } 687 702 myObjs->erase(it); … … 1474 1489 { 1475 1490 if (!myImgApp) return; 1491 if ( !_fgimgapp ) ZSync(myImgApp->getMutex(),2); 1492 1476 1493 (myImgApp->ObjMgrW())->ClearObjList(); 1477 1494 -
trunk/SophyaPI/PIext/nobjmgr.h
r2322 r2490 26 26 public: 27 27 // Constructeur et destructeur 28 NamedObjMgr( );28 NamedObjMgr(bool fgimgapp=false); 29 29 virtual ~NamedObjMgr(); 30 30 … … 107 107 static bool CheckDirName(string & nom); 108 108 static int ParseObjectName(string & nom, string & nomrep, string & nomobj); 109 110 protected: 111 bool _fgimgapp; // true -> cree par PIStdImgApp / pour gestion de thread 109 112 }; 110 113 -
trunk/SophyaPI/PIext/piacmd.cc
r2489 r2490 146 146 // static PIACmd* curpiacmd = NULL; 147 147 /* --Methode-- */ 148 PIACmd::PIACmd( NamedObjMgr* omg,PIStdImgApp* app)148 PIACmd::PIACmd(PIStdImgApp* app) 149 149 : Commander() 150 150 { 151 mObjMgr = omg;151 mObjMgr = new NamedObjMgr; 152 152 mImgApp = app; 153 153 helpwin = new PIAHelpWind(app, this); … … 165 165 RegisterCommand(kw, usage, NULL, grp); 166 166 167 basexec = new PIABaseExecutor(this, omg, app);167 basexec = new PIABaseExecutor(this, mObjMgr, app); 168 168 fitexec = new PIAFitter(this, app); 169 169 pawexec = new PAWExecutor(this, app); … … 188 188 PIACmd::~PIACmd() 189 189 { 190 190 delete mObjMgr; 191 191 delete helpwin; 192 192 delete cxxexwin; -
trunk/SophyaPI/PIext/piacmd.h
r2486 r2490 35 35 // static PIACmd* GetInterpreter(); 36 36 37 PIACmd( NamedObjMgr* omg,PIStdImgApp* app);37 PIACmd(PIStdImgApp* app); 38 38 virtual ~PIACmd(); 39 39 -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2489 r2490 251 251 // RedirectStdOutErr(true); pas par defaut 252 252 253 mObjMgr = new NamedObjMgr ;254 mCmd = new PIACmd( mObjMgr,this);253 mObjMgr = new NamedObjMgr(true); 254 mCmd = new PIACmd(this); 255 255 256 256 // Pas trop de message de la part de NamedObjMgr … … 322 322 323 323 SetReady(); 324 fg_glsynlock = false; 324 325 } 325 326 … … 418 419 } 419 420 420 bool fg_gls_lock = false; 421 421 422 while (mStop) { 422 423 thr_glsyn.lock(); // <ZThread> 424 fg_glsynlock = true; 423 425 while (XtAppPending(*appctx) != 0) { 424 426 XtAppNextEvent(*appctx, &evt); 425 427 XtDispatchEvent(&evt); 426 428 } 429 fg_glsynlock = false; 427 430 thr_glsyn.unlock(); // <ZThread> 428 431 // thr_glsyn.wait(); -
trunk/SophyaPI/PIext/pistdimgapp.h
r2486 r2490 58 58 virtual void Run(); 59 59 inline ZMutex & getMutex() { return thr_glsyn; } 60 inline bool isGlSyncLocked() { return fg_glsynlock; } 60 61 61 62 // Methodes d'Affichage generique … … 234 235 // Attributs pour controle de thread 235 236 ZMutex thr_glsyn; 237 bool fg_glsynlock; // true: thr_glsyn locke pour traitement evts 236 238 }; 237 239
Note:
See TracChangeset
for help on using the changeset viewer.