- Timestamp:
- May 23, 2005, 6:33:02 PM (20 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2718 r2755 53 53 /* Macro pour tester si flag normalized coordinate est present */ 54 54 #define _CkBoolNC_(_jk_) ((tokens.size()>_jk_) && (tokens[_jk_] == "true")) ? true : false; 55 55 56 56 57 /* --Methode-- */ 57 58 int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks) … … 1125 1126 1126 1127 return(0); 1128 } 1129 1130 /* --Methode-- */ 1131 bool PIABaseExecutor::IsThreadable(string const & keyw) 1132 { 1133 if ( (keyw == "fillvec") || (keyw == "fillmtx") || 1134 (keyw == "fillnt") || (keyw == "ntloop") ) return true; 1135 else if (keyw.substr(0,4) == "func") return true; 1136 else { 1137 string skw = keyw.substr(0,5); 1138 if ( (skw == "plot2") || (skw == "plot3") || (skw == "projh") ) return true; 1139 } 1140 return false; 1127 1141 } 1128 1142 -
trunk/SophyaPI/PIext/basexecut.h
r1276 r2755 14 14 virtual ~PIABaseExecutor(); 15 15 virtual int Execute(string& keyw, vector<string>& args, string& toks); 16 virtual bool IsThreadable(string const & keyw); 16 17 17 18 protected : -
trunk/SophyaPI/PIext/cxxexecutor.cc
r2616 r2755 155 155 return(1); 156 156 } 157 // Pour synchronisation d'execution simultanee 158 ZSync zs(mutx_cxxe, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 159 157 160 rc = ExecuteCXX(toks); if(rc) return(1); 158 161 … … 162 165 return(1); 163 166 } 167 // Pour synchronisation d'execution simultanee 168 ZSync zs(mutx_cxxe, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 169 164 170 rc = FillUserCode(tokens[0]); if(rc) return(1); 165 171 if(tokens.size()>1) rc = FillUserFctFrF(tokens[1]); … … 181 187 return(1); 182 188 } 189 // Pour synchronisation d'execution simultanee 190 ZSync zs(mutx_cxxe, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 191 183 192 rc = FillUserCode(toks,2); if(rc) return(1); 184 193 rc = FillUserFctFrS(); if(rc) return(1); … … 190 199 return(1); 191 200 } 201 // Pour synchronisation d'execution simultanee 202 ZSync zs(mutx_cxxe, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 203 192 204 rc = FillUserCode(tokens[2]); if(rc) return(1); 193 205 if(tokens.size()>3) rc = FillUserFctFrF(tokens[3]); … … 197 209 198 210 } else if(kw == "c++compile") { 211 // Pour synchronisation d'execution simultanee 212 ZSync zs(mutx_cxxe, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 213 199 214 if(tokens.size()>=1) rc = Compile(tokens[0]); 200 215 else rc = Compile(); … … 202 217 203 218 } else if(kw == "c++link") { 219 // Pour synchronisation d'execution simultanee 220 ZSync zs(mutx_cxxe, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 221 204 222 if(tokens.size()>=2) rc = Link(tokens[0],tokens[1]); 205 223 else if(tokens.size()>=1) rc = Link(tokens[0]); … … 262 280 263 281 return(0); 282 } 283 284 /* --Methode-- */ 285 bool CxxExecutor::IsThreadable(string const & kw) 286 { 287 if ( (kw == "c++exec") || (kw == "c++execfrf") || 288 (kw == "c++create") || (kw == "c++createfrf") || 289 (kw == "c++compile") || (kw == "c++link") ) return true; 290 else return false; 264 291 } 265 292 -
trunk/SophyaPI/PIext/cxxexecutor.h
r2322 r2755 24 24 25 25 virtual int Execute(string& keyw,vector<string>& args, string& toks); 26 virtual bool IsThreadable(string const & keyw); 26 27 27 28 inline void SetPrtLevel(uint_2 lp=2) {mPrtLevel = lp;} … … 96 97 uint_2 mPrtLevel; 97 98 bool mFgPutVar; // if true , declare ObjMgr variables as $varname, default=false 99 100 // Mutex de controle de thread pour dynamic-link 101 ZMutex mutx_cxxe; 102 98 103 }; 99 104 -
trunk/SophyaPI/PIext/nobjmgr.cc
r2701 r2755 95 95 static DVList* myVars = NULL; // Pour stocker les variables 96 96 97 static string* TmpDir ; // Repertoire pour les compilations / link dynamique97 static string* TmpDir = NULL; // Repertoire pour les compilations / link dynamique 98 98 99 99 // Pour gestion multithread 100 static ZMutex* myMutex ;100 static ZMutex* myMutex = NULL; 101 101 // .................................................................. 102 102 … … 122 122 myObjs = new NObjList; 123 123 myVars = new DVList; 124 myMutex = new ZMutex; 124 125 currDir = new string("home"); 125 126 string dirn = "home"; … … 144 145 if ( (l>0) && ((*TmpDir)[l-1] != '/') ) (*TmpDir) += '/'; 145 146 servnobjm = new Services2NObjMgr(*TmpDir); 146 myMutex = new ZMutex;147 147 } 148 148 fgOInit++; … … 230 230 return(false); 231 231 } 232 ZSync (*myMutex);232 ZSync zs(*myMutex); zs.NOp(); 233 233 #ifdef SANS_EVOLPLANCK 234 234 bool fg = true; … … 248 248 return(false); 249 249 } 250 ZSync (*myMutex);250 ZSync zs(*myMutex); zs.NOp(); 251 251 #ifdef SANS_EVOLPLANCK 252 252 DVList::ValList::const_iterator it; … … 266 266 return(false); 267 267 } 268 ZSync (*myMutex);268 ZSync zs(*myMutex); zs.NOp(); 269 269 #ifdef SANS_EVOLPLANCK 270 270 return(false); … … 281 281 return(""); 282 282 } 283 ZSync (*myMutex);283 ZSync zs(*myMutex); zs.NOp(); 284 284 // cout << " DEBUG::GetVar " << *myVars << endl; 285 285 return(myVars->GetS(key)); … … 290 290 { 291 291 // cout << " DEBUG::GetVarList " << *myVars << endl; 292 ZSync (*myMutex);292 ZSync zs(*myMutex); zs.NOp(); 293 293 return(*myVars); 294 294 } … … 297 297 bool NamedObjMgr::CreateDir(string & dirname) 298 298 { 299 ZSync (*myMutex);299 ZSync zs(*myMutex); zs.NOp(); 300 300 return CreateDir_P(dirname); 301 301 } … … 337 337 return(false); 338 338 } 339 ZSync (*myMutex);339 ZSync zs(*myMutex); zs.NOp(); 340 340 NObjDirList::iterator it = myDirs->find(dirname); 341 341 if (it == myDirs->end()) { … … 369 369 void NamedObjMgr::LockDir(string & dirname) 370 370 { 371 ZSync (*myMutex);371 ZSync zs(*myMutex); zs.NOp(); 372 372 if ( !CheckDirName(dirname) ) return; 373 373 NObjDirList::iterator it = myDirs->find(dirname); … … 381 381 void NamedObjMgr::UnlockDir(string & dirname) 382 382 { 383 ZSync (*myMutex);383 ZSync zs(*myMutex); zs.NOp(); 384 384 if ( !CheckDirName(dirname) ) return; 385 385 NObjDirList::iterator it = myDirs->find(dirname); … … 393 393 void NamedObjMgr::SetKeepOldDirAtt(string & dirname, bool keepold) 394 394 { 395 ZSync (*myMutex);395 ZSync zs(*myMutex); zs.NOp(); 396 396 if ( !CheckDirName(dirname) ) return; 397 397 NObjDirList::iterator it = myDirs->find(dirname); … … 409 409 bool NamedObjMgr::SetCurrentDir(string & dirname) 410 410 { 411 ZSync (*myMutex);411 ZSync zs(*myMutex); zs.NOp(); 412 412 if ( !CheckDirName(dirname) ) { 413 413 cout << "NamedObjMgr::SetCurrentDir( " << dirname << ") Error - Invalid name !" << endl; … … 427 427 void NamedObjMgr::GetCurrentDir(string & dirname) 428 428 { 429 ZSync (*myMutex);429 ZSync zs(*myMutex); zs.NOp(); 430 430 dirname = *currDir; 431 431 } … … 434 434 void NamedObjMgr::ListDirs(string & patt) 435 435 { 436 ZSync (*myMutex);436 ZSync zs(*myMutex); zs.NOp(); 437 437 NObjDirList::iterator it; 438 438 string cn; … … 454 454 void NamedObjMgr::GetDirList(string & patt, vector<string>& lstd) 455 455 { 456 ZSync (*myMutex);456 ZSync zs(*myMutex); zs.NOp(); 457 457 NObjDirList::iterator it; 458 458 string cn; … … 467 467 void NamedObjMgr::CleanDir(string & dirname) 468 468 { 469 ZSync (*myMutex);469 ZSync zs(*myMutex); zs.NOp(); 470 470 CleanDir_P(dirname); 471 471 } … … 533 533 bool NamedObjMgr::AddObj(AnyDataObj* obj, string & nom, bool crd) 534 534 { 535 ZSync (*myMutex);535 ZSync zs(*myMutex); zs.NOp(); 536 536 return AddObj_P(obj, nom, crd); 537 537 } … … 625 625 bool NamedObjMgr::AddObj(AnyDataObj& obj, string & nom, bool crd) 626 626 { 627 ZSync (*myMutex);627 ZSync zs(*myMutex); zs.NOp(); 628 628 NObjMgrAdapter* adap = GetServiceObj()->GetAdapter(&obj); 629 629 if (adap == NULL) { … … 643 643 bool NamedObjMgr::RenameObj(string & nom, string& nomnew) 644 644 { 645 ZSync (*myMutex);645 ZSync zs(*myMutex); zs.NOp(); 646 646 return RenameObj_P(nom, nomnew); 647 647 } … … 710 710 bool NamedObjMgr::CopyObj(string & nom, string& nomcp) 711 711 { 712 ZSync (*myMutex);712 ZSync zs(*myMutex); zs.NOp(); 713 713 if(nomcp.length()<=0) 714 714 {cout<<"NamedObjMgr::CopyObj() Error, copied obj name "<<nomcp<<" not valid"<<endl; 715 715 return(false);} 716 NObjMgrAdapter* obnom = GetObjAdapter (nom);716 NObjMgrAdapter* obnom = GetObjAdapter_P(nom); 717 717 if(obnom==NULL) 718 718 {cout<<"NamedObjMgr::CopyObj() Error - No "<<nom<<" object !"<<endl; … … 727 727 bool NamedObjMgr::DelObj(string & nom, bool fgd) 728 728 { 729 ZSync (*myMutex);729 ZSync zs(*myMutex); zs.NOp(); 730 730 return DelObj_P(nom, fgd); 731 731 } … … 778 778 bool NamedObjMgr::DelObj_Id(int oid) 779 779 { 780 ZSync (*myMutex);780 ZSync zs(*myMutex); zs.NOp(); 781 781 NObjList::iterator it; 782 782 string nom; … … 794 794 void NamedObjMgr::DelObjects(string & patt, bool fgd) 795 795 { 796 ZSync (*myMutex);796 ZSync zs(*myMutex); zs.NOp(); 797 797 string n1,r1; 798 798 ParseObjectName(patt, r1, n1); … … 812 812 AnyDataObj* NamedObjMgr::GetObj(string & nom) 813 813 { 814 ZSync(*myMutex); 814 ZSync zs(*myMutex); zs.NOp(); 815 return GetObj_P(nom); 816 } 817 818 /* --Methode-- */ 819 AnyDataObj* NamedObjMgr::GetObj_P(string & nom) 820 { 815 821 string n1,r1; 816 822 ParseObjectName(nom, r1, n1); … … 824 830 NObjMgrAdapter* NamedObjMgr::GetObjAdapter(string & nom) 825 831 { 826 ZSync(*myMutex); 832 ZSync zs(*myMutex); zs.NOp(); 833 return GetObjAdapter_P(nom); 834 } 835 836 /* --Methode-- */ 837 NObjMgrAdapter* NamedObjMgr::GetObjAdapter_P(string & nom) 838 { 827 839 string n1,r1; 828 840 ParseObjectName(nom, r1, n1); … … 836 848 void NamedObjMgr::ListObjs(string & patt) 837 849 { 838 ZSync (*myMutex);850 ZSync zs(*myMutex); zs.NOp(); 839 851 int k; 840 852 AnyDataObj* obj=NULL; … … 865 877 void NamedObjMgr::GetObjList(string & patt, vector<string> &lst) 866 878 { 867 ZSync (*myMutex);879 ZSync zs(*myMutex); zs.NOp(); 868 880 string n1,r1; 869 881 if (patt.length() < 1) return; … … 901 913 void NamedObjMgr::ReadObj(string const & flnm, string & nobj) 902 914 { 903 ZSync (*myMutex);915 ZSync zs(*myMutex); zs.NOp(); 904 916 PPersist* ppobj=NULL; 905 917 bool ok = true; … … 934 946 { 935 947 if(flnm_objname.size()<2) return; 936 ZSync (*myMutex);948 ZSync zs(*myMutex); zs.NOp(); 937 949 int nread=0; 938 950 try { … … 963 975 void NamedObjMgr::ReadObj(PInPersist& s, int num) 964 976 { 965 ZSync(*myMutex); 977 ZSync zs(*myMutex); zs.NOp(); 978 ReadObj_P(s, num); 979 } 980 981 /* --Methode-- */ 982 void NamedObjMgr::ReadObj_P(PInPersist& s, int num) 983 { 966 984 int_4 i; // $CHECK$ int -> int_4 a cause de TagKey 967 985 #ifdef SANS_EVOLPLANCK … … 1046 1064 void NamedObjMgr::ReadAll(string const & flnm) 1047 1065 { 1048 ZSync (*myMutex);1066 ZSync zs(*myMutex); zs.NOp(); 1049 1067 #ifdef SANS_EVOLPLANCK 1050 1068 bool ok = true; … … 1065 1083 AddObj_P(obj->DataObj(), nom, false); 1066 1084 } 1067 else ReadObj ((*ppin), -1);1085 else ReadObj_P((*ppin), -1); 1068 1086 delete ppin; 1069 1087 #else … … 1077 1095 cout << " ... Reading " << pis.NbNameTags() << " objects at NameTags " ; 1078 1096 } 1079 ReadObj (pis, -1);1097 ReadObj_P(pis, -1); 1080 1098 return; 1081 1099 } … … 1101 1119 void NamedObjMgr::ReadFits(string const & flnm, string & nobj) 1102 1120 { 1103 ZSync (*myMutex);1121 ZSync zs(*myMutex); zs.NOp(); 1104 1122 #ifdef SANS_EVOLPLANCK 1105 1123 bool ok = false; … … 1161 1179 void NamedObjMgr::SaveObj(string & nom, POutPersist& s, bool keeppath) 1162 1180 { 1163 ZSync (*myMutex);1181 ZSync zs(*myMutex); zs.NOp(); 1164 1182 SaveObj_P(nom, s, keeppath); 1165 1183 } … … 1175 1193 NObjMgrAdapter* obja=NULL; 1176 1194 string nomf = (keeppath) ? nom : nob; 1177 obja = GetObjAdapter (nom);1195 obja = GetObjAdapter_P(nom); 1178 1196 if (obja == NULL) return; 1179 1197 printf("NamedObjMgr::SaveObj(%s, ) (Type=%s) \n", … … 1186 1204 void NamedObjMgr::SaveObjects(string & patt, string const& flnm) 1187 1205 { 1188 ZSync (*myMutex);1206 ZSync zs(*myMutex); zs.NOp(); 1189 1207 string n1,r1; 1190 1208 if (patt.length() < 1) return; … … 1228 1246 // dont le nom est le dernier argument (liste[n-1]) 1229 1247 { 1230 ZSync (*myMutex);1248 ZSync zs(*myMutex); zs.NOp(); 1231 1249 1232 1250 if(liste.size()<2) { … … 1260 1278 void NamedObjMgr::SaveAll(string const& flnm) 1261 1279 { 1262 ZSync (*myMutex);1280 ZSync zs(*myMutex); zs.NOp(); 1263 1281 bool ok = true; 1264 1282 … … 1293 1311 void NamedObjMgr::SaveFits(string& nom, string const & flnm) 1294 1312 { 1295 ZSync (*myMutex);1313 ZSync zs(*myMutex); zs.NOp(); 1296 1314 1297 1315 NObjMgrAdapter* obja=NULL; 1298 obja = GetObjAdapter (nom);1316 obja = GetObjAdapter_P(nom); 1299 1317 if (obja == NULL) return; 1300 1318 cout << " SaveFits: Object" << nom << " to FITS file " << flnm << endl; … … 1308 1326 void NamedObjMgr::PrintObj(string& nom) 1309 1327 { 1310 ZSync (*myMutex);1328 ZSync zs(*myMutex); zs.NOp(); 1311 1329 NObjMgrAdapter* obja=NULL; 1312 obja = GetObjAdapter (nom);1330 obja = GetObjAdapter_P(nom); 1313 1331 if (obja == NULL) return; 1314 1332 AnyDataObj* ob = obja->GetDataObj(); … … 1330 1348 if ( (dopt == "nodisp") || (dopt == "nodisplay") ) return; 1331 1349 1332 ZSync (*myMutex);1350 ZSync zs(*myMutex); zs.NOp(); 1333 1351 1334 1352 NObjMgrAdapter* obja=NULL; 1335 obja = GetObjAdapter (nom);1353 obja = GetObjAdapter_P(nom); 1336 1354 if (obja == NULL) { 1337 1355 cout << "NamedObjMgr::DisplayObj() Error , No object with name " << nom << endl; … … 1380 1398 if ( (dopt == "nodisp") || (dopt == "nodisplay") ) return; 1381 1399 1382 ZSync (*myMutex);1400 ZSync zs(*myMutex); zs.NOp(); 1383 1401 1384 1402 NObjMgrAdapter* obja=NULL; 1385 obja = GetObjAdapter (nom);1403 obja = GetObjAdapter_P(nom); 1386 1404 if (obja == NULL) { 1387 1405 cout << "NamedObjMgr::DisplayImage() Error , No such object " << nom << endl; … … 1420 1438 if ( (dopt == "nodisp") || (dopt == "nodisplay") ) return; 1421 1439 1422 ZSync (*myMutex);1440 ZSync zs(*myMutex); zs.NOp(); 1423 1441 1424 1442 NObjMgrAdapter* obja=NULL; 1425 obja = GetObjAdapter (nom);1443 obja = GetObjAdapter_P(nom); 1426 1444 if (obja == NULL) { 1427 1445 cout << "NamedObjMgr::DisplaySurf3D() Error , No such object " << nom << endl; … … 1470 1488 if ( (dopt == "nodisp") || (dopt == "nodisplay") ) return; 1471 1489 1472 ZSync (*myMutex);1473 1474 AnyDataObj* obj=GetObj (nom);1490 ZSync zs(*myMutex); zs.NOp(); 1491 1492 AnyDataObj* obj=GetObj_P(nom); 1475 1493 if (obj == NULL) { 1476 1494 cout << "NamedObjMgr::DisplayNT() Error , No such object " << nom << endl; … … 1536 1554 if ( (dopt == "nodisp") || (dopt == "nodisplay") ) return; 1537 1555 1538 ZSync (*myMutex);1539 1540 AnyDataObj* obj=GetObj (nom);1556 ZSync zs(*myMutex); zs.NOp(); 1557 1558 AnyDataObj* obj=GetObj_P(nom); 1541 1559 if(obj == NULL) 1542 1560 {cout << "NamedObjMgr::DisplayGFD() Error , No such object " << nom << endl; … … 1592 1610 if ( (dopt == "nodisp") || (dopt == "nodisplay") ) return; 1593 1611 1594 ZSync (*myMutex);1612 ZSync zs(*myMutex); zs.NOp(); 1595 1613 1596 1614 #ifdef SANS_EVOLPLANCK … … 1601 1619 1602 1620 AnyDataObj* obj; 1603 obj = GetObj (nomvx);1621 obj = GetObj_P(nomvx); 1604 1622 if(obj == NULL) { 1605 1623 cout << "NamedObjMgr::DisplayVector() Error , No such object " << nomvx << endl; … … 1613 1631 } 1614 1632 1615 obj = GetObj (nomvy);1633 obj = GetObj_P(nomvy); 1616 1634 if(obj == NULL) { 1617 1635 cout << "NamedObjMgr::DisplayVector() Error , No such object " << nomvy << endl; … … 1706 1724 { 1707 1725 if (!myImgApp) return; 1708 ZSync (*myMutex);1726 ZSync zs(*myMutex); zs.NOp(); 1709 1727 if ( !_fgimgapp ) myImgApp->LockMutex(); 1710 1728 -
trunk/SophyaPI/PIext/nobjmgr.h
r2669 r2755 116 116 virtual bool RenameObj_P(string & nom, string& nomnew); 117 117 virtual bool DelObj_P(string & nom, bool fgd=true); 118 virtual AnyDataObj* GetObj_P(string & nom); 119 virtual NObjMgrAdapter* GetObjAdapter_P(string & nom); 120 virtual void ReadObj_P(PInPersist& s, int num=-1); 118 121 virtual void SaveObj_P(string & nom, POutPersist& s, bool keeppath=false); 119 122 -
trunk/SophyaPI/PIext/pawexecut.cc
r2709 r2755 319 319 } else return(1); 320 320 } 321 322 /* methode */ 323 bool PAWExecutor::IsThreadable(string const & keyw) 324 { 325 if ( (keyw == "n/plot") || (keyw == "n/pl") || 326 (keyw == "n/proj") ) return true; 327 else return false; 328 } 329 321 330 322 331 /* methode */ … … 435 444 } 436 445 446 437 447 /* methode */ 438 448 void PAWExecutor::n_proj(vector<string>& tokens) … … 630 640 } 631 641 642 632 643 /* methode */ 633 644 #define __LENLINE_N_READ__ 8192 -
trunk/SophyaPI/PIext/pawexecut.h
r2707 r2755 19 19 virtual ~PAWExecutor(); 20 20 virtual int Execute(string& keyw, vector<string>& args, string& toks); 21 virtual bool IsThreadable(string const & keyw); 22 21 23 protected: 22 24 void reset(vector<string>& tokens); -
trunk/SophyaPI/PIext/piacmd.cc
r2677 r2755 366 366 Commander::SetCurrentPrompt(pr); 367 367 if (mImgApp) { 368 ZSync (mImgApp->getMutex());368 ZSync zs(mImgApp->getMutex()); zs.NOp(); 369 369 mImgApp->GetConsole()->SetPrompt(pr); 370 370 } … … 378 378 char va = (att == 0) ? 0 : PIVA_Magenta; 379 379 if (mImgApp) { 380 ZSync(mImgApp->getMutex()); 380 ZSync(mImgApp->getMutex()); zs.NOp(); 381 381 mImgApp->GetConsole()->AddStr(msg, va); 382 382 } -
trunk/SophyaPI/PIext/pintuple.cc
r2690 r2755 198 198 npolyg = 0; 199 199 NptDraw = 0; 200 201 // Mai 2005: Correction bug trace des lignes avec le pts en dehors de la zone (Reza) 202 // flags pour la gestion des points/lignes a tracer 203 bool fgokcurpt = true; // Point courant dans la zone a tracer 204 bool fgoklastpt = true; // Le dernier point etait dans la zone a tracer 200 205 for (long i=0; i<(long)mNT->NbLines(); i++) { 201 xl = xp; yl = yp; 206 xl = xp; yl = yp; fgoklastpt = fgokcurpt; 207 202 208 xp = mNT->GetCell(i, xK); 203 209 yp = mNT->GetCell(i, yK); 204 if ( (xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2) ) continue; 205 nok++; 206 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) continue; 207 208 NptDraw++; 210 211 // Comptage du nombre de pts dans la zone graphique du widget 212 if ( !((xp < xmin2) || (xp > xmax2) || (yp < ymin2) || (yp > ymax2)) ) nok++; 213 // Gestion des limites a tracer 214 fgokcurpt = true; 215 if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) ) fgokcurpt = false; 216 else NptDraw++; 217 209 218 // Taille - couleur de marker en fonction du poids 210 if ( wK >= 0) wp = mNT->GetCell(i, wK);211 if ( mrkSzScale && (wK >= 0)) { // Changement de taille219 if ( fgokcurpt &&(wK >= 0) ) wp = mNT->GetCell(i, wK); 220 if ( fgokcurpt && mrkSzScale && (wK >= 0) ) { // Changement de taille 212 221 sz = (int)((wp-wMin)/dw); 213 222 if (sz < 0) sz = 0; … … 218 227 } 219 228 // Couleur du marker en fonction du poids 220 if( colorScale && (wK >= 0) && cmap ) {229 if( fgokcurpt && colorScale && (wK >= 0) && cmap ) { 221 230 int cid = (int)((wp-wMin)/dwc); 222 231 if (cid < 0) cid = 0; … … 227 236 // Trace d'une ligne reliant les points 228 237 if( connectPts ) { 229 if((npolyg==0) && (i>0)) {xpolyg[0]=xl; ypolyg[0]=yl; npolyg=1;} 230 if(npolyg<NMXMULTP_LOCAL) 238 // On initialise le polygone avec le dernier point, si ce dernier ok 239 if((npolyg==0) && (i>0) && fgokcurpt) {xpolyg[0]=xl; ypolyg[0]=yl; npolyg=1;} 240 // On ajoute le point courant au polygone - sauf si celui-ci est vide 241 if((npolyg<NMXMULTP_LOCAL) && (npolyg>0)) 231 242 {xpolyg[npolyg]=xp; ypolyg[npolyg]=yp; npolyg++;} 232 if(npolyg==NMXMULTP_LOCAL) 243 // On trace le polygone s'il est plein - ou le point courant en dehors 244 // (point courant en dehors -> discontinuite de la ligne 245 if( !fgokcurpt || (npolyg==NMXMULTP_LOCAL) ) 233 246 {g->DrawPolygon(xpolyg,ypolyg,npolyg,false); npolyg=0;} 234 247 } 235 248 249 // Plus rien a faire si point en dehors -- on s'en va 250 if (!fgokcurpt) continue; 251 236 252 // Trace des erreurs selon X et Y 237 if ( xebK >= 0) {253 if (xebK >= 0) { 238 254 xer = mNT->GetCell(i, xebK); 239 255 if(xer>0.) g->DrawLine(xp-xer, yp, xp+xer, yp); 240 256 } 241 if ( yebK >= 0) {257 if (yebK >= 0) { 242 258 yer = mNT->GetCell(i, yebK); 243 259 if(yer>0.) g->DrawLine(xp, yp-yer, xp, yp+yer); -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2701 r2755 1035 1035 { 1036 1036 // <ZThread> global PIApplication event loop synchronisation 1037 ZSync zs(thr_glsyn, 2); 1037 ZSync zs(thr_glsyn, 2); zs.NOp(); 1038 1038 1039 1039 PIDrawer *eld=CurrentElDrawer(); … … 1062 1062 { 1063 1063 // <ZThread> global PIApplication event loop synchronisation 1064 ZSync zs(thr_glsyn, 2); 1064 ZSync zs(thr_glsyn, 2); zs.NOp(); 1065 1065 1066 1066 PIDrawer *eld=CurrentElDrawer(); … … 1090 1090 { 1091 1091 // <ZThread> global PIApplication event loop synchronisation 1092 ZSync zs(thr_glsyn, 2); 1092 ZSync zs(thr_glsyn, 2); zs.NOp(); 1093 1093 1094 1094 PIDrawer *eld=CurrentElDrawer(); … … 1116 1116 { 1117 1117 // <ZThread> global PIApplication event loop synchronisation 1118 ZSync zs(thr_glsyn, 2); 1118 ZSync zs(thr_glsyn, 2); zs.NOp(); 1119 1119 1120 1120 PIDrawer *eld=CurrentElDrawer(); … … 1156 1156 { 1157 1157 // <ZThread> global PIApplication event loop synchronisation 1158 ZSync zs(thr_glsyn, 2); 1158 ZSync zs(thr_glsyn, 2); zs.NOp(); 1159 1159 1160 1160 PIDrawer *eld=CurrentElDrawer(); … … 1183 1183 { 1184 1184 // <ZThread> global PIApplication event loop synchronisation 1185 ZSync zs(thr_glsyn, 2); 1185 ZSync zs(thr_glsyn, 2); zs.NOp(); 1186 1186 1187 1187 PIDrawer *eld=CurrentElDrawer(); … … 1209 1209 { 1210 1210 // <ZThread> global PIApplication event loop synchronisation 1211 ZSync zs(thr_glsyn, 2); 1211 ZSync zs(thr_glsyn, 2); zs.NOp(); 1212 1212 1213 1213 PIDrawer *eld=CurrentElDrawer(); … … 1233 1233 { 1234 1234 // <ZThread> global PIApplication event loop synchronisation 1235 ZSync zs(thr_glsyn, 2); 1235 ZSync zs(thr_glsyn, 2); zs.NOp(); 1236 1236 1237 1237 PIDrawer *eld=CurrentElDrawer(); … … 1259 1259 { 1260 1260 // <ZThread> global PIApplication event loop synchronisation 1261 ZSync zs(thr_glsyn, 2); 1261 ZSync zs(thr_glsyn, 2); zs.NOp(); 1262 1262 1263 1263 PIDrawer *eld=CurrentElDrawer(); … … 1286 1286 { 1287 1287 // <ZThread> global PIApplication event loop synchronisation 1288 ZSync zs(thr_glsyn, 2); 1288 ZSync zs(thr_glsyn, 2); zs.NOp(); 1289 1289 1290 1290 PIDrawer *eld=CurrentElDrawer(); … … 1312 1312 { 1313 1313 // <ZThread> global PIApplication event loop synchronisation 1314 ZSync zs(thr_glsyn, 2); 1314 ZSync zs(thr_glsyn, 2); zs.NOp(); 1315 1315 1316 1316 PIDrawer *eld=CurrentElDrawer(); -
trunk/SophyaPI/PIext/servnobjm.cc
r2681 r2755 107 107 if (!mImgapp) return; 108 108 109 // Pour synchronisation d'execution simultanee 110 ZSync zs(mutx_dynlink, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 111 109 112 cmd = "rm -f " + fname; 110 113 rc = system(cmd.c_str()); … … 141 144 142 145 if (!mImgapp) return; 146 // Pour synchronisation d'execution simultanee 147 ZSync zs(mutx_dynlink, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 143 148 144 149 cmd = "rm " + fname; … … 170 175 double xmin, double xmax, int np, string dopt) 171 176 { 177 // Pour synchronisation d'execution simultanee 178 ZSync zs(mutx_dynlink, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 172 179 DlFunctionOfX f = (DlFunctionOfX) LinkFunctionFromFile(fname, func); 173 180 if (!f) return; … … 181 188 double xmin, double xmax, double ymin, double ymax, int npx, int npy, string dopt) 182 189 { 190 // Pour synchronisation d'execution simultanee 191 ZSync zs(mutx_dynlink, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 183 192 DlFunctionOfXY f = (DlFunctionOfXY) LinkFunctionFromFile(fname, func); 184 193 if (!f) return; … … 884 893 } 885 894 895 // Pour synchronisation d'execution simultanee 896 ZSync zs(mutx_dynlink, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 897 886 898 NTLoopExprFunc f = (NTLoopExprFunc)LinkFunctionFromFile(fname, funcname); 887 899 if (!f) { … … 1177 1189 if (objnt == NULL) return; 1178 1190 string vardec = objnt->VarList_C("_zz6qi_"); 1191 1192 // Pour synchronisation d'execution simultanee 1193 ZSync zs(mutx_dynlink, 2); zs.NOp(); // 2 -> broadcast lors de la destruction 1179 1194 1180 1195 PlotExprFunc f = LinkExprFunc(vardec, expx, expy, expz, expt, expcut); -
trunk/SophyaPI/PIext/servnobjm.h
r2491 r2755 17 17 #include "dlftypes.h" 18 18 #include "anydataobj.h" 19 20 #include "zthread.h" 19 21 20 22 #ifdef SANS_EVOLPLANCK … … 135 137 PDynLinkMgr * dynlink; // shared-lib lib.so 136 138 string TmpDir; // Pour fichiers temporaires 139 // Mutex de controle de thread pour dynamic-link 140 ZMutex mutx_dynlink; 137 141 138 142 PIStdImgApp* mImgapp; 139 143 NamedObjMgr* mOmg; 144 140 145 141 146 };
Note:
See TracChangeset
for help on using the changeset viewer.