1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 02:30:36 +02:00

eeshow/: missing sheets are now flagged in red, instead of failing the revision

This commit is contained in:
Werner Almesberger 2016-08-16 04:07:42 -03:00
parent e349ae0d1f
commit 3c7033ce61
4 changed files with 8 additions and 3 deletions

View File

@ -287,6 +287,8 @@ static bool obj_eq(const struct sch_obj *a, const struct sch_obj *b,
return 0; return 0;
if (!recurse) if (!recurse)
return 1; return 1;
if (a->u.sheet.error != b->u.sheet.error)
return 0;
return sheet_eq(a->u.sheet.sheet, b->u.sheet.sheet); return sheet_eq(a->u.sheet.sheet, b->u.sheet.sheet);
default: default:
abort(); abort();

View File

@ -516,13 +516,14 @@ static bool parse_line(const struct file *file, void *user, const char *line)
struct sch_obj *sheet_obj; struct sch_obj *sheet_obj;
sheet_obj = submit_obj(ctx, sch_obj_sheet); sheet_obj = submit_obj(ctx, sch_obj_sheet);
sheet_obj->u.sheet.error = 0;
if (ctx->recurse) { if (ctx->recurse) {
struct sheet *sheet; struct sheet *sheet;
sheet = recurse_sheet(ctx, file); sheet = recurse_sheet(ctx, file);
if (!sheet) if (!sheet)
return 0; sheet_obj->u.sheet.error = 1;
if (sheet_obj->u.sheet.name) { if (sheet && sheet_obj->u.sheet.name) {
free((char *) sheet->title); free((char *) sheet->title);
sheet->title = sheet->title =
stralloc(sheet_obj->u.sheet.name); stralloc(sheet_obj->u.sheet.name);

View File

@ -118,7 +118,8 @@ static void render_sheet(const struct sch_obj *obj,
const struct sheet_field *field; const struct sheet_field *field;
gfx_rect(obj->x, obj->y, obj->x + sheet->w, obj->y + sheet->h, gfx_rect(obj->x, obj->y, obj->x + sheet->w, obj->y + sheet->h,
COLOR_HSHEET_BOX, COLOR_NONE, LAYER_HSHEET_BOX); COLOR_HSHEET_BOX, sheet->error ? COLOR_MISSING_BG : COLOR_NONE,
LAYER_HSHEET_BOX);
do_hsheet_text(obj, sheet); do_hsheet_text(obj, sheet);
for (field = sheet->fields; field; field = field->next) for (field = sheet->fields; field; field = field->next)

View File

@ -79,6 +79,7 @@ struct sch_obj {
const char *file; const char *file;
unsigned file_dim; unsigned file_dim;
bool rotated; bool rotated;
bool error; /* if set, sheet == NULL */
const struct sheet *sheet; const struct sheet *sheet;
/* pointer to sub-sheet; NULL if absent */ /* pointer to sub-sheet; NULL if absent */