Changeset 2762 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- May 24, 2005, 6:31:58 PM (20 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/cxxexecutor.cc
r2755 r2762 156 156 } 157 157 // Pour synchronisation d'execution simultanee 158 ZSync zs(mutx_cxxe , 2); zs.NOp(); // 2 -> broadcast lors de la destruction158 ZSync zs(mutx_cxxe); zs.NOp(); 159 159 160 160 rc = ExecuteCXX(toks); if(rc) return(1); … … 166 166 } 167 167 // Pour synchronisation d'execution simultanee 168 ZSync zs(mutx_cxxe , 2); zs.NOp(); // 2 -> broadcast lors de la destruction168 ZSync zs(mutx_cxxe); zs.NOp(); 169 169 170 170 rc = FillUserCode(tokens[0]); if(rc) return(1); … … 188 188 } 189 189 // Pour synchronisation d'execution simultanee 190 ZSync zs(mutx_cxxe , 2); zs.NOp(); // 2 -> broadcast lors de la destruction190 ZSync zs(mutx_cxxe); zs.NOp(); 191 191 192 192 rc = FillUserCode(toks,2); if(rc) return(1); … … 200 200 } 201 201 // Pour synchronisation d'execution simultanee 202 ZSync zs(mutx_cxxe , 2); zs.NOp(); // 2 -> broadcast lors de la destruction202 ZSync zs(mutx_cxxe); zs.NOp(); 203 203 204 204 rc = FillUserCode(tokens[2]); if(rc) return(1); … … 210 210 } else if(kw == "c++compile") { 211 211 // Pour synchronisation d'execution simultanee 212 ZSync zs(mutx_cxxe , 2); zs.NOp(); // 2 -> broadcast lors de la destruction212 ZSync zs(mutx_cxxe); zs.NOp(); 213 213 214 214 if(tokens.size()>=1) rc = Compile(tokens[0]); … … 218 218 } else if(kw == "c++link") { 219 219 // Pour synchronisation d'execution simultanee 220 ZSync zs(mutx_cxxe , 2); zs.NOp(); // 2 -> broadcast lors de la destruction220 ZSync zs(mutx_cxxe); zs.NOp(); 221 221 222 222 if(tokens.size()>=2) rc = Link(tokens[0],tokens[1]); -
trunk/SophyaPI/PIext/nobjmgr.cc
r2757 r2762 499 499 list<string>::iterator ii; 500 500 for(ii=odel.begin(); ii != odel.end(); ii++) DelObj_P(*ii,true); 501 if (myImgApp) { 502 if ( !_fgimgapp ) myImgApp->LockMutex(); 503 (myImgApp->ObjMgrW())->UpdateList(did); 504 if ( !_fgimgapp ) myImgApp->UnlockMutex(true); 505 } 501 502 UpdateObjMgrWindow_P(did); // On met a jour la fenetre de gestion des objets 506 503 } 507 504 … … 1388 1385 else if (arr) wrsid = myImgApp->DispImage(arr, n1, dopt, false, 0, fglock); 1389 1386 1390 AddWRsId (nom, wrsid);1387 AddWRsId_P(nom, wrsid); 1391 1388 return; 1392 1389 } … … 1429 1426 wrsid = myImgApp->DispImage(arr, n1, dopt, fgimagnav, 0, fglock); 1430 1427 1431 AddWRsId (nom, wrsid);1428 AddWRsId_P(nom, wrsid); 1432 1429 return; 1433 1430 } … … 1476 1473 PISurfaceDrawer* sdr = new PISurfaceDrawer(arr, true, true, true); 1477 1474 wrsid = myImgApp->Disp3DDrawer(sdr, n1, dopt, "", 0, fglock); 1478 AddWRsId (nom, wrsid);1475 AddWRsId_P(nom, wrsid); 1479 1476 return; 1480 1477 } … … 1533 1530 } 1534 1531 1535 AddWRsId (nom, wrsid);1532 AddWRsId_P(nom, wrsid); 1536 1533 return; 1537 1534 } … … 1597 1594 } 1598 1595 1599 AddWRsId (nom, wrsid);1596 AddWRsId_P(nom, wrsid); 1600 1597 1601 1598 return; … … 1712 1709 void NamedObjMgr::AddWRsId(string & nom, int wrsid) 1713 1710 { 1711 ZSync zs(*myMutex); zs.NOp(); 1712 AddWRsId_P(nom, wrsid); 1713 } 1714 1715 /* --Methode-- */ 1716 void NamedObjMgr::AddWRsId_P(string & nom, int wrsid) 1717 { 1714 1718 if(wrsid != 0) { 1715 1719 NObjList::iterator it = myObjs->find(nom); … … 1724 1728 { 1725 1729 if (!myImgApp) return; 1726 //RZDEL ZSync zs(*myMutex); zs.NOp(); 1730 ZSync zs(*myMutex); zs.NOp(); 1731 UpdateObjMgrWindow_P(did); 1732 } 1733 1734 /* --Methode-- */ 1735 void NamedObjMgr::UpdateObjMgrWindow_P(int did) 1736 { 1737 if (!myImgApp) return; 1727 1738 if ( !_fgimgapp ) myImgApp->LockMutex(); 1739 if ( !(myImgApp->ObjMgrW())->Visible() || 1740 ( (myImgApp->ObjMgrW())->GetCurDirId() != did) ) { 1741 if ( !_fgimgapp ) myImgApp->UnlockMutex(true); 1742 return; 1743 } 1728 1744 1729 1745 (myImgApp->ObjMgrW())->ClearObjList(); … … 1738 1754 (myImgApp->ObjMgrW())->AddObj(cn.c_str(), (*it).second.oid); 1739 1755 } 1740 1741 1756 if ( !_fgimgapp ) myImgApp->UnlockMutex(true); 1757 return; 1742 1758 } 1743 1759 -
trunk/SophyaPI/PIext/nobjmgr.h
r2755 r2762 101 101 virtual void SetTmpDir(string const& tmpdir); 102 102 103 // Ajoute un identificateur d'objet widget/drawer/fenetre pour l'objet nom 104 // Ces identificateurs servent lors de la destruction de l'objet nom 103 105 virtual void AddWRsId(string & nom, int wrsid); 104 106 // Pour utilisation par ObjMgrWind … … 111 113 112 114 protected: 115 // Les methodes _P sont celles SANS ZSync() - pour un usage interne par NamedObjMgr 113 116 virtual bool CreateDir_P(string & dirname); 114 117 virtual void CleanDir_P(string & dirname); … … 121 124 virtual void SaveObj_P(string & nom, POutPersist& s, bool keeppath=false); 122 125 126 virtual void AddWRsId_P(string & nom, int wrsid); 127 virtual void UpdateObjMgrWindow_P(int did); 128 123 129 bool _fgimgapp; // true -> cree par PIStdImgApp / pour gestion de thread 124 130 }; -
trunk/SophyaPI/PIext/piaversion.h
r2677 r2762 2 2 #define PIAPPVERSION_H_SEEN 3 3 4 #define PIAPP_VERSIONNUMBER 3.98 4 #define PIAPP_VERSIONNUMBER 3.985 5 5 6 6 #endif -
trunk/SophyaPI/PIext/pisiadw.cc
r2615 r2762 76 76 cdir = '/' + cdir; 77 77 dirlist->SetValueStr(cdir); 78 dap->ObjMgr()->UpdateObjMgrWindow( dirlist->GetValue()-30000);78 dap->ObjMgr()->UpdateObjMgrWindow( GetCurDirId() ); 79 79 PIWindow::Show(); 80 80 return; … … 159 159 { 160 160 if (!Visible()) return; 161 if (did != (dirlist->GetValue()-30000) ) return;161 if (did != GetCurDirId() ) return; 162 162 dap->ObjMgr()->UpdateObjMgrWindow(did); 163 163 return; -
trunk/SophyaPI/PIext/pisiadw.h
r685 r2762 38 38 inline void AddObj(const char * objn, int oid) 39 39 { mNitem++; objlist->AppendItem(objn, oid); } 40 inline int GetCurDirId() { return (dirlist->GetValue()-30000); } 40 41 41 42 virtual void UpdateList(int did); -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2755 r2762 763 763 piin->ImageWdg()->ShowCursor(true); 764 764 pii = piin->ImageWdg(); 765 piin->SetUserData(NULL, oid); 765 766 pii->SetUserData(NULL, oid); 766 767 // XSync(PIXDisplay(), False); … … 805 806 mLastWdg = pii; 806 807 mBWId++; 807 mBWList[mBWId] = pii; 808 if (fgimagnav) mBWList[mBWId] = piin; 809 else mBWList[mBWId] = pii; 808 810 // pii->Refresh(); 809 811 pii->Apply(true); … … 1505 1507 for(it = mBWList.begin(); it != mBWList.end(); it++) 1506 1508 if ((*it).second == w) { mBWList.erase(it); break; } 1507 PIBaseWdg* bw = dynamic_cast<PIBaseWdg *>(w); 1509 PIBaseWdg* bw = NULL; 1510 if (w->kind() == PIImageNavigator::ClassId) { 1511 PIImageNavigator* piin = dynamic_cast<PIImageNavigator *>(w); 1512 if (piin) bw = piin->ImageWdg(); 1513 } 1514 else bw = dynamic_cast<PIBaseWdg *>(w); 1508 1515 if (bw != NULL) { 1509 1516 PIDrawer* drw; … … 1517 1524 } 1518 1525 1519 // Reza Fev 2005 - On met systematiquement mCurWdg et mLastWdg a NULL 1520 // Il peuvent en effet etre un des fils du widget qui est supprime 1521 // if (w == mCurWdg) { 1522 if (true) { // Reza Fev 2005 - mCurWdg = NULL systematique 1526 if ( (w == mCurWdg) || (bw == mCurWdg) ) { 1523 1527 mCurWdg = NULL; 1524 1528 if (mFgCWImg) { … … 1529 1533 } 1530 1534 1531 // if (w == mLastWdg) mLastWdg = NULL; 1532 mLastWdg = NULL; // Reza Fev 2005 - mLastWdg = NULL systematique 1535 if ( (w == mLastWdg) || (bw == mLastWdg) ) mLastWdg = NULL; 1533 1536 1534 1537 PIWdg* pw=NULL; 1535 1538 pw = (PIWdg*)(w->Parent()); 1536 1539 //DBG printf("DeleteWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin); 1537 if (dw) { 1538 if (pw && (pw->kind() == PIImageNavigator::ClassId) ) { 1539 delete pw; 1540 pw = NULL; 1541 } 1542 else delete w; 1543 } 1544 if (dwin && pw && (pw->kind() == PIWindow::ClassId )) { 1545 PIWindow* pww = dynamic_cast<PIWindow *>(pw); 1546 if (pww && (pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 1540 if (dw) delete w; 1541 1542 if (dwin && pw) { 1543 PIWindow* pww = dynamic_cast<PIWindow *>(pw); 1544 if (pww && (pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 1547 1545 DeleteWindow((PIWindow*)pw); 1548 }1546 } 1549 1547 return; 1550 1548 } … … 1911 1909 if (mCurWdg) { 1912 1910 int oid = mCurWdg->UserFlag(); 1913 DeleteWidget(mCurWdg);1911 //RZDEL-Mai2005 DeleteWidget(mCurWdg); 1914 1912 mObjMgr->DelObj_Id(oid); 1915 1913 } -
trunk/SophyaPI/PIext/servnobjm.cc
r2755 r2762 108 108 109 109 // Pour synchronisation d'execution simultanee 110 ZSync zs(mutx_dynlink , 2); zs.NOp(); // 2 -> broadcast lors de la destruction110 ZSync zs(mutx_dynlink); zs.NOp(); 111 111 112 112 cmd = "rm -f " + fname; … … 145 145 if (!mImgapp) return; 146 146 // Pour synchronisation d'execution simultanee 147 ZSync zs(mutx_dynlink , 2); zs.NOp(); // 2 -> broadcast lors de la destruction147 ZSync zs(mutx_dynlink); zs.NOp(); 148 148 149 149 cmd = "rm " + fname; … … 176 176 { 177 177 // Pour synchronisation d'execution simultanee 178 ZSync zs(mutx_dynlink , 2); zs.NOp(); // 2 -> broadcast lors de la destruction178 ZSync zs(mutx_dynlink); zs.NOp(); 179 179 DlFunctionOfX f = (DlFunctionOfX) LinkFunctionFromFile(fname, func); 180 180 if (!f) return; … … 189 189 { 190 190 // Pour synchronisation d'execution simultanee 191 ZSync zs(mutx_dynlink , 2); zs.NOp(); // 2 -> broadcast lors de la destruction191 ZSync zs(mutx_dynlink); zs.NOp(); 192 192 DlFunctionOfXY f = (DlFunctionOfXY) LinkFunctionFromFile(fname, func); 193 193 if (!f) return; … … 894 894 895 895 // Pour synchronisation d'execution simultanee 896 ZSync zs(mutx_dynlink , 2); zs.NOp(); // 2 -> broadcast lors de la destruction896 ZSync zs(mutx_dynlink); zs.NOp(); 897 897 898 898 NTLoopExprFunc f = (NTLoopExprFunc)LinkFunctionFromFile(fname, funcname); … … 1191 1191 1192 1192 // Pour synchronisation d'execution simultanee 1193 ZSync zs(mutx_dynlink , 2); zs.NOp(); // 2 -> broadcast lors de la destruction1193 ZSync zs(mutx_dynlink); zs.NOp(); 1194 1194 1195 1195 PlotExprFunc f = LinkExprFunc(vardec, expx, expy, expz, expt, expcut);
Note:
See TracChangeset
for help on using the changeset viewer.