add `spectrum` type analysis in graph dialog sim type combobox. Make sp and spectrum aliases of ac in read_dataset() and extra_rawfile()

This commit is contained in:
stefan schippers 2024-01-22 01:19:27 +01:00
parent 9ceb274b5e
commit 1f35fdf05c
2 changed files with 7 additions and 1 deletions

View File

@ -515,6 +515,10 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type)
return 0;
}
dbg(1, "read_dataset(): type=%s\n", type ? type : "<NULL>");
if(type) {
if(!my_strcasecmp(type, "spectrum")) type = "ac";
if(!my_strcasecmp(type, "sp")) type = "ac";
}
while((line = my_fgets(fd, NULL))) {
my_strdup2(_ALLOC_ID_, &lowerline, line);
strtolower(lowerline);
@ -897,6 +901,8 @@ int extra_rawfile(int what, const char *file, const char *type, double sweep1, d
if(what == 1 && xctx->extra_raw_n < MAX_RAW_N && file && type) {
tclvareval("subst {", file, "}", NULL);
my_strncpy(f, tclresult(), S(f));
if(!my_strcasecmp(type, "spectrum")) type = "ac";
if(!my_strcasecmp(type, "sp")) type = "ac";
for(i = 0; i < xctx->extra_raw_n; i++) {
if(xctx->extra_raw_arr[i]->sim_type &&
!strcmp(xctx->extra_raw_arr[i]->rawfile, f) &&

View File

@ -2517,7 +2517,7 @@ proc graph_edit_properties {n} {
# center right frame
label .graphdialog.center.right.lab1 -text { Signals in graph }
if { [info tclversion] > 8.4} {
ttk::combobox .graphdialog.center.right.list -values {dc ac tran op sp noise} -width 4
ttk::combobox .graphdialog.center.right.list -values {dc ac tran op sp spectrum noise} -width 4
} else {
entry .graphdialog.center.right.list -width 4
}