Salome HOME
Fix on Bug PAL7927
[modules/visu.git] / src / VISU_I / VISU_Table_i.cc
index 0779e845318f18f1198776f4d1cb78be77d51553..d588e45c279085e0ab0ec3e629e6c18b58fc14f9 100644 (file)
 #include "QAD_Study.h"
 
 #include "VISU_CutLines_i.hh"
+#include "VISU_Result_i.hh"
 
 #include <memory>      
 #include <fstream>     
 #include <strstream>
 
 #include <qfileinfo.h>
+#include <qstring.h>
 #include <qfile.h>
 
 using namespace std;
@@ -79,7 +81,7 @@ VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry
 */
 VISU::Table_i::~Table_i()
 {
-  INFOS("Table_i::~Table_i");
+  MESSAGE("Table_i::~Table_i");
 }
 /*!
   Gets number of rows in table
@@ -92,7 +94,7 @@ CORBA::Long VISU::Table_i::GetNbRows()
     SALOMEDS::GenericAttribute_var        anAttr;
     if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
       SALOMEDS::AttributeTableOfInteger_var anInt =  SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
-      return anInt->GetNbRows();
+       return anInt->GetNbRows();
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       SALOMEDS::AttributeTableOfReal_var aReal =  SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
@@ -128,6 +130,21 @@ VISU::Storable* VISU::Table_i::Create()
 {
   // generate name ... 
   myName = GetTableTitle(); 
+
+  // mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
+  if ( myName == "" )
+    if ( !mySObj->_is_nil() ) {
+      CutLines_i* pCutLines = NULL;
+      CORBA::Object_var anObj = SObjectToObject(mySObj);
+      if(!CORBA::is_nil(anObj)){
+       VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
+         if(!aCutLines->_is_nil())
+           pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
+       }
+      if (!pCutLines)
+       if (mySObj->GetName()) myName = mySObj->GetName();
+    }
+
   if ( myName == "" )
     myName = GenerateName();
   // ... and build the object
@@ -165,14 +182,15 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
                                          GetName(),
                                          "",
                                          aComment.latin1(), 
-                                         true );
+                                         pCutLines );
        // create SObject referenced to real table object
        mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID( anEntry.c_str() ));
        if(pCutLines) {
          pCutLines->BuildTableOfReal(mySObj);
        }
-       SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
-       Builder->Addreference( refSO, SO );
+       // mpv (PAL5357): reference attributes are unnecessary now
+       //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
+       //Builder->Addreference( refSO, SO );
       }
     return this;
   }
@@ -182,7 +200,6 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
   Restores table object from stream
 */
 VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
-     throw( std::logic_error& )
 {
   if(MYDEBUG) MESSAGE(GetComment());
   myName = (const char*)(VISU::Storable::FindValue(theMap,"myName"));
@@ -205,7 +222,6 @@ void VISU::Table_i::ToStream( std::ostringstream& theStr )
 */
 VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                       const string& thePrefix, const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Table_i* pResent = new VISU::Table_i( aStudy, "" );
@@ -234,6 +250,10 @@ const char* VISU::Table_i::GetTableTitle()
   return ""; 
 }
 
+void VISU::Table_i::RemoveFromStudy(){
+  VISU::RemoveFromStudy(mySObj,false);
+}
+
 //----------------------------------------------------------------
 //                      Curve Object
 //----------------------------------------------------------------
@@ -284,7 +304,7 @@ VISU::Curve_i::Curve_i(SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::L
 */
 VISU::Curve_i::~Curve_i()
 {
-  INFOS("Curve_i::~Curve_i");
+  MESSAGE("Curve_i::~Curve_i");
 }
 /*!
   Creates curve object
@@ -374,14 +394,14 @@ string VISU::Curve_i::GetHorTitle()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
       if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() ) {
-       title = strdup( rowTitles[ myHRow-1 ] );
+       title = rowTitles[ myHRow-1 ];
       }
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
       if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() ) {
-       title = strdup( rowTitles[ myHRow-1 ] );
+       title = rowTitles[ myHRow-1 ];
       }
     }
   }
@@ -404,13 +424,13 @@ string VISU::Curve_i::GetVerTitle()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
       if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() )
-       title = strdup( rowTitles[ myVRow-1 ] );
+       title = rowTitles[ myVRow-1 ];
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
       if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() )
-       title = strdup( rowTitles[ myVRow-1 ] );
+       title = rowTitles[ myVRow-1 ];
     }
   }
   return title;
@@ -432,13 +452,13 @@ string VISU::Curve_i::GetHorUnits()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits();
       if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() )
-       units = strdup( rowUnits[ myHRow-1 ] );
+       units = rowUnits[ myHRow-1 ];
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits();
       if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() )
-       units = strdup( rowUnits[ myHRow-1 ] );
+       units = rowUnits[ myHRow-1 ];
     }
   }
   return units;
@@ -460,13 +480,13 @@ string VISU::Curve_i::GetVerUnits()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits();
       if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() )
-       units = strdup( rowUnits[ myVRow-1] );
+       units = rowUnits[ myVRow-1];
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits();
       if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() )
-       units = strdup( rowUnits[ myVRow-1 ] );
+       units = rowUnits[ myVRow-1 ];
     }
   }
   return units;
@@ -565,16 +585,15 @@ Plot2d_Curve* VISU::Curve_i::CreatePresentation()
   SALOMEDS::Color color = GetColor();
   crv->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
   crv->setAutoAssign( IsAuto() );
-  crv->setIO(new SALOME_InteractiveObject(strdup(mySObj->GetID()),"VISU",strdup(GetName()))); 
+  crv->setIO(new SALOME_InteractiveObject(mySObj->GetID(),"VISU",GetName()));
   if ( myTable )
-    crv->setTableIO(new SALOME_InteractiveObject(strdup(myTable->GetObjectEntry()),"VISU",strdup(myTable->GetName()))); 
+    crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(),"VISU",myTable->GetName()));
   return crv;
 }
 /*!
   Restores curve object from stream
 */
 VISU::Storable* VISU::Curve_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO)
-     throw( std::logic_error& )
 {
   if(MYDEBUG) MESSAGE(GetComment());
   mySObj = SALOMEDS::SObject::_duplicate(theSO);
@@ -610,14 +629,13 @@ void VISU::Curve_i::ToStream( std::ostringstream& theStr )
   Gets reference table's entry
 */
 const char* VISU::Curve_i::GetTableID() { 
-  return CORBA::string_dup(myTable->GetObjectEntry());
+  return myTable->GetObjectEntry();
 }
 /*!
   Called from engine to restore curve from the file
 */
 VISU::Storable* VISU::Curve_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                       const string& thePrefix, const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather());
@@ -628,6 +646,10 @@ VISU::Storable* VISU::Curve_i::Restore(SALOMEDS::SObject_ptr theSObject,
   return NULL;
 }
 
+void VISU::Curve_i::RemoveFromStudy(){
+  VISU::RemoveFromStudy(mySObj,false);
+}
+
 //----------------------------------------------------------------
 //                      Container Object
 //----------------------------------------------------------------
@@ -659,7 +681,7 @@ VISU::Container_i::Container_i( SALOMEDS::Study_ptr theStudy )
 */
 VISU::Container_i::~Container_i()
 {
-  INFOS("Container_i::~Container_i");
+  MESSAGE("Container_i::~Container_i");
   myCurves.clear();
 }
 /*!
@@ -773,6 +795,7 @@ VISU::Storable* VISU::Container_i::Build( int theRestoring )
                                       "",
                                       aComment.latin1(),
                                       true );
+    mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str()));
   }
   return this;
 }
@@ -860,10 +883,10 @@ VISU::Curve_i* VISU::Container_i::GetCurve( CORBA::Long theIndex )
 /*!
   Restores container data from the stream
 */
-VISU::Storable* VISU::Container_i::Restore( const Storable::TRestoringMap& theMap )
-     throw( std::logic_error& )
+VISU::Storable* VISU::Container_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO )
 {
   if(MYDEBUG) MESSAGE(GetComment());
+  mySObj = SALOMEDS::SObject::_duplicate(SO);
   myName = VISU::Storable::FindValue( theMap, "myName" ).latin1(); 
   QString val = VISU::Storable::FindValue( theMap, "myCurves" );
   myCurves = QStringList::split( QString( "*" ), val, false );
@@ -884,17 +907,20 @@ void VISU::Container_i::ToStream( std::ostringstream& theStr )
 */
 VISU::Storable* VISU::Container_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                           const string& thePrefix, const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Container_i* pResent = new VISU::Container_i( aStudy );
-  return pResent->Restore( theMap );
+  return pResent->Restore( theMap, theSObject );
+}
+
+void VISU::Container_i::RemoveFromStudy(){
+  VISU::RemoveFromStudy(mySObj,false);
 }
 
 //-------------------------------------------------------------
 //             Implementation of reading from file
 //-------------------------------------------------------------
-typedef double TValue;
+typedef string TValue;
 typedef vector<TValue> TValues;
 
 struct TRow{
@@ -964,84 +990,127 @@ int getLine(ifstream& theStmIn, QString& theString){
 }
 
 void ImportTables(const char* theFileName, TTableCont& theTableCont){
-  static int STRPRECISION = 12;
   ifstream aStmIn;
-  QFileInfo aFileInfo(theFileName);
-  if(!aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size()) return;
-  aStmIn.open(theFileName);
+  QFileInfo aFileInfo( theFileName );
+  if( !aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size() )
+    return;
+  aStmIn.open( theFileName );
   QString aTmp;
-  do{
-    //Find beginning of Table
-    while(getLine(aStmIn,aTmp) && aTmp == "\n");
-    if(MYDEBUG) cout<<"\n There is new Table2D with Title = ";
+  do {
+    // find beginning of table (tables are separated by empty lines)
+    while( getLine( aStmIn, aTmp ) && aTmp.stripWhiteSpace() == "");
     TTable2D aTable2D;
-    while(!aStmIn.eof() && aTmp != "\n"){
-      if(aTmp.find("#TITLE:") == 0){
-       int aLen = aTmp.find(":") + 1;
-       aTmp.remove(0,aLen);
-       QString aTitle = aTmp.stripWhiteSpace();
-       aTable2D.myTitle = aTitle.latin1();
-       if(MYDEBUG) cout<<aTitle<<endl;
-      }else if(aTmp.find("#COLUMN_TITLES:") == 0){
-       int aLen = aTmp.find(":") + 1;
-       aTmp.remove(0,aLen);
-       QStringList aStrList = QStringList::split("|",aTmp);
-       if(MYDEBUG) cout<<"Its Column Titles : ";
-       for(int i = 0; i < aStrList.count(); i++){
-         aTmp = aStrList[i].stripWhiteSpace();
-         aTable2D.myColumnTitles.push_back(aTmp.latin1());
-         if(MYDEBUG) cout<<"\t"<<aTmp;
+    if(MYDEBUG) cout << "New table is found" << endl;
+    while( !aStmIn.eof() && aTmp.stripWhiteSpace() != "" ){
+      QString data = aTmp.stripWhiteSpace();
+      QString cmt = "";
+      QString keyword = "";
+      // split string to data and comment (comment starts from '#' symbol)
+      int index = aTmp.find( "#" );
+      if ( index >= 0 ) {
+       data = aTmp.left( index ).stripWhiteSpace();
+       cmt = aTmp.mid( index+1 ).stripWhiteSpace();
+      }
+      // if comment is not empty, try to get keyword from it (separated by ':' symbol)
+      if ( !cmt.isEmpty() ) {
+       int index1 = cmt.find( ":" );
+       if ( index1 >= 0 ) {
+         QString tmpstr = cmt.left( index1 ).stripWhiteSpace();
+         if ( tmpstr == QString( "TITLE" ) ||
+              tmpstr == QString( "COLUMN_TITLES" ) ||
+              tmpstr == QString( "COLUMN_UNITS" ) ||
+              tmpstr == QString( "COMMENT" ) ) {
+           keyword = tmpstr;
+           cmt = cmt.mid( index1+1 ).stripWhiteSpace();
+         }
        }
-       if(MYDEBUG) cout<<endl;
-      }else if(aTmp.find("#COLUMN_UNITS:") == 0){
-       int aLen = aTmp.find(":") + 1;
-       aTmp.remove(0,aLen);
-       QStringList aStrList = QStringList::split(" ",aTmp);
-       if(MYDEBUG) cout<<"Its Column Units : ";
-       for(int i = 0; i < aStrList.count(); i++){
-         aTmp = aStrList[i].stripWhiteSpace();
-         aTable2D.myColumnUnits.push_back(aTmp.latin1());
-         if(MYDEBUG) cout<<"\t"<<aTmp;
+      }
+      // if data is empty, process only comment
+      if ( data.isEmpty() ) {
+       // if keyword is found, try to process it
+       // elsewise it is a simple comment, just ignore it
+       if ( !keyword.isEmpty() ) {
+         if ( keyword == QString( "TITLE" ) ) {
+           QString title = cmt;
+           if ( aTable2D.myTitle != "" )
+             title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
+           if(MYDEBUG) cout << "...Table TITLE is: " << title.latin1() << endl;
+           aTable2D.myTitle = title.latin1();
+         }
+         else if ( keyword == QString( "COLUMN_TITLES" ) ) {
+           // comment may contain column headers
+           QStringList aStrList = QStringList::split( "|", cmt );
+           if(MYDEBUG) cout << "...Column TITLES are: ";
+           for ( int i = 0; i < aStrList.count(); i++ ) {
+             QString tmpstr = aStrList[ i ].stripWhiteSpace();
+             if(MYDEBUG) cout << tmpstr.latin1() << " ";
+             aTable2D.myColumnTitles.push_back( tmpstr.latin1() );
+           }
+           if(MYDEBUG) cout << endl;
+         }
+         else if ( keyword == QString( "COLUMN_UNITS" ) ) {
+           // comment may contain column units
+           QStringList aStrList = QStringList::split( " ", cmt );
+           if(MYDEBUG) cout << "...Column UNITS are: ";
+           for ( int i = 0; i < aStrList.count(); i++ ) {
+             QString tmpstr = aStrList[ i ].stripWhiteSpace();
+             if(MYDEBUG) cout << tmpstr.latin1() << " ";
+             aTable2D.myColumnUnits.push_back( tmpstr.latin1() );
+           }
+           if(MYDEBUG) cout << endl;
+         }
+         else if ( keyword == QString( "COMMENT" ) ) {
+           // keyword 'COMMENT' processing can be here
+           // currently it is ignored
+           if(MYDEBUG) cout << "...COMMENT: " << cmt.latin1() << endl;
+         }
+       }
+       else {
+         if(MYDEBUG) cout << "...comment: " << cmt.latin1() << endl;
+         // simple comment processing can be here
+         // currently it is ignored
        }
-       if(MYDEBUG) cout<<endl;
-      }else if(aTmp.find("#") == 0){
-       //It is a comment
-      }else if(aTmp.find("#TITLE:") > 0){
-       QStringList aStrList = QStringList::split("#TITLE:",aTmp);
-       QString aTitle = aStrList[1].stripWhiteSpace();
+      }
+      // if data is not empty, try to process it
+      else {
        TRow aRow; 
-       aRow.myTitle = aTitle.latin1();
-       if(MYDEBUG) cout<<aTitle<<" : ";
-       QStringList aValList = QStringList::split(" ",aStrList[0]);
-       for(int i = 0; i < aValList.count(); i++){
-         float aVal = aValList[i].toFloat();
-         aRow.myValues.push_back(aVal);
-         if(MYDEBUG) cout<<"\t"<<aVal;
+       if(MYDEBUG) cout << "...New row is found: " << endl;
+       if ( !cmt.isEmpty() ) {
+         aRow.myTitle = cmt.latin1();
+         if(MYDEBUG) cout << "......ROW TITLE is: " << cmt.latin1() << endl;
+       }
+       QStringList aValList = QStringList::split( " ", data );
+       for ( int i = 0; i < aValList.count(); i++ ) {
+         if ( aValList[i].stripWhiteSpace() != "" ) {
+           TValue aVal = aValList[i].stripWhiteSpace().latin1();
+           aRow.myValues.push_back( aVal );
+         }
        }
-       aTable2D.myRows.push_back(aRow);
-       if(MYDEBUG) cout<<endl;
-      }else{
-       TRow aRow;
+       if( aRow.myValues.size() > 0 )
+         aTable2D.myRows.push_back( aRow );
+       // ************** OLD CODE ******************
+       /*
        TValue aVal;
-       istrstream aStream(aTmp);
-       aStream.precision(STRPRECISION);
-       while(aStream>>aVal){
-         aRow.myValues.push_back(aVal);
-         if(MYDEBUG) cout<<"\t"<<aVal;
+       istrstream aStream( data );
+       aStream.precision( STRPRECISION );
+       while( aStream >> aVal ) {
+         aRow.myValues.push_back( aVal );
        }
-       if(aRow.myValues.size() > 0)
-         aTable2D.myRows.push_back(aRow);
-       if(MYDEBUG) cout<<endl;
+       if( aRow.myValues.size() > 0 )
+         aTable2D.myRows.push_back( aRow );
+       */
+       // ************** OLD CODE ******************
       }
-      getLine(aStmIn,aTmp);
+      getLine( aStmIn, aTmp );
     }
-    if(aTable2D.Check()){
-      if(MYDEBUG) cout<<"aTable2D checked "<<aTable2D.myTitle<<endl;
-      theTableCont.push_back(aTable2D);
+    if( aTable2D.Check() ) {
+      if(MYDEBUG) cout << "aTable2D is checked OK " << aTable2D.myTitle << endl;
+      theTableCont.push_back( aTable2D );
     }
-  }while(!aStmIn.eof());
+  }
+  while( !aStmIn.eof() );
   aStmIn.close();
-  if(MYDEBUG) cout<<"After close"<<endl;
+  if(MYDEBUG) cout << "After close" << endl;
 }
 
 SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy){
@@ -1056,7 +1125,6 @@ SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Stud
   SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
   QFileInfo aFileInfo(theFileName);
   aName->SetValue(aFileInfo.fileName().latin1());
-  int iEnd = aTableCont.size();
   for(int i = 0, iEnd = aTableCont.size(); i < iEnd; i++){
     const TTable2D& aTable2D = aTableCont[i];
     SALOMEDS::SObject_var aRealObject = aStudyBuilder->NewObject(aFileObject);
@@ -1078,12 +1146,16 @@ SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Stud
     int kEnd = aNewTable2D.myRows[0].myValues.size();
     aTableOfReal->SetNbColumns(kEnd);
     for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++){
-      if(MYDEBUG) cout<<"j = "<<j<<endl;
-      SALOMEDS::DoubleSeq_var aDoubleSeq = new SALOMEDS::DoubleSeq();
-      aDoubleSeq->length(kEnd);
-      if(MYDEBUG) cout<<"kEnd = "<<kEnd<<endl;
-      for(int k = 0; k < kEnd; k++) aDoubleSeq[k] = aNewTable2D.myRows[j].myValues[k];
-      aTableOfReal->AddRow(aDoubleSeq.in());
+      if(MYDEBUG) cout<<"j = "<<j<<"; kEnd = "<<kEnd<<endl;
+
+      for(int k = 0; k < kEnd; k++){
+       QString aVal = aNewTable2D.myRows[j].myValues[k].c_str();
+       bool anIsOk = false;
+       double aValue = aVal.toDouble(&anIsOk);
+       if(anIsOk && !aVal.contains("NAN",false) && !aVal.contains("INF",false))
+         aTableOfReal->PutValue(aValue,j+1,k+1);
+      }
+
       aTableOfReal->SetRowTitle(j+1,aNewTable2D.myRows[j].myTitle.c_str());
       aTableOfReal->SetRowUnit(j+1,aNewTable2D.myRows[j].myUnit.c_str());
     }