I confirm the solver message isn't updated here till I validate the dialog. Will have a look.
[Feature request #4067] Sketcher - Auto Remove Redundants - disabling - Feature request
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Re: [Feature request #4067] Sketcher - Auto Remove Redundants - disabling - Feature request
I see what you mean; I had in these cases used a recompute, but that performs already an update on the object.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Sketcher - Auto Remove Redundants - disabling - Feature request
Hi there!
I have reviewed the PR.
As far as I am trying to reproduce the issue, it appears that it only happens if the AutoUpdate checkbox is checked.
The reason is that if the AutoUpdate checkbox is not checked, the SketchObject::setDriving function already executes a solve() operation:
Code: Select all
int SketchObject::setDriving(int ConstrId, bool isdriving)
{
const std::vector<Constraint *> &vals = this->Constraints.getValues();
int ret = testDrivingChange(ConstrId, isdriving);
if(ret < 0)
return ret;
// copy the list
std::vector<Constraint *> newVals(vals);
// clone the changed Constraint
Constraint *constNew = vals[ConstrId]->clone();
constNew->isDriving = isdriving;
newVals[ConstrId] = constNew;
this->Constraints.setValues(newVals);
if (!isdriving)
setExpression(Constraints.createPath(ConstrId), boost::shared_ptr<App::Expression>());
delete constNew;
if(noRecomputes) // if we do not have a recompute, the sketch must be solved to update the DoF of the solver
solve();
return 0;
}
Code: Select all
void EditDatumDialog::drivingToggled(bool state)
{
if (state) {
ui_ins_datum->labelEdit->setToLastUsedValue();
}
sketch->setDriving(ConstrNbr, !state);
if(!sketch->noRecomputes)
sketch->solve();
}
Re: Sketcher - Auto Remove Redundants - disabling - Feature request
Totally agree. I have to admit that it was some kind of a lazy PR where I just fixed the problem the quick way.
Should I update the PR or would you just update the code and thus I'll kill the PR ?
Re: [Feature request #4067] Sketcher - Auto Remove Redundants - disabling - Feature request
I never have autoupdate enabled, nevertheless it didn't update the solver messages. I will see what this pull request will bring.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Feature request #4067] Sketcher - Auto Remove Redundants - disabling - Feature request
I was on the wrong track again. I don't know if this case is handled by your update:
Take this sketch: Adding a 20mm horizontal constraint to the selected point creates a message saying that this is not allowed. After that the constraint is deleted, but the solver's error messages stays. A recompute fixes it, but that will not always be required.
Take this sketch: Adding a 20mm horizontal constraint to the selected point creates a message saying that this is not allowed. After that the constraint is deleted, but the solver's error messages stays. A recompute fixes it, but that will not always be required.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [Feature request #4067] Sketcher - Auto Remove Redundants - disabling - Feature request
git commit 21cbceba5ae0f5690e1863c89d94085ac99e28adchrisb wrote: ↑Tue Jun 02, 2020 10:42 pm I was on the wrong track again. I don't know if this case is handled by your update:
Take this sketch:
Snip macro screenshot-925600.png
Adding a 20mm horizontal constraint to the selected point creates a message saying that this is not allowed. After that the constraint is deleted, but the solver's error messages stays. A recompute fixes it, but that will not always be required.