1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-09-30 00:35:05 +03:00

eeshow/: support selection of "De Morgan" style

This commit is contained in:
Werner Almesberger 2016-08-16 01:47:07 -03:00
parent 7d72a28c31
commit 6fe19f52e9
6 changed files with 13 additions and 4 deletions

View File

@ -263,6 +263,8 @@ static bool obj_eq(const struct sch_obj *a, const struct sch_obj *b,
return 0;
if (a->u.comp.unit != b->u.comp.unit)
return 0;
if (a->u.comp.convert != b->u.comp.convert)
return 0;
if (memcmp(a->u.comp.m, b->u.comp.m, sizeof(a->u.comp.m)))
return 0;
return comp_fields_eq(a->u.comp.fields, b->u.comp.fields);

View File

@ -403,7 +403,8 @@ static void missing_component(const int m[4])
}
void lib_render(const struct comp *comp, unsigned unit, const int m[4])
void lib_render(const struct comp *comp, unsigned unit, unsigned convert,
const int m[4])
{
const struct lib_obj *obj;
@ -416,6 +417,8 @@ void lib_render(const struct comp *comp, unsigned unit, const int m[4])
for (obj = comp->objs; obj; obj = obj->next) {
if (obj->unit && obj->unit != unit)
continue;
if (obj->convert && obj->convert != convert)
continue;
draw(comp, obj, m);
}
}

View File

@ -123,7 +123,8 @@ extern struct comp *comps;
const struct comp *lib_find(const struct lib *lib, const char *name);
bool lib_field_visible(const struct comp *comp, int n);
void lib_render(const struct comp *comp, unsigned unit, const int m[6]);
void lib_render(const struct comp *comp, unsigned unit, unsigned convert,
const int m[6]);
bool lib_parse_file(struct lib *lib, struct file *file);
bool lib_parse(struct lib *lib, const char *name, const struct file *related);

View File

@ -491,7 +491,8 @@ static bool parse_line(const struct file *file, void *user, const char *line)
free(s);
return 1;
}
if (sscanf(line, "U %u", &obj->u.comp.unit) == 1)
if (sscanf(line, "U %u %u",
&obj->u.comp.unit, &obj->u.comp.convert) == 2)
return 1;
if (sscanf(line, "P %d %d", &obj->x, &obj->y) == 2)
return 1;

View File

@ -162,7 +162,8 @@ void sch_render(const struct sheet *sheet)
const struct sch_comp *comp = &obj->u.comp;
const struct comp_field *field;
lib_render(comp->comp, comp->unit, comp->m);
lib_render(comp->comp, comp->unit,
comp->convert, comp->m);
for (field = comp->fields; field;
field = field->next)
dump_field(field, comp->m);

View File

@ -65,6 +65,7 @@ struct sch_obj {
struct sch_comp {
const struct comp *comp; /* current component */
unsigned unit; /* unit of current component */
unsigned convert;/* "De Morgan" selection */
struct comp_field {
struct text txt;
struct comp_field *next;