Browse Source

Write out the current in the old fashion

1	v1#branch	current
when keep#branch is set in .spiceinit.
To make the raw file compatible with ICCAP.
pre-master-46
Holger Vogt 4 years ago
parent
commit
f698ce6281
  1. 3
      src/frontend/outitf.c
  2. 4
      src/frontend/rawfile.c

3
src/frontend/outitf.c

@ -972,6 +972,7 @@ static void
fileInit_pass2(runDesc *run) fileInit_pass2(runDesc *run)
{ {
int i, type; int i, type;
bool keepbranch = cp_getvar("keep#branch", CP_BOOL, NULL, 0);
for (i = 0; i < run->numData; i++) { for (i = 0; i < run->numData; i++) {
@ -979,7 +980,7 @@ fileInit_pass2(runDesc *run)
type = guess_type(name); type = guess_type(name);
if (type == SV_CURRENT) {
if (type == SV_CURRENT && !keepbranch) {
char *branch = strstr(name, "#branch"); char *branch = strstr(name, "#branch");
if (branch) if (branch)
*branch = '\0'; *branch = '\0';

4
src/frontend/rawfile.c

@ -51,8 +51,10 @@ void raw_write(char *name, struct plot *pl, bool app, bool binary)
double dd; double dd;
char buf[BSIZE_SP]; char buf[BSIZE_SP];
char *branch; char *branch;
bool keepbranch = FALSE;
raw_padding = !cp_getvar("nopadding", CP_BOOL, NULL, 0); raw_padding = !cp_getvar("nopadding", CP_BOOL, NULL, 0);
keepbranch = cp_getvar("keep#branch", CP_BOOL, NULL, 0);
/* Why bother printing out an empty plot? */ /* Why bother printing out an empty plot? */
if (!pl->pl_dvecs) { if (!pl->pl_dvecs) {
@ -157,7 +159,7 @@ void raw_write(char *name, struct plot *pl, bool app, bool binary)
fprintf(fp, "Variables:\n"); fprintf(fp, "Variables:\n");
for (i = 0, v = pl->pl_dvecs; v; v = v->v_next) { for (i = 0, v = pl->pl_dvecs; v; v = v->v_next) {
/* write i(name) instaed of name#branch */ /* write i(name) instaed of name#branch */
if (v->v_type == SV_CURRENT) {
if (v->v_type == SV_CURRENT && !keepbranch) {
branch = NULL; branch = NULL;
/* get name only*/ /* get name only*/
if ((branch = strstr(v->v_name, "#branch")) != NULL) { if ((branch = strstr(v->v_name, "#branch")) != NULL) {

Loading…
Cancel
Save