Index: trunk/src_plugins/drc_query/dlg.c =================================================================== --- trunk/src_plugins/drc_query/dlg.c (revision 31530) +++ trunk/src_plugins/drc_query/dlg.c (revision 31531) @@ -38,7 +38,7 @@ typedef struct{ RND_DAD_DECL_NOINIT(dlg) drc_query_prog_t *prog; - int wname, wtotprog, wcurrprog; + int wname, wtotprog, wcurrprog, wcnt; } progbar_t; static void drc_query_progress_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) @@ -69,6 +69,12 @@ RND_DAD_PROGRESS(pb->dlg); pb->wcurrprog = RND_DAD_CURRENT(pb->dlg); + RND_DAD_BEGIN_HBOX(pb->dlg); + RND_DAD_LABEL(pb->dlg, "Violatons so far:"); + RND_DAD_LABEL(pb->dlg, "0"); + pb->wcnt = RND_DAD_CURRENT(pb->dlg); + RND_DAD_END(pb->dlg); + RND_DAD_BUTTON_CLOSES(pb->dlg, clbtn); RND_DAD_END(pb->dlg); @@ -81,9 +87,14 @@ drc_query_prog_t *prog = ec->progress_ctx; progbar_t *pb = prog->dialog; rnd_hid_attr_val_t hv; + char tmp[128]; if (!RND_HAVE_GUI_ATTR_DLG) { - fprintf(stderr, "DRC: %ld/%ld %s %ld/%ld\n", prog->script_at, prog->script_total, prog->name, at, total); + fprintf(stderr, "DRC: %ld/%ld %s %ld/%ld", prog->script_at, prog->script_total, prog->name, at, total); + if (prog->qctx != NULL) + fprintf(stderr, " Violations: %ld\n", prog->qctx->hit_cnt); + else + fprintf(stderr, "\n"); return; } @@ -112,6 +123,12 @@ hv.dbl = (double)at / (double)total; rnd_gui->attr_dlg_set_value(pb->dlg_hid_ctx, pb->wcurrprog, &hv); + if (prog->qctx != NULL) { + sprintf(tmp, "%ld", prog->qctx->hit_cnt); + hv.str = rnd_strdup(tmp); + rnd_gui->attr_dlg_set_value(pb->dlg_hid_ctx, pb->wcnt, &hv); + } + rnd_hid_iterate(rnd_gui); } Index: trunk/src_plugins/drc_query/drc_query.c =================================================================== --- trunk/src_plugins/drc_query/drc_query.c (revision 31530) +++ trunk/src_plugins/drc_query/drc_query.c (revision 31531) @@ -144,9 +144,17 @@ qctx->hit_cnt++; } +typedef struct { + const char *name; + long script_total, script_at; + void *dialog; + drc_qry_ctx_t *qctx; +} drc_query_prog_t; + static long drc_qry_exec(pcb_qry_exec_t *ec, pcb_board_t *pcb, pcb_view_list_t *lst, const char *name, const char *type, const char *title, const char *desc, const char *query) { const char *scope = NULL; + drc_query_prog_t *prog = ec->progress_ctx; drc_qry_ctx_t qctx; pcb_drcq_stat_t *st; double ts, te; @@ -165,6 +173,7 @@ qctx.title = title; qctx.desc = desc; qctx.hit_cnt = 0; + prog->qctx = &qctx; st = pcb_drcq_stat_get(name); @@ -177,7 +186,7 @@ st->run_cnt++; st->last_hit_cnt = qctx.hit_cnt; st->sum_hit_cnt += qctx.hit_cnt; - + prog->qctx = 0; return 0; } @@ -203,11 +212,6 @@ return nat->val.boolean; } -typedef struct { - const char *name; - long script_total, script_at; - void *dialog; -} drc_query_prog_t; static void drc_query_progress(pcb_qry_exec_t *ec, long at, long total);