mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-29 20:15:54 +02:00
eeshow/: support selection of "De Morgan" style
This commit is contained in:
parent
7d72a28c31
commit
6fe19f52e9
@ -263,6 +263,8 @@ static bool obj_eq(const struct sch_obj *a, const struct sch_obj *b,
|
|||||||
return 0;
|
return 0;
|
||||||
if (a->u.comp.unit != b->u.comp.unit)
|
if (a->u.comp.unit != b->u.comp.unit)
|
||||||
return 0;
|
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)))
|
if (memcmp(a->u.comp.m, b->u.comp.m, sizeof(a->u.comp.m)))
|
||||||
return 0;
|
return 0;
|
||||||
return comp_fields_eq(a->u.comp.fields, b->u.comp.fields);
|
return comp_fields_eq(a->u.comp.fields, b->u.comp.fields);
|
||||||
|
@ -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;
|
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) {
|
for (obj = comp->objs; obj; obj = obj->next) {
|
||||||
if (obj->unit && obj->unit != unit)
|
if (obj->unit && obj->unit != unit)
|
||||||
continue;
|
continue;
|
||||||
|
if (obj->convert && obj->convert != convert)
|
||||||
|
continue;
|
||||||
draw(comp, obj, m);
|
draw(comp, obj, m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,8 @@ extern struct comp *comps;
|
|||||||
|
|
||||||
const struct comp *lib_find(const struct lib *lib, const char *name);
|
const struct comp *lib_find(const struct lib *lib, const char *name);
|
||||||
bool lib_field_visible(const struct comp *comp, int n);
|
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_file(struct lib *lib, struct file *file);
|
||||||
bool lib_parse(struct lib *lib, const char *name, const struct file *related);
|
bool lib_parse(struct lib *lib, const char *name, const struct file *related);
|
||||||
|
@ -491,7 +491,8 @@ static bool parse_line(const struct file *file, void *user, const char *line)
|
|||||||
free(s);
|
free(s);
|
||||||
return 1;
|
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;
|
return 1;
|
||||||
if (sscanf(line, "P %d %d", &obj->x, &obj->y) == 2)
|
if (sscanf(line, "P %d %d", &obj->x, &obj->y) == 2)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -162,7 +162,8 @@ void sch_render(const struct sheet *sheet)
|
|||||||
const struct sch_comp *comp = &obj->u.comp;
|
const struct sch_comp *comp = &obj->u.comp;
|
||||||
const struct comp_field *field;
|
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;
|
for (field = comp->fields; field;
|
||||||
field = field->next)
|
field = field->next)
|
||||||
dump_field(field, comp->m);
|
dump_field(field, comp->m);
|
||||||
|
@ -65,6 +65,7 @@ struct sch_obj {
|
|||||||
struct sch_comp {
|
struct sch_comp {
|
||||||
const struct comp *comp; /* current component */
|
const struct comp *comp; /* current component */
|
||||||
unsigned unit; /* unit of current component */
|
unsigned unit; /* unit of current component */
|
||||||
|
unsigned convert;/* "De Morgan" selection */
|
||||||
struct comp_field {
|
struct comp_field {
|
||||||
struct text txt;
|
struct text txt;
|
||||||
struct comp_field *next;
|
struct comp_field *next;
|
||||||
|
Loading…
Reference in New Issue
Block a user