mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 00:45:36 +00:00
saving PDF is optional when saving plot
This commit is contained in:
parent
c81316ef32
commit
97267c196f
@ -683,7 +683,7 @@ void Plot::display(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plot::save(string dirName)
|
void Plot::save(string dirName, bool savePdf)
|
||||||
{
|
{
|
||||||
vector<string> commandBack;
|
vector<string> commandBack;
|
||||||
string path, terminalBack, outputBack, gpCommand, scriptName;
|
string path, terminalBack, outputBack, gpCommand, scriptName;
|
||||||
@ -691,11 +691,6 @@ void Plot::save(string dirName)
|
|||||||
ofstream script;
|
ofstream script;
|
||||||
|
|
||||||
mode755 = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
|
mode755 = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
|
||||||
|
|
||||||
// backup I/O parameters
|
|
||||||
terminalBack = options_.terminal;
|
|
||||||
outputBack = options_.output;
|
|
||||||
commandBack = plotCommand_;
|
|
||||||
|
|
||||||
// generate directory
|
// generate directory
|
||||||
if (mkdir(dirName))
|
if (mkdir(dirName))
|
||||||
@ -703,12 +698,20 @@ void Plot::save(string dirName)
|
|||||||
LATAN_ERROR(Io, "impossible to create directory '" + dirName + "'");
|
LATAN_ERROR(Io, "impossible to create directory '" + dirName + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// backup I/O parameters
|
||||||
|
terminalBack = options_.terminal;
|
||||||
|
outputBack = options_.output;
|
||||||
|
commandBack = plotCommand_;
|
||||||
|
|
||||||
// save PDF
|
// save PDF
|
||||||
options_.terminal = "pdf";
|
if (savePdf)
|
||||||
options_.output = dirName + "/plot.pdf";
|
{
|
||||||
display();
|
options_.terminal = "pdf";
|
||||||
options_.terminal = terminalBack;
|
options_.output = dirName + "/plot.pdf";
|
||||||
options_.output = outputBack;
|
display();
|
||||||
|
options_.terminal = terminalBack;
|
||||||
|
options_.output = outputBack;
|
||||||
|
}
|
||||||
|
|
||||||
// save script and datafiles
|
// save script and datafiles
|
||||||
for (unsigned int i = 0; i < tmpFileName_.size(); ++i)
|
for (unsigned int i = 0; i < tmpFileName_.size(); ++i)
|
||||||
|
@ -377,7 +377,7 @@ public:
|
|||||||
Plot & operator<<(PlotModifier &&modifier);
|
Plot & operator<<(PlotModifier &&modifier);
|
||||||
// plot parsing and output
|
// plot parsing and output
|
||||||
void display(void);
|
void display(void);
|
||||||
void save(std::string dirName);
|
void save(std::string dirName, bool savePdf = true);
|
||||||
friend std::ostream & operator<<(std::ostream &out, const Plot &plot);
|
friend std::ostream & operator<<(std::ostream &out, const Plot &plot);
|
||||||
// plot reset
|
// plot reset
|
||||||
void reset(void);
|
void reset(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user