Skip to content
Snippets Groups Projects
Commit 934af047 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

start modification of gp, gf. Aim: enable appending.

parent 1412fa27
No related branches found
No related tags found
No related merge requests found
......@@ -303,9 +303,8 @@ bool frida_command(string cmd)
" gd graphic dialog (feed commands to gnuplot)\n"
"Save for print:\n"
" gp plot to complete .ps file\n"
" gP ditto, no automatic file name\n"
" gf plot to short .psX file\n"
" gF ditto, no automatic file name\n"
" gfa append plot to existing .ps or .psa file\n"
"Change window:\n"
" gw list of plot windows\n"
" g<n> switch to plot window <n>\n"
......@@ -351,15 +350,18 @@ bool frida_command(string cmd)
SPloWin::instance()->current()->refine = bask(
"Allow iterative refinement for curve plotting",
SPloWin::instance()->current()->refine);
} else if (cmd == "gp" || cmd == "gP" || cmd == "gf" || cmd == "gF") {
} else if (cmd == "gp" || cmd == "gf" || cmd == "gfa") {
string ps_outdir = CNode::eval("psdir")->to_s();
string ps_head = CNode::eval("pshead")->to_s();
string ps_dict = (cmd == "gp"||cmd == "gP") ? CNode::eval("psdict")->to_s() : "";
string fname = "&auto";
if (cmd == "gP" || cmd == "gF")
string ps_dict = (cmd == "gp") ? CNode::eval("psdict")->to_s() : "";
static string fname = "";
if (cmd != "gfa")
fname = sask("Graphic file name (without extension)");
else
fname = sask("Graphic file name", fname);
if (fname != "")
SPloWin::instance()->current()->write_postscript(fname, ps_outdir, ps_head, ps_dict);
SPloWin::instance()->current()->write_postscript(
cmd=="gfa", fname, ps_outdir, ps_head, ps_dict);
} else if (cmd == "gw") {
SPloWin::instance()->display_list();
} else if (sscanf(cmd.c_str(), "g%i", &i) == 1) {
......
......@@ -317,7 +317,8 @@ void CPlot::doc_CvTxLine(const string& line, int num)
//! Write buffered plot to postscript file.
void CPlot::write_postscript(
const string& fname, const string& ps_outdir, const string& ps_head, const string& ps_dict)
const bool append, const string& fname, const string& ps_outdir,
const string& ps_head, const string& ps_dict)
{
// construct output file name:
string ext = string(".") + (ps_dict == "" ? "psa" : "ps");
......
......@@ -40,8 +40,8 @@ public:
void doc_PtTxLine(const std::string& line, int num);
void doc_CvTxLine(const std::string& line, int num);
void write_postscript(
const std::string& fname, const std::string& ps_outdir, const std::string& ps_head,
const std::string& ps_dict);
const bool append, const std::string& fname, const std::string& ps_outdir,
const std::string& ps_head, const std::string& ps_dict);
void set_aux(const std::string& cmd);
std::string info() const;
......
......@@ -11,7 +11,7 @@ iFrame 0 eq
10 dup autolabel defsiz
1 dup geld stdred
2 -11 setnewpage newpage
1 1 13 -14 setpagegrid
2 4 13 -14 setpagegrid
2 8 24 abcset % usage: {(text)} abc
/EndFrame { nextFrame end } def
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment