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 shown = g->visible;
bool ok = g->IsSolvedOkay();
bool warn = g->type == Group::Type::DRAWING_WORKPLANE &&
g->polyError.how != PolyError::GOOD;
int dof = g->solved.dof;
char sdof[16] = "ok ";
if(ok && dof > 0) {
@ -132,11 +134,12 @@ void TextWindow::ShowListOfGroups() {
g->h.v, (&TextWindow::ScreenToggleGroupShown),
afterActive ? "" : (shown ? checkTrue : checkFalse),
// Link to the errors, if a problem occurred while solving
ok ? (dof > 0 ? 'i' : 's') : 'x', g->h.v, (&TextWindow::ScreenHowGroupSolved),
ok ? sdof : "",
ok ? (warn ? 'm' : (dof > 0 ? 'i' : 's')) : 'x',
g->h.v, (&TextWindow::ScreenHowGroupSolved),
ok ? (warn ? "err" : sdof) : "",
ok ? "" : "ERR",
// 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;
}