Index: ltspice.c =================================================================== --- ltspice.c (revision 6787) +++ ltspice.c (revision 6788) @@ -71,7 +71,12 @@ static void sym_flush(symattr_t *sattr) { - pcb_trace("ltspice sym: refdes=%s val=%s fp=%s\n", sattr->refdes, sattr->value, sattr->footprint); +/* pcb_trace("ltspice sym: refdes=%s val=%s fp=%s\n", sattr->refdes, sattr->value, sattr->footprint);*/ + + if (sattr->footprint == NULL) + pcb_message(PCB_MSG_ERROR, "ltspice: not importing refdes=%s: no footprint specified\n", sattr->refdes); + else + pcb_hid_actionl("ElementList", "Need", sattr->refdes, sattr->footprint, sattr->value, NULL); free(sattr->refdes); sattr->refdes = NULL; free(sattr->value); sattr->value = NULL; free(sattr->footprint); sattr->footprint = NULL; @@ -84,6 +89,8 @@ memset(&sattr, 0, sizeof(sattr)); + pcb_hid_actionl("ElementList", "start", NULL); + while(fgets(line, sizeof(line), fa) != NULL) { char *s; @@ -122,6 +129,8 @@ } if (strncmp(fp, ".pcb-rnd-", 9) == 0) fp += 9; + if (strncmp(fp, "pcb-rnd-", 8) == 0) + fp += 8; free(sattr.footprint); sattr.footprint = pcb_strdup(fp); } @@ -135,6 +144,7 @@ } } sym_flush(&sattr); + pcb_hid_actionl("ElementList", "Done", NULL); return 0; } @@ -142,6 +152,9 @@ { char line[1024]; + pcb_hid_actionl("Netlist", "Freeze", NULL); + pcb_hid_actionl("Netlist", "Clear", NULL); + while(fgets(line, sizeof(line), fn) != NULL) { int argc; char **argv, *s; @@ -152,10 +165,16 @@ argc = qparse2(s, &argv, QPARSE_DOUBLE_QUOTE | QPARSE_SINGLE_QUOTE); if ((argc > 1) && (strcmp(argv[0], "NET") == 0)) { int n; - for(n = 2; n < argc; n++) - pcb_trace("net-add '%s' '%s'\n", argv[1], argv[n]); + for(n = 2; n < argc; n++) { +/* pcb_trace("net-add '%s' '%s'\n", argv[1], argv[n]);*/ + pcb_hid_actionl("Netlist", "Add", argv[1], argv[n], NULL); + } } } + + pcb_hid_actionl("Netlist", "Sort", NULL); + pcb_hid_actionl("Netlist", "Thaw", NULL); + return 0; } @@ -182,6 +201,7 @@ goto error; } + if (ltspice_parse_asc(fa) != 0) goto error; if (ltspice_parse_net(fn) != 0) goto error;