Make minor errors visible at a glance in the group list.

If a sketch has a "minor" problem, such as being self-intersecting,
this can cause considerably confusion in subsequent groups, yet is
not indicated in the group list.

This commit makes the "err" yellow in such cases. Note that the
indication may not change immediately when a change leading to
trouble is made, since the dependent groups are not recalculated
on all changes.
pull/434/head
Werner Almesberger 2017-02-12 17:42:25 -03:00 committed by whitequark
parent 260769c03b
commit c2c26e95ad
1 changed files with 6 additions and 3 deletions

View File

@ -106,6 +106,8 @@ void TextWindow::ShowListOfGroups() {
bool active = (g->h.v == SS.GW.activeGroup.v); bool active = (g->h.v == SS.GW.activeGroup.v);
bool shown = g->visible; bool shown = g->visible;
bool ok = g->IsSolvedOkay(); bool ok = g->IsSolvedOkay();
bool warn = g->type == Group::Type::DRAWING_WORKPLANE &&
g->polyError.how != PolyError::GOOD;
int dof = g->solved.dof; int dof = g->solved.dof;
char sdof[16] = "ok "; char sdof[16] = "ok ";
if(ok && dof > 0) { if(ok && dof > 0) {
@ -132,11 +134,12 @@ void TextWindow::ShowListOfGroups() {
g->h.v, (&TextWindow::ScreenToggleGroupShown), g->h.v, (&TextWindow::ScreenToggleGroupShown),
afterActive ? "" : (shown ? checkTrue : checkFalse), afterActive ? "" : (shown ? checkTrue : checkFalse),
// Link to the errors, if a problem occurred while solving // Link to the errors, if a problem occurred while solving
ok ? (dof > 0 ? 'i' : 's') : 'x', g->h.v, (&TextWindow::ScreenHowGroupSolved), ok ? (warn ? 'm' : (dof > 0 ? 'i' : 's')) : 'x',
ok ? sdof : "", g->h.v, (&TextWindow::ScreenHowGroupSolved),
ok ? (warn ? "err" : sdof) : "",
ok ? "" : "ERR", ok ? "" : "ERR",
// Link to a screen that gives more details on the group // Link to a screen that gives more details on the group
g->h.v, (&TextWindow::ScreenSelectGroup), s.c_str()); g->h.v, (&TextWindow::ScreenSelectGroup), s.c_str());
if(active) afterActive = true; if(active) afterActive = true;
} }