HILIGHT_CONN macro

This commit is contained in:
Stefan Frederik 2022-01-16 14:49:59 +01:00
parent 51889e524a
commit 4379a68a19
6 changed files with 19 additions and 13 deletions

View File

@ -930,7 +930,8 @@ int place_symbol(int pos, const char *symbol_name, double x, double y, short rot
}
dbg(1, "place_symbol(): done set_inst_prop()\n"); /* 03-02-2000 */
if(!strcmp(get_tok_value(xctx->inst[n].prop_ptr,"highlight",0), "true")) xctx->inst[n].flags |= 4;
if(!strcmp(get_tok_value(xctx->inst[n].prop_ptr,"highlight",0), "true"))
xctx->inst[n].flags |= HILIGHT_CONN;
type = xctx->sym[xctx->inst[n].ptr].type;
cond= !type || !IS_LABEL_SH_OR_PIN(type);
if(cond) xctx->inst[n].flags|=2;

View File

@ -1069,8 +1069,8 @@ void update_symbol(const char *result, int x)
get_tok_value(xctx->inst[*ii].prop_ptr, "lab",0));
}
if(!strcmp(get_tok_value(xctx->inst[*ii].prop_ptr,"highlight",0), "true"))
xctx->inst[*ii].flags |= 4;
else xctx->inst[*ii].flags &= ~4;
xctx->inst[*ii].flags |= HILIGHT_CONN;
else xctx->inst[*ii].flags &= ~HILIGHT_CONN;
} /* end for(k=0;k<xctx->lastsel;k++) */
/* new symbol bbox after prop changes (may change due to text length) */
if(xctx->modified) {

View File

@ -779,7 +779,7 @@ void drill_hilight(int mode)
npin = symbol->rects[PINLAYER];
rct=symbol->rect[PINLAYER];
hilight_connected_inst = en_hi &&
( (xctx->inst[i].flags & 4) || ((xctx->inst[i].ptr+ xctx->sym)->flags & 4) );
((xctx->inst[i].flags & HILIGHT_CONN) || ((xctx->inst[i].ptr+ xctx->sym)->flags & HILIGHT_CONN));
for(j=0; j<npin;j++) {
my_strdup(143, &netname, net_name(i, j, &mult, 1, 0));
entry=bus_hilight_hash_lookup(netname, 0, XLOOKUP);
@ -1066,7 +1066,7 @@ void propagate_hilights(int set, int clear, int mode)
}
type = (xctx->inst[i].ptr+ xctx->sym)->type;
hilight_connected_inst = en_hi &&
( (xctx->inst[i].flags & 4) || ((xctx->inst[i].ptr+ xctx->sym)->flags & 4) );
((xctx->inst[i].flags & HILIGHT_CONN) || ((xctx->inst[i].ptr+ xctx->sym)->flags & HILIGHT_CONN));
/* hilight/clear instances with hilight=true attr set and en_hilight_conn_inst option is set ... */
if(hilight_connected_inst && type && !IS_LABEL_SH_OR_PIN(type)) {
int rects, j, nohilight_pins;
@ -1668,9 +1668,9 @@ void select_hilight_net(void)
type = (xctx->inst[i].ptr+ xctx->sym)->type;
hilight_connected_inst = en_hi &&
( (xctx->inst[i].flags & 4) || ((xctx->inst[i].ptr+ xctx->sym)->flags & 4) );
((xctx->inst[i].flags & HILIGHT_CONN) || ((xctx->inst[i].ptr+ xctx->sym)->flags & HILIGHT_CONN));
if( xctx->inst[i].color != -10000) {
dbg(1, "select_hilight_net(): instance %d flags &4 true\n", i);
dbg(1, "select_hilight_net(): instance %d flags & HILIGHT_CONN true\n", i);
xctx->inst[i].sel = SELECTED;
}
else if(hilight_connected_inst) {

View File

@ -310,7 +310,8 @@ void merge_inst(int k,FILE *fd)
new_prop_string(i, prop_ptr, k, tclgetboolvar("disable_unique_names"));
/* the final tmp argument is zero for the 1st call and used in */
/* new_prop_string() for cleaning some internal caches. */
if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true")) xctx->inst[i].flags |= 4;
if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true"))
xctx->inst[i].flags |= HILIGHT_CONN;
my_free(871, &prop_ptr);
xctx->instances++;

View File

@ -571,7 +571,8 @@ static void load_inst(int k, FILE *fd)
load_ascii_string(&prop_ptr,fd);
my_strdup(319, &xctx->inst[i].prop_ptr, prop_ptr);
my_strdup2(320, &xctx->inst[i].instname, get_tok_value(xctx->inst[i].prop_ptr, "name", 0));
if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true")) xctx->inst[i].flags |= 4;
if(!strcmp(get_tok_value(xctx->inst[i].prop_ptr,"highlight",0), "true"))
xctx->inst[i].flags |= HILIGHT_CONN;
dbg(2, "load_inst(): n=%d name=%s prop=%s\n", i, xctx->inst[i].name? xctx->inst[i].name:"<NULL>",
xctx->inst[i].prop_ptr? xctx->inst[i].prop_ptr:"<NULL>");
@ -1784,8 +1785,9 @@ int load_sym_def(const char *name, FILE *embed_fd)
get_tok_value(symbol[symbols].prop_ptr, "template", 0));
my_strdup2(515, &symbol[symbols].type,
get_tok_value(symbol[symbols].prop_ptr, "type",0));
if(!strcmp(get_tok_value(symbol[symbols].prop_ptr,"highlight",0), "true")) symbol[symbols].flags |= 4;
else symbol[symbols].flags &= ~4;
if(!strcmp(get_tok_value(symbol[symbols].prop_ptr,"highlight",0), "true"))
symbol[symbols].flags |= HILIGHT_CONN;
else symbol[symbols].flags &= ~HILIGHT_CONN;
}
else {
@ -1800,8 +1802,9 @@ int load_sym_def(const char *name, FILE *embed_fd)
get_tok_value(symbol[symbols].prop_ptr, "template", 0));
my_strdup2(342, &symbol[symbols].type,
get_tok_value(symbol[symbols].prop_ptr, "type",0));
if(!strcmp(get_tok_value(symbol[symbols].prop_ptr,"highlight",0), "true")) symbol[symbols].flags |= 4;
else symbol[symbols].flags &= ~4;
if(!strcmp(get_tok_value(symbol[symbols].prop_ptr,"highlight",0), "true"))
symbol[symbols].flags |= HILIGHT_CONN;
else symbol[symbols].flags &= ~HILIGHT_CONN;
}
else {
load_ascii_string(&aux_ptr, lcc[level].fd);

View File

@ -161,6 +161,7 @@ extern char win_temp_dir[PATH_MAX];
#define ELEMINST 4096 /* (initial) max # of placed elements, was 600 20102004 */
#define ELEMDEF 256 /* (initial) max # of defined elements */
#define EMBEDDED 1 /* used for embedded symbols marking in Symbol.flags */
#define HILIGHT_CONN 4 /* used to hilight instances if connected wire is hilighted */
#define CADMAXGRIDPOINTS 512
#define CADMAXHIER 80
#define CADCHUNKALLOC 512 /* was 256 20102004 */