use `enum simulation_types'

This commit is contained in:
rlar 2015-03-10 18:25:26 +01:00
parent 07ee771a96
commit 6f21c3b9db
2 changed files with 7 additions and 7 deletions

View File

@ -20,6 +20,7 @@ Author: 1988 Jeffrey M. Hsu
#include "ngspice/graph.h"
#include "ngspice/ftedbgra.h"
#include "ngspice/ftedev.h"
#include "ngspice/sim.h"
#include <terminal.h>
#include "graf.h"
#include "graphdb.h"
@ -315,15 +316,13 @@ static void
gr_start_internal(struct dvec *dv, bool copyvec)
{
struct dveclist *link;
char *s;
/* Do something special with poles and zeros. Poles are 'x's, and
* zeros are 'o's. */
s = ft_typenames(dv->v_type);
if (eq(s, "pole")) {
if (dv->v_type == SV_POLE) {
dv->v_linestyle = 'x';
return;
} else if (eq(s, "zero")) {
} else if (dv->v_type == SV_ZERO) {
dv->v_linestyle = 'o';
return;
}
@ -658,7 +657,7 @@ iplot(struct plot *pl, int id)
for (yt = pl->pl_dvecs->v_type, v = pl->pl_dvecs->v_next; v; v = v->v_next)
if ((v->v_flags & VF_PLOT) && (v->v_type != yt)) {
yt = 0;
yt = SV_NOTYPE;
break;
}

View File

@ -12,6 +12,7 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "ngspice/ftedefs.h"
#include "dimens.h"
#include "ngspice/dvec.h"
#include "ngspice/sim.h"
#include "rawfile.h"
#include "variable.h"
@ -154,14 +155,14 @@ raw_write(char *name, struct plot *pl, bool app, bool binary)
fprintf(fp, "Variables:\n");
for (i = 0, v = pl->pl_dvecs; v; v = v->v_next) {
if (strcmp(ft_typenames(v->v_type), "current") == 0) {
if (v->v_type == SV_CURRENT) {
branch = NULL;
if ((branch = strstr(v->v_name, "#branch")) != NULL) {
*branch = '\0';
}
fprintf(fp, "\t%d\ti(%s)\t%s", i++, v->v_name, ft_typenames(v->v_type));
if (branch != NULL) *branch = '#';
} else if (strcmp(ft_typenames(v->v_type), "voltage") == 0) {
} else if (v->v_type == SV_VOLTAGE) {
fprintf(fp, "\t%d\t%s\t%s", i++, v->v_name, ft_typenames(v->v_type));
} else {
fprintf(fp, "\t%d\t%s\t%s", i++, v->v_name, ft_typenames(v->v_type));