[Echempp-devel] GUI/Windows/Qt/EChem++/Experiment Makefile.am, 1.13, 1.14 caExcitationFunctionDialo
Status: Beta
Brought to you by:
berndspeiser
|
From: beeblbrox <bee...@us...> - 2007-12-22 15:51:37
|
Update of /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv25843/GUI/Windows/Qt/EChem++/Experiment Modified Files: Makefile.am caExcitationFunctionDialog.cpp cvExcitationFunctionDialog.cpp userDefinedEtExcitationFunctionDialog.cpp userDefinedItExcitationFunctionDialog.cpp Log Message: Switch to boost::serialization. Index: cvExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/cvExcitationFunctionDialog.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** cvExcitationFunctionDialog.cpp 19 Dec 2007 13:11:34 -0000 1.26 --- cvExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.27 *************** *** 61,68 **** - //BSUtilities includes - #include "xmlReader.h" - #include "xmlwriter.h" - //namespaces --- 61,64 ---- *************** *** 262,269 **** } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 258,261 ---- *************** *** 1023,1027 **** } - try { --- 1015,1018 ---- *************** *** 1038,1042 **** EtExcitationFunction temp; ! // BSUtilities::xmlr::xmlLoad (fileName.ascii(), temp); _EtFunction = temp; --- 1029,1054 ---- EtExcitationFunction temp; ! ExcitationFunctions::Segments::LinearEtSegment temp_seg(1,2,3); ! std::ifstream ifs_xml(fileName.ascii()); ! if(!ifs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg(fileName)); ! return; ! } ! boost::archive::xml_iarchive ia_xml(ifs_xml); ! try ! { ! ia_xml >> BOOST_SERIALIZATION_NVP(temp); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ! ifs_xml.close(); ! return; ! } ! ifs_xml.close(); _EtFunction = temp; *************** *** 1056,1065 **** } - } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 1068,1072 ---- *************** *** 1085,1089 **** fileName.append(".xml"); } ! // BSUtilities::xmlw::save(fileName.ascii(), _EtFunction); } --- 1092,1114 ---- fileName.append(".xml"); } ! std::ofstream ofs_xml(fileName.ascii()); ! if(!ofs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg( fileName.ascii() ) ); ! return; ! } ! boost::archive::xml_oarchive oa_xml(ofs_xml); ! try{ ! oa_xml << BOOST_SERIALIZATION_NVP(_EtFunction); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ofs_xml.close(); ! return; ! } ! ofs_xml.close(); } Index: userDefinedItExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/userDefinedItExcitationFunctionDialog.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** userDefinedItExcitationFunctionDialog.cpp 19 Dec 2007 13:11:34 -0000 1.4 --- userDefinedItExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.5 *************** *** 61,68 **** #include <qpushbutton.h> - //BSUtilities includes - #include "xmlReader.h" - #include "xmlwriter.h" - //namespaces --- 61,64 ---- *************** *** 324,333 **** unsigned int i = 0; - std::string id; for(;i<_itFunction.size();++i) { ! // id = _itFunction.segment(i)->id(); ! // TODO FIXME ! id = ""; if( id == "Constant" ) --- 320,326 ---- unsigned int i = 0; for(;i<_itFunction.size();++i) { ! const std::string id = _itFunction.segment(i)->id(); if( id == "Constant" ) *************** *** 1432,1436 **** { itExcitationFunction temp; ! // BSUtilities::xmlr::xmlLoad(fileName.ascii(), temp); std::vector<int> efType; --- 1425,1450 ---- { itExcitationFunction temp; ! ExcitationFunctions::Segments::LinearitSegment temp_seg(1,2,3); ! std::ifstream ifs_xml(fileName.ascii()); ! if(!ifs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg(fileName)); ! return; ! } ! boost::archive::xml_iarchive ia_xml(ifs_xml); ! try ! { ! ia_xml >> BOOST_SERIALIZATION_NVP(temp); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ! ifs_xml.close(); ! return; ! } ! ifs_xml.close(); std::vector<int> efType; *************** *** 1440,1446 **** for(;i<temp.size();++i) { ! // id = temp.segment(i)->id(); ! // TODO FIXME ! id = ""; if( id == "Constant" ) --- 1454,1458 ---- for(;i<temp.size();++i) { ! id = temp.segment(i)->id(); if( id == "Constant" ) *************** *** 1497,1504 **** } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 1509,1512 ---- *************** *** 1525,1529 **** fileName.append(".xml"); } ! // BSUtilities::xmlw::save(fileName.ascii(), _itFunction); } --- 1533,1555 ---- fileName.append(".xml"); } ! std::ofstream ofs_xml(fileName.ascii()); ! if(!ofs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg( fileName.ascii() ) ); ! return; ! } ! boost::archive::xml_oarchive oa_xml(ofs_xml); ! try{ ! oa_xml << BOOST_SERIALIZATION_NVP(_itFunction); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ofs_xml.close(); ! return; ! } ! ofs_xml.close(); } Index: caExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/caExcitationFunctionDialog.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** caExcitationFunctionDialog.cpp 19 Dec 2007 13:11:34 -0000 1.20 --- caExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.21 *************** *** 56,63 **** #include <qpushbutton.h> - //BSUtilities includes - #include "xmlReader.h" - #include "xmlwriter.h" - using namespace ExcitationFunctions; using namespace quantity; --- 56,59 ---- *************** *** 233,240 **** } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 229,232 ---- *************** *** 956,964 **** return; } - try { - // else delete drawings and load function. if( _segmentNumber > -1 ) --- 948,954 ---- *************** *** 972,976 **** EtExcitationFunction temp; ! // BSUtilities::xmlr::xmlLoad (fileName.ascii(), temp); _EtFunction = temp; --- 962,987 ---- EtExcitationFunction temp; ! ExcitationFunctions::Segments::LinearEtSegment temp_seg(1,2,3); ! std::ifstream ifs_xml(fileName.ascii()); ! if(!ifs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg(fileName)); ! return; ! } ! boost::archive::xml_iarchive ia_xml(ifs_xml); ! try ! { ! ia_xml >> BOOST_SERIALIZATION_NVP(temp); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ! ifs_xml.close(); ! return; ! } ! ifs_xml.close(); _EtFunction = temp; *************** *** 992,999 **** } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 1003,1006 ---- *************** *** 1019,1023 **** fileName.append(".xml"); } ! // BSUtilities::xmlw::save(fileName.ascii(), _EtFunction); } --- 1026,1049 ---- fileName.append(".xml"); } ! std::ofstream ofs_xml(fileName.ascii()); ! if(!ofs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg( fileName.ascii() ) ); ! return; ! } ! boost::archive::xml_oarchive oa_xml(ofs_xml); ! try ! { ! oa_xml << BOOST_SERIALIZATION_NVP(_EtFunction); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ofs_xml.close(); ! return; ! } ! ofs_xml.close(); } Index: Makefile.am =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.am 26 Feb 2007 17:33:55 -0000 1.13 --- Makefile.am 22 Dec 2007 15:51:23 -0000 1.14 *************** *** 90,94 **** experiment_LDFLAGS = $(GUI_LDFLAGS) ! experiment_CXXFLAGS = -DTIXML_USE_STL=YES $(CXXFLAGS) $(QT_CXXFLAGS) experiment_LDADD = ../../../../../Utilities/Algorithms/libeppAlgorithms.la ../../../../../Experiment/ExcitationFunction/libeppExcitationFunction.la -L$(QUANTITIESLIB) -lPhysicalQuantities -lQuantity -L$(BSUTILITIESLIB) -lBSUtilities -L$(LOKILIB) -lloki $(QT_LDADD) --- 90,94 ---- experiment_LDFLAGS = $(GUI_LDFLAGS) ! experiment_CXXFLAGS = $(CXXFLAGS) $(QT_CXXFLAGS) experiment_LDADD = ../../../../../Utilities/Algorithms/libeppAlgorithms.la ../../../../../Experiment/ExcitationFunction/libeppExcitationFunction.la -L$(QUANTITIESLIB) -lPhysicalQuantities -lQuantity -L$(BSUTILITIESLIB) -lBSUtilities -L$(LOKILIB) -lloki $(QT_LDADD) Index: userDefinedEtExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/userDefinedEtExcitationFunctionDialog.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** userDefinedEtExcitationFunctionDialog.cpp 19 Dec 2007 13:11:34 -0000 1.4 --- userDefinedEtExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.5 *************** *** 60,67 **** #include <qpushbutton.h> - //BSUtilities includes - #include "xmlReader.h" - #include "xmlwriter.h" - //namespaces --- 60,63 ---- *************** *** 302,311 **** unsigned int i = 0; - std::string id; for(;i<_EtFunction.size();++i) { ! // id = _EtFunction.segment(i)->id(); ! // TODO FIXME ! id = ""; if( id == "Constant" ) --- 298,304 ---- unsigned int i = 0; for(;i<_EtFunction.size();++i) { ! const std::string id = _EtFunction.segment(i)->id(); if( id == "Constant" ) *************** *** 345,352 **** } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 338,341 ---- *************** *** 1362,1366 **** { EtExcitationFunction temp; ! // BSUtilities::xmlr::xmlLoad (fileName.ascii(), temp); std::vector<int> efType; --- 1351,1376 ---- { EtExcitationFunction temp; ! ExcitationFunctions::Segments::LinearEtSegment temp_seg(1,2,3); ! std::ifstream ifs_xml(fileName.ascii()); ! if(!ifs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg(fileName)); ! return; ! } ! boost::archive::xml_iarchive ia_xml(ifs_xml); ! try ! { ! ia_xml >> BOOST_SERIALIZATION_NVP(temp); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ! ifs_xml.close(); ! return; ! } ! ifs_xml.close(); std::vector<int> efType; *************** *** 1370,1376 **** for(;i<temp.size();++i) { ! // id = temp.segment(i)->id(); ! // TODO FIXME ! id = ""; if( id == "Constant" ) --- 1380,1384 ---- for(;i<temp.size();++i) { ! id = temp.segment(i)->id(); if( id == "Constant" ) *************** *** 1419,1426 **** } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 1427,1430 ---- *************** *** 1447,1451 **** fileName.append(".xml"); } ! // BSUtilities::xmlw::save(fileName.ascii(), _EtFunction); } --- 1451,1473 ---- fileName.append(".xml"); } ! std::ofstream ofs_xml(fileName.ascii()); ! if(!ofs_xml) ! { ! QMessageBox::warning( 0, QObject::tr( "I/O Warning" ), ! QObject::tr( "Cannot open file %1" ).arg( fileName.ascii() ) ); ! return; ! } ! boost::archive::xml_oarchive oa_xml(ofs_xml); ! try{ ! oa_xml << BOOST_SERIALIZATION_NVP(_EtFunction); ! } ! catch(std::exception& e) ! { ! QMessageBox::critical( 0, QObject::tr( "Critical Error" ), ! QObject::tr(e.what()) ); ! ofs_xml.close(); ! return; ! } ! ofs_xml.close(); } |