various graphic rendering fixes for the new "view instance pin net names" function. Fixed some errors in merge schematic in callback.c and paste.c
This commit is contained in:
parent
cf0db629c4
commit
8807c7250d
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Name="XSchem" Language="1033" Version="1.0.0.10" Manufacturer="XSchem" UpgradeCode="0deb9c17-cbbd-491c-be3e-24446b27ccd5">
|
||||
<Product Id="*" Name="XSchem" Language="1033" Version="1.0.0.11" Manufacturer="XSchem" UpgradeCode="0deb9c17-cbbd-491c-be3e-24446b27ccd5">
|
||||
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
|
||||
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
|
||||
|
|
@ -484,6 +484,9 @@
|
|||
<Component Id="cmp27E7659104A411842F0420D7053BD27F" Guid="{5AC0422A-4AFF-46CF-8981-3E8C86218DDD}">
|
||||
<File Id="filD6C6A5660AF3BDE07EC6A7E384F25685" KeyPath="yes" Source="../../doc\xschem_man\creating_symbols.html" />
|
||||
</Component>
|
||||
<Component Id="cmpDEB74D0D620417EA4BA538766CB06A02" Guid="{1B201BC2-B20C-4110-9B63-8855E51DEEC8}">
|
||||
<File Id="filFE5A37A7845194D0997D8ECFC2BDBC88" KeyPath="yes" Source="../../doc\xschem_man\dashes.png" />
|
||||
</Component>
|
||||
<Component Id="cmpE49B2AD390E78D91ADE0465806C4C919" Guid="{522F8BF6-850A-467F-9AC0-909AF3462DEA}">
|
||||
<File Id="fil8511A5BD6B6DC90068C3259E5569E588" KeyPath="yes" Source="../../doc\xschem_man\developer_info.html" />
|
||||
</Component>
|
||||
|
|
@ -691,6 +694,9 @@
|
|||
<Component Id="cmp59F023E27FDD7B234ECC639EE2522976" Guid="{93F91814-ECBC-40A5-9404-E195FF599674}">
|
||||
<File Id="fil9B0609A35E6BAF4D23349C23B0810A0B" KeyPath="yes" Source="../../doc\xschem_man\special1.png" />
|
||||
</Component>
|
||||
<Component Id="cmpDD44C20809ECD127A88F7DE88096611B" Guid="{1386D03B-F14A-4215-B916-017B962904AE}">
|
||||
<File Id="filD92F807682A4CA83B3B3D159FCC28686" KeyPath="yes" Source="../../doc\xschem_man\spiceprefix.png" />
|
||||
</Component>
|
||||
<Component Id="cmp732E5B2D49C27C570ABDB29084D05C51" Guid="{4499136D-D415-477B-9F36-F11DAAFD501C}">
|
||||
<File Id="filFB1CBAC7934327E0A7BCC596B737DDBA" KeyPath="yes" Source="../../doc\xschem_man\spice_backannotate.png" />
|
||||
</Component>
|
||||
|
|
@ -985,6 +991,9 @@
|
|||
<Component Id="cmp3452F4393032E2BCF466F796BE5B8BC1" Guid="{06281A40-68AB-4138-AB56-5882A69611D6}">
|
||||
<File Id="fil00883A873D49F2054B69E270D230D1D2" KeyPath="yes" Source="../../doc\xschem_man\xschem_elements_01.png" />
|
||||
</Component>
|
||||
<Component Id="cmp9ACBF8902D10F23B410D1E5DF213E367" Guid="{C6149939-F0C2-4106-B425-C0ED5346E73E}">
|
||||
<File Id="fil4DB55A390AFDA2DE5176604EB0366630" KeyPath="yes" Source="../../doc\xschem_man\xschem_elements_02.png" />
|
||||
</Component>
|
||||
<Component Id="cmpA8EFC822F728321D727C148FFCC1087E" Guid="{0FA02A87-EA57-4A1D-818A-4FF390F84E0F}">
|
||||
<File Id="fil4AE90C6BCC0CE9714D22AE0D3C7E9968" KeyPath="yes" Source="../../doc\xschem_man\xschem_footer.html" />
|
||||
</Component>
|
||||
|
|
@ -1107,6 +1116,7 @@
|
|||
<ComponentRef Id="cmp6CBE46479E7664346599B1EF23A21D31" />
|
||||
<ComponentRef Id="cmp088C9DD67B52A3BFF280B5B03611A1A2" />
|
||||
<ComponentRef Id="cmp27E7659104A411842F0420D7053BD27F" />
|
||||
<ComponentRef Id="cmpDEB74D0D620417EA4BA538766CB06A02" />
|
||||
<ComponentRef Id="cmpE49B2AD390E78D91ADE0465806C4C919" />
|
||||
<ComponentRef Id="cmp4741CC8232567664140F33AEE03B38EB" />
|
||||
<ComponentRef Id="cmp668A06750E550AE50E1E502FC90FF9B8" />
|
||||
|
|
@ -1176,6 +1186,7 @@
|
|||
<ComponentRef Id="cmpE14EAA5599BC259217D3F2681EFFF54F" />
|
||||
<ComponentRef Id="cmpF5359475429AC9229DF1525D1CE5CBD9" />
|
||||
<ComponentRef Id="cmp59F023E27FDD7B234ECC639EE2522976" />
|
||||
<ComponentRef Id="cmpDD44C20809ECD127A88F7DE88096611B" />
|
||||
<ComponentRef Id="cmp732E5B2D49C27C570ABDB29084D05C51" />
|
||||
<ComponentRef Id="cmpDEE941524809D6E54F8694EF265A5B62" />
|
||||
<ComponentRef Id="cmpA42615759AC426408A2751D3EE30399B" />
|
||||
|
|
@ -1274,6 +1285,7 @@
|
|||
<ComponentRef Id="cmp9F057B79775C11138DAC9F1536354C5F" />
|
||||
<ComponentRef Id="cmpD3DEDB3C114AAE2DB365CD35D9783E48" />
|
||||
<ComponentRef Id="cmp3452F4393032E2BCF466F796BE5B8BC1" />
|
||||
<ComponentRef Id="cmp9ACBF8902D10F23B410D1E5DF213E367" />
|
||||
<ComponentRef Id="cmpA8EFC822F728321D727C148FFCC1087E" />
|
||||
<ComponentRef Id="cmpE0DE35DD51025BCC6111820E3A05FA78" />
|
||||
<ComponentRef Id="cmpA8D772FA90BF83FAE361088389726619" />
|
||||
|
|
@ -1453,6 +1465,9 @@
|
|||
<Component Id="cmpD6B8231E142BB1E2AC3D266CED7EA801" Guid="{ED8AFD6D-F5FC-48A0-B238-E29F8C793055}">
|
||||
<File Id="fil4BB9252C0F5D2EE7597D51A329008FE5" KeyPath="yes" Source="../../xschem_library\devices\lab_pin.sym" />
|
||||
</Component>
|
||||
<Component Id="cmp43D63007EC7C7651A38CD2F5D76A6071" Guid="{65EE9537-1889-4742-BA4A-545A18E9F727}">
|
||||
<File Id="fil3B33DC095BA0A70C126F163911775C69" KeyPath="yes" Source="../../xschem_library\devices\lab_show.sym" />
|
||||
</Component>
|
||||
<Component Id="cmp83ACD9EEB6424099DC3E3994A23DDA02" Guid="{9C849D89-E0C8-495A-B158-32CA55C6CD26}">
|
||||
<File Id="fil3E1E2A51D31C9417462F0A1AECA3E794" KeyPath="yes" Source="../../xschem_library\devices\lab_wire.sym" />
|
||||
</Component>
|
||||
|
|
@ -6404,6 +6419,7 @@
|
|||
<ComponentRef Id="cmp6C0D769630B1C4287304667E42E8799F" />
|
||||
<ComponentRef Id="cmp6B59BDD10233B043F2C7290A08F9EE15" />
|
||||
<ComponentRef Id="cmpD6B8231E142BB1E2AC3D266CED7EA801" />
|
||||
<ComponentRef Id="cmp43D63007EC7C7651A38CD2F5D76A6071" />
|
||||
<ComponentRef Id="cmp83ACD9EEB6424099DC3E3994A23DDA02" />
|
||||
<ComponentRef Id="cmp959DCA1017056F08472B765ADA789B18" />
|
||||
<ComponentRef Id="cmp21004F1B65ACEBF807C81932002A0548" />
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1615,9 +1615,17 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
{
|
||||
static double x1,y1,x2,y2;
|
||||
static double xx1,yy1,xx2,yy2;
|
||||
int savelastwire;
|
||||
|
||||
if( (what & PLACE) ) {
|
||||
if( (ui_state & STARTWIRE) && (x1!=x2 || y1!=y2) ) {
|
||||
savelastwire = lastwire;
|
||||
/*
|
||||
prepared_netlist_structs = 0;
|
||||
prepared_hash_wires = 0;
|
||||
prepared_hilight_structs = 0;
|
||||
prepare_netlist_structs(0);
|
||||
*/
|
||||
push_undo();
|
||||
if(manhattan_lines==1) {
|
||||
if(xx2!=xx1) {
|
||||
|
|
@ -1655,7 +1663,47 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
printf("xschem wire %g %g %g %g %d\n", xx1, yy1, xx2, yy2, -1);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
if(show_pin_net_names) {
|
||||
int w;
|
||||
/*
|
||||
int i, p, rot, flip, save;
|
||||
double x0, y0, rx1, ry1;
|
||||
Box * rect;
|
||||
*/
|
||||
bbox(BEGIN , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
/*
|
||||
save = lastwire;
|
||||
lastwire=savelastwire;
|
||||
for (i=0;i<lastinst;i++) {
|
||||
for(p=0; p< (inst_ptr[i].ptr + instdef) -> rects[PINLAYER]; p++) {
|
||||
rect=(inst_ptr[i].ptr+instdef)->boxptr[PINLAYER];
|
||||
x0=(rect[p].x1+rect[p].x2)/2;
|
||||
y0=(rect[p].y1+rect[p].y2)/2;
|
||||
rot=inst_ptr[i].rot;
|
||||
flip=inst_ptr[i].flip;
|
||||
ROTATION(0.0,0.0,x0,y0,rx1,ry1);
|
||||
x0=inst_ptr[i].x0+rx1;
|
||||
y0=inst_ptr[i].y0+ry1;
|
||||
for(w=savelastwire; w<save; w++) {
|
||||
if(touch(wire[w].x1, wire[w].y1, wire[w].x2, wire[w].y2, x0, y0)) {
|
||||
symbol_bbox(i, &inst_ptr[i].x1, &inst_ptr[i].y1, &inst_ptr[i].x2, &inst_ptr[i].y2 );
|
||||
bbox(ADD, inst_ptr[i].x1, inst_ptr[i].y1, inst_ptr[i].x2, inst_ptr[i].y2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lastwire = save;
|
||||
*/
|
||||
prepared_hash_wires = 0;
|
||||
prepared_hilight_structs = 0;
|
||||
prepare_netlist_structs(0);
|
||||
for(w=savelastwire; w<lastwire; w++) {
|
||||
find_inst_to_be_redrawn(wire[w].node);
|
||||
}
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
draw();
|
||||
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
}
|
||||
if(! (what &END)) {
|
||||
x1=mx_snap;
|
||||
|
|
|
|||
|
|
@ -146,12 +146,18 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
{
|
||||
case EnterNotify:
|
||||
if(!sel_or_clip[0]) my_snprintf(sel_or_clip, S(sel_or_clip), "%s/%s", user_conf_dir, ".selection.sch"); /* 20181002 */
|
||||
|
||||
/* xschem window *sending* selected objects
|
||||
when the pointer comes back in abort copy operation since it has been done
|
||||
in another xschem window; STARTCOPY set and selection file does not exist any more */
|
||||
if( stat(sel_or_clip, &buf) && (ui_state & STARTCOPY) )
|
||||
{
|
||||
copy_objects(ABORT); /* also unlinks sel_or_flip file */
|
||||
unselect_all();
|
||||
}
|
||||
if(lastselected == 0 ) {
|
||||
/* xschem window *receiving* selected objects */
|
||||
/* no selected objects and selection file exists */
|
||||
if(lastselected == 0 && !stat(sel_or_clip, &buf)) {
|
||||
dbg(2, "callback(): Enter event\n");
|
||||
mousex_snap = 490;
|
||||
mousey_snap = -340;
|
||||
|
|
@ -1410,6 +1416,8 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
ORDER(x1, y1, x2, y2);
|
||||
storeobject(-1, x1, y1, x2, y2, WIRE,0,0,NULL);
|
||||
}
|
||||
prepared_netlist_structs = 0;
|
||||
prepared_hilight_structs = 0;
|
||||
|
||||
|
||||
zoom_full(1, 0);
|
||||
|
|
|
|||
|
|
@ -1581,7 +1581,6 @@ void draw(void)
|
|||
hash_wires();
|
||||
}
|
||||
if(!only_probes) { /* 20110112 */
|
||||
|
||||
dbg(3, "draw(): check4\n");
|
||||
for(c=0;c<cadlayers;c++)
|
||||
{
|
||||
|
|
@ -1649,6 +1648,7 @@ void draw(void)
|
|||
}
|
||||
/* --------------------------------- /20171224 */
|
||||
} else {
|
||||
|
||||
for(i=0;i<lastinst;i++) {
|
||||
if(inst_ptr[i].ptr == -1) continue;
|
||||
symptr = (inst_ptr[i].ptr+instdef);
|
||||
|
|
|
|||
|
|
@ -946,6 +946,16 @@ void update_symbol(const char *result, int x)
|
|||
only_different=atoi(tclgetvar("preserve_unchanged_attrs") );
|
||||
copy_cell=atoi(tclgetvar("user_wants_copy_cell") ); /* 20150911 */
|
||||
|
||||
bbox(BEGIN,0.0,0.0,0.0,0.0);
|
||||
if(show_pin_net_names) {
|
||||
prepare_netlist_structs(0);
|
||||
for(k = 0; k < (inst_ptr[i].ptr + instdef)->rects[PINLAYER]; k++) {
|
||||
if( inst_ptr[i].node && inst_ptr[i].node[k]) {
|
||||
find_inst_to_be_redrawn(inst_ptr[i].node[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 20191227 necessary? --> Yes since a symbol copy has already been done
|
||||
in edit_symbol_property() -> tcl edit_prop, this ensures new symbol is loaded from disk.
|
||||
if for some reason a symbol with matching name is loaded in xschem this
|
||||
|
|
@ -969,7 +979,6 @@ void update_symbol(const char *result, int x)
|
|||
prefix=(get_tok_value((instdef+sym_number)->templ, "name",0))[0]; /* get new symbol prefix */
|
||||
}
|
||||
}
|
||||
bbox(BEGIN,0.0,0.0,0.0,0.0);
|
||||
|
||||
/* instance name prefix (1st char) changed? --> allow_change_name=1 */
|
||||
allow_change_name = 0;
|
||||
|
|
@ -1083,6 +1092,16 @@ void update_symbol(const char *result, int x)
|
|||
|
||||
bbox(ADD, inst_ptr[i].x1, inst_ptr[i].y1, inst_ptr[i].x2, inst_ptr[i].y2);
|
||||
}
|
||||
|
||||
if(show_pin_net_names) {
|
||||
prepare_netlist_structs(0);
|
||||
for(k = 0; k < (inst_ptr[i].ptr + instdef)->rects[PINLAYER]; k++) {
|
||||
if( inst_ptr[i].node && inst_ptr[i].node[k]) {
|
||||
find_inst_to_be_redrawn(inst_ptr[i].node[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* redraw symbol with new props */
|
||||
bbox(SET,0.0,0.0,0.0,0.0);
|
||||
dbg(1, "update_symbol(): redrawing inst_ptr.txtprop string\n");
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ char home_dir[PATH_MAX]; /* home dir obtained via getpwuid */
|
|||
char pwd_dir[PATH_MAX]; /* obtained via getcwd() */
|
||||
#ifndef __unix__
|
||||
char win_temp_dir[PATH_MAX]="";
|
||||
const char fopen_read_mode[] = "rb";
|
||||
#else
|
||||
const char fopen_read_mode[] = "r";
|
||||
#endif
|
||||
int load_initfile=1;
|
||||
char plotfile[PATH_MAX] = {'\0'};
|
||||
|
|
|
|||
171
src/move.c
171
src/move.c
|
|
@ -445,6 +445,23 @@ void draw_selection(GC g, int interruptable)
|
|||
lastsel = i;
|
||||
}
|
||||
|
||||
void find_inst_to_be_redrawn(const char *node)
|
||||
{
|
||||
int i, p, rects;
|
||||
Instdef * sym;
|
||||
|
||||
for(i=0; i< lastinst; i++) {
|
||||
sym = inst_ptr[i].ptr + instdef;
|
||||
rects = sym->rects[PINLAYER];
|
||||
for(p = 0; p < rects; p++) {
|
||||
if(node && inst_ptr[i].node[p] && !strcmp(inst_ptr[i].node[p], node )) {
|
||||
symbol_bbox(i, &inst_ptr[i].x1, &inst_ptr[i].y1, &inst_ptr[i].x2, &inst_ptr[i].y2 );
|
||||
bbox(ADD, inst_ptr[i].x1, inst_ptr[i].y1, inst_ptr[i].x2, inst_ptr[i].y2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void copy_objects(int what)
|
||||
{
|
||||
int c, i, n, k;
|
||||
|
|
@ -516,7 +533,7 @@ void copy_objects(int what)
|
|||
newpropcnt=0;
|
||||
set_modify(1); push_undo(); /* 20150327 push_undo */
|
||||
prepared_hash_instances=0; /* 20171224 */
|
||||
prepared_hash_wires=0; /* 20171224 */
|
||||
prepared_hash_wires=0;
|
||||
|
||||
/* calculate copied symbols bboxes before actually doing the move */
|
||||
for(i=0;i<lastselected;i++)
|
||||
|
|
@ -528,6 +545,62 @@ void copy_objects(int what)
|
|||
}
|
||||
}
|
||||
|
||||
for(i=0;i<lastselected;i++)
|
||||
{
|
||||
n = selectedgroup[i].n;
|
||||
if(selectedgroup[i].type == WIRE)
|
||||
{
|
||||
check_wire_storage();
|
||||
if(wire[n].bus){ /* 20171201 */
|
||||
int ov, y1, y2;
|
||||
ov = bus_width> cadhalfdotsize ? bus_width : CADHALFDOTSIZE;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
} else {
|
||||
int ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
}
|
||||
if(rotatelocal) {
|
||||
ROTATION(wire[n].x1, wire[n].y1, wire[n].x1, wire[n].y1, rx1,ry1);
|
||||
ROTATION(wire[n].x1, wire[n].y1, wire[n].x2, wire[n].y2, rx2,ry2);
|
||||
} else {
|
||||
ROTATION(x1, y_1, wire[n].x1, wire[n].y1, rx1,ry1);
|
||||
ROTATION(x1, y_1, wire[n].x2, wire[n].y2, rx2,ry2);
|
||||
}
|
||||
if( wire[n].sel & (SELECTED|SELECTED1) )
|
||||
{
|
||||
rx1+=deltax;
|
||||
ry1+=deltay;
|
||||
}
|
||||
if( wire[n].sel & (SELECTED|SELECTED2) )
|
||||
{
|
||||
rx2+=deltax;
|
||||
ry2+=deltay;
|
||||
}
|
||||
tmpx=rx1; /* used as temporary storage */
|
||||
tmpy=ry1;
|
||||
ORDER(rx1,ry1,rx2,ry2);
|
||||
if( tmpx == rx2 && tmpy == ry2)
|
||||
{
|
||||
if(wire[n].sel == SELECTED1) wire[n].sel = SELECTED2;
|
||||
else if(wire[n].sel == SELECTED2) wire[n].sel = SELECTED1;
|
||||
}
|
||||
selectedgroup[i].n=lastwire;
|
||||
storeobject(-1, rx1,ry1,rx2,ry2,WIRE,0,wire[n].sel,wire[n].prop_ptr);
|
||||
wire[n].sel=0;
|
||||
if(wire[n].bus) /* 20171201 */
|
||||
drawline(WIRELAYER, THICK, rx1,ry1,rx2,ry2, 0);
|
||||
else
|
||||
drawline(WIRELAYER, ADD, rx1,ry1,rx2,ry2, 0);
|
||||
}
|
||||
drawline(WIRELAYER, END, 0.0, 0.0, 0.0, 0.0, 0);
|
||||
}
|
||||
|
||||
|
||||
for(k=0;k<cadlayers;k++)
|
||||
{
|
||||
for(i=0;i<lastselected;i++)
|
||||
|
|
@ -535,58 +608,6 @@ void copy_objects(int what)
|
|||
c = selectedgroup[i].col;n = selectedgroup[i].n;
|
||||
switch(selectedgroup[i].type)
|
||||
{
|
||||
case WIRE:
|
||||
if(k == 0) {
|
||||
check_wire_storage();
|
||||
if(wire[n].bus){ /* 20171201 */
|
||||
int ov, y1, y2;
|
||||
bbox(ADD, wire[n].x1-bus_width, wire[n].y1-bus_width , wire[n].x2+bus_width , wire[n].y2+bus_width );
|
||||
ov = bus_width> cadhalfdotsize ? bus_width : CADHALFDOTSIZE;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
} else {
|
||||
int ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
}
|
||||
if(rotatelocal) {
|
||||
ROTATION(wire[n].x1, wire[n].y1, wire[n].x1, wire[n].y1, rx1,ry1);
|
||||
ROTATION(wire[n].x1, wire[n].y1, wire[n].x2, wire[n].y2, rx2,ry2);
|
||||
} else {
|
||||
ROTATION(x1, y_1, wire[n].x1, wire[n].y1, rx1,ry1);
|
||||
ROTATION(x1, y_1, wire[n].x2, wire[n].y2, rx2,ry2);
|
||||
}
|
||||
if( wire[n].sel & (SELECTED|SELECTED1) )
|
||||
{
|
||||
rx1+=deltax;
|
||||
ry1+=deltay;
|
||||
}
|
||||
if( wire[n].sel & (SELECTED|SELECTED2) )
|
||||
{
|
||||
rx2+=deltax;
|
||||
ry2+=deltay;
|
||||
}
|
||||
tmpx=rx1; /* used as temporary storage */
|
||||
tmpy=ry1;
|
||||
ORDER(rx1,ry1,rx2,ry2);
|
||||
if( tmpx == rx2 && tmpy == ry2)
|
||||
{
|
||||
if(wire[n].sel == SELECTED1) wire[n].sel = SELECTED2;
|
||||
else if(wire[n].sel == SELECTED2) wire[n].sel = SELECTED1;
|
||||
}
|
||||
selectedgroup[i].n=lastwire;
|
||||
storeobject(-1, rx1,ry1,rx2,ry2,WIRE,0,wire[n].sel,wire[n].prop_ptr);
|
||||
wire[n].sel=0;
|
||||
} else if(k == WIRELAYER) {
|
||||
if(wire[n].bus) /* 20171201 */
|
||||
drawline(WIRELAYER, THICK, rx1,ry1,rx2,ry2, 0);
|
||||
else
|
||||
drawline(WIRELAYER, ADD, rx1,ry1,rx2,ry2, 0);
|
||||
}
|
||||
break;
|
||||
case LINE:
|
||||
if(c!=k) break;
|
||||
bbox(ADD, line[c][n].x1, line[c][n].y1, line[c][n].x2, line[c][n].y2); /* 20181009 */
|
||||
|
|
@ -841,21 +862,35 @@ void copy_objects(int what)
|
|||
} /* end for(i=0;i<lastselected;i++) */
|
||||
|
||||
|
||||
need_rebuild_selected_array=1;
|
||||
rebuild_selected_array();
|
||||
|
||||
if(k == 0 ) {
|
||||
/* force these vars to 0 to trigger a prepare_netlist_structs(0) needed by symbol_bbox->translate
|
||||
* to translate @#n:net_name texts */
|
||||
need_rebuild_selected_array=1;
|
||||
rebuild_selected_array();
|
||||
prepared_hash_wires=0;
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
if(show_pin_net_names) {
|
||||
prepare_netlist_structs(0);
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < lastselected; i++) {
|
||||
n = selectedgroup[i].n;
|
||||
if(k == 0) {
|
||||
if(selectedgroup[i].type == ELEMENT) {
|
||||
int p;
|
||||
symbol_bbox(n, &inst_ptr[n].x1, &inst_ptr[n].y1, &inst_ptr[n].x2, &inst_ptr[n].y2 ); /* 20171201 */
|
||||
bbox(ADD, inst_ptr[n].x1, inst_ptr[n].y1, inst_ptr[n].x2, inst_ptr[n].y2 );
|
||||
if(show_pin_net_names) for(p = 0; p < (inst_ptr[n].ptr + instdef)->rects[PINLAYER]; p++) {
|
||||
if( inst_ptr[n].node && inst_ptr[n].node[p]) {
|
||||
find_inst_to_be_redrawn(inst_ptr[n].node[p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(show_pin_net_names && selectedgroup[i].type == WIRE) {
|
||||
find_inst_to_be_redrawn(wire[n].node);
|
||||
}
|
||||
}
|
||||
/* draw_symbol(ADD,k, n,k, 0, 0, 0.0, 0.0); */
|
||||
|
|
@ -879,6 +914,7 @@ void copy_objects(int what)
|
|||
draw_selection(gc[SELLAYER], 0);
|
||||
}
|
||||
|
||||
|
||||
/* merge param unused, RFU */
|
||||
void move_objects(int what, int merge, double dx, double dy)
|
||||
{
|
||||
|
|
@ -947,7 +983,7 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
bbox(BEGIN, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
set_modify(1);
|
||||
prepared_hash_instances=0; /* 20171224 */
|
||||
prepared_hash_wires=0; /* 20171224 */
|
||||
prepared_hash_wires=0;
|
||||
if( !(ui_state & (STARTMERGE | PLACE_SYMBOL)) ) {
|
||||
dbg(1, "move_objects(): push undo state\n");
|
||||
push_undo(); /* 20150327 push_undo */
|
||||
|
|
@ -968,8 +1004,17 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
{
|
||||
n = selectedgroup[i].n;
|
||||
if( selectedgroup[i].type == ELEMENT) {
|
||||
int p;
|
||||
symbol_bbox(n, &inst_ptr[n].x1, &inst_ptr[n].y1, &inst_ptr[n].x2, &inst_ptr[n].y2 ); /* 20171201 */
|
||||
bbox(ADD, inst_ptr[n].x1, inst_ptr[n].y1, inst_ptr[n].x2, inst_ptr[n].y2 );
|
||||
if(show_pin_net_names) for(p = 0; p < (inst_ptr[n].ptr + instdef)->rects[PINLAYER]; p++) {
|
||||
if( inst_ptr[n].node && inst_ptr[n].node[p]) {
|
||||
find_inst_to_be_redrawn(inst_ptr[n].node[p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(show_pin_net_names && selectedgroup[i].type == WIRE) {
|
||||
find_inst_to_be_redrawn(wire[n].node);
|
||||
}
|
||||
}
|
||||
for(k=0;k<cadlayers;k++)
|
||||
|
|
@ -983,7 +1028,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
if(k == 0) {
|
||||
if(wire[n].bus){ /* 20171201 */
|
||||
int ov, y1, y2;
|
||||
bbox(ADD, wire[n].x1-bus_width, wire[n].y1-bus_width , wire[n].x2+bus_width , wire[n].y2+bus_width );
|
||||
ov = bus_width> cadhalfdotsize ? bus_width : CADHALFDOTSIZE;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
|
|
@ -1316,13 +1360,26 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
* to translate @#n:net_name texts */
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
prepared_hash_wires=0;
|
||||
if(show_pin_net_names) {
|
||||
prepare_netlist_structs(0);
|
||||
}
|
||||
}
|
||||
for(i = 0; i < lastselected; i++) {
|
||||
n = selectedgroup[i].n;
|
||||
if(k == 0) {
|
||||
if(selectedgroup[i].type == ELEMENT) {
|
||||
int p;
|
||||
symbol_bbox(n, &inst_ptr[n].x1, &inst_ptr[n].y1, &inst_ptr[n].x2, &inst_ptr[n].y2 ); /* 20171201 */
|
||||
bbox(ADD, inst_ptr[n].x1, inst_ptr[n].y1, inst_ptr[n].x2, inst_ptr[n].y2 );
|
||||
if(show_pin_net_names) for(p = 0; p < (inst_ptr[n].ptr + instdef)->rects[PINLAYER]; p++) {
|
||||
if( inst_ptr[n].node && inst_ptr[n].node[p]) {
|
||||
find_inst_to_be_redrawn(inst_ptr[n].node[p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(show_pin_net_names && selectedgroup[i].type == WIRE) {
|
||||
find_inst_to_be_redrawn(wire[n].node);
|
||||
}
|
||||
}
|
||||
/* draw_symbol(ADD,k, n,k, 0, 0, 0.0, 0.0); */
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ void print_verilog_signals(FILE *fd)
|
|||
|
||||
/* wrapper to node_hash_lookup that handles buses */
|
||||
/* warning, in case of buses return only pointer to first bus element */
|
||||
struct node_hashentry *bus_hash_lookup(const char *token, const char *dir,int remove,int port,
|
||||
struct node_hashentry *bus_hash_lookup(const char *token, const char *dir, int what, int port,
|
||||
char *sig_type,char *verilog_type, char *value, char *class)
|
||||
{
|
||||
char *start, *string_ptr, c;
|
||||
|
|
@ -208,7 +208,7 @@ struct node_hashentry *bus_hash_lookup(const char *token, const char *dir,int re
|
|||
{
|
||||
*string_ptr='\0'; /* set end string at comma position.... */
|
||||
/* insert one bus element at a time in hash table */
|
||||
ptr1=node_hash_lookup(start, dir, remove,port, sig_type, verilog_type, value, class, token);
|
||||
ptr1=node_hash_lookup(start, dir, what,port, sig_type, verilog_type, value, class, token);
|
||||
if(!ptr2) ptr2=ptr1;
|
||||
dbg(3, "bus_hash_lookup(): processing node: %s\n", start);
|
||||
*string_ptr=c; /* ....restore original char */
|
||||
|
|
@ -223,17 +223,18 @@ struct node_hashentry *bus_hash_lookup(const char *token, const char *dir,int re
|
|||
}
|
||||
|
||||
|
||||
struct node_hashentry *node_hash_lookup(const char *token, const char *dir,int remove,int port,
|
||||
struct node_hashentry *node_hash_lookup(const char *token, const char *dir,int what,int port,
|
||||
char *sig_type, char *verilog_type, char *value, char *class, const char *orig_tok)
|
||||
/* token dir remove ... what ... */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* "whatever" "in"/"out" 0,XINSERT insert in hash table if not in and return NULL */
|
||||
/* if already present just return entry address */
|
||||
/* and update in/out fields sum up port field */
|
||||
/* return NULL otherwise */
|
||||
/* */
|
||||
/* "whatever" whatever 1,XDELETE delete entry if found return NULL */
|
||||
/* "whatever" whatever 2,XLOOKUP only look up element, dont insert */
|
||||
/* token dir et all what ... action ...
|
||||
* --------------------------------------------------------------------------
|
||||
* "whatever" "in"/"out" 0,XINSERT insert in hash table if not in and return NULL
|
||||
* if already present just return entry address
|
||||
* and update in/out fields sum up port field
|
||||
* return NULL otherwise
|
||||
* "whatever" "in"/"out" 0,XINSERT_NOREPLACE same as XINSERT but do not replace existing value
|
||||
*
|
||||
* "whatever" whatever 2,XDELETE delete entry if found return NULL
|
||||
* "whatever" whatever 1,XLOOKUP only look up element, dont insert */
|
||||
{
|
||||
unsigned int hashcode, index;
|
||||
struct node_hashentry *entry, *saveptr, **preventry;
|
||||
|
|
@ -242,8 +243,8 @@ struct node_hashentry *node_hash_lookup(const char *token, const char *dir,int r
|
|||
struct drivers d;
|
||||
|
||||
if(token==NULL || token[0]==0 ) return NULL;
|
||||
dbg(3, "node_hash_lookup(): called with: %s dir=%s remove=%d port=%d\n",
|
||||
token, dir, remove, port);
|
||||
dbg(3, "node_hash_lookup(): called with: %s dir=%s what=%d port=%d\n",
|
||||
token, dir, what, port);
|
||||
d.in=d.out=d.inout=0;
|
||||
if(!strcmp(dir,"in") ) d.in=1;
|
||||
else if(!strcmp(dir,"out") ) d.out=1;
|
||||
|
|
@ -257,7 +258,7 @@ struct node_hashentry *node_hash_lookup(const char *token, const char *dir,int r
|
|||
{
|
||||
if( !entry ) /* empty slot */
|
||||
{
|
||||
if( remove==XINSERT ) /* insert data */
|
||||
if( what==XINSERT || what==XINSERT_NOREPLACE) /* insert data */
|
||||
{
|
||||
s=sizeof( struct node_hashentry );
|
||||
ptr= my_malloc(281, s );
|
||||
|
|
@ -286,7 +287,7 @@ struct node_hashentry *node_hash_lookup(const char *token, const char *dir,int r
|
|||
}
|
||||
if( entry -> hash==hashcode && strcmp(token,entry->token)==0 ) /* found matching tok */
|
||||
{
|
||||
if(remove==XDELETE) /* remove token from the hash table ... */
|
||||
if(what==XDELETE) /* remove token from the hash table ... */
|
||||
{
|
||||
saveptr=entry->next;
|
||||
my_free(854, &entry->token);
|
||||
|
|
|
|||
15
src/paste.c
15
src/paste.c
|
|
@ -226,9 +226,6 @@ void merge_inst(int k,FILE *fd)
|
|||
my_free(871, &prop_ptr);
|
||||
lastinst++;
|
||||
set_modify(1);
|
||||
prepared_hash_instances=0;
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -246,7 +243,7 @@ void match_merged_inst(int old)
|
|||
symbol = match_symbol(inst_ptr[i].name);
|
||||
if(symbol == -1)
|
||||
{
|
||||
dbg(1, "merge_inst(): missing symbol, skipping...\n");
|
||||
dbg(1, "match_merged_inst(): missing symbol, skipping...\n");
|
||||
my_free(872, &inst_ptr[i].prop_ptr); /* 06052001 remove properties */
|
||||
my_free(873, &inst_ptr[i].name); /* 06052001 remove symname */
|
||||
my_free(874, &inst_ptr[i].instname);
|
||||
|
|
@ -299,6 +296,7 @@ void merge_file(int selection_load, const char ext[])
|
|||
char *aux_ptr=NULL;
|
||||
int got_mouse;
|
||||
|
||||
|
||||
if(selection_load==0)
|
||||
{
|
||||
if(!strcmp(ext,"")) { /* 20071215 */
|
||||
|
|
@ -320,8 +318,11 @@ void merge_file(int selection_load, const char ext[])
|
|||
{
|
||||
my_snprintf(name, S(name), "%s/.clipboard.sch", user_conf_dir);
|
||||
}
|
||||
if( (fd=fopen(name,"r"))!= NULL)
|
||||
{
|
||||
if( (fd=fopen(name,"r"))!= NULL) {
|
||||
prepared_hilight_structs=0;
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hash_instances=0;
|
||||
prepared_hash_wires=0;
|
||||
got_mouse = 0;
|
||||
push_undo(); /* 20150327 */
|
||||
unselect_all();
|
||||
|
|
@ -400,5 +401,7 @@ void merge_file(int selection_load, const char ext[])
|
|||
mousex_snap = mx_double_save;
|
||||
mousey_snap = my_double_save;
|
||||
move_objects(RUBBER,0,0,0);
|
||||
} else {
|
||||
dbg(0, "merge_file(): can not open %s\n", name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
20
src/save.c
20
src/save.c
|
|
@ -982,7 +982,7 @@ void load_schematic(int load_symbols, const char *filename, int reset_undo) /* 2
|
|||
printf("xschem load %s\n", escape_chars(n, name, PATH_MAX));
|
||||
fflush(stdout);
|
||||
}
|
||||
if( (fd=fopen(name,"r"))== NULL) {
|
||||
if( (fd=fopen(name,fopen_read_mode))== NULL) {
|
||||
fprintf(errfp, "load_schematic(): unable to open file: %s, filename=%s\n",
|
||||
name, filename ? filename : "<NULL>");
|
||||
my_snprintf(msg, S(msg), "alert_ {Unable to open file: %s}", filename ? filename: "(null)");
|
||||
|
|
@ -1203,7 +1203,6 @@ void pop_undo(int redo)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
read_xschem_file(fd);
|
||||
|
||||
#if HAS_POPEN==1
|
||||
|
|
@ -1222,6 +1221,7 @@ void pop_undo(int redo)
|
|||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
update_conn_cues(0, 0);
|
||||
|
||||
dbg(2, "pop_undo(): returning\n");
|
||||
if(event_reporting) {
|
||||
if(redo) printf("xschem redo\n");
|
||||
|
|
@ -1270,7 +1270,7 @@ void get_sym_type(const char *symname, char **type, struct int_hashentry **pinta
|
|||
/* ... if not found open file and look for 'type' into the global attributes. */
|
||||
|
||||
if(embed_fd) fd = embed_fd;
|
||||
else fd=fopen(name,"r");
|
||||
else fd=fopen(name,fopen_read_mode);
|
||||
|
||||
if(fd==NULL) {
|
||||
dbg(1, "get_sym_type(): Symbol not found: %s\n",name);
|
||||
|
|
@ -1549,11 +1549,11 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
my_strncpy(sympath, abs_sym_path(name, ""), S(sympath));
|
||||
}
|
||||
if(!embed_fd) {
|
||||
if((lcc[level].fd=fopen(sympath,"r"))==NULL)
|
||||
if((lcc[level].fd=fopen(sympath,fopen_read_mode))==NULL)
|
||||
{
|
||||
if(recursion_counter == 1) dbg(0, "l_s_d(): Symbol not found: %s\n",sympath);
|
||||
my_snprintf(sympath, S(sympath), "%s/%s.sym", tclgetvar("XSCHEM_SHAREDIR"), "systemlib/missing");
|
||||
if((lcc[level].fd=fopen(sympath, "r"))==NULL)
|
||||
if((lcc[level].fd=fopen(sympath, fopen_read_mode))==NULL)
|
||||
{
|
||||
fprintf(errfp, "l_s_d(): systemlib/missing.sym missing, I give up\n");
|
||||
tcleval( "exit");
|
||||
|
|
@ -1880,7 +1880,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
|
||||
{
|
||||
char c;
|
||||
filepos = ftell(lcc[level].fd); /* store file pointer position to inspect next line */
|
||||
filepos = xftell(lcc[level].fd); /* store file pointer position to inspect next line */
|
||||
fd_tmp = NULL;
|
||||
read_line(lcc[level].fd, 1);
|
||||
fscanf(lcc[level].fd, "%*1[\n]");
|
||||
|
|
@ -1893,7 +1893,7 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
* opening/closing the symbol file and getting the 'type' attribute from global symbol attributes
|
||||
* if fd_tmp set read symbol from embedded tags '[...]' */
|
||||
get_sym_type(symname, &symtype, NULL, fd_tmp);
|
||||
fseek(lcc[level].fd, filepos, SEEK_SET); /* rewind file pointer */
|
||||
xfseek(lcc[level].fd, filepos, SEEK_SET); /* rewind file pointer */
|
||||
}
|
||||
|
||||
dbg(1, "l_s_d(): level=%d, symname=%s symtype=%s\n", level, symname, symtype);
|
||||
|
|
@ -1925,17 +1925,17 @@ int load_sym_def(const char *name, FILE *embed_fd)
|
|||
use_lcc_pins(level, symtype, &sympath);
|
||||
|
||||
/* find out if symbol is in an external file or embedded, set fd_tmp accordingly */
|
||||
if ((fd_tmp = fopen(sympath, "r")) == NULL) {
|
||||
if ((fd_tmp = fopen(sympath, fopen_read_mode)) == NULL) {
|
||||
char c;
|
||||
fprintf(errfp, "l_s_d(): unable to open file to read schematic: %s\n", sympath);
|
||||
filepos = ftell(lcc[level].fd); /* store file pointer position to inspect next char */
|
||||
filepos = xftell(lcc[level].fd); /* store file pointer position to inspect next char */
|
||||
read_line(lcc[level].fd, 1);
|
||||
fscanf(lcc[level].fd, "%*1[\n]");
|
||||
if(fscanf(lcc[level].fd," %c",&c)!=EOF) {
|
||||
if( c == '[') {
|
||||
fd_tmp = lcc[level].fd;
|
||||
} else {
|
||||
fseek(lcc[level].fd, filepos, SEEK_SET); /* rewind file pointer */
|
||||
xfseek(lcc[level].fd, filepos, SEEK_SET); /* rewind file pointer */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -840,6 +840,10 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
else prop = NULL;
|
||||
push_undo();
|
||||
storeobject(pos, x1,y1,x2,y2,WIRE,0,0,prop);
|
||||
prepared_hilight_structs=0;
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hash_wires=0;
|
||||
|
||||
save = draw_window; draw_window = 1;
|
||||
drawline(WIRELAYER,NOW, x1,y1,x2,y2, 0);
|
||||
draw_window = save;
|
||||
|
|
|
|||
265
src/select.c
265
src/select.c
|
|
@ -206,135 +206,162 @@ static void del_rect_line_arc_poly(void)
|
|||
|
||||
void delete(void)
|
||||
{
|
||||
int i,j;
|
||||
#ifdef HAS_CAIRO
|
||||
int customfont;
|
||||
#endif
|
||||
int i, j, n;
|
||||
#ifdef HAS_CAIRO
|
||||
int customfont;
|
||||
#endif
|
||||
|
||||
dbg(3, "delete(): start\n");
|
||||
j = 0;
|
||||
bbox(BEGIN, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
rebuild_selected_array();
|
||||
if(lastselected) push_undo(); /* 20150327 */
|
||||
for(i=0;i<lasttext;i++)
|
||||
{
|
||||
if(textelement[i].sel == SELECTED)
|
||||
{
|
||||
rot = textelement[i].rot;
|
||||
flip = textelement[i].flip;
|
||||
#ifdef HAS_CAIRO
|
||||
customfont = set_text_custom_font(&textelement[i]);
|
||||
#endif
|
||||
text_bbox(textelement[i].txt_ptr, textelement[i].xscale,
|
||||
textelement[i].yscale, rot, flip, textelement[i].hcenter, textelement[i].vcenter,
|
||||
textelement[i].x0, textelement[i].y0,
|
||||
&xx1,&yy1, &xx2,&yy2);
|
||||
#ifdef HAS_CAIRO
|
||||
if(customfont) cairo_restore(ctx);
|
||||
#endif
|
||||
bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
my_free(935, &textelement[i].prop_ptr);
|
||||
my_free(936, &textelement[i].font);
|
||||
my_free(937, &textelement[i].txt_ptr);
|
||||
set_modify(1);
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
if(j)
|
||||
{
|
||||
dbg(1, "select(); deleting string %d\n",i-j);
|
||||
textelement[i-j] = textelement[i];
|
||||
dbg(1, "select(); new string %d = %s\n",i-j,textelement[i-j].txt_ptr);
|
||||
}
|
||||
}
|
||||
lasttext -= j;
|
||||
j = 0;
|
||||
dbg(3, "delete(): start\n");
|
||||
j = 0;
|
||||
bbox(BEGIN, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
rebuild_selected_array();
|
||||
if(lastselected) push_undo(); /* 20150327 */
|
||||
|
||||
prepared_hash_instances=0;
|
||||
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
|
||||
/* first calculate bbox, because symbol_bbox() needs translate (@#0:net_name) which needs prepare_netlist_structs
|
||||
* which needs a consistent inst_ptr[] data structure */
|
||||
for(i=0;i<lastinst;i++)
|
||||
{
|
||||
if(inst_ptr[i].sel == SELECTED)
|
||||
{
|
||||
symbol_bbox(i, &inst_ptr[i].x1, &inst_ptr[i].y1, &inst_ptr[i].x2, &inst_ptr[i].y2); /*20171201 */
|
||||
bbox(ADD, inst_ptr[i].x1, inst_ptr[i].y1, inst_ptr[i].x2, inst_ptr[i].y2);
|
||||
}
|
||||
}
|
||||
for(i=0;i<lastinst;i++)
|
||||
{
|
||||
if(inst_ptr[i].sel == SELECTED)
|
||||
{
|
||||
set_modify(1);
|
||||
if(inst_ptr[i].prop_ptr != NULL)
|
||||
{
|
||||
my_free(938, &inst_ptr[i].prop_ptr);
|
||||
/* first calculate bbox, because symbol_bbox() needs translate (@#0:net_name) which needs prepare_netlist_structs
|
||||
* which needs a consistent inst_ptr[] data structure */
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
if(show_pin_net_names) {
|
||||
prepare_netlist_structs(0);
|
||||
}
|
||||
for(i = 0; i < lastselected; i++) {
|
||||
n = selectedgroup[i].n;
|
||||
if(selectedgroup[i].type == ELEMENT) {
|
||||
int p;
|
||||
symbol_bbox(n, &inst_ptr[n].x1, &inst_ptr[n].y1, &inst_ptr[n].x2, &inst_ptr[n].y2 ); /* 20171201 */
|
||||
bbox(ADD, inst_ptr[n].x1, inst_ptr[n].y1, inst_ptr[n].x2, inst_ptr[n].y2 );
|
||||
if(show_pin_net_names) for(p = 0; p < (inst_ptr[n].ptr + instdef)->rects[PINLAYER]; p++) {
|
||||
if( inst_ptr[n].node && inst_ptr[n].node[p]) {
|
||||
find_inst_to_be_redrawn(inst_ptr[n].node[p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(show_pin_net_names && selectedgroup[i].type == WIRE && wire[n].node) {
|
||||
find_inst_to_be_redrawn(wire[n].node);
|
||||
}
|
||||
}
|
||||
delete_inst_node(i);
|
||||
my_free(939, &inst_ptr[i].name);
|
||||
my_free(940, &inst_ptr[i].instname); /* 20150409 */
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
if(j)
|
||||
{
|
||||
inst_ptr[i-j] = inst_ptr[i];
|
||||
}
|
||||
}
|
||||
lastinst-=j;
|
||||
|
||||
|
||||
|
||||
|
||||
for(i=0;i<lastinst;i++)
|
||||
{
|
||||
if(inst_ptr[i].sel == SELECTED)
|
||||
{
|
||||
symbol_bbox(i, &inst_ptr[i].x1, &inst_ptr[i].y1, &inst_ptr[i].x2, &inst_ptr[i].y2); /*20171201 */
|
||||
bbox(ADD, inst_ptr[i].x1, inst_ptr[i].y1, inst_ptr[i].x2, inst_ptr[i].y2);
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0;i<lasttext;i++)
|
||||
{
|
||||
if(textelement[i].sel == SELECTED)
|
||||
{
|
||||
rot = textelement[i].rot;
|
||||
flip = textelement[i].flip;
|
||||
#ifdef HAS_CAIRO
|
||||
customfont = set_text_custom_font(&textelement[i]);
|
||||
#endif
|
||||
text_bbox(textelement[i].txt_ptr, textelement[i].xscale,
|
||||
textelement[i].yscale, rot, flip, textelement[i].hcenter, textelement[i].vcenter,
|
||||
textelement[i].x0, textelement[i].y0,
|
||||
&xx1,&yy1, &xx2,&yy2);
|
||||
#ifdef HAS_CAIRO
|
||||
if(customfont) cairo_restore(ctx);
|
||||
#endif
|
||||
bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
my_free(935, &textelement[i].prop_ptr);
|
||||
my_free(936, &textelement[i].font);
|
||||
my_free(937, &textelement[i].txt_ptr);
|
||||
set_modify(1);
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
if(j)
|
||||
{
|
||||
dbg(1, "select(); deleting string %d\n",i-j);
|
||||
textelement[i-j] = textelement[i];
|
||||
dbg(1, "select(); new string %d = %s\n",i-j,textelement[i-j].txt_ptr);
|
||||
}
|
||||
}
|
||||
lasttext -= j;
|
||||
j = 0;
|
||||
|
||||
for(i=0;i<lastinst;i++)
|
||||
{
|
||||
if(inst_ptr[i].sel == SELECTED)
|
||||
{
|
||||
set_modify(1);
|
||||
if(inst_ptr[i].prop_ptr != NULL)
|
||||
{
|
||||
my_free(938, &inst_ptr[i].prop_ptr);
|
||||
}
|
||||
delete_inst_node(i);
|
||||
my_free(939, &inst_ptr[i].name);
|
||||
my_free(940, &inst_ptr[i].instname); /* 20150409 */
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
if(j)
|
||||
{
|
||||
inst_ptr[i-j] = inst_ptr[i];
|
||||
}
|
||||
}
|
||||
lastinst-=j;
|
||||
|
||||
if(j) {
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
}
|
||||
j = 0;
|
||||
for(i=0;i<lastwire;i++)
|
||||
{
|
||||
if(wire[i].sel == SELECTED)
|
||||
{
|
||||
j++;
|
||||
if(wire[i].bus){ /* 20171201 */
|
||||
int ov, y1, y2;
|
||||
ov = bus_width> cadhalfdotsize ? bus_width : CADHALFDOTSIZE;
|
||||
if(wire[i].y1 < wire[i].y2) { y1 = wire[i].y1-ov; y2 = wire[i].y2+ov; }
|
||||
else { y1 = wire[i].y1+ov; y2 = wire[i].y2-ov; }
|
||||
bbox(ADD, wire[i].x1-ov, y1 , wire[i].x2+ov , y2 );
|
||||
} else {
|
||||
int ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(wire[i].y1 < wire[i].y2) { y1 = wire[i].y1-ov; y2 = wire[i].y2+ov; }
|
||||
else { y1 = wire[i].y1+ov; y2 = wire[i].y2-ov; }
|
||||
bbox(ADD, wire[i].x1-ov, y1 , wire[i].x2+ov , y2 );
|
||||
if(wire[i].sel == SELECTED) {
|
||||
j++;
|
||||
if(wire[i].bus){ /* 20171201 */
|
||||
int ov, y1, y2;
|
||||
ov = bus_width> cadhalfdotsize ? bus_width : CADHALFDOTSIZE;
|
||||
if(wire[i].y1 < wire[i].y2) { y1 = wire[i].y1-ov; y2 = wire[i].y2+ov; }
|
||||
else { y1 = wire[i].y1+ov; y2 = wire[i].y2-ov; }
|
||||
bbox(ADD, wire[i].x1-ov, y1 , wire[i].x2+ov , y2 );
|
||||
} else {
|
||||
int ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(wire[i].y1 < wire[i].y2) { y1 = wire[i].y1-ov; y2 = wire[i].y2+ov; }
|
||||
else { y1 = wire[i].y1+ov; y2 = wire[i].y2-ov; }
|
||||
bbox(ADD, wire[i].x1-ov, y1 , wire[i].x2+ov , y2 );
|
||||
}
|
||||
|
||||
my_free(941, &wire[i].prop_ptr);
|
||||
my_free(942, &wire[i].node);
|
||||
|
||||
set_modify(1);
|
||||
prepared_hash_wires=0;
|
||||
continue;
|
||||
}
|
||||
if(j) {
|
||||
wire[i-j] = wire[i];
|
||||
}
|
||||
my_free(941, &wire[i].prop_ptr);
|
||||
my_free(942, &wire[i].node);
|
||||
|
||||
set_modify(1);
|
||||
prepared_hash_wires=0;
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
|
||||
continue;
|
||||
}
|
||||
if(j)
|
||||
{
|
||||
wire[i-j] = wire[i];
|
||||
}
|
||||
}
|
||||
lastwire -= j;
|
||||
if(j) {
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
}
|
||||
|
||||
del_rect_line_arc_poly();
|
||||
update_conn_cues(0, 0);
|
||||
lastselected = 0;
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
draw();
|
||||
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
ui_state &= ~SELECTION;
|
||||
if(event_reporting) {
|
||||
printf("xschem delete\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
del_rect_line_arc_poly();
|
||||
update_conn_cues(0, 0);
|
||||
lastselected = 0;
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
draw();
|
||||
bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
ui_state &= ~SELECTION;
|
||||
if(event_reporting) {
|
||||
printf("xschem delete\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -452,12 +479,6 @@ void bbox(int what,double x1,double y1, double x2, double y2)
|
|||
cairo_clip(save_ctx);
|
||||
#endif
|
||||
break;
|
||||
/*
|
||||
case DRAW:
|
||||
XCopyArea(display, save_pixmap, window, gctiled, xrect[0].x, xrect[0].y,
|
||||
xrect[0].width, xrect[0].height, xrect[0].x, xrect[0].y);
|
||||
*/
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -330,9 +330,6 @@ void storeobject(int pos, double x1,double y1,double x2,double y2,
|
|||
wire[n].sel=sel;
|
||||
lastwire++;
|
||||
set_modify(1);
|
||||
prepared_hash_wires=0;
|
||||
prepared_netlist_structs=0;
|
||||
prepared_hilight_structs=0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2625,7 +2625,7 @@ const char *translate(int inst, char* s)
|
|||
if( show_pin_net_names && (!strcmp(get_tok_value(inst_ptr[inst].prop_ptr, "net_name", 0), "true") ||
|
||||
!strcmp(get_tok_value( (inst_ptr[inst].ptr + instdef)->prop_ptr, "net_name", 0), "true")) ) {
|
||||
prepare_netlist_structs(0);
|
||||
my_strdup2(1175, &pinnumber, inst_ptr[inst].node && inst_ptr[inst].node[n] ? inst_ptr[inst].node[n] : "<UNCONN>");
|
||||
my_strdup2(1175, &pinnumber, inst_ptr[inst].node && inst_ptr[inst].node[n] ? inst_ptr[inst].node[n] : "?");
|
||||
}
|
||||
} else {
|
||||
if(!pinnumber[0]) my_strdup(379, &pinnumber, "--UNDEF--");
|
||||
|
|
|
|||
11
src/xschem.h
11
src/xschem.h
|
|
@ -87,7 +87,8 @@
|
|||
#include <X11/Xatom.h>
|
||||
#include <X11/xpm.h>
|
||||
#define xunlink unlink
|
||||
|
||||
#define xfseek fseek
|
||||
#define xftell ftell
|
||||
#else
|
||||
#include <tkWinInt.h>
|
||||
#define xunlink _unlink
|
||||
|
|
@ -96,6 +97,8 @@ extern int XSetClipRectangles(register Display* dpy, GC gc, int clip_x_origin, i
|
|||
extern int XSetTile(Display* display, GC gctiled, Pixmap save_pixmap);
|
||||
extern void change_to_unix_fn(char* fn);
|
||||
extern char win_temp_dir[PATH_MAX];
|
||||
#define xfseek _fseeki64
|
||||
#define xftell _ftelli64
|
||||
#endif
|
||||
|
||||
#include <tcl.h>
|
||||
|
|
@ -869,6 +872,7 @@ extern void arc_3_points(double x1, double y1, double x2, double y2, double x3,
|
|||
double *x, double *y, double *r, double *a, double *b);
|
||||
extern void move_objects(int what,int merge, double dx, double dy);
|
||||
extern void copy_objects(int what);
|
||||
extern void find_inst_to_be_redrawn(const char *node);
|
||||
extern void pan(int what);
|
||||
extern void pan2(int what, int mx, int my);
|
||||
extern void zoom_box(int what);
|
||||
|
|
@ -962,11 +966,11 @@ extern int count_labels(char *s);
|
|||
extern int get_unnamed_node(int what, int mult, int node);
|
||||
extern void free_node_hash(void);
|
||||
extern struct node_hashentry
|
||||
*node_hash_lookup(const char *token, const char *dir,int remove, int port, char *sig_type,
|
||||
*node_hash_lookup(const char *token, const char *dir,int what, int port, char *sig_type,
|
||||
char *verilog_type, char *value, char *class, const char *orig_tok);
|
||||
extern void traverse_node_hash();
|
||||
extern struct node_hashentry
|
||||
*bus_hash_lookup(const char *token, const char *dir,int remove, int port, char *sig_type,
|
||||
*bus_hash_lookup(const char *token, const char *dir,int what, int port, char *sig_type,
|
||||
char *verilog_type, char *value, char *class);
|
||||
/* extern void insert_missing_pin(); */
|
||||
extern void round_schematic_to_grid(double cadsnap);
|
||||
|
|
@ -1019,6 +1023,7 @@ extern double nocairo_font_yscale;
|
|||
extern double cairo_font_line_spacing; /* allows to change line spacing: default: 1.0 */
|
||||
extern double cairo_vert_correct;
|
||||
extern double nocairo_vert_correct;
|
||||
extern const char fopen_read_mode[];
|
||||
#ifdef HAS_CAIRO /* 20171105 */
|
||||
#include <cairo.h>
|
||||
#include <cairo-xlib.h>
|
||||
|
|
|
|||
|
|
@ -1801,7 +1801,14 @@ proc property_search {} {
|
|||
destroy .dialog
|
||||
}
|
||||
button .dialog.but.cancel -text Cancel -command { destroy .dialog }
|
||||
checkbutton .dialog.but.sub -text Exact_search -variable search_exact
|
||||
|
||||
# Window doesn't support regular expression, has to be exact match for now
|
||||
if {$::OS == "Windows"} {
|
||||
set search_exact 1
|
||||
checkbutton .dialog.but.sub -text Exact_search -variable search_exact -state disable
|
||||
} else {
|
||||
checkbutton .dialog.but.sub -text Exact_search -variable search_exact
|
||||
}
|
||||
radiobutton .dialog.but.nosel -text {Highlight} -variable search_select -value 0
|
||||
radiobutton .dialog.but.sel -text {Select} -variable search_select -value 1
|
||||
# 20171211 added unselect
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ function replace_pattern(old, new)
|
|||
replace_pattern("global_vhdl_netlist[:(:][:):]: opening.*$", "global_vhdl_netlist(): opening ***Removed***")
|
||||
replace_pattern("global_tedax_netlist[:(:][:):]: opening.*$", "global_tedax_netlist(): opening***Removed***")
|
||||
replace_pattern("global_spice_netlist[:(:][:):]: opening.*$", "global_spice_netlist(): opening ***Removed***")
|
||||
replace_pattern("load_sym_def[:(:][:):]: fopen.*$", "load_sym_def(): fopen ***Removed***")
|
||||
replace_pattern("load_sym_def[:(:][:):]: fclose.*$", "load_sym_def(): fclose ***Removed***")
|
||||
replace_pattern("l_s_d[:(:][:):]: fopen.*$", "load_sym_def(): fopen ***Removed***")
|
||||
replace_pattern("l_s_d[:(:][:):]: fclose.*$", "load_sym_def(): fclose ***Removed***")
|
||||
__a[__lines++] = $0
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ xschem instance ../../../xschem_library/devices/title.sym 160 -30 0 0 {name=l1 a
|
|||
xschem instance ../../../xschem_library/examples/cmos_example.sym 160 -350 0 0 {name=x6}
|
||||
xschem instance ../../../xschem_library/examples/greycnt.sym 160 -390 0 0 {name=x8}
|
||||
xschem instance ../../../xschem_library/examples/loading.sym 160 -430 0 0 {name=x9}
|
||||
xschem instance ../../../xschem_library/examples/inv.sym 930 -200 0 0 {name=E1 TABLE="1.4 3.0 1.6 0.0"}
|
||||
xschem instance ../../../xschem_library/examples/and.sym 930 -200 0 0 {name=E1 TABLE="1.4 3.0 1.6 0.0"}
|
||||
xschem instance ../../../xschem_library/devices/launcher.sym 460 -210 0 0 {name=h1 descr="XSCHEM ON REPO.HU" url="http://repo.hu/projects/xschem"program=x-www-browser}
|
||||
xschem instance ../../../xschem_library/devices/launcher.sym 460 -160 0 0 {name=h3 descr="Toggle light/dark colorscheme" tclcommand="xschem toggle_colorscheme"}
|
||||
xschem instance ../../../xschem_library/devices/launcher.sym 460 -260 0 0 {name=h2 descr="LOCAL DOCUMENTATION" url="$\{XSCHEM_SHAREDIR\}/../doc/xschem/index.html"program=x-www-browser}
|
||||
|
|
|
|||
Loading…
Reference in New Issue