1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-18 01:25:21 +02:00

eeshow/lib-parse.c (parse_def): suppress pin name and number if power symbol

This commit is contained in:
Werner Almesberger 2016-08-16 02:14:45 -03:00
parent a03f41a845
commit 7603e917c3

View File

@ -62,15 +62,19 @@ static bool parse_poly(struct lib_poly *poly, const char *line, int points)
static bool parse_def(struct lib *lib, const char *line) static bool parse_def(struct lib *lib, const char *line)
{ {
char *s; char *s, *ref;
char draw_num, draw_name; char draw_num, draw_name;
unsigned name_offset; unsigned name_offset;
unsigned units; unsigned units;
bool power;
if (sscanf(line, "DEF %ms %*s %*d %u %c %c %u", if (sscanf(line, "DEF %ms %ms %*d %u %c %c %u",
&s, &name_offset, &draw_num, &draw_name, &units) != 5) &s, &ref, &name_offset, &draw_num, &draw_name, &units) != 6)
return 0; return 0;
power = *ref == '#';
free(ref);
lib->curr_comp = alloc_type(struct comp); lib->curr_comp = alloc_type(struct comp);
if (*s == '~') { if (*s == '~') {
char *tmp = alloc_size(strlen(s) + 1); char *tmp = alloc_size(strlen(s) + 1);
@ -85,8 +89,8 @@ static bool parse_def(struct lib *lib, const char *line)
lib->curr_comp->units = units; lib->curr_comp->units = units;
lib->curr_comp->visible = 0; lib->curr_comp->visible = 0;
lib->curr_comp->show_pin_name = draw_name == 'Y'; lib->curr_comp->show_pin_name = draw_name == 'Y' && !power;
lib->curr_comp->show_pin_num = draw_num == 'Y'; lib->curr_comp->show_pin_num = draw_num == 'Y' && !power;
lib->curr_comp->name_offset = name_offset; lib->curr_comp->name_offset = name_offset;
lib->curr_comp->objs = NULL; lib->curr_comp->objs = NULL;