[Echempp-devel] GUI/Windows/Qt/EChem++/Experiment caExcitationFunctionDialog.cpp, 1.21, 1.22 cvExc
Status: Beta
Brought to you by:
berndspeiser
|
From: beeblbrox <bee...@us...> - 2007-12-27 19:20:02
|
Update of /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv13984/GUI/Windows/Qt/EChem++/Experiment Modified Files: caExcitationFunctionDialog.cpp cvExcitationFunctionDialog.cpp optionsDialog.hpp userDefinedEtExcitationFunctionDialog.cpp userDefinedItExcitationFunctionDialog.cpp Log Message: Changed. All I/O is now within modelMainWindow to improve compilation time. Index: cvExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/cvExcitationFunctionDialog.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** cvExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.27 --- cvExcitationFunctionDialog.cpp 27 Dec 2007 19:19:55 -0000 1.28 *************** *** 30,33 **** --- 30,34 ---- #include "cvExcitationFunctionDialog.hpp" #include "experimentError.hpp" + #include "Model/modelMainWindow.hpp" //STL includes *************** *** 1028,1056 **** } ! 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; _xmax = this->time2pixel( _EtFunction.maximum() ); _segmentNumber = _EtFunction.size()-1; --- 1029,1033 ---- } ! _EtFunction = ::GUI::model::ModelMainWindow::readEtExcitationFunction(fileName.ascii()); _xmax = this->time2pixel( _EtFunction.maximum() ); _segmentNumber = _EtFunction.size()-1; *************** *** 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(); } --- 1069,1073 ---- fileName.append(".xml"); } ! ::GUI::model::ModelMainWindow::saveEtExcitationFunction(fileName.ascii(), _EtFunction); } Index: optionsDialog.hpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/optionsDialog.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** optionsDialog.hpp 29 Nov 2006 15:36:16 -0000 1.4 --- optionsDialog.hpp 27 Dec 2007 19:19:55 -0000 1.5 *************** *** 28,33 **** #define OPTIONS_DIALOG_HPP - - #include "optionsDialogBase.h" --- 28,31 ---- Index: userDefinedItExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/userDefinedItExcitationFunctionDialog.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** userDefinedItExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.5 --- userDefinedItExcitationFunctionDialog.cpp 27 Dec 2007 19:19:55 -0000 1.6 *************** *** 31,34 **** --- 31,35 ---- #include "userDefinedItExcitationFunctionDialog.hpp" #include "experimentError.hpp" + #include "Model/modelMainWindow.hpp" //STL includes *************** *** 324,355 **** const std::string id = _itFunction.segment(i)->id(); ! if( id == "Constant" ) { efType.push_back(0); } ! else if( id == "Linear" ) { efType.push_back(1); } ! else if( id == "Sine" ) { efType.push_back(2); } ! else if( id == "Exp" ) { efType.push_back(3); } ! else if( id == "Power" ) { efType.push_back(4); } ! else if( id == "PowerExp" ) { efType.push_back(5); } ! else if( id == "Cosine" ) ! { ! efType.push_back(6); ! } else --- 325,357 ---- const std::string id = _itFunction.segment(i)->id(); ! if( id == ConstantitSegment::GUID ) { efType.push_back(0); } ! else if( id == LinearitSegment::GUID ) { efType.push_back(1); } ! else if( id == SineitSegment::GUID ) { efType.push_back(2); } ! else if( id == ExponentialitSegment::GUID ) { efType.push_back(3); } ! else if( id == PoweritSegment::GUID ) { efType.push_back(4); } ! else if( id == PowerExponentialitSegment::GUID ) { efType.push_back(5); } ! // There are no Cosine Segments! ! // else if( id == CosineitSegment::GUID ) ! // { ! // efType.push_back(6); ! // } else *************** *** 369,376 **** } - // catch( ExcitationFunctions::LoadError& error ) - // { - // QMessageBox::warning( this, "Load button", error.message().c_str() ); - // } catch( const ExperimentError& error ) { --- 371,374 ---- *************** *** 1424,1450 **** try { ! 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; --- 1422,1426 ---- try { ! itExcitationFunction temp = ::GUI::model::ModelMainWindow::readitExcitationFunction(fileName.ascii()); std::vector<int> efType; *************** *** 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(); } --- 1509,1513 ---- fileName.append(".xml"); } ! ::GUI::model::ModelMainWindow::saveitExcitationFunction(fileName.ascii(), _itFunction); } Index: caExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/caExcitationFunctionDialog.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** caExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.21 --- caExcitationFunctionDialog.cpp 27 Dec 2007 19:19:55 -0000 1.22 *************** *** 30,33 **** --- 30,34 ---- #include "caExcitationFunctionDialog.hpp" #include "experimentError.hpp" + #include "Model/modelMainWindow.hpp" //STL includes *************** *** 960,989 **** _RemoveLE->setText("0"); } ! ! 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; _xmax = this->time2pixel( _EtFunction.maximum() ); _segmentNumber = _EtFunction.size()-1; --- 961,965 ---- _RemoveLE->setText("0"); } ! _EtFunction = ::GUI::model::ModelMainWindow::readEtExcitationFunction(fileName.ascii()); _xmax = this->time2pixel( _EtFunction.maximum() ); _segmentNumber = _EtFunction.size()-1; *************** *** 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(); } --- 1002,1006 ---- fileName.append(".xml"); } ! ::GUI::model::ModelMainWindow::saveEtExcitationFunction(fileName.ascii(), _EtFunction); } Index: userDefinedEtExcitationFunctionDialog.cpp =================================================================== RCS file: /cvsroot/echempp/GUI/Windows/Qt/EChem++/Experiment/userDefinedEtExcitationFunctionDialog.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** userDefinedEtExcitationFunctionDialog.cpp 22 Dec 2007 15:51:24 -0000 1.5 --- userDefinedEtExcitationFunctionDialog.cpp 27 Dec 2007 19:19:55 -0000 1.6 *************** *** 30,33 **** --- 30,34 ---- #include "userDefinedEtExcitationFunctionDialog.hpp" #include "experimentError.hpp" + #include "Model/modelMainWindow.hpp" //STL includes *************** *** 302,322 **** const std::string id = _EtFunction.segment(i)->id(); ! if( id == "Constant" ) { efType.push_back(0); } ! else if( id == "Linear" ) { efType.push_back(1); } ! else if( id == "Sine" ) { efType.push_back(2); } ! else if( id == "Exp" ) { efType.push_back(3); } ! else if( id == "Power" ) { efType.push_back(4); --- 303,323 ---- const std::string id = _EtFunction.segment(i)->id(); ! if( id == ConstantEtSegment::GUID ) { efType.push_back(0); } ! else if( id == LinearEtSegment::GUID ) { efType.push_back(1); } ! else if( id == SineEtSegment::GUID ) { efType.push_back(2); } ! else if( id == ExponentialEtSegment::GUID ) { efType.push_back(3); } ! else if( id == PowerEtSegment::GUID ) { efType.push_back(4); *************** *** 1350,1378 **** try { ! 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; unsigned int i = 0; --- 1351,1357 ---- try { ! EtExcitationFunction temp = ::GUI::model::ModelMainWindow::readEtExcitationFunction(fileName.ascii()); ! ! std::vector<int> efType; unsigned int i = 0; *************** *** 1382,1402 **** id = temp.segment(i)->id(); ! if( id == "Constant" ) { efType.push_back(0); } ! else if( id == "Linear" ) { efType.push_back(1); } ! else if( id == "Sine" ) { efType.push_back(2); } ! else if( id == "Exp" ) { efType.push_back(3); } ! else if( id == "Power" ) { efType.push_back(4); --- 1361,1381 ---- id = temp.segment(i)->id(); ! if( id == ConstantEtSegment::GUID ) { efType.push_back(0); } ! else if( id == LinearEtSegment::GUID ) { efType.push_back(1); } ! else if( id == SineEtSegment::GUID ) { efType.push_back(2); } ! else if( id == ExponentialEtSegment::GUID ) { efType.push_back(3); } ! else if( id == PowerEtSegment::GUID ) { efType.push_back(4); *************** *** 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(); } --- 1430,1434 ---- fileName.append(".xml"); } ! ::GUI::model::ModelMainWindow::saveEtExcitationFunction(fileName.ascii(), _EtFunction); } |