|
From: Erik H. <eh...@us...> - 2015-10-27 10:03:08
|
Update of /cvsroot/jsbsim/JSBSim/utils/aeromatic++ In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13063 Modified Files: Aircraft.cpp aeromatic.cpp Log Message: Try to explain why certain information is asked and how important it is for the configuration Set 'create subdirectory' to true by default now that System files also can write to it's own files Test for _overwrite when generating System files too Index: Aircraft.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/Aircraft.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** Aircraft.cpp 26 Oct 2015 18:05:13 -0000 1.22 --- Aircraft.cpp 27 Oct 2015 10:03:05 -0000 1.23 *************** *** 41,45 **** _subtype(0), _overwrite(true), ! _subdir(false), _engines(0), _aircraft(p) --- 41,45 ---- _subtype(0), _overwrite(true), ! _subdir(true), _engines(0), _aircraft(p) *************** *** 484,503 **** std::string sname = systems[i]->get_description(); std::string sfname = sname + ".xml"; - file << " <system file=\"" << sfname << "\"/>" << std::endl; ! std::string sfpath = systems_dir + "/" + sfname; ! std::ofstream sfile; ! sfile.open(sfpath.c_str()); ! if (sfile.fail() || sfile.bad()) { ! file << system << std::endl; } else { ! sfile << "<?xml version=\"1.0\"?>" << std::endl; ! sfile << "<system name=\"" << sname << "\">" << std::endl; ! sfile << system << std::endl; ! sfile << "</system>" << std::endl; } - sfile.close(); } } --- 484,514 ---- std::string sname = systems[i]->get_description(); std::string sfname = sname + ".xml"; ! if (!_overwrite && overwrite(sfname)) ! { ! std::cout << "File already exists: " << fname << std::endl; ! std::cout << "Skipping." << std::endl; } else { ! file << " <system file=\"" << sfname << "\"/>" << std::endl; ! ! std::string sfpath = systems_dir + "/" + sfname; ! std::ofstream sfile; ! sfile.open(sfpath.c_str()); ! if (sfile.fail() || sfile.bad()) ! { ! std::cout << "Error opening file: " << fname << std::endl; ! std::cout << "Skipping." << std::endl; ! } ! else ! { ! sfile << "<?xml version=\"1.0\"?>" << std::endl; ! sfile << "<system name=\"" << sname << "\">" << std::endl; ! sfile << system << std::endl; ! sfile << "</system>" << std::endl; ! } ! sfile.close(); } } } Index: aeromatic.cpp =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/utils/aeromatic++/aeromatic.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** aeromatic.cpp 22 Oct 2015 09:27:45 -0000 1.4 --- aeromatic.cpp 27 Oct 2015 10:03:05 -0000 1.5 *************** *** 74,78 **** cout << endl; cout << "** AeromatiC++ version " << AEROMATIC_VERSION_STR << endl; ! cout << "A JSBSim configuration file generation utility" << endl << endl; cout << "You can always enter 'h' to get verbose help" << endl << endl; --- 74,79 ---- cout << endl; cout << "** AeromatiC++ version " << AEROMATIC_VERSION_STR << endl; ! cout << "Aeromatiic is a JSBSim configuration file generation utility." << endl; ! cout << "Please enter aircraft data when prompted." << endl << endl; cout << "You can always enter 'h' to get verbose help" << endl << endl; *************** *** 123,125 **** --- 124,130 ---- } cout << endl << endl; + + cout << "Press enter to continue." << endl; + string input; + getline(cin, input); } |