Changeset 2792 in Sophya for trunk/SophyaPI/PIext/servnobjm.cc
- Timestamp:
- Jun 1, 2005, 3:24:48 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/servnobjm.cc
r2781 r2792 34 34 #include "histos.h" 35 35 #include "histos2.h" 36 #include "hisprof.h" 36 37 #include "ntuple.h" 37 #include " hisprof.h"38 #include "datatable.h" 38 39 39 40 #include "piyfxdrw.h" … … 823 824 /* --Methode-- */ 824 825 void Services2NObjMgr::NtFromASCIIFile(string& nom,string& filename,double def_val) 825 // Pour remplir un ntuple "nom" existant a partir du fichier826 // Pour remplir un NTuple/DataTable "nom" existant a partir du fichier 826 827 // ASCII table "filename". Si il y a plus de variables dans le 827 828 // ntuple que dans le fichier "filename", 828 // les sur-numeraires sont mises a "def_val" par defaut.829 // les sur-numeraires numeriques sont mises a "def_val" par defaut. 829 830 { 830 831 AnyDataObj* mobj = MyObjMgr()->GetObj(nom); 831 if(mobj == NULL) 832 {cout<<"NtFromASCIIFile() Error, object "<<nom<<" not existing"<<endl; 833 return;} 834 if(typeid(*mobj) != typeid(NTuple)) 835 {cout<<"NtFromASCIIFile() Error, object "<<nom<<" not an NTuple"<<endl; 836 return;} 837 if (!mImgapp) return; 838 839 NTuple* nt = (NTuple*) mobj; 840 nt->FillFromASCIIFile(filename, def_val); 832 if(mobj == NULL) { 833 cout<<"NtFromASCIIFile() Error, object "<<nom<<" not existing"<<endl; 834 return; 835 } 836 837 NTuple* nt = NULL; 838 DataTable* dt = NULL; 839 if(typeid(*mobj) == typeid(NTuple)) nt = (NTuple*) mobj; 840 else if(typeid(*mobj) == typeid(DataTable)) dt = (DataTable*) mobj; 841 842 if(nt==NULL && dt==NULL) { 843 cout<<"NtFromASCIIFile() Error, object "<<nom<<" not an NTuple nor a DataTable"<<endl; 844 return; 845 } 846 if (!mImgapp) return; 847 848 if(nt) nt->FillFromASCIIFile(filename, def_val); 849 else if(dt) dt->FillFromASCIIFile(filename); 841 850 return; 842 851 }
Note:
See TracChangeset
for help on using the changeset viewer.