Changeset 2701 in Sophya for trunk/SophyaPI/PIext
- Timestamp:
- Apr 27, 2005, 1:55:00 PM (20 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nobjmgr.cc
r2677 r2701 1047 1047 { 1048 1048 ZSync(*myMutex); 1049 #ifdef SANS_EVOLPLANCK 1049 1050 bool ok = true; 1050 1051 PPersist* obj=NULL; 1051 1052 1052 1053 PInPersist* ppin=NULL; 1053 #ifdef SANS_EVOLPLANCK1054 1054 TRY{ 1055 1055 ppin = new PInPersist(flnm); … … 1058 1058 } CATCH(merr) 1059 1059 { printf("NamedObjMgr::ReadAll()/Error Exception= %ld (%s) \n", 1060 (long)merr, PeidaExc(merr)); ok = false; } ENDTRY; 1061 #else 1062 try { 1063 ppin = new PInPersist(flnm); 1064 if (ppin->NbNameTags() < 1) obj = ppin->ReadObject(); 1065 else obj = NULL; 1066 } 1067 catch (IOExc iox) { 1068 cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl; 1069 ok = false; 1070 } 1071 #endif 1060 (long)merr, PeidaExc(merr)); ok = false; } 1061 ENDTRY; 1072 1062 if (!ok) return; 1073 1063 if (obj) { … … 1077 1067 else ReadObj((*ppin), -1); 1078 1068 delete ppin; 1069 #else 1070 try { 1071 PInPersist pis(flnm); 1072 if (pis.NbNameTags() >= 1) { 1073 if (pis.NbNameTags() < pis.NbTopLevelObjects()) { 1074 cout << "NamedObjMgr::ReadAll()/Warning File " << flnm << " NbNameTags=" 1075 << pis.NbNameTags() << " < NbTopLevelObjects= " 1076 << pis.NbTopLevelObjects() << endl; 1077 cout << " ... Reading " << pis.NbNameTags() << " objects at NameTags " ; 1078 } 1079 ReadObj(pis, -1); 1080 return; 1081 } 1082 1083 string nom = servnobjm->FileName2Name(flnm); 1084 int kn = 1; 1085 for(int ii=0; ii<pis.NbTopLevelObjects(); ii++) { 1086 PPersist* obj = pis.ReadObject(); 1087 if (!obj) continue; 1088 AddObj_P(obj->DataObj(), nom, false); 1089 kn++; 1090 nom += (string)MuTyV(kn); 1091 } 1092 } 1093 catch (IOExc& iox) { 1094 cerr << "NamedObjMgr::ReadAll()/Error Exception - Msg= " << iox.Msg() << endl; 1095 } 1096 #endif 1079 1097 return; 1080 1098 } -
trunk/SophyaPI/PIext/nomhistadapter.cc
r2697 r2701 18 18 // Pour les DataTable ( Depuis Avril 2005 ) 19 19 #include "datatable.h" 20 #include "swppfdtable.h" 20 21 #endif 21 22 … … 620 621 DataTable* dt = dynamic_cast<DataTable *>(mDT); 621 622 if (dt) return ("DataTable "); 622 else return ("BaseDataTable "); 623 else { 624 SwPPFDataTable* swdt = dynamic_cast<SwPPFDataTable *>(mDT); 625 if (swdt) return ("SwPPFDataTable "); 626 return ("BaseDataTable "); 627 } 623 628 } 624 629 … … 628 633 DataTable* dt = dynamic_cast<DataTable *>(mDT); 629 634 if (dt) return new DataTable(*dt, share); 630 else return NULL; 635 else { 636 SwPPFDataTable* swdt = dynamic_cast<SwPPFDataTable *>(mDT); 637 if (swdt) cout << "NOMAdapter_DataTable::CloneDataObj() Object type SwPPFDataTable can not be cloned !" << endl; 638 return NULL; 639 } 631 640 } 632 641 … … 647 656 { 648 657 DataTable* dt = dynamic_cast<DataTable *>(mDT); 649 if (dt) { 650 ObjFileIO<DataTable> fio(dt); 658 SwPPFDataTable* swdt = dynamic_cast<SwPPFDataTable *>(mDT); 659 if (dt) { 660 ObjFileIO<BaseDataTable> fio(dt); 651 661 fio.Write(pos, nom); 652 662 } 663 else if (swdt) { 664 ObjFileIO<BaseDataTable> fio(swdt); 665 fio.Write(pos, nom); 666 } 653 667 else { 654 cerr << " NOMAdapter_DataTable::SavePPF() Objet pas de type DataTable (nom="668 cerr << " NOMAdapter_DataTable::SavePPF() Objet pas de type DataTable/SwPPFDataTable (nom=" 655 669 << nom << ")" << endl; 656 670 } -
trunk/SophyaPI/PIext/piinit.cc
r2697 r2701 18 18 19 19 #include "datatable.h" 20 #include "swppfdtable.h" 20 21 21 22 #include "nomskymapadapter.h" … … 52 53 53 54 serv->RegisterClass(new DataTable, new NOMAdapter_DataTable ); 55 serv->RegisterClass(new SwPPFDataTable, new NOMAdapter_DataTable ); 54 56 char* varenv=NULL; 55 57 if ( (varenv=getenv("PEIDA_TMP")) == NULL ) varenv=getenv("TMPDIR") ; -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2677 r2701 455 455 fg_glsynlock = true; 456 456 int nevtproc = 0; 457 while (XtAppPending(*appctx) != 0) { 458 XtAppNextEvent(*appctx, &evt); 459 XtDispatchEvent(&evt); 460 // Soumission de la commande exterieur a executer 461 if (fg_exc_cmd) { 462 fg_exc_cmd = false; 463 CmdInterpreter()->AddInputLine(exc_command); 457 while (XtAppPending(*appctx) != 0) { // Boucle XtAppPending() 458 try { 459 XtAppNextEvent(*appctx, &evt); 460 XtDispatchEvent(&evt); 461 // Soumission de la commande exterieur a executer 462 if (fg_exc_cmd) { 463 fg_exc_cmd = false; 464 CmdInterpreter()->AddInputLine(exc_command); 465 } 466 nevtproc++; 467 if (nevtproc >= 200) break; 464 468 } 465 nevtproc++; 466 if (nevtproc >= 200) break; 467 } 469 catch ( PThrowable & exc ) { 470 cerr << "\nPIStdImgApp::Run()/ Exception catched in event loop: \n " 471 << (string)typeid(exc).name() << " Msg= " << exc.Msg() << endl; 472 cerr << " Trying to continue event loop ... " << endl; 473 } 474 catch ( std::exception & sexc ) { 475 cerr << "\nPIStdImgApp::Run()/ Exception catched in event loop: \n " 476 << (string)typeid(sexc).name() << " what()= " << sexc.what() << endl; 477 cerr << " Trying to continue event loop ... " << endl; 478 } 479 catch ( ... ) { 480 cerr << "\nPIStdImgApp::Run()/ Unknown Exception (...) catched in event loop ! " << endl; 481 cerr << " Trying to continue event loop ... " << endl; 482 } 483 } // FIN Boucle XtAppPending() 468 484 fg_glsynlock = false; 469 485 //DBG cout << " "DBG-Run:: Going to wait ... " << klp << endl;
Note:
See TracChangeset
for help on using the changeset viewer.