save.c: do not assume complex data for `constants` raw file sections, deduce data type from Flags line (both complex and real constants sections exist)
This commit is contained in:
parent
7fccc2eed1
commit
cf7933b99d
|
|
@ -613,7 +613,6 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
||||||
if(type) {
|
if(type) {
|
||||||
if(!my_strcasecmp(type, "spectrum")) type = "ac";
|
if(!my_strcasecmp(type, "spectrum")) type = "ac";
|
||||||
else if(!my_strcasecmp(type, "sp")) type = "ac";
|
else if(!my_strcasecmp(type, "sp")) type = "ac";
|
||||||
else if(!my_strcasecmp(type, "constants")) type = "ac";
|
|
||||||
}
|
}
|
||||||
while((line = my_fgets(fd, NULL))) {
|
while((line = my_fgets(fd, NULL))) {
|
||||||
my_strdup2(_ALLOC_ID_, &lowerline, line);
|
my_strdup2(_ALLOC_ID_, &lowerline, line);
|
||||||
|
|
@ -691,7 +690,6 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
||||||
else if(!strncmp(line, "Plotname:", 9) &&
|
else if(!strncmp(line, "Plotname:", 9) &&
|
||||||
( strstr(lowerline, "ac analysis") ||
|
( strstr(lowerline, "ac analysis") ||
|
||||||
strstr(lowerline, "spectrum") ||
|
strstr(lowerline, "spectrum") ||
|
||||||
strstr(lowerline, "constants") ||
|
|
||||||
strstr(lowerline, "sp analysis")) ) {
|
strstr(lowerline, "sp analysis")) ) {
|
||||||
ac = 1;
|
ac = 1;
|
||||||
if(!type) type = "ac";
|
if(!type) type = "ac";
|
||||||
|
|
@ -707,7 +705,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
|
||||||
if(name[0]) {
|
if(name[0]) {
|
||||||
if(!type) type = name;
|
if(!type) type = name;
|
||||||
if(!strcmp(type, name)) sim_type = name;
|
if(!strcmp(type, name)) sim_type = name;
|
||||||
dbg(dbglev, "read_dataset(): ac sim_type=%s\n", sim_type ? sim_type : "<NULL>");
|
dbg(dbglev, "read_dataset(): sim_type=%s\n", sim_type ? sim_type : "<NULL>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* points and vars are needed for all sections (also ones we are not interested in)
|
/* points and vars are needed for all sections (also ones we are not interested in)
|
||||||
|
|
@ -1223,7 +1221,6 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
|
||||||
if(type) {
|
if(type) {
|
||||||
if(!my_strcasecmp(type, "spectrum")) type = "ac";
|
if(!my_strcasecmp(type, "spectrum")) type = "ac";
|
||||||
else if(!my_strcasecmp(type, "sp")) type = "ac";
|
else if(!my_strcasecmp(type, "sp")) type = "ac";
|
||||||
else if(!my_strcasecmp(type, "constants")) type = "ac";
|
|
||||||
}
|
}
|
||||||
for(i = 0; i < xctx->extra_raw_n; i++) {
|
for(i = 0; i < xctx->extra_raw_n; i++) {
|
||||||
if(xctx->extra_raw_arr[i]->sim_type &&
|
if(xctx->extra_raw_arr[i]->sim_type &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue