added command <Alt-b> (menu Symbol->Show only instance Bounding boxes) to toggle displaying instance detals / only bounding box.
This commit is contained in:
parent
461e2eae97
commit
8626a8a11b
|
|
@ -105,6 +105,7 @@ ctrl 'a' Select all
|
|||
shift 'A' Toggle show netlist
|
||||
- 'b' Merge file
|
||||
ctrl 'b' Toggle show text in symbol
|
||||
alt 'b' Toggle show symbol details / only bounding boxes
|
||||
- 'c' Copy selected obj.
|
||||
ctrl 'c' Save to clipboard
|
||||
shift 'C' Start arc placement
|
||||
|
|
|
|||
|
|
@ -1283,6 +1283,15 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
merge_file(0, ""); /* 2nd parameter not used any more for merge 25122002 */
|
||||
break;
|
||||
}
|
||||
if(key=='b' && state==Mod1Mask) /* hide/show instance details */
|
||||
{
|
||||
if(semaphore >= 2) break;
|
||||
hide_symbols = !hide_symbols;
|
||||
if(hide_symbols) tclsetvar("hide_symbols", "1");
|
||||
else tclsetvar("hide_symbols", "0");
|
||||
draw();
|
||||
break;
|
||||
}
|
||||
if(key=='B' && state==ShiftMask) /* delete files */
|
||||
{
|
||||
|
||||
|
|
|
|||
107
src/draw.c
107
src/draw.c
|
|
@ -459,6 +459,7 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot,
|
|||
register int j;
|
||||
register double x0,y0,x1,y1,x2,y2;
|
||||
int flip;
|
||||
int hide = 0;
|
||||
Line line;
|
||||
Box box;
|
||||
xArc arc;
|
||||
|
|
@ -470,17 +471,23 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot,
|
|||
#ifdef HAS_CAIRO
|
||||
char *textfont;
|
||||
#endif
|
||||
|
||||
if(inst_ptr[n].ptr == -1) return;
|
||||
if( (layer != PINLAYER && !enable_layer[layer]) ) return;
|
||||
if(!has_x) return;
|
||||
if(hide_symbols && (inst_ptr[n].ptr+instdef)->prop_ptr &&
|
||||
!strcmp(get_tok_value( (inst_ptr[n].ptr+instdef)->prop_ptr, "type",0 ), "subcircuit") ) {
|
||||
hide = 1;
|
||||
} else {
|
||||
hide = 0;
|
||||
}
|
||||
if(hide && layer == 0) {
|
||||
drawrect(PINLAYER, what, inst_ptr[n].xx1, inst_ptr[n].yy1, inst_ptr[n].xx2, inst_ptr[n].yy2, 2);
|
||||
}
|
||||
if(layer==0) {
|
||||
x1=X_TO_SCREEN(inst_ptr[n].x1+xoffset); /* 20150729 added xoffset, yoffset */
|
||||
x2=X_TO_SCREEN(inst_ptr[n].x2+xoffset);
|
||||
y1=Y_TO_SCREEN(inst_ptr[n].y1+yoffset);
|
||||
y2=Y_TO_SCREEN(inst_ptr[n].y2+yoffset);
|
||||
|
||||
|
||||
if(!only_probes && (x2-x1)< 0.3 && (y2-y1)< 0.3) {
|
||||
inst_ptr[n].flags|=1;
|
||||
return; /* 20171210 */
|
||||
|
|
@ -492,13 +499,10 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot,
|
|||
}
|
||||
else inst_ptr[n].flags&=~1;
|
||||
|
||||
/* following code handles different text color for labels/pins 06112002 */
|
||||
|
||||
} else if(inst_ptr[n].flags&1) {
|
||||
dbg(2, "draw_symbol(): skipping inst %d\n", n);
|
||||
return;
|
||||
}
|
||||
|
||||
flip = inst_ptr[n].flip;
|
||||
if(tmp_flip) flip = !flip;
|
||||
rot = (inst_ptr[n].rot + rot ) & 0x3;
|
||||
|
|
@ -506,55 +510,57 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot,
|
|||
x0=inst_ptr[n].x0 + xoffset;
|
||||
y0=inst_ptr[n].y0 + yoffset;
|
||||
symptr = (inst_ptr[n].ptr+instdef);
|
||||
for(j=0;j< symptr->lines[layer];j++)
|
||||
{
|
||||
line = (symptr->lineptr[layer])[j];
|
||||
ROTATION(0.0,0.0,line.x1,line.y1,x1,y1);
|
||||
ROTATION(0.0,0.0,line.x2,line.y2,x2,y2);
|
||||
ORDER(x1,y1,x2,y2);
|
||||
drawline(c,what, x0+x1, y0+y1, x0+x2, y0+y2, line.dash);
|
||||
}
|
||||
for(j=0;j< symptr->polygons[layer];j++) /* 20171115 */
|
||||
{
|
||||
polygon = (symptr->polygonptr[layer])[j];
|
||||
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
|
||||
int k;
|
||||
double *x = my_malloc(34, sizeof(double) * polygon.points);
|
||||
double *y = my_malloc(35, sizeof(double) * polygon.points);
|
||||
for(k=0;k<polygon.points;k++) {
|
||||
ROTATION(0.0,0.0,polygon.x[k],polygon.y[k],x[k],y[k]);
|
||||
x[k]+= x0;
|
||||
y[k] += y0;
|
||||
if(!hide) {
|
||||
for(j=0;j< symptr->lines[layer];j++)
|
||||
{
|
||||
line = (symptr->lineptr[layer])[j];
|
||||
ROTATION(0.0,0.0,line.x1,line.y1,x1,y1);
|
||||
ROTATION(0.0,0.0,line.x2,line.y2,x2,y2);
|
||||
ORDER(x1,y1,x2,y2);
|
||||
drawline(c,what, x0+x1, y0+y1, x0+x2, y0+y2, line.dash);
|
||||
}
|
||||
for(j=0;j< symptr->polygons[layer];j++) /* 20171115 */
|
||||
{
|
||||
polygon = (symptr->polygonptr[layer])[j];
|
||||
{ /* scope block so we declare some auxiliary arrays for coord transforms. 20171115 */
|
||||
int k;
|
||||
double *x = my_malloc(34, sizeof(double) * polygon.points);
|
||||
double *y = my_malloc(35, sizeof(double) * polygon.points);
|
||||
for(k=0;k<polygon.points;k++) {
|
||||
ROTATION(0.0,0.0,polygon.x[k],polygon.y[k],x[k],y[k]);
|
||||
x[k]+= x0;
|
||||
y[k] += y0;
|
||||
}
|
||||
drawpolygon(c, NOW, x, y, polygon.points, polygon.fill, polygon.dash); /* 20180914 added fill */
|
||||
my_free(718, &x);
|
||||
my_free(719, &y);
|
||||
}
|
||||
drawpolygon(c, NOW, x, y, polygon.points, polygon.fill, polygon.dash); /* 20180914 added fill */
|
||||
my_free(718, &x);
|
||||
my_free(719, &y);
|
||||
}
|
||||
}
|
||||
for(j=0;j< symptr->arcs[layer];j++)
|
||||
{
|
||||
for(j=0;j< symptr->arcs[layer];j++)
|
||||
{
|
||||
|
||||
arc = (symptr->arcptr[layer])[j];
|
||||
if(flip) {
|
||||
angle = 270.*rot+180.-arc.b-arc.a;
|
||||
} else {
|
||||
angle = arc.a+rot*270.;
|
||||
arc = (symptr->arcptr[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(0.0,0.0,arc.x,arc.y,x1,y1);
|
||||
drawarc(c,what, x0+x1, y0+y1, arc.r, angle, arc.b, arc.fill, arc.dash);
|
||||
}
|
||||
angle = fmod(angle, 360.);
|
||||
if(angle<0.) angle+=360.;
|
||||
ROTATION(0.0,0.0,arc.x,arc.y,x1,y1);
|
||||
drawarc(c,what, x0+x1, y0+y1, arc.r, angle, arc.b, arc.fill, arc.dash);
|
||||
}
|
||||
|
||||
if( (layer != PINLAYER || enable_layer[layer]) ) for(j=0;j< symptr->rects[layer];j++)
|
||||
{
|
||||
box = (symptr->boxptr[layer])[j];
|
||||
ROTATION(0.0,0.0,box.x1,box.y1,x1,y1);
|
||||
ROTATION(0.0,0.0,box.x2,box.y2,x2,y2);
|
||||
RECTORDER(x1,y1,x2,y2);
|
||||
drawrect(c,what, x0+x1, y0+y1, x0+x2, y0+y2, box.dash);
|
||||
filledrect(c,what, x0+x1, y0+y1, x0+x2, y0+y2);
|
||||
}
|
||||
if( (layer != PINLAYER || enable_layer[layer]) ) for(j=0;j< symptr->rects[layer];j++)
|
||||
{
|
||||
box = (symptr->boxptr[layer])[j];
|
||||
ROTATION(0.0,0.0,box.x1,box.y1,x1,y1);
|
||||
ROTATION(0.0,0.0,box.x2,box.y2,x2,y2);
|
||||
RECTORDER(x1,y1,x2,y2);
|
||||
drawrect(c,what, x0+x1, y0+y1, x0+x2, y0+y2, box.dash);
|
||||
filledrect(c,what, x0+x1, y0+y1, x0+x2, y0+y2);
|
||||
}
|
||||
} /*if (!hide) */
|
||||
if( (layer==TEXTWIRELAYER && !(inst_ptr[n].flags&2) ) ||
|
||||
(sym_txt && (layer==TEXTLAYER) && (inst_ptr[n].flags&2) ) ) {
|
||||
const char *txtptr;
|
||||
|
|
@ -562,6 +568,7 @@ void draw_symbol(int what,int c, int n,int layer,int tmp_flip, int rot,
|
|||
{
|
||||
text = symptr->txtptr[j];
|
||||
if(text.xscale*FONTWIDTH*mooz<1) continue;
|
||||
if( hide && text.txt_ptr && strcmp(text.txt_ptr, "@symname") && strcmp(text.txt_ptr, "@name") ) continue;
|
||||
txtptr= translate(n, text.txt_ptr);
|
||||
ROTATION(0.0,0.0,text.x0,text.y0,x1,y1);
|
||||
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ struct instentry *insttable[NBOXES][NBOXES];
|
|||
size_t get_tok_value_size;
|
||||
size_t get_tok_size;
|
||||
int batch_mode = 0; /* no tcl console if set; batch mode */
|
||||
int hide_symbols = 0; /* draw only a bounding box for component instances and @symname, @name texts */
|
||||
|
||||
#ifdef HAS_CAIRO
|
||||
cairo_surface_t *sfc, *save_sfc;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ ctrl 'a' Select all
|
|||
shift 'A' Toggle show netlist
|
||||
- 'b' Merge file
|
||||
ctrl 'b' Toggle show text in symbol
|
||||
alt 'b' Toggle show symbol details / only bounding boxes
|
||||
shift 'B' Delete files
|
||||
- 'c' Copy selected obj.
|
||||
ctrl 'c' Save to clipboard
|
||||
|
|
|
|||
|
|
@ -1828,6 +1828,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
int s = atoi(argv[3]);
|
||||
no_draw=s;
|
||||
}
|
||||
else if(!strcmp(argv[2],"hide_symbols")) { /* 20171204 */
|
||||
int s = atoi(argv[3]);
|
||||
hide_symbols=s;
|
||||
}
|
||||
else if(!strcmp(argv[2],"user_top_netl_name")) { /* 20171204 */
|
||||
my_strncpy(user_top_netl_name, argv[3], S(user_top_netl_name));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -679,6 +679,8 @@ extern struct instentry *insttable[NBOXES][NBOXES];
|
|||
extern size_t get_tok_value_size;
|
||||
extern size_t get_tok_size;
|
||||
extern int batch_mode; /* no TCL console */
|
||||
extern int hide_symbols; /* draw only a bounding box for component instances and @symname, @name texts */
|
||||
|
||||
/* functions */
|
||||
extern void dbg(int level, char *fmt, ...);
|
||||
extern void here(void);
|
||||
|
|
|
|||
|
|
@ -3059,6 +3059,8 @@ set_ne computerfarm {} ;# 20151007
|
|||
# set a port number in xschemrc if you want accept remote connections.
|
||||
set_ne xschem_listen_port {}
|
||||
|
||||
# hide instance details (show only bbox)
|
||||
set_ne hide_symbols 0
|
||||
# gaw tcp {host port}
|
||||
set_ne gaw_tcp_address {localhost 2020}
|
||||
|
||||
|
|
@ -3571,6 +3573,8 @@ font configure Underline-Font -underline true -size 24
|
|||
.menubar.prop.menu add command -label "View" -command "xschem view_prop" -accelerator Ctrl+Q
|
||||
.menubar.prop.menu add command -background red -label "Edit file (danger!)" -command "xschem edit_file" -accelerator Alt+Q
|
||||
|
||||
.menubar.sym.menu add checkbutton -label "Show only instance Bounding boxes" -variable hide_symbols \
|
||||
-command {xschem set hide_symbols $hide_symbols; xschem redraw} -accelerator Alt+B
|
||||
.menubar.sym.menu add command -label "Make symbol from schematic" -command "xschem make_symbol" -accelerator A
|
||||
.menubar.sym.menu add command -label "Make schematic from symbol" -command "xschem make_sch" -accelerator Ctrl+L
|
||||
.menubar.sym.menu add command -label "Attach pins to component instance" -command "xschem attach_pins" -accelerator Shift+H
|
||||
|
|
|
|||
Loading…
Reference in New Issue