1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-04 23:29:42 +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;
if (!recurse)
return 1;
if (a->u.sheet.error != b->u.sheet.error)
return 0;
return sheet_eq(a->u.sheet.sheet, b->u.sheet.sheet);
default:
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;
sheet_obj = submit_obj(ctx, sch_obj_sheet);
sheet_obj->u.sheet.error = 0;
if (ctx->recurse) {
struct sheet *sheet;
sheet = recurse_sheet(ctx, file);
if (!sheet)
return 0;
if (sheet_obj->u.sheet.name) {
sheet_obj->u.sheet.error = 1;
if (sheet && sheet_obj->u.sheet.name) {
free((char *) sheet->title);
sheet->title =
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;
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);
for (field = sheet->fields; field; field = field->next)

View File

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