New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App/Gui: Refactor expression completer and unit expressions #3062
base: main
Are you sure you want to change the base?
Commits on Mar 17, 2022
-
Spreadsheet: change alias handling
No longer add dynamic property for alias, simply rely on get(Dynamic)PropertyByName() to check for aliases. Add new API PropertyContainer::getPropertyNamedList() so that ExpressionCompleter can discover properties with aliases.
Configuration menu - View commit details
-
Copy full SHA for 1cb40ca - Browse repository at this point
Copy the full SHA 1cb40caView commit details -
Configuration menu - View commit details
-
Copy full SHA for 242f372 - Browse repository at this point
Copy the full SHA 242f372View commit details -
App: support new sub object referencing syntax in expression
The previous syntax for sub-object referencing is kind of awkward, but is unambiguious nevertherless. The new syntax allows referencing sub-object like, Part.Origin.X_Axis which may be ambiguious in case there is also a (existing or future added dynamic) property named 'Origin'. The expression parser will automatically convert this more natural syntax to the unambiguous one like, Part.<<Origin.X_Axis.>> The new syntax works for label reference as well, <<Part>>.<<Part001>>.<<Cube>> which will be converted to <<Part>>.<<$Part001.$Cube.>>
Configuration menu - View commit details
-
Copy full SHA for 935b926 - Browse repository at this point
Copy the full SHA 935b926View commit details -
Gui: refactor ExpressionCompleter
Make use of the more user friendly sub-object referecing syntax. Refectored ExpressionCompleterModel to support completing Python attributes, using CallTipsList::extractTips().
Configuration menu - View commit details
-
Copy full SHA for bb9ea11 - Browse repository at this point
Copy the full SHA bb9ea11View commit details -
App: change Property::getPaths() and getPyPathValue()
Since ExpressionCompleter will now look into Python attributes, there is no need to expose duplicated information through getPaths(), except those that provides extra information (e.g. Rotation.Angle with extra unit information) getPyPathValue() is modified to return Python attributes after the given path.
Configuration menu - View commit details
-
Copy full SHA for 320f71b - Browse repository at this point
Copy the full SHA 320f71bView commit details -
The Python exception is supposed to be captured by application code. If it is somehow leaked, it may cause system instability.
Configuration menu - View commit details
-
Copy full SHA for d16d4cf - Browse repository at this point
Copy the full SHA d16d4cfView commit details -
Base/App: refactor expression unit parsing
Before this patch, the definitions of unit are somewhat duplicated in several places, Base/QuantityParser.l, App/ExpressionParser.l, Base/Quantity.cpp, App/FreeCADInit.py, etc. This patch remove all duplications (that I can found), and put them all inside function Base::Quantity::unitInfo(). Here is how other code obtain the definition, Base/QuantityParser.l calls Quantity::fromUnitString() and resolved the unit at parsing time. App/ExpressionParser.l treats unit token as IDENTIFIER, and let the expression parser (ExpressionParser.y) to decide whether to resolve the unit at parsing time (by calling UnitExpression::create()), and create a VariableExpression and resolve the unit at runtime (if there is no property found with the same name). App/FreeCADUnit.py expose Python predefined units using App.Units.listPredefinedUnits/listUnitTypes(), which are implemented in UnitsApiPy.cpp. The benifit of moving unit token parsing out of expression lexical scanner is that we can safely introduce new unit keyword without any risking of breaking backward compatibility. Because the lexical scanner will not mistakenly treat any identifier in existing expression as unit because of name clash. In does introduce some side effect as the unit may or may not be resolved at parsing time. For example, an expression '1m/s' may be evaluated to different results depending on whether there is a property named 's'. To avoid this, the user can opt to bracket the unit expression, like '1(m/s)'.
Configuration menu - View commit details
-
Copy full SHA for d91c1e3 - Browse repository at this point
Copy the full SHA d91c1e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf6e41e - Browse repository at this point
Copy the full SHA bf6e41eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0782ef7 - Browse repository at this point
Copy the full SHA 0782ef7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8efdf2d - Browse repository at this point
Copy the full SHA 8efdf2dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f2ef38a - Browse repository at this point
Copy the full SHA f2ef38aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 685e230 - Browse repository at this point
Copy the full SHA 685e230View commit details -
App: add ObjectIdentifier pseudo property _ref
To return a (sub)object reference that is suitable for assignment to link type property
Configuration menu - View commit details
-
Copy full SHA for b4bed4c - Browse repository at this point
Copy the full SHA b4bed4cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a6c85e - Browse repository at this point
Copy the full SHA 4a6c85eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 89c1a10 - Browse repository at this point
Copy the full SHA 89c1a10View commit details -
Configuration menu - View commit details
-
Copy full SHA for da7b591 - Browse repository at this point
Copy the full SHA da7b591View commit details -
App: fix unintialized variable bug in ObjectIdentifier
This must be the cause of mysterious test failure on Travis!
Configuration menu - View commit details
-
Copy full SHA for 5e0fc73 - Browse repository at this point
Copy the full SHA 5e0fc73View commit details -
Spreadsheet: relax alias naming restriction
Because there is now a way to resolve name clash with unit.
Configuration menu - View commit details
-
Copy full SHA for 67af184 - Browse repository at this point
Copy the full SHA 67af184View commit details -
App: fix ObjectIdentifier behavior when copying without dependency
Object reference will be auto converted to external or internal reference depending on whether the referenced object is exported together or not. Related FreeCAD#2477
Configuration menu - View commit details
-
Copy full SHA for 5cab396 - Browse repository at this point
Copy the full SHA 5cab396View commit details -
App: fix ObjectIdentifier map indexing
Support old syntax of map indexing for backward compatibility, Obj.PropertyMap.<<key>>
Configuration menu - View commit details
-
Copy full SHA for 6321ffc - Browse repository at this point
Copy the full SHA 6321ffcView commit details -
Sketcher: fix PropertyConstraintList::canonicalPath()
For named constraint with space.
Configuration menu - View commit details
-
Copy full SHA for 9750fed - Browse repository at this point
Copy the full SHA 9750fedView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3bba14a - Browse repository at this point
Copy the full SHA 3bba14aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 10aa7ad - Browse repository at this point
Copy the full SHA 10aa7adView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9580de4 - Browse repository at this point
Copy the full SHA 9580de4View commit details -
Add Quantity::concat() to handle quantity concatenation, which can either be plus or minus depending on the signedness of the left quantity. 1m1mm is interpreted as 1m plus 1mm, -1m1mm means -1m minus 1mm. -1m-1mm means -1m minus -1mm, i.e. -1m plus 1mm. (0-1)m-1mm means -1m minus -1mm, i.e. -1m plus 1mm.
Configuration menu - View commit details
-
Copy full SHA for 7750f5e - Browse repository at this point
Copy the full SHA 7750f5eView commit details -
Configuration menu - View commit details
-
Copy full SHA for fdd5c1f - Browse repository at this point
Copy the full SHA fdd5c1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b450f43 - Browse repository at this point
Copy the full SHA b450f43View commit details -
Configuration menu - View commit details
-
Copy full SHA for f832bfc - Browse repository at this point
Copy the full SHA f832bfcView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf8b1e0 - Browse repository at this point
Copy the full SHA cf8b1e0View commit details -
Gui: do not report error on incomplete expression
That is, to supress 'unexpected end of input' ParserError.
Configuration menu - View commit details
-
Copy full SHA for 1476c38 - Browse repository at this point
Copy the full SHA 1476c38View commit details -
Configuration menu - View commit details
-
Copy full SHA for e808537 - Browse repository at this point
Copy the full SHA e808537View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8555cd4 - Browse repository at this point
Copy the full SHA 8555cd4View commit details -
App: improve ObjectIdentifier resolve()
Try to resolve as much information as possible
Configuration menu - View commit details
-
Copy full SHA for 8b49772 - Browse repository at this point
Copy the full SHA 8b49772View commit details -
Gui: improve ExpressionCompleter
Support 'MatchContains' on sub-object/property/attribute Fix sub-object/element references
Configuration menu - View commit details
-
Copy full SHA for 3fddd56 - Browse repository at this point
Copy the full SHA 3fddd56View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7cba97 - Browse repository at this point
Copy the full SHA a7cba97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 25cca0f - Browse repository at this point
Copy the full SHA 25cca0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 301feaf - Browse repository at this point
Copy the full SHA 301feafView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9aa7f29 - Browse repository at this point
Copy the full SHA 9aa7f29View commit details -
Configuration menu - View commit details
-
Copy full SHA for b05a06d - Browse repository at this point
Copy the full SHA b05a06dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81333ac - Browse repository at this point
Copy the full SHA 81333acView commit details -
Configuration menu - View commit details
-
Copy full SHA for e50864d - Browse repository at this point
Copy the full SHA e50864dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ed576de - Browse repository at this point
Copy the full SHA ed576deView commit details -
Configuration menu - View commit details
-
Copy full SHA for e52ee97 - Browse repository at this point
Copy the full SHA e52ee97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f23e8e - Browse repository at this point
Copy the full SHA 1f23e8eView commit details
Commits on Mar 18, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5d267d0 - Browse repository at this point
Copy the full SHA 5d267d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 567409a - Browse repository at this point
Copy the full SHA 567409aView commit details -
App/Sketcher: fix sketch constraint renaming
In case either and new or old name contains space
Configuration menu - View commit details
-
Copy full SHA for 4ad94ae - Browse repository at this point
Copy the full SHA 4ad94aeView commit details -
Base: do not report exception in Base::PyException::ThrowException()
Because user code may want to silence the exception
Configuration menu - View commit details
-
Copy full SHA for 0c39584 - Browse repository at this point
Copy the full SHA 0c39584View commit details
Commits on Mar 21, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d531d55 - Browse repository at this point
Copy the full SHA d531d55View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad9cf27 - Browse repository at this point
Copy the full SHA ad9cf27View commit details