| 263 | } |
| 264 | |
| 265 | bool PropertyConstraintList::getPyPathValue(const App::ObjectIdentifier& path, Py::Object& res) const |
| 266 | { |
| 267 | if (path.numSubComponents() != 2 || path.getPropertyComponent(0).getName() != getName()) { |
| 268 | return false; |
| 269 | } |
| 270 | |
| 271 | const ObjectIdentifier::Component& c1 = path.getPropertyComponent(1); |
| 272 | |
| 273 | const Constraint* cstr = nullptr; |
| 274 | |
| 275 | if (c1.isArray()) { |
| 276 | cstr = _lValueList[c1.getIndex(_lValueList.size())]; |
| 277 | } |
| 278 | else if (c1.isSimple()) { |
| 279 | ObjectIdentifier::Component c1 = path.getPropertyComponent(1); |
| 280 | for (auto c : _lValueList) { |
| 281 | if (c->Name == c1.getName()) { |
| 282 | cstr = c; |
| 283 | break; |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | if (!cstr) { |
| 288 | return false; |
| 289 | } |
| 290 | Quantity q = cstr->getPresentationValue(); |
| 291 | res = new Base::QuantityPy(new Base::Quantity(q)); |
| 292 | return true; |
| 293 | } |
| 294 | |
| 295 | void PropertyConstraintList::setPyObject(PyObject* value) |
| 296 | { |
nothing calls this directly
no test coverage detected