fix the wrong rawfile writing for v(#)

This commit is contained in:
dwarning 2008-01-02 18:24:56 +00:00
parent b449c09b48
commit 280580cb36
1 changed files with 17 additions and 22 deletions

View File

@ -26,9 +26,8 @@ $Id$
#include "outitf.h" #include "outitf.h"
#include "variable.h" #include "variable.h"
#include <fcntl.h> #include <fcntl.h>
#include <time.h>
#include "cktdefs.h" #include "cktdefs.h"
#include <inpdefs.h> #include "inpdefs.h"
#include "breakp2.h" #include "breakp2.h"
#include "runcoms.h" #include "runcoms.h"
#include "plotting/graf.h" #include "plotting/graf.h"
@ -738,16 +737,12 @@ static void
fileInit_pass2(runDesc *run) fileInit_pass2(runDesc *run)
{ {
int i, type; int i, type;
char *name, buf[BSIZE_SP], *branch; char *name, *branch;
for (i = 0; i < run->numData; i++) { for (i = 0; i < run->numData; i++) {
if (isdigit(*run->data[i].name)) { name = run->data[i].name;
(void) sprintf(buf, "v(%s)", run->data[i].name);
name = buf;
} else {
name = run->data[i].name;
}
if (substring("#branch", name)) if (substring("#branch", name))
type = SV_CURRENT; type = SV_CURRENT;
else if (cieq(name, "time")) else if (cieq(name, "time"))
@ -761,18 +756,18 @@ fileInit_pass2(runDesc *run)
else else
type = SV_VOLTAGE; type = SV_VOLTAGE;
if ( type == SV_CURRENT ) { if ( type == SV_CURRENT ) {
branch = NULL; branch = NULL;
if ( (branch = strstr( name, "#branch" )) ) { if ( (branch = strstr( name, "#branch" )) ) {
*branch = '\0'; *branch = '\0';
} }
fprintf(run->fp, "\t%d\ti(%s)\t%s", i, name, ft_typenames(type)); fprintf(run->fp, "\t%d\ti(%s)\t%s", i, name, ft_typenames(type));
if ( branch != NULL ) *branch = '#'; if ( branch != NULL ) *branch = '#';
} else if ( type == SV_VOLTAGE ) { } else if ( type == SV_VOLTAGE ) {
fprintf(run->fp, "\t%d\tv(%s)\t%s", i, name, ft_typenames(type)); fprintf(run->fp, "\t%d\tv(%s)\t%s", i, name, ft_typenames(type));
} else { } else {
fprintf(run->fp, "\t%d\t%s\t%s", i, name, ft_typenames(type)); fprintf(run->fp, "\t%d\t%s\t%s", i, name, ft_typenames(type));
} }
if (run->data[i].gtype == GRID_XLOG) if (run->data[i].gtype == GRID_XLOG)
fprintf(run->fp, "\tgrid=3"); fprintf(run->fp, "\tgrid=3");
fprintf(run->fp, "\n"); fprintf(run->fp, "\n");