Commit Graph

258 Commits

Author SHA1 Message Date
Holger Vogt b343bc8803 plug memory leaks for the 'plot' command 2020-01-11 11:25:14 +01:00
Jim Monte 7681f34664 Additional freeing of device-dependent information for bug #419 and related bugs. 2020-01-04 15:28:56 +01:00
Jim Monte 503af6ac00 Fixed several issues related to plotting and vector lifetimes and made ownership of vectors clearer. The issues in bugs 419, 423, 425, and 426 were related and were addressed here. 2020-01-04 15:25:31 +01:00
Jim Monte 10415875f4 Fixed "phantom vector" issue with plots and crash when plots are resized. See bugs #419 and #423 for details. Also several parameters were changed from char * to const char * in the plotting functions. 2020-01-04 15:25:15 +01:00
Jim Monte b4bbcb1497 Made ft_numparse() thread-safe (no internal static variables) and prepared to support ngspice variable type CP_NUM. 2020-01-04 11:17:54 +01:00
Holger Vogt b7bd59c22c On Linux: allow calling gnuplot without invoking a terminal.
Reported by Terry Pilling
2019-11-24 12:40:28 +01:00
Holger Vogt ec6d676920 Make CopyGraph safe against NULL argument.
Otherwise memcpy will fail.
2019-09-14 12:38:57 +02:00
Holger Vogt afdf3ff710 Partially undo commit 016c558d7, 2019-05-01
If sacles for plotting differ, issue a warning.
Skip this plot command only, when strict_errorhandling is set.
2019-08-13 23:27:15 +02:00
Holger Vogt 8af1663bba Try to detect, if one wants to plot vectors with
different scale vectors into the same graph.
Issue a warning and skip the plot command.
2019-08-13 23:26:58 +02:00
Holger Vogt 31db4228f5 fix a typo, correct writing to files under Linux 2019-08-13 22:53:41 +02:00
Holger Vogt 52584312c3 delete the plt and data files after writing eps or png
(only if gnuplot_terminal is set to eps/quit of png/quit)
2019-08-13 22:53:32 +02:00
Holger Vogt 8efa08602a no plotting, only saving to file
if gnuplot_terminal is eps/quit or png/quit
2019-08-13 22:53:24 +02:00
Holger Vogt 601dfbd781 sprintf -> snprintf: prevent buffer overflow 2019-08-13 22:53:13 +02:00
Holger Vogt ec4625eda6 redo gnuplot_terminal: Do not save eps/png automatically
none      1: do not print an eps or png file (default)
png       2: print png file, keep command window open
png/quit  3: print png file, quit command window
eps       4: print eps file, keep command window open
eps/quit  5: print eps file, quit command window
2019-08-13 22:53:00 +02:00
Holger Vogt 2344e3d012 patch no. 30 by astx:
don't show command window if gnuplot_terminal is set to png/quit
2019-08-13 22:52:49 +02:00
Holger Vogt 65ee87e0a2 grid.c, windisp.c, vertical text for postscript and WINGUI
Arial as standard font for WINGUI
2018-11-18 15:51:09 +01:00
Holger Vogt 56701e3d10 add rotation angle to text output, currently used only by postscript,
ignored by all others
2018-11-18 15:50:56 +01:00
dwarning cc4e4d9bad verify pointer before utilization 2018-11-18 15:45:12 +01:00
Holger Vogt 94fa272c9d A hack to repair bug reported by Clyde R. Shappee 2018-10-27 12:28:01 +02:00
Holger Vogt e3b2b395b9 fix an ancient bug in retrieving the data with the cursor
from a log y graph: use y-offset instead of x-offset
2018-07-26 20:55:21 +02:00
Holger Vogt 8fbcb16a57 add fourth parameter to cp_getvar(), in functions missing so far 2018-07-22 14:58:25 +02:00
Holger Vogt 09c876550f prevent string overflow by adding the string length
to the cp_getvar parameters. Used only with CP_STRING
2018-07-22 14:57:49 +02:00
Holger Vogt 417dbfef72 undo the previous commits dealing with snprintf,
use the C99 compliant function also with MS Visual Studio
2018-05-31 11:37:51 +02:00
Holger Vogt 3b4640dee4 _snprintf in Windows 7 does not automatically put a '\0'
to the end of the buffer, only if there is space available.
That will change in the future if Snprintf is used.
2018-05-31 10:24:09 +02:00
h_vogt c8cd763314 gnuplot.c, add 'noretraceplot' to prevent retracing of the graph if plotting against a vector which is not the original scale vector ('plot vec1 vs vec2') 2018-05-18 17:25:48 +02:00
h_vogt d4adb027d2 avoid retrace in output graph by adding label 'noretraceplot'
to the plot command, that creates a lin plot trying to avoid retracing
2018-05-18 17:08:27 +02:00
Holger Vogt 560cb6e970 plotting/grid.c, bug fix, avoid string buffer overflow
Prevent a crash of example/FFT_test.cir.
Buffer 'buf' in function drawlingrid() has been too small.
Increase 'buf' size, and add some protection.

The example file examples/plot/test-small-plot.cir
shows the limits of plotting:
  difference in two numbers at digit 14 is plotted well.
                            at digit 15 is plotted with bugs.
                            at digit 16 is reduced to integer.

consider compiling with
  -O1 -D_FORTIFY_SOURCE=2
for gcc, and
  /GS
for visual studio.
2018-01-27 21:58:15 +01:00
rlar 91c60c28df whitespace change, avoid gcc warnings due to missleading indentation 2017-09-16 20:38:27 +02:00
h_vogt b3827f6488 gnuplot.c, correct the setting of limits in log plots 2017-09-16 20:37:24 +02:00
h_vogt e5d70d0821 gnuplot.c, bug fix, allow gnuplot with MINGW 2017-04-09 17:53:40 +02:00
rlar 99e864b6bc graf.c, drop an excess cast 2016-10-15 15:06:18 +02:00
rlar aca1b3a374 use 'abs()' 2016-10-15 15:06:17 +02:00
h_vogt 6f609abc27 x11.c, fix bug #330, rename csh variable font -> xfont
reported by graahnul.grom in
  #330 setting xfont in .spiceinit has no effect
  https://sourceforge.net/p/ngspice/bugs/330/
2016-10-15 15:06:16 +02:00
h_vogt c0d5d054ab gnuplot.c, ft_gnuplot(), suppress generating the .eps and .png file
when the given output file name starts with "np_"
2016-10-15 12:58:29 +02:00
h_vogt 42ac9a2859 gnuplot.c, ft_writesimple(), upgrade command 'wrdata'
- remove a bug to allow printing of vectors with differing scale lengths
- add option 'numdgt' to specify the width of the numbers printed
- add variable wr_singlescale
  use 'set wr_singlescale' to print the scale vector only once
  (vectors need to have equal scale lengths)
- add variable wr_vecnames
  use 'set wr_vecnames' to print the vector names to the first row
2016-10-15 12:57:46 +02:00
h_vogt fef2e1439d gnuplot.c, ft_writesimple(), command 'wrdata', use the given filename literally 2016-10-15 12:43:19 +02:00
rlar 141ed61ec8 use memcpy() instead of deprecated bcopy() 2016-07-30 20:58:19 +02:00
h_vogt 841f2846fe plotit.c, properly free a reversed wordlist 2016-04-01 18:05:40 +02:00
rlar 9652cc46c8 plotting/graf.c, cleanup 2016-03-23 17:04:55 +01:00
rlar b1d8b99018 skip-ws, #6/6, rename to match inpcom.c 2016-03-22 15:26:10 +01:00
rlar 22875d056b skip-ws, #5/6, use functional style 2016-03-22 15:26:09 +01:00
rlar a86f2068c8 skip-ws, #3/6, use TEMPORARY macros, obj-invariant 2016-03-22 15:26:06 +01:00
rlar 6d1171ad6f skip-ws, #2/6, introduce "ngspice/stringskip.h"
with some temporary macros to skip whitespace
2016-03-22 15:26:05 +01:00
rlar 40a0cea0d2 swap some `SWAP' arguments for readability 2016-03-22 15:23:05 +01:00
rlar bd0bc3038b use `SWAP' macro 2016-03-22 13:04:13 +01:00
rlar 6fe937f931 drop unused `SWAPINT' macro 2016-03-21 21:22:23 +01:00
rlar 71a7c3459b use char variants of the <ctype.h> isxxxx() family 2016-03-09 20:24:36 +01:00
rlar 8ce99a3c66 plotting/graf.c, bug fix, dbfree1() is wanted instead of dbfree() 2016-03-09 18:23:22 +01:00
rlar df70661c3a dvec abstraction, #11/11, introduce `dvec_realloc()' 2015-12-28 20:34:42 +01:00
rlar c2a7821449 dvec abstraction, #10/11, introduce `dvec_trunc()' 2015-12-28 20:34:42 +01:00