MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / updateHiddenReference

Method updateHiddenReference

src/App/PropertyExpressionEngine.cpp:344–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344void PropertyExpressionEngine::updateHiddenReference(const std::string& key)
345{
346 if (!pimpl) {
347 return;
348 }
349 auto it = pimpl->propMap.find(key);
350 if (it == pimpl->propMap.end()) {
351 return;
352 }
353 for (auto& var : it->second) {
354 auto it = expressions.find(var);
355 if (it == expressions.end() || it->second.busy) {
356 continue;
357 }
358 Property* myProp = var.getProperty();
359 if (!myProp) {
360 continue;
361 }
362 Base::StateLocker guard(it->second.busy);
363 App::any value;
364 try {
365 value = it->second.expression->getValueAsAny();
366 if (!isAnyEqual(value, myProp->getPathValue(var))) {
367 myProp->setPathValue(var, value);
368 }
369 }
370 catch (Base::Exception& e) {
371 e.reportException();
372 FC_ERR("Failed to evaluate property binding " << myProp->getFullName()
373 << " on change of " << key);
374 }
375 catch (std::bad_cast&) {
376 FC_ERR("Invalid type '" << value.type().name() << "' in property binding "
377 << myProp->getFullName() << " on change of " << key);
378 }
379 catch (std::exception& e) {
380 FC_ERR(e.what());
381 FC_ERR("Failed to evaluate property binding " << myProp->getFullName()
382 << " on change of " << key);
383 }
384 }
385}
386
387void PropertyExpressionEngine::slotChangedObject(const App::DocumentObject& obj,
388 const App::Property&)

Callers

nothing calls this directly

Calls 12

isAnyEqualFunction · 0.85
getValueAsAnyMethod · 0.80
findMethod · 0.45
endMethod · 0.45
getPropertyMethod · 0.45
getPathValueMethod · 0.45
setPathValueMethod · 0.45
reportExceptionMethod · 0.45
getFullNameMethod · 0.45
nameMethod · 0.45
typeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected