diff --git a/eeshow/delta.c b/eeshow/delta.c index 5325d5a..3ae1087 100644 --- a/eeshow/delta.c +++ b/eeshow/delta.c @@ -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); diff --git a/eeshow/lib-render.c b/eeshow/lib-render.c index 1bfc463..366ee43 100644 --- a/eeshow/lib-render.c +++ b/eeshow/lib-render.c @@ -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); } } diff --git a/eeshow/lib.h b/eeshow/lib.h index e04c05f..adc703e 100644 --- a/eeshow/lib.h +++ b/eeshow/lib.h @@ -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); diff --git a/eeshow/sch-parse.c b/eeshow/sch-parse.c index 12b8e88..1a2832d 100644 --- a/eeshow/sch-parse.c +++ b/eeshow/sch-parse.c @@ -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; diff --git a/eeshow/sch-render.c b/eeshow/sch-render.c index 79d345c..0f3c6eb 100644 --- a/eeshow/sch-render.c +++ b/eeshow/sch-render.c @@ -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); diff --git a/eeshow/sch.h b/eeshow/sch.h index 2c2434f..dfd5917 100644 --- a/eeshow/sch.h +++ b/eeshow/sch.h @@ -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;