fix hier_psprint() to handle all previous enhancements

This commit is contained in:
stefan schippers 2023-04-26 11:35:32 +02:00
parent 7a16859702
commit 07fcdfbde4
3 changed files with 9 additions and 8 deletions

View File

@ -1212,7 +1212,8 @@ const char *get_sym_name(int inst, int ext)
const char *sym, *sch;
sch = get_tok_value(xctx->inst[inst].prop_ptr, "schematic", 0);
if(xctx->tok_size) { /* token exists */
if(!sch[0]) sch = get_tok_value((xctx->inst[inst].ptr + xctx->sym)->prop_ptr, "schematic", 0);
if(xctx->tok_size) { /* token exists */
if(ext) sym = get_cell_w_ext(add_ext(rel_sym_path(sch), ".sym"), 0);
else sym = skip_dir(add_ext(rel_sym_path(sch), ".sym"));
}

View File

@ -804,7 +804,7 @@ static void ps_draw_symbol(int n,int layer, int what, short tmp_flip, short rot,
"/Subtype /Link "
"/ANN pdfmark\n",
x1, y1, x2, y2,
add_ext(get_sym_name(n, 0), ".sch"));
sanitize(get_sym_name(n, 0)));
}
}
}
@ -1075,8 +1075,7 @@ void create_ps(char **psfile, int what)
fprintf(fd,
"[ "
"/Dest /%s "
"/DEST pdfmark\n", get_cell_w_ext(xctx->current_name, 0));
"/DEST pdfmark\n", get_cell_w_ext(sanitize(xctx->current_name), 0));
scaley = scale = (pagey-2 * margin) / dy;
dbg(1, "scale=%g pagex=%g pagey=%g dx=%g dy=%g\n", scale, pagex, pagey, dx, dy);
if(dx * scale > (pagex - 2 * margin)) {

View File

@ -85,12 +85,13 @@ void hier_psprint(char **res, int what) /* netlister driver */
{
/* xctx->sym can be SCH or SYM, use hash to avoid writing duplicate subckt */
my_strdup(_ALLOC_ID_, &subckt_name, get_cell(xctx->sym[i].name, 0));
if (str_hash_lookup(&subckt_table, subckt_name, "", XLOOKUP)==NULL)
get_sch_from_sym(filename, xctx->sym + i, -1);
if (str_hash_lookup(&subckt_table, filename, "", XLOOKUP)==NULL)
{
str_hash_lookup(&subckt_table, subckt_name, "", XINSERT);
get_sch_from_sym(filename, xctx->sym + i, -1);
if(!stat(filename, &buf)) {
str_hash_lookup(&subckt_table, filename, "", XINSERT);
if(is_generator(filename) || !stat(filename, &buf)) {
/* for printing we go down to bottom regardless of spice_stop attribute */
dbg(1, "hier_psprint(): loading file: |%s|\n", filename);
load_schematic(1,filename, 0, 1);
zoom_full(0, 0, 1, 0.97);
if(what & 1) ps_draw(2); /* page */