From 9ea93e9938eab28f8fce94fa01341603aa8c6d2f Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 12 May 2023 12:09:20 +0200 Subject: [PATCH] hide_texts=true attribute added on instance will avoid the display of all symbol texts (will be probably used when using floater symbol texts) --- src/actions.c | 10 +- src/draw.c | 12 +- src/editprop.c | 14 +- src/paste.c | 3 + src/psprint.c | 206 ++++++++++++----------- src/save.c | 12 +- src/scheduler.c | 22 ++- src/svgdraw.c | 15 +- src/xschem.h | 36 ++-- xschem_library/examples/poweramp.sch | 3 +- xschem_library/examples/poweramp_lcc.sch | 3 +- 11 files changed, 191 insertions(+), 145 deletions(-) diff --git a/src/actions.c b/src/actions.c index 1b77f038..8964776a 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1110,10 +1110,14 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot xctx->inst[n].flags |= HIDE_INST; if(!strcmp(get_tok_value(xctx->inst[n].prop_ptr,"highlight",0), "true")) xctx->inst[n].flags |= HILIGHT_CONN; + if(!strcmp(get_tok_value(xctx->inst[n].prop_ptr,"hide_texts",0), "true")) + xctx->inst[n].flags |= HIDE_SYMBOL_TEXTS; type = xctx->sym[xctx->inst[n].ptr].type; - cond= !type || !IS_LABEL_SH_OR_PIN(type); - if(cond) xctx->inst[n].flags|=2; - else my_strdup(_ALLOC_ID_, &xctx->inst[n].lab, get_tok_value(xctx->inst[n].prop_ptr,"lab",0)); + cond= type && IS_LABEL_SH_OR_PIN(type); + if(cond) { + xctx->inst[n].flags |= PIN_OR_LABEL; + my_strdup(_ALLOC_ID_, &xctx->inst[n].lab, get_tok_value(xctx->inst[n].prop_ptr,"lab",0)); + } xctx->inst[n].embed = !strcmp(get_tok_value(xctx->inst[n].prop_ptr, "embed", 2), "true"); if(first_call && (draw_sym & 3) ) bbox(START, 0.0 , 0.0 , 0.0 , 0.0); xctx->instances++; /* must be updated before calling symbol_bbox() */ diff --git a/src/draw.c b/src/draw.c index add15a71..713eea6d 100644 --- a/src/draw.c +++ b/src/draw.c @@ -436,7 +436,7 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot, #endif if(xctx->inst[n].ptr == -1) return; - if( layer == 0) { + if(layer == 0) { char *type = xctx->sym[xctx->inst[n].ptr].type; if( type && strcmp(type, "launcher") && strcmp(type, "logo") && strcmp(type, "probe") && @@ -617,8 +617,14 @@ void draw_symbol(int what,int c, int n,int layer,short tmp_flip, short rot, } } } - if( (layer==TEXTWIRELAYER && !(xctx->inst[n].flags&2) ) || - (xctx->sym_txt && (layer==TEXTLAYER) && (xctx->inst[n].flags&2) ) ) { + if( + !(xctx->inst[n].flags & HIDE_SYMBOL_TEXTS) && + ( + (layer==TEXTWIRELAYER && (xctx->inst[n].flags & PIN_OR_LABEL) ) || + (xctx->sym_txt && (layer==TEXTLAYER) && !(xctx->inst[n].flags & PIN_OR_LABEL)) + ) + ) + { for(j=0;j< symptr->texts; ++j) { text = symptr->text[j]; diff --git a/src/editprop.c b/src/editprop.c index bd3e5a8c..2c9b8e35 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -1384,13 +1384,14 @@ static void update_symbol(const char *result, int x) /* set cached flags in instances */ type=xctx->sym[xctx->inst[*ii].ptr].type; - cond= !type || !IS_LABEL_SH_OR_PIN(type); - if(cond) xctx->inst[*ii].flags |= 2; /* bit 1: flag = 1 for textlayer for ordinary symbols */ - else { - xctx->inst[*ii].flags &= ~2; /* bit 1: flag = 0 for textlayer for pins/labels/net show symbols */ + cond= type && IS_LABEL_SH_OR_PIN(type); + if(cond) { + xctx->inst[*ii].flags |= PIN_OR_LABEL; my_strdup(_ALLOC_ID_, &xctx->inst[*ii].lab, get_tok_value(xctx->inst[*ii].prop_ptr, "lab",0)); } + else xctx->inst[*ii].flags &= ~PIN_OR_LABEL; + if(!strcmp(get_tok_value(xctx->inst[*ii].prop_ptr,"highlight",0), "true")) xctx->inst[*ii].flags |= HILIGHT_CONN; else xctx->inst[*ii].flags &= ~HILIGHT_CONN; @@ -1414,6 +1415,11 @@ static void update_symbol(const char *result, int x) if(!strcmp(get_tok_value(xctx->inst[*ii].prop_ptr,"hide",0), "true")) xctx->inst[*ii].flags |= HIDE_INST; else xctx->inst[*ii].flags &= ~HIDE_INST; + + if(!strcmp(get_tok_value(xctx->inst[*ii].prop_ptr,"hide_texts",0), "true")) + xctx->inst[*ii].flags |= HIDE_SYMBOL_TEXTS; + else xctx->inst[*ii].flags &= ~HIDE_SYMBOL_TEXTS; + xctx->inst[*ii].embed = !strcmp(get_tok_value(xctx->inst[*ii].prop_ptr, "embed", 2), "true"); } /* end for(k=0;klastsel; ++k) */ diff --git a/src/paste.c b/src/paste.c index a4e68542..370c3feb 100644 --- a/src/paste.c +++ b/src/paste.c @@ -296,6 +296,9 @@ static void merge_inst(int k,FILE *fd) if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"tedax_ignore",0), "true")) xctx->inst[i].flags |= TEDAX_IGNORE_INST; + if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"hide_texts",0), "true")) + xctx->inst[i].flags |= HIDE_SYMBOL_TEXTS; + xctx->inst[i].embed = !strcmp(get_tok_value(xctx->inst[i].prop_ptr, "embed", 2), "true"); my_free(_ALLOC_ID_, &prop_ptr); xctx->instances++; diff --git a/src/psprint.c b/src/psprint.c index bd922c1b..b49a8c08 100644 --- a/src/psprint.c +++ b/src/psprint.c @@ -826,112 +826,116 @@ static void ps_draw_symbol(int n,int layer, int what, short tmp_flip, short rot, x0=xctx->inst[n].x0 + xoffset; y0=xctx->inst[n].y0 + yoffset; symptr = (xctx->inst[n].ptr+ xctx->sym); - for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->lines[layer]; ++j) - { - line = ((xctx->inst[n].ptr+ xctx->sym)->line[layer])[j]; - ROTATION(rot, flip, 0.0,0.0,line.x1,line.y1,x1,y1); - ROTATION(rot, flip, 0.0,0.0,line.x2,line.y2,x2,y2); - ORDER(x1,y1,x2,y2); - ps_drawline(layer, x0+x1, y0+y1, x0+x2, y0+y2, line.dash); - } - for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->polygons[layer]; ++j) - { - polygon = ((xctx->inst[n].ptr+ xctx->sym)->poly[layer])[j]; - { /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */ - int k; - double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points); - double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points); - for(k=0;kinst[n].ptr+ xctx->sym)->arcs[layer]; ++j) - { - double angle; - arc = ((xctx->inst[n].ptr+ xctx->sym)->arc[layer])[j]; - if(flip) { - angle = 270.*rot+180.-arc.b-arc.a; - } else { - angle = arc.a+rot*270.; - } - angle = fmod(angle, 360.); - if(angle<0.) angle+=360.; - ROTATION(rot, flip, 0.0,0.0,arc.x,arc.y,x1,y1); - ps_drawarc(layer, arc.fill, x0+x1, y0+y1, arc.r, angle, arc.b, arc.dash); - } - if( xctx->enable_layer[layer] ) for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->rects[layer]; ++j) - { - rect = ((xctx->inst[n].ptr+ xctx->sym)->rect[layer])[j]; - ROTATION(rot, flip, 0.0,0.0,rect.x1,rect.y1,x1,y1); - ROTATION(rot, flip, 0.0,0.0,rect.x2,rect.y2,x2,y2); - RECTORDER(x1,y1,x2,y2); - if (rect.flags & 1024) /* image */ - { - ps_drawPNG(&rect, x0 + x1, y0 + y1, x0 + x2, y0 + y2, rot, flip); - continue; + for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->lines[layer]; ++j) + { + line = ((xctx->inst[n].ptr+ xctx->sym)->line[layer])[j]; + ROTATION(rot, flip, 0.0,0.0,line.x1,line.y1,x1,y1); + ROTATION(rot, flip, 0.0,0.0,line.x2,line.y2,x2,y2); + ORDER(x1,y1,x2,y2); + ps_drawline(layer, x0+x1, y0+y1, x0+x2, y0+y2, line.dash); + } + for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->polygons[layer]; ++j) + { + polygon = ((xctx->inst[n].ptr+ xctx->sym)->poly[layer])[j]; + { /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */ + int k; + double *x = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points); + double *y = my_malloc(_ALLOC_ID_, sizeof(double) * polygon.points); + for(k=0;kinst[n].flags&2) ) || - (xctx->sym_txt && (layer==TEXTLAYER) && (xctx->inst[n].flags&2) ) ) - { + ps_drawpolygon(layer, NOW, x, y, polygon.points, polygon.fill, polygon.dash); + my_free(_ALLOC_ID_, &x); + my_free(_ALLOC_ID_, &y); + } + + } + for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->arcs[layer]; ++j) + { + double angle; + arc = ((xctx->inst[n].ptr+ xctx->sym)->arc[layer])[j]; + if(flip) { + angle = 270.*rot+180.-arc.b-arc.a; + } else { + angle = arc.a+rot*270.; + } + angle = fmod(angle, 360.); + if(angle<0.) angle+=360.; + ROTATION(rot, flip, 0.0,0.0,arc.x,arc.y,x1,y1); + ps_drawarc(layer, arc.fill, x0+x1, y0+y1, arc.r, angle, arc.b, arc.dash); + } + if( xctx->enable_layer[layer] ) for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->rects[layer]; ++j) + { + rect = ((xctx->inst[n].ptr+ xctx->sym)->rect[layer])[j]; + ROTATION(rot, flip, 0.0,0.0,rect.x1,rect.y1,x1,y1); + ROTATION(rot, flip, 0.0,0.0,rect.x2,rect.y2,x2,y2); + RECTORDER(x1,y1,x2,y2); + if (rect.flags & 1024) /* image */ + { + ps_drawPNG(&rect, x0 + x1, y0 + y1, x0 + x2, y0 + y2, rot, flip); + continue; + } + ps_filledrect(layer, x0+x1, y0+y1, x0+x2, y0+y2, rect.dash, rect.fill); + } + if( + !(xctx->inst[n].flags & HIDE_SYMBOL_TEXTS) && + ( + (layer==TEXTWIRELAYER && (xctx->inst[n].flags & PIN_OR_LABEL) ) || + (xctx->sym_txt && (layer==TEXTLAYER) && !(xctx->inst[n].flags & PIN_OR_LABEL)) + ) + ) + { const char *txtptr; for(j=0;j< (xctx->inst[n].ptr+ xctx->sym)->texts; ++j) { - text = (xctx->inst[n].ptr+ xctx->sym)->text[j]; - /* if(text.xscale*FONTWIDTH* xctx->mooz<1) continue; */ - if(!xctx->show_hidden_texts && (text.flags & HIDE_TEXT)) continue; - if( hide && text.txt_ptr && strcmp(text.txt_ptr, "@symname") && strcmp(text.txt_ptr, "@name") ) continue; - txtptr= translate(n, text.txt_ptr); - ROTATION(rot, flip, 0.0,0.0,text.x0,text.y0,x1,y1); - textlayer = layer; - /* do not allow custom text color on PINLAYER hilighted instances */ - if( !(xctx->inst[n].color == -PINLAYER)) { - textlayer = (xctx->inst[n].ptr+ xctx->sym)->text[j].layer; - if(textlayer < 0 || textlayer >= cadlayers) textlayer = layer; - } - /* display PINLAYER colored instance texts even if PINLAYER disabled */ - if(xctx->inst[n].color == -PINLAYER || xctx->enable_layer[textlayer]) { - my_snprintf(ps_font_family, S(ps_font_name), "Helvetica"); - my_snprintf(ps_font_name, S(ps_font_name), "Helvetica"); - textfont = symptr->text[j].font; - if( (textfont && textfont[0])) { - my_snprintf(ps_font_family, S(ps_font_family), textfont); - my_snprintf(ps_font_name, S(ps_font_name), textfont); - } - if( symptr->text[j].flags & TEXT_BOLD) { - if( (symptr->text[j].flags & TEXT_ITALIC) || (symptr->text[j].flags & TEXT_OBLIQUE) ) { - my_snprintf(ps_font_family, S(ps_font_family), "%s-BoldOblique", ps_font_name); - } else { - my_snprintf(ps_font_family, S(ps_font_family), "%s-Bold", ps_font_name); - } - } - else if( symptr->text[j].flags & TEXT_ITALIC) - my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); - else if( symptr->text[j].flags & TEXT_OBLIQUE) - my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); - if(text_ps) { - ps_draw_string(textlayer, txtptr, - (text.rot + ( (flip && (text.rot & 1) ) ? rot+2 : rot) ) & 0x3, - flip^text.flip, text.hcenter, text.vcenter, - x0+x1, y0+y1, text.xscale, text.yscale); - } else { - old_ps_draw_string(textlayer, txtptr, - (text.rot + ( (flip && (text.rot & 1) ) ? rot+2 : rot) ) & 0x3, - flip^text.flip, text.hcenter, text.vcenter, - x0+x1, y0+y1, text.xscale, text.yscale); - } - } + text = (xctx->inst[n].ptr+ xctx->sym)->text[j]; + /* if(text.xscale*FONTWIDTH* xctx->mooz<1) continue; */ + if(!xctx->show_hidden_texts && (text.flags & HIDE_TEXT)) continue; + if( hide && text.txt_ptr && strcmp(text.txt_ptr, "@symname") && strcmp(text.txt_ptr, "@name") ) continue; + txtptr= translate(n, text.txt_ptr); + ROTATION(rot, flip, 0.0,0.0,text.x0,text.y0,x1,y1); + textlayer = layer; + /* do not allow custom text color on PINLAYER hilighted instances */ + if( !(xctx->inst[n].color == -PINLAYER)) { + textlayer = (xctx->inst[n].ptr+ xctx->sym)->text[j].layer; + if(textlayer < 0 || textlayer >= cadlayers) textlayer = layer; + } + /* display PINLAYER colored instance texts even if PINLAYER disabled */ + if(xctx->inst[n].color == -PINLAYER || xctx->enable_layer[textlayer]) { + my_snprintf(ps_font_family, S(ps_font_name), "Helvetica"); + my_snprintf(ps_font_name, S(ps_font_name), "Helvetica"); + textfont = symptr->text[j].font; + if( (textfont && textfont[0])) { + my_snprintf(ps_font_family, S(ps_font_family), textfont); + my_snprintf(ps_font_name, S(ps_font_name), textfont); + } + if( symptr->text[j].flags & TEXT_BOLD) { + if( (symptr->text[j].flags & TEXT_ITALIC) || (symptr->text[j].flags & TEXT_OBLIQUE) ) { + my_snprintf(ps_font_family, S(ps_font_family), "%s-BoldOblique", ps_font_name); + } else { + my_snprintf(ps_font_family, S(ps_font_family), "%s-Bold", ps_font_name); + } + } + else if( symptr->text[j].flags & TEXT_ITALIC) + my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); + else if( symptr->text[j].flags & TEXT_OBLIQUE) + my_snprintf(ps_font_family, S(ps_font_family), "%s-Oblique", ps_font_name); + if(text_ps) { + ps_draw_string(textlayer, txtptr, + (text.rot + ( (flip && (text.rot & 1) ) ? rot+2 : rot) ) & 0x3, + flip^text.flip, text.hcenter, text.vcenter, + x0+x1, y0+y1, text.xscale, text.yscale); + } else { + old_ps_draw_string(textlayer, txtptr, + (text.rot + ( (flip && (text.rot & 1) ) ? rot+2 : rot) ) & 0x3, + flip^text.flip, text.hcenter, text.vcenter, + x0+x1, y0+y1, text.xscale, text.yscale); + } + } } - } - + } } diff --git a/src/save.c b/src/save.c index 29f03c32..2596b3ef 100644 --- a/src/save.c +++ b/src/save.c @@ -1897,6 +1897,7 @@ static void load_inst(int k, FILE *fd) load_ascii_string(&prop_ptr,fd); my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, prop_ptr); my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, get_tok_value(xctx->inst[i].prop_ptr, "name", 0)); + if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"hide",0), "true")) xctx->inst[i].flags |= HIDE_INST; @@ -1909,6 +1910,9 @@ static void load_inst(int k, FILE *fd) if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"tedax_ignore",0), "true")) xctx->inst[i].flags |= TEDAX_IGNORE_INST; + if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"hide_texts",0), "true")) + xctx->inst[i].flags |= HIDE_SYMBOL_TEXTS; + if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true")) xctx->inst[i].flags |= HILIGHT_CONN; @@ -2409,12 +2413,12 @@ void link_symbols_to_instances(int from) } for(i = from; i < xctx->instances; ++i) { type=xctx->sym[xctx->inst[i].ptr].type; - cond= !type || !IS_LABEL_SH_OR_PIN(type); - if(cond) xctx->inst[i].flags|=2; /* ordinary symbol */ - else { - xctx->inst[i].flags &=~2; /* label or pin */ + cond= type && IS_LABEL_SH_OR_PIN(type); + if(cond) { + xctx->inst[i].flags |= PIN_OR_LABEL; /* label or pin */ my_strdup(_ALLOC_ID_, &xctx->inst[i].lab, get_tok_value(xctx->inst[i].prop_ptr,"lab",0)); } + else xctx->inst[i].flags &= ~PIN_OR_LABEL; /* ordinary symbol */ } /* symbol_bbox() might call translate() that might call prepare_netlist_structs() that * needs .lab field set above, so this must be done last */ diff --git a/src/scheduler.c b/src/scheduler.c index 3bf03ea1..09abcbb3 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -2866,12 +2866,14 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg hash_all_names(); new_prop_string(inst, ptr,0, tclgetboolvar("disable_unique_names")); /* set new prop_ptr */ type=xctx->sym[xctx->inst[inst].ptr].type; - cond= !type || !IS_LABEL_SH_OR_PIN(type); - if(cond) xctx->inst[inst].flags|=2; - else { - xctx->inst[inst].flags &=~2; + + cond= type && IS_LABEL_SH_OR_PIN(type); + if(cond) { + xctx->inst[inst].flags |= PIN_OR_LABEL; my_strdup(_ALLOC_ID_, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0)); } + else xctx->inst[inst].flags &= ~PIN_OR_LABEL; + xctx->inst[inst].embed = !strcmp(get_tok_value(xctx->inst[inst].prop_ptr, "embed", 2), "true"); my_free(_ALLOC_ID_, &ptr); } @@ -3335,12 +3337,12 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg tclgetboolvar("disable_unique_names")); } type=xctx->sym[xctx->inst[inst].ptr].type; - cond= !type || !IS_LABEL_SH_OR_PIN(type); - if(cond) xctx->inst[inst].flags|=2; - else { - xctx->inst[inst].flags &=~2; + cond= type && IS_LABEL_SH_OR_PIN(type); + if(cond) { + xctx->inst[inst].flags |= PIN_OR_LABEL; my_strdup(_ALLOC_ID_, &xctx->inst[inst].lab, get_tok_value(xctx->inst[inst].prop_ptr, "lab", 0)); } + else xctx->inst[inst].flags &= ~PIN_OR_LABEL; if(!strcmp(get_tok_value(xctx->inst[inst].prop_ptr,"highlight",0), "true")) xctx->inst[inst].flags |= HILIGHT_CONN; @@ -3366,6 +3368,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg xctx->inst[inst].flags |= TEDAX_IGNORE_INST; else xctx->inst[inst].flags &= ~TEDAX_IGNORE_INST; + if(!strcmp(get_tok_value(xctx->inst[inst].prop_ptr,"hide_texts",0), "true")) + xctx->inst[inst].flags |= HIDE_SYMBOL_TEXTS; + else xctx->inst[inst].flags &= ~HIDE_SYMBOL_TEXTS; + xctx->inst[inst].embed = !strcmp(get_tok_value(xctx->inst[inst].prop_ptr, "embed", 2), "true"); if(!fast) { /* new symbol bbox after prop changes (may change due to text length) */ diff --git a/src/svgdraw.c b/src/svgdraw.c index 1715763d..9720c4ce 100644 --- a/src/svgdraw.c +++ b/src/svgdraw.c @@ -531,8 +531,15 @@ static void svg_draw_symbol(int c, int n,int layer,short tmp_flip, short rot, svg_filledrect(c, x0+x1, y0+y1, x0+x2, y0+y2, rect->dash, rect->fill); } } - if( (layer==TEXTWIRELAYER && !(xctx->inst[n].flags&2) ) || - (xctx->sym_txt && (layer==TEXTLAYER) && (xctx->inst[n].flags&2) ) ) { + + if( + !(xctx->inst[n].flags & HIDE_SYMBOL_TEXTS) && + ( + (layer==TEXTWIRELAYER && (xctx->inst[n].flags & PIN_OR_LABEL) ) || + (xctx->sym_txt && (layer==TEXTLAYER) && !(xctx->inst[n].flags & PIN_OR_LABEL)) + ) + ) + { const char *txtptr; for(j=0;j< symptr->texts; ++j) { text = symptr->text[j]; @@ -695,8 +702,8 @@ void svg_draw(void) * if( (c == PINLAYER || xctx->enable_layer[c]) && symptr->polygons[c] ) unused_layer[c] = 0; * if( (c == PINLAYER || xctx->enable_layer[c]) && symptr->arcs[c] ) unused_layer[c] = 0; * if( (c != PINLAYER || xctx->enable_layer[c]) && symptr->rects[c] ) unused_layer[c] = 0; - * if( (c==TEXTWIRELAYER && !(xctx->inst[i].flags&2) ) || - * (xctx->sym_txt && (c==TEXTLAYER) && (xctx->inst[i].flags&2) ) ) + * if( (c==TEXTWIRELAYER && (xctx->inst[i].flags & PIN_OR_LABEL) ) || + * (xctx->sym_txt && (c==TEXTLAYER) && !(xctx->inst[i].flags & PIN_OR_LABEL) ) ) * { * int j; * for(j=0;j< symptr->texts; ++j) diff --git a/src/xschem.h b/src/xschem.h index 7b91da1b..1a483374 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -168,6 +168,7 @@ extern char win_temp_dir[PATH_MAX]; #define ELEMINST 100 /* (initial) max # of placed elements, was 600 20102004 */ #define ELEMDEF 50 /* (initial) max # of defined elements */ #define EMBEDDED 1 /* used for embedded symbols marking in Symbol.flags */ +#define PIN_OR_LABEL 2 /* symbol represents a pin or a label */ #define HILIGHT_CONN 4 /* used to hilight instances if connected wire is hilighted */ #define HIDE_INST 8 /* will only show a bounding box for specific symbol instance */ #define SPICE_IGNORE_INST 16 @@ -175,6 +176,7 @@ extern char win_temp_dir[PATH_MAX]; #define VHDL_IGNORE_INST 64 #define TEDAX_IGNORE_INST 128 #define IGNORE_INST 256 +#define HIDE_SYMBOL_TEXTS 512 #define CADMAXGRIDPOINTS 512 #define CADMAXHIER 80 #define CADCHUNKALLOC 512 /* was 256 20102004 */ @@ -525,12 +527,15 @@ typedef struct char *templ; int flags; /* bit 0: embedded flag * bit 1: **free** - * bit 2: highight if connected wire highlighted - * bit 4: spice_ignore=true - * bit 5: verilog_ignore=true - * bit 6: vhdl_ignore=true - * bit 7: tedax_ignore=true - * bit 8: instance must be ignored based on *_ignore=true and netlisting mode. used in draw.c + * bit 2: HILIGHT_CONN, highlight if connected net/label is highlighted + * bit 3: HIDE_INST, hidden instance, show only bounding box (hide=true attribute) + * bit 4: SPICE_IGNORE_INST, spice_ignore=true + * bit 5: VERILOG_IGNORE_INST, verilog_ignore=true + * bit 6: VHDL_IGNORE_INST, vhdl_ignore=true + * bit 7: TEDAX_IGNORE_INST, tedax_ignore=true + * bit 8: IGNORE_INST, instance must be ignored based on *_ignore=true and netlisting mode. + * used in draw.c + * bit 9: HIDE_SYMBOL_TEXTS, hide_texts=true on instance (not used in symbol, but keep free) */ } xSymbol; @@ -554,16 +559,19 @@ typedef struct short sel; short embed; /* cache embed=true|false attribute in prop_ptr */ int color; /* hilight color */ - short flags; /* bit 0: skip field, + short flags; /* bit 0: skip field, set to 1 while drawing layer 0 if symbol is outside bbox + * to avoid doing the evaluation again. * bit 1: flag for different textlayer for pin/labels, * 1: ordinary symbol, 0: label/pin/show - * bit 2: highlight if connected net/label is highlighted - * bit 3: hidden instance, show only bounding box (hide=true attribute) - * bit 4: spice_ignore=true - * bit 5: verilog_ignore=true - * bit 6: vhdl_ignore=true - * bit 7: tedax_ignore=true - * bit 8: instance must be ignored based on *_ignore=true and netlisting mode. used in draw.c + * bit 2: HILIGHT_CONN, highlight if connected net/label is highlighted + * bit 3: HIDE_INST, hidden instance, show only bounding box (hide=true attribute) + * bit 4: SPICE_IGNORE_INST, spice_ignore=true + * bit 5: VERILOG_IGNORE_INST, verilog_ignore=true + * bit 6: VHDL_IGNORE_INST, vhdl_ignore=true + * bit 7: TEDAX_IGNORE_INST, tedax_ignore=true + * bit 8: IGNORE_INST, instance must be ignored based on *_ignore=true and netlisting mode. + * used in draw.c + * bit 9: HIDE_SYMBOL_TEXTS, hide_texts=true (hide_texts=true attribute on instance) */ char *prop_ptr; char **node; diff --git a/xschem_library/examples/poweramp.sch b/xschem_library/examples/poweramp.sch index 1572da63..db931d57 100644 --- a/xschem_library/examples/poweramp.sch +++ b/xschem_library/examples/poweramp.sch @@ -187,8 +187,7 @@ C {res.sym} 130 -1220 1 1 {name=R11 m=1 value=0.3} C {res.sym} 130 -1060 1 1 {name=R9 m=1 value=0.3} C {res.sym} 550 -920 0 1 {name=R19 m=1 value='100k' } -C {res.sym} 550 -860 0 1 {name=R0 m=1 value="'100k/gain'" -floaters=true} +C {res.sym} 550 -860 0 1 {name=R0 m=1 value="'100k/gain'"} C {lab_pin.sym} 550 -750 0 0 {name=p108 lab=IN} C {mos_power_ampli.sym} 500 -660 0 0 {name=x1} C {lab_pin.sym} 350 -640 0 0 {name=p2 lab=VPP} diff --git a/xschem_library/examples/poweramp_lcc.sch b/xschem_library/examples/poweramp_lcc.sch index 008ce5c6..bdc96ea6 100644 --- a/xschem_library/examples/poweramp_lcc.sch +++ b/xschem_library/examples/poweramp_lcc.sch @@ -190,8 +190,7 @@ C {res.sym} 1940 -1410 1 1 {name=R11 m=1 value=0.3} C {res.sym} 1940 -1250 1 1 {name=R9 m=1 value=0.3} C {res.sym} 90 -570 0 0 {name=R19 m=1 value='100k' } -C {res.sym} 90 -510 0 0 {name=R0 m=1 value="'100k/gain'" -floaters=true} +C {res.sym} 90 -510 0 0 {name=R0 m=1 value="'100k/gain'"} C {lab_pin.sym} 90 -400 0 1 {name=p108 lab=IN} C {lab_pin.sym} 2190 -210 0 1 {name=p9 lab=OUTM} C {lab_pin.sym} 310 170 0 0 {name=p12 lab=VPP}