Browse Source

New variable 'plainwrite' added. Allows 'write' with node names

containing characters like + - /. Function are the disabled.
This replaces the automatic selection of this mode by compat flags,
which is not transparent enough to the user.
pre-master-46
Holger Vogt 5 years ago
parent
commit
d06ff2abab
  1. 12
      src/frontend/postcoms.c

12
src/frontend/postcoms.c

@ -435,7 +435,7 @@ com_write(wordlist *wl)
static wordlist all = { "all", NULL, NULL }; static wordlist all = { "all", NULL, NULL };
struct pnode *names = NULL; struct pnode *names = NULL;
bool ascii = AsciiRawFile; bool ascii = AsciiRawFile;
bool scalefound, appendwrite;
bool scalefound, appendwrite, plainwrite = FALSE;
struct plot *tpl, newplot; struct plot *tpl, newplot;
if (wl) { if (wl) {
@ -455,9 +455,11 @@ com_write(wordlist *wl)
} }
appendwrite = cp_getvar("appendwrite", CP_BOOL, NULL, 0); appendwrite = cp_getvar("appendwrite", CP_BOOL, NULL, 0);
/* If use with EAGLE or KiCad compatibility, we do not expand equations, serve v vs vs etc.
plainwrite = cp_getvar("plainwrite", CP_BOOL, NULL, 0);
/* If variable plainwrite is set, we do not expand equations, serve v vs vs etc.
We offer plain writing of the vectors. This enables node names containing +, -, / etc. */ We offer plain writing of the vectors. This enables node names containing +, -, / etc. */
if (!newcompat.eg && !newcompat.ki) {
if (!plainwrite) {
if (wl) if (wl)
names = ft_getpnames(wl, TRUE); names = ft_getpnames(wl, TRUE);
else else
@ -485,8 +487,10 @@ com_write(wordlist *wl)
wl = &all; wl = &all;
for (wli = wl; wli; wli = wli->wl_next) { for (wli = wl; wli; wli = wli->wl_next) {
d = vec_get(wli->wl_word); d = vec_get(wli->wl_word);
if (!d)
if (!d) {
fprintf(stderr, "Error during 'write': vector %s not found\n", wli->wl_word);
goto done; goto done;
}
if (vecs) if (vecs)
lv->v_link2 = d; lv->v_link2 = d;
else else

Loading…
Cancel
Save