From 60ddad49838254bd712bee6f7e923d8da8d1ec5e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 29 Oct 2024 16:57:43 +0100 Subject: [PATCH] Make the resistor name unique for a device with multiple unconnected nodes --- src/frontend/inpc_probe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpc_probe.c b/src/frontend/inpc_probe.c index dd61de7af..5642420b9 100644 --- a/src/frontend/inpc_probe.c +++ b/src/frontend/inpc_probe.c @@ -199,6 +199,7 @@ void inp_probe(struct card* deck) char* curr_line = card->line; struct card* prevcard = NULL; + int nn = 0; /* exclude any command inside .control ... .endc */ if (ciprefix(".control", curr_line)) { @@ -330,7 +331,8 @@ void inp_probe(struct card* deck) card = insert_new_line(card, vline, 0, card->linenum_orig, card->linesource); /* special for KiCad: add shunt resistor if thisnode contains 'unconnected' */ if (*instname == 'x' && strstr(thisnode, "unconnected")) { - char *rline = tprintf("R%s %s 0 1e15", thisnode, thisnode); + /* nn makes the resistor name unique for a device with multiple unconnected nodes */ + char *rline = tprintf("R%s%d %s 0 1e15", thisnode, nn++, thisnode); card = insert_new_line(card, rline, 0, card->linenum_orig, card->linesource); } char* nodesaves = tprintf("%s:%s#branch", instname, nodename);