folded long lines

This commit is contained in:
Stefan Schippers 2020-11-16 12:33:06 +01:00
parent 90f6d7ee90
commit fac9cfe26b
6 changed files with 56 additions and 30 deletions

View File

@ -1619,7 +1619,7 @@ void draw(void)
ptr = xctx->inst[i].ptr;
if( ptr !=-1) {
symptr = ptr+xctx->sym;
if( c==0 || /*20150408 draw_symbol call is needed on layer 0 to avoid redundant work (outside check) */
if( c==0 || /*draw_symbol call is needed on layer 0 to avoid redundant work (outside check) */
symptr->lines[c] ||
symptr->arcs[c] ||
symptr->rects[c] ||
@ -1695,19 +1695,23 @@ void draw(void)
for(init_wire_iterator(x1, y1, x2, y2); ( wireptr = wire_iterator_next() ) ;) {
ii=wireptr->n;
if(xctx->wire[ii].bus) {
drawline(WIRELAYER, THICK, xctx->wire[ii].x1,xctx->wire[ii].y1,xctx->wire[ii].x2,xctx->wire[ii].y2, 0);
drawline(WIRELAYER, THICK, xctx->wire[ii].x1,xctx->wire[ii].y1,
xctx->wire[ii].x2,xctx->wire[ii].y2, 0);
}
else
drawline(WIRELAYER, ADD, xctx->wire[ii].x1,xctx->wire[ii].y1,xctx->wire[ii].x2,xctx->wire[ii].y2, 0);
drawline(WIRELAYER, ADD, xctx->wire[ii].x1,xctx->wire[ii].y1,
xctx->wire[ii].x2,xctx->wire[ii].y2, 0);
}
} else {
for(i=0;i<xctx->wires;i++)
{
if(xctx->wire[i].bus) {
drawline(WIRELAYER, THICK, xctx->wire[i].x1,xctx->wire[i].y1,xctx->wire[i].x2,xctx->wire[i].y2, 0);
drawline(WIRELAYER, THICK, xctx->wire[i].x1,xctx->wire[i].y1,
xctx->wire[i].x2,xctx->wire[i].y2, 0);
}
else
drawline(WIRELAYER, ADD, xctx->wire[i].x1,xctx->wire[i].y1,xctx->wire[i].x2,xctx->wire[i].y2, 0);
drawline(WIRELAYER, ADD, xctx->wire[i].x1,xctx->wire[i].y1,
xctx->wire[i].x2,xctx->wire[i].y2, 0);
}
}
update_conn_cues(1, draw_window);

View File

@ -125,7 +125,8 @@ void create_plot_cmd(int viewer)
if(node_entry && !strcmp(xctx->sch_path[xctx->currsch], entry->path) &&
(node_entry->d.port == 0 || !strcmp(entry->path, ".") )) {
c = get_color(entry->value);
sprintf(color_str, "%02x/%02x/%02x", xcolor_array[c].red>>8, xcolor_array[c].green>>8, xcolor_array[c].blue>>8);
sprintf(color_str, "%02x/%02x/%02x",
xcolor_array[c].red>>8, xcolor_array[c].green>>8, xcolor_array[c].blue>>8);
idx++;
if(viewer == NGSPICE) {
if(idx > 9) {
@ -423,7 +424,8 @@ void hilight_child_pins(void)
dbg(1, "hilight_child_pins(): looking net:%s\n", find_nth(net_node, ',',
((inst_number - 1) * mult + k - 1) % net_mult + 1));
xctx->currsch--;
entry = bus_hilight_lookup(find_nth(net_node, ',', ((inst_number - 1) * mult + k - 1) % net_mult + 1), 0, XLOOKUP);
entry = bus_hilight_lookup(find_nth(net_node, ',',
((inst_number - 1) * mult + k - 1) % net_mult + 1), 0, XLOOKUP);
xctx->currsch++;
if(entry) {
bus_hilight_lookup(find_nth(pin_node, ',', k), entry->value, XINSERT);

View File

@ -223,8 +223,10 @@ void draw_selection(GC g, int interruptable)
break;
case xRECT:
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1,
xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1,
xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, x1, y_1, xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
@ -348,8 +350,10 @@ void draw_selection(GC g, int interruptable)
break;
case LINE:
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1, xctx->line[c][n].x1, xctx->line[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1, xctx->line[c][n].x2, xctx->line[c][n].y2, rx2,ry2);
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1,
xctx->line[c][n].x1, xctx->line[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1,
xctx->line[c][n].x2, xctx->line[c][n].y2, rx2,ry2);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->line[c][n].x1, xctx->line[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, x1, y_1, xctx->line[c][n].x2, xctx->line[c][n].y2, rx2,ry2);
@ -591,8 +595,10 @@ void copy_objects(int what)
}
*/
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->wire[n].x1, xctx->wire[n].y1, xctx->wire[n].x1, xctx->wire[n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->wire[n].x1, xctx->wire[n].y1, xctx->wire[n].x2, xctx->wire[n].y2, rx2,ry2);
ROTATION(move_rot, move_flip, xctx->wire[n].x1, xctx->wire[n].y1,
xctx->wire[n].x1, xctx->wire[n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->wire[n].x1, xctx->wire[n].y1,
xctx->wire[n].x2, xctx->wire[n].y2, rx2,ry2);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->wire[n].x1, xctx->wire[n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, x1, y_1, xctx->wire[n].x2, xctx->wire[n].y2, rx2,ry2);
@ -638,8 +644,10 @@ void copy_objects(int what)
if(c!=k) break;
/* bbox(ADD, xctx->line[c][n].x1, xctx->line[c][n].y1, xctx->line[c][n].x2, xctx->line[c][n].y2) */
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1, xctx->line[c][n].x1, xctx->line[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1, xctx->line[c][n].x2, xctx->line[c][n].y2, rx2,ry2);
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1,
xctx->line[c][n].x1, xctx->line[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->line[c][n].x1, xctx->line[c][n].y1,
xctx->line[c][n].x2, xctx->line[c][n].y2, rx2,ry2);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->line[c][n].x1, xctx->line[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, x1, y_1, xctx->line[c][n].x2, xctx->line[c][n].y2, rx2,ry2);
@ -745,8 +753,10 @@ void copy_objects(int what)
if(c!=k) break;
/* bbox(ADD, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2); */
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1,
xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1,
xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, x1, y_1, xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
@ -777,7 +787,8 @@ void copy_objects(int what)
bbox(ADD, rx1, ry1, rx2, ry2 );
*/
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->text[n].x0, xctx->text[n].y0, xctx->text[n].x0, xctx->text[n].y0, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->text[n].x0, xctx->text[n].y0,
xctx->text[n].x0, xctx->text[n].y0, rx1,ry1);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->text[n].x0, xctx->text[n].y0, rx1,ry1);
}
@ -864,7 +875,8 @@ void copy_objects(int what)
}
check_inst_storage();
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->inst[n].x0, xctx->inst[n].y0, xctx->inst[n].x0, xctx->inst[n].y0, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->inst[n].x0, xctx->inst[n].y0,
xctx->inst[n].x0, xctx->inst[n].y0, rx1,ry1);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->inst[n].x0, xctx->inst[n].y0, rx1,ry1);
}
@ -1254,8 +1266,10 @@ void move_objects(int what, int merge, double dx, double dy)
if(c!=k) break;
bbox(ADD, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2);
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1,
xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1,
xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->rect[c][n].x1, xctx->rect[c][n].y1, rx1,ry1);
ROTATION(move_rot, move_flip, x1, y_1, xctx->rect[c][n].x2, xctx->rect[c][n].y2, rx2,ry2);
@ -1342,7 +1356,8 @@ void move_objects(int what, int merge, double dx, double dy)
bbox(ADD, rx1, ry1, rx2, ry2 );
if(rotatelocal) {
ROTATION(move_rot, move_flip, xctx->text[n].x0, xctx->text[n].y0, xctx->text[n].x0, xctx->text[n].y0, rx1,ry1);
ROTATION(move_rot, move_flip, xctx->text[n].x0, xctx->text[n].y0,
xctx->text[n].x0, xctx->text[n].y0, rx1,ry1);
} else {
ROTATION(move_rot, move_flip, x1, y_1, xctx->text[n].x0, xctx->text[n].y0, rx1,ry1);
}

View File

@ -1361,7 +1361,8 @@ void align_sch_pins_with_sym(const char *name, int pos)
pinname = get_tok_value(xctx->sym[pos].rect[PINLAYER][i].prop_ptr, "name", 0);
entry = int_hash_lookup(pintable, pinname, 0 , XLOOKUP);
if(!entry) {
dbg(0, " align_sch_pins_with_sym(): warning: pin mismatch between %s and %s : %s\n", name, symname, pinname);
dbg(0, " align_sch_pins_with_sym(): warning: pin mismatch between %s and %s : %s\n",
name, symname, pinname);
fail = 1;
break;
}
@ -1987,7 +1988,8 @@ int load_sym_def(const char *name, FILE *embed_fd)
}
my_strdup(654, &lcc[level].prop_ptr, prop_ptr);
my_strdup(657, &lcc[level].symname, symname);
dbg(1, "level incremented: level=%d, symname=%s, prop_ptr=%s sympath=%s\n", level, symname, prop_ptr, sympath);
dbg(1, "level incremented: level=%d, symname=%s, prop_ptr=%s sympath=%s\n",
level, symname, prop_ptr, sympath);
}
break;
case '[':
@ -2382,14 +2384,15 @@ void save_selection(int what)
break;
case WIRE:
fprintf(fd, "N %.16g %.16g %.16g %.16g ",xctx->wire[n].x1, xctx->wire[n].y1, xctx->wire[n].x2, xctx->wire[n].y2);
fprintf(fd, "N %.16g %.16g %.16g %.16g ",xctx->wire[n].x1, xctx->wire[n].y1,
xctx->wire[n].x2, xctx->wire[n].y2);
save_ascii_string(xctx->wire[n].prop_ptr,fd);
fputc('\n' ,fd);
break;
case LINE:
fprintf(fd, "L %d %.16g %.16g %.16g %.16g ", c,xctx->line[c][n].x1, xctx->line[c][n].y1,xctx->line[c][n].x2,
xctx->line[c][n].y2 );
fprintf(fd, "L %d %.16g %.16g %.16g %.16g ", c,xctx->line[c][n].x1, xctx->line[c][n].y1,
xctx->line[c][n].x2, xctx->line[c][n].y2 );
save_ascii_string(xctx->line[c][n].prop_ptr,fd);
fputc('\n' ,fd);
break;
@ -2397,7 +2400,8 @@ void save_selection(int what)
case ELEMENT:
fprintf(fd, "C ");
save_ascii_string(xctx->inst[n].name,fd);
fprintf(fd, " %.16g %.16g %d %d ",xctx->inst[n].x0, xctx->inst[n].y0, xctx->inst[n].rot, xctx->inst[n].flip );
fprintf(fd, " %.16g %.16g %d %d ",xctx->inst[n].x0, xctx->inst[n].y0,
xctx->inst[n].rot, xctx->inst[n].flip );
save_ascii_string(xctx->inst[n].prop_ptr,fd);
fputc('\n' ,fd);
break;

View File

@ -679,7 +679,8 @@ void select_element(int i,unsigned short select_mode, int fast, int override_loc
}
}
}
my_snprintf(str, S(str), "n=%4d x = %.16g y = %.16g w = %.16g h = %.16g",i, xctx->inst[i].xx1, xctx->inst[i].yy1,
my_snprintf(str, S(str), "n=%4d x = %.16g y = %.16g w = %.16g h = %.16g",i,
xctx->inst[i].xx1, xctx->inst[i].yy1,
xctx->inst[i].xx2-xctx->inst[i].xx1, xctx->inst[i].yy2-xctx->inst[i].yy1
);
statusmsg(str,1);

View File

@ -1182,7 +1182,7 @@ void print_generic(FILE *fd, char *ent_or_comp, int symbol)
{
if(!tmp) {fprintf(fd, "generic (\n");}
if(tmp) fprintf(fd, " ;\n");
if(!type || strcmp(type,"string") ) { /* 20080213 print "" around string values 20080418 check for type==NULL */
if(!type || strcmp(type,"string") ) { /* print "" around string values 20080418 check for type==NULL */
fprintf(fd, " %s : %s := %s", token, type? type:"integer", value);
} else {
fprintf(fd, " %s : %s := \"%s\"", token, type? type:"integer", value);