Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
7c8ec459
Commit
7c8ec459
authored
13 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
improve comments
parent
9d6011d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pub/src/dualplot.cpp
+8
-5
8 additions, 5 deletions
pub/src/dualplot.cpp
with
8 additions
and
5 deletions
pub/src/dualplot.cpp
+
8
−
5
View file @
7c8ec459
...
@@ -27,28 +27,31 @@ CPlot::CPlot( uint _iPlot, bool _logx, bool _logy ) :
...
@@ -27,28 +27,31 @@ CPlot::CPlot( uint _iPlot, bool _logx, bool _logy ) :
iPlot
(
_iPlot
),
X
(
_logx
),
Y
(
_logy
),
iPlot
(
_iPlot
),
X
(
_logx
),
Y
(
_logy
),
maxpoints
(
20000
),
with_errors
(
true
),
equipoints
(
7
),
refine
(
true
)
maxpoints
(
20000
),
with_errors
(
true
),
equipoints
(
7
),
refine
(
true
)
{
{
// Start gnuplot. Use input redirection so that gnuplot receives
// == Initialization for Gnuplot ==
// commands from a gp_fifo which is created here.
// Create a named pipe (FIFO) that will transmit our commands to Gnuplot.
string
fn_fifo
=
string
(
"/tmp/gnuplot-"
)
+
getenv
(
"LOGNAME"
);
string
fn_fifo
=
string
(
"/tmp/gnuplot-"
)
+
getenv
(
"LOGNAME"
);
mystd
::
system
(
"rm -f "
+
fn_fifo
);
mystd
::
system
(
"rm -f "
+
fn_fifo
);
if
(
mkfifo
(
fn_fifo
.
c_str
(),
0666
))
if
(
mkfifo
(
fn_fifo
.
c_str
(),
0666
))
throw
"SYSTEM ERROR cannot make fifo "
+
fn_fifo
+
throw
"SYSTEM ERROR cannot make fifo "
+
fn_fifo
+
": will not be able to print"
;
": will not be able to print"
;
// Start a Gnuplot that will read from our pipe.
mystd
::
system
(
"gnuplot -title "
+
strg
(
iPlot
)
+
" -noraise"
+
mystd
::
system
(
"gnuplot -title "
+
strg
(
iPlot
)
+
" -noraise"
+
" < "
+
fn_fifo
+
" &"
);
" < "
+
fn_fifo
+
" &"
);
// we use open instead of fopen or ofstream,
// Open our pipe so that we can write commands to it
// because we need non-blocking mode.
// (we use 'open' instead of 'fopen' or 'ofstream',
// because we need non-blocking mode).
if
(
!
(
gp_fifo
=
open
(
fn_fifo
.
c_str
(),
O_WRONLY
)
)
)
if
(
!
(
gp_fifo
=
open
(
fn_fifo
.
c_str
(),
O_WRONLY
)
)
)
throw
"SYSTEM ERROR cannot open fifo "
+
fn_fifo
+
throw
"SYSTEM ERROR cannot open fifo "
+
fn_fifo
+
": will not be able to print"
;
": will not be able to print"
;
fcntl
(
gp_fifo
,
F_SETFL
,
O_NONBLOCK
);
fcntl
(
gp_fifo
,
F_SETFL
,
O_NONBLOCK
);
// Now the initialization _within_ Gnuplot.
gp_write
(
string
(
"set terminal x11"
)
);
gp_write
(
string
(
"set terminal x11"
)
);
// == Initialization for PostScript ==
ps_fnum
=
0
;
ps_fnum
=
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment