MCPcopy Create free account
hub / github.com/JSBSim-Team/jsbsim / EmitComparisonPlot

Function EmitComparisonPlot

utils/simplot/prep_plot.cpp:729–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727// ############################################################################
728
729void EmitComparisonPlot(const vector <string>& filenames, const int index, const string linetitle)
730{
731 string varname = NamesArray[0][index-1];
732 bool fail = false;
733
734 for (unsigned int f=1;f<filenames.size();f++) {
735 if (HaveTerm(NamesArray[f],varname).size() == 0) {
736 cerr << "## Variable: " << varname << " does not exist in all files being plotted." << endl;
737 fail = true;
738 }
739 }
740
741 if (!fail) {
742 cout << "##" << endl << "##" << endl;
743 cout << "print \"Processing parameter plot: " << linetitle << "\"" << endl;
744 cout << "##" << endl << "##" << endl;
745 cout << "plot " << plot_range << " \"" << filenames[0] << "\" using 1:" << GetTermIndex(NamesArray[0],varname) << " with lines title \"" << linetitle << ": 1" << "\", \\" << endl;
746 for (unsigned int f=1;f<filenames.size()-1;f++){
747 cout << "\"" << filenames[f] << "\" using 1:" << GetTermIndex(NamesArray[f],varname) << " with lines title \"" << linetitle << ": " << f+1 << "\", \\" << endl;
748 }
749 cout << "\"" << filenames[filenames.size()-1] << "\" using 1:" << GetTermIndex(NamesArray[filenames.size()-1],varname) << " with lines title \"" << linetitle << ": " << filenames.size() << "\"" << endl;
750 }
751
752}
753
754// ############################################################################
755

Callers 1

mainFunction · 0.85

Calls 3

HaveTermFunction · 0.85
GetTermIndexFunction · 0.85
sizeMethod · 0.80

Tested by

no test coverage detected