From 8d986e50ccf41f8f4806d95f3effd8cfa5d71584 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 16 Feb 2020 13:50:08 +0100 Subject: [PATCH] remove the remains of the old xgraph program that has not been supported for many years --- src/frontend/Makefile.am | 2 - src/frontend/commands.c | 9 -- src/frontend/plotting/Makefile.am | 5 +- src/frontend/plotting/gnuplot.c | 1 - src/frontend/plotting/plotit.c | 14 --- src/frontend/plotting/xgraph.c | 167 ------------------------------ src/frontend/plotting/xgraph.h | 13 --- visualc/vngspice.vcxproj | 1 - 8 files changed, 2 insertions(+), 210 deletions(-) delete mode 100644 src/frontend/plotting/xgraph.c delete mode 100644 src/frontend/plotting/xgraph.h diff --git a/src/frontend/Makefile.am b/src/frontend/Makefile.am index 46000d289..2ebd79e19 100644 --- a/src/frontend/Makefile.am +++ b/src/frontend/Makefile.am @@ -69,8 +69,6 @@ libfte_la_SOURCES = \ com_sysinfo.c \ com_unset.c \ com_unset.h \ - com_xgraph.c \ - com_xgraph.h \ completion.h \ control.h \ control.c \ diff --git a/src/frontend/commands.c b/src/frontend/commands.c index be8d8e394..119bd1dcc 100644 --- a/src/frontend/commands.c +++ b/src/frontend/commands.c @@ -47,7 +47,6 @@ #include "com_let.h" #include "com_plot.h" #include "com_setscale.h" -#include "com_xgraph.h" #include "com_gnuplot.h" #include "com_state.h" #include "com_chdir.h" @@ -205,10 +204,6 @@ struct comm spcp_coms[] = { { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Perform matrix transposition on multi-D vectors." } , - { "xgraph", com_xgraph, FALSE, TRUE, - { 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, - NULL, - "file plotargs : Send plot to Xgraph-11." } , { "gnuplot", com_gnuplot, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 2, LOTS, NULL, @@ -689,10 +684,6 @@ struct comm nutcp_coms[] = { { 040000, 040000, 040000, 040000 }, E_DEFHMASK, 1, LOTS, NULL, "varname ... : Perform matrix transposition on multi-D vectors." } , - { "xgraph", com_xgraph, FALSE, TRUE, - { 1, 041000, 041000, 041000 }, E_DEFHMASK, 1, LOTS, - NULL, - "file plotargs : Send plot to Xgraph-11." } , { "gnuplot", com_gnuplot, FALSE, TRUE, { 1, 041000, 041000, 041000 }, E_DEFHMASK, 2, LOTS, NULL, diff --git a/src/frontend/plotting/Makefile.am b/src/frontend/plotting/Makefile.am index 055cb75d3..d641bd116 100644 --- a/src/frontend/plotting/Makefile.am +++ b/src/frontend/plotting/Makefile.am @@ -26,9 +26,8 @@ libplotting_la_SOURCES = \ if !NO_X libplotting_la_SOURCES += \ x11.c \ - x11.h \ - xgraph.c \ - xgraph.h + x11.h + endif AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -I$(top_srcdir)/src/frontend @X_CFLAGS@ diff --git a/src/frontend/plotting/gnuplot.c b/src/frontend/plotting/gnuplot.c index 9672af6cd..9420a31aa 100644 --- a/src/frontend/plotting/gnuplot.c +++ b/src/frontend/plotting/gnuplot.c @@ -1,5 +1,4 @@ /********** - * From xgraph.c: * Copyright 1992 Regents of the University of California. All rights reserved. * Author: 1992 David A. Gates, U. C. Berkeley CAD Group * diff --git a/src/frontend/plotting/plotit.c b/src/frontend/plotting/plotit.c index 6de95aafd..997ada184 100644 --- a/src/frontend/plotting/plotit.c +++ b/src/frontend/plotting/plotit.c @@ -13,7 +13,6 @@ #include "plotit.h" #include "points.h" #include "agraf.h" -#include "xgraph.h" #include "gnuplot.h" #include "graf.h" @@ -1073,19 +1072,6 @@ bool plotit(wordlist *wl, const char *hcopy, const char *devname) y_type = d ? SV_NOTYPE : vecs->v_type; -#ifndef X_DISPLAY_MISSING - if (devname && eq(devname, "xgraph")) { - /* Interface to XGraph-11 Plot Program */ - ft_xgraph(xlims, ylims, hcopy, - title ? title : vecs->v_plot->pl_title, - xlabel ? xlabel : ft_typabbrev(vecs->v_scale->v_type), - ylabel ? ylabel : ft_typabbrev(y_type), - gtype, ptype, vecs); - rtn = TRUE; - goto quit; - } -#endif - if (devname && eq(devname, "gnuplot")) { /* Interface to Gnuplot Plot Program */ ft_gnuplot(xlims, ylims, hcopy, diff --git a/src/frontend/plotting/xgraph.c b/src/frontend/plotting/xgraph.c deleted file mode 100644 index ff40075bd..000000000 --- a/src/frontend/plotting/xgraph.c +++ /dev/null @@ -1,167 +0,0 @@ -/********** -Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1992 David A. Gates, U. C. Berkeley CAD Group -**********/ - -/* - * Xgraph-11 plots. - */ - -#include "ngspice/ngspice.h" -#include "ngspice/cpdefs.h" -#include "ngspice/ftedefs.h" -#include "ngspice/dvec.h" -#include "ngspice/fteparse.h" -#include "xgraph.h" - - -#define XG_MAXVECTORS 64 - -void -ft_xgraph(double *xlims, double *ylims, char *filename, char *title, char *xlabel, char *ylabel, GRIDTYPE gridtype, PLOTTYPE plottype, struct dvec *vecs) -{ - FILE *file; - struct dvec *v, *scale; - double xval, yval; - int i, numVecs, linewidth; - bool xlog, ylog, nogrid, markers; - char buf[BSIZE_SP], pointstyle[BSIZE_SP], *text; - - /* Sanity checking. */ - for (v = vecs, numVecs = 0; v; v = v->v_link2) - numVecs++; - - if (numVecs == 0) { - return; - } else if (numVecs > XG_MAXVECTORS) { - fprintf(cp_err, "Error: too many vectors for Xgraph.\n"); - return; - } - - if (!cp_getvar("xbrushwidth", CP_NUM, &linewidth, 0)) - linewidth = 1; - - if (linewidth < 1) - linewidth = 1; - - if (!cp_getvar("pointstyle", CP_STRING, pointstyle, sizeof(pointstyle))) { - markers = FALSE; - } else { - if (cieq(pointstyle, "markers")) - markers = TRUE; - else - markers = FALSE; - } - - /* Make sure the gridtype is supported. */ - switch (gridtype) { - case GRID_LIN: - nogrid = xlog = ylog = FALSE; - break; - case GRID_XLOG: - xlog = TRUE; - nogrid = ylog = FALSE; - break; - case GRID_YLOG: - ylog = TRUE; - nogrid = xlog = FALSE; - break; - case GRID_LOGLOG: - xlog = ylog = TRUE; - nogrid = FALSE; - break; - case GRID_NONE: - nogrid = TRUE; - xlog = ylog = FALSE; - break; - default: - fprintf(cp_err, "Error: grid type unsupported by Xgraph.\n"); - return; - } - - /* Open the output file. */ - if ((file = fopen(filename, "w")) == NULL) { - perror(filename); - return; - } - - /* Set up the file header. */ - if (title) { - text = cp_unquote(title); - fprintf(file, "TitleText: %s\n", text); - tfree(text); - } - if (xlabel) { - text = cp_unquote(xlabel); - fprintf(file, "XUnitText: %s\n", text); - tfree(text); - } - if (ylabel) { - text = cp_unquote(ylabel); - fprintf(file, "YUnitText: %s\n", text); - tfree(text); - } - if (nogrid) { - fprintf(file, "Ticks: True\n"); - } - - if (xlog) { - fprintf(file, "LogX: True\n"); - if (xlims) { - fprintf(file, "XLowLimit: % e\n", log10(xlims[0])); - fprintf(file, "XHighLimit: % e\n", log10(xlims[1])); - } - } else { - if (xlims) { - fprintf(file, "XLowLimit: % e\n", xlims[0]); - fprintf(file, "XHighLimit: % e\n", xlims[1]); - } - } - - if (ylog) { - fprintf(file, "LogY: True\n"); - if (ylims) { - fprintf(file, "YLowLimit: % e\n", log10(ylims[0])); - fprintf(file, "YHighLimit: % e\n", log10(ylims[1])); - } - } else { - if (ylims) { - fprintf(file, "YLowLimit: % e\n", ylims[0]); - fprintf(file, "YHighLimit: % e\n", ylims[1]); - } - } - - fprintf(file, "LineWidth: %d\n", linewidth); - fprintf(file, "BoundBox: True\n"); - - if (plottype == PLOT_COMB) { - fprintf(file, "BarGraph: True\n"); - fprintf(file, "NoLines: True\n"); - } else if (plottype == PLOT_POINT) { - if (markers) - fprintf(file, "Markers: True\n"); - else - fprintf(file, "LargePixels: True\n"); - fprintf(file, "NoLines: True\n"); - } - - /* Write out the data. */ - for (v = vecs; v; v = v->v_link2) { - scale = v->v_scale; - if (v->v_name) - fprintf(file, "\"%s\"\n", v->v_name); - - for (i = 0; i < scale->v_length; i++) { - xval = isreal(scale) ? - scale->v_realdata[i] : realpart(scale->v_compdata[i]); - yval = isreal(v) ? - v->v_realdata[i] : realpart(v->v_compdata[i]); - fprintf(file, "% e % e\n", xval, yval); - } - fprintf(file, "\n"); - } - - (void) fclose(file); - (void) sprintf(buf, "xgraph %s &", filename); - (void) system(buf); -} diff --git a/src/frontend/plotting/xgraph.h b/src/frontend/plotting/xgraph.h deleted file mode 100644 index e900bfa54..000000000 --- a/src/frontend/plotting/xgraph.h +++ /dev/null @@ -1,13 +0,0 @@ -/************* - * Header file for xgraph.c - * 1999 E. Rouat - ************/ - -#ifndef ngspice_XGRAPH_H -#define ngspice_XGRAPH_H - -void ft_xgraph(double *xlims, double *ylims, char *filename, char *title, - char *xlabel, char *ylabel, GRIDTYPE gridtype, PLOTTYPE plottype, - struct dvec *vecs); - -#endif diff --git a/visualc/vngspice.vcxproj b/visualc/vngspice.vcxproj index 737d57b29..99a98c4da 100644 --- a/visualc/vngspice.vcxproj +++ b/visualc/vngspice.vcxproj @@ -1511,7 +1511,6 @@ -