Only consider groups until active when checking for solver failure.
After commit 2f734d9
, inactive groups are no longer regenerated
for trivial changes, e.g. changing parameters, so it's possible to
switch to an earlier group and work on it without incurring
the computational (slowdown) and cognitive (annoyance by red
background) overhead of later groups failing to solve.
However, if a group--any group anywhere--was not solved OK,
the interface reacted accordingly, which diminished usefulness of
the change, especially given that, if we have groups A and B with
B depending on A, if B is broken by a change in A and we activate A
and fix it, B will not be regenerated.
After this commit, only active groups are considered when deciding
if generating the entire sketch would fail.
pull/4/head
parent
57fb3bf3dc
commit
d43bd93060
|
@ -506,7 +506,7 @@ void GraphicsWindow::Paint(void) {
|
||||||
// At the same depth, we want later lines drawn over earlier.
|
// At the same depth, we want later lines drawn over earlier.
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
|
|
||||||
if(SS.AllGroupsOkay()) {
|
if(SS.ActiveGroupsOkay()) {
|
||||||
glClearColor(SS.backgroundColor.redF(),
|
glClearColor(SS.backgroundColor.redF(),
|
||||||
SS.backgroundColor.greenF(),
|
SS.backgroundColor.greenF(),
|
||||||
SS.backgroundColor.blueF(), 1.0f);
|
SS.backgroundColor.blueF(), 1.0f);
|
||||||
|
|
|
@ -506,10 +506,13 @@ void SolveSpaceUI::SolveGroup(hGroup hg, bool andFindFree) {
|
||||||
FreeAllTemporary();
|
FreeAllTemporary();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SolveSpaceUI::AllGroupsOkay() {
|
bool SolveSpaceUI::ActiveGroupsOkay() {
|
||||||
for(int i = 0; i < SK.group.n; i++) {
|
for(int i = 0; i < SK.group.n; i++) {
|
||||||
if(!SK.group.elem[i].IsSolvedOkay())
|
Group *group = &SK.group.elem[i];
|
||||||
|
if(!group->IsSolvedOkay())
|
||||||
return false;
|
return false;
|
||||||
|
if(group->h.v == SS.GW.activeGroup.v)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -874,7 +874,7 @@ public:
|
||||||
void MarkDraggedParams(void);
|
void MarkDraggedParams(void);
|
||||||
void ForceReferences(void);
|
void ForceReferences(void);
|
||||||
|
|
||||||
bool AllGroupsOkay(void);
|
bool ActiveGroupsOkay(void);
|
||||||
|
|
||||||
// The system to be solved.
|
// The system to be solved.
|
||||||
System sys;
|
System sys;
|
||||||
|
|
|
@ -552,7 +552,7 @@ void TextWindow::ScreenStepDimGo(int link, uint32_t v) {
|
||||||
c->valA = start + ((finish - start)*i)/n;
|
c->valA = start + ((finish - start)*i)/n;
|
||||||
SS.MarkGroupDirty(c->group);
|
SS.MarkGroupDirty(c->group);
|
||||||
SS.GenerateAll();
|
SS.GenerateAll();
|
||||||
if(!SS.AllGroupsOkay()) {
|
if(!SS.ActiveGroupsOkay()) {
|
||||||
// Failed to solve, so quit
|
// Failed to solve, so quit
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue