[For v0.19]Fix ObjectIdentifier ambiguity#1619
Closed
realthunder wants to merge 6 commits intoFreeCAD:masterfrom
Closed
[For v0.19]Fix ObjectIdentifier ambiguity#1619realthunder wants to merge 6 commits intoFreeCAD:masterfrom
realthunder wants to merge 6 commits intoFreeCAD:masterfrom
Conversation
All modifications uses ObjectIdentifier to capture the path of its own property. The new ObjectIdentifier explicitly sets the document object name as the owner name to avoid runtime resolving ambiguity where there is an object with same name as the property.
Expression path starting with '.' now means to reference the object's own property. Without this syntax the expression may fail at runtime if there is an object with the same name as the property name.
Undo 6732008, because it interfer with object identifier renaming, where the renamed identifier does not exist any more.
a1892db to
655d6fe
Compare
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jun 30, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 4, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 5, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 6, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 6, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 10, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 11, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 12, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 13, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 13, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 14, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 14, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 15, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 15, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
realthunder
added a commit
to realthunder/FreeCAD
that referenced
this pull request
Jul 16, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
wwmayer
pushed a commit
to wwmayer/FreeCAD
that referenced
this pull request
Aug 8, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
wwmayer
pushed a commit
to wwmayer/FreeCAD
that referenced
this pull request
Aug 17, 2019
PropertyExpressionEngine is changed to derived from a new class PropertyExpressionContainer, which is in turn derives from PropertyXLinkContainer. This makes PropertyExpressionEngine a link type property that is capable of external linking. It now uses the unified link property APIs for dependency management and tracking of object life time, re-labeling, etc. ObjectIdentifier is modified to support sub-object reference, but is not exposed to end-user, because expression syntax is kept mostly unchanged, which will be submitted in future PR. There is, however, one small change in expression syntax (ExpressionParser.y) to introduce local property reference to avoid ambiguity mentioned in FreeCAD#1619 Modified Expression/ExpressionModifier interface to support various link property API for link modification.
Contributor
Author
|
This is included in the Link merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is an ambiguity problem in ObjectIdentifier. If there are more than one component, then the first component can either be interpreted as an object name, object label, or property name. This file demonstrate the problem.
Cube.Heightbinds to an expressionPlacement.Base.x+10mm, which is not working because there is an object with labelPlacement. The named constraint in the sketch cannot be deleted, because SketchObject internally uses ObjectIdentifier for itsPropertyConstraintListnamedConstraints, and the object with the labelPlacementhas an internal name ofConstraints.Commit 6732008 reduces the ambiguity of existing expression (Edit: this commit has been refined by 655d6fe)
Commit d5eeee7 modifies the ObjectIdentifier constructor to make it easy for other code to explicitly set the object name.
Commit 3c4750a modifies all code (that I can find) that uses ObjectIdentifier to use explicit object name.
Commit 47c4a3b add a new syntax to expression to allow explicit object name when the path starts with a dot.
We probably should forbid direct referencing of a property without a leading dot.