-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Context
Currently replaceable elements are parsed by assigning the replaceable type to both the type and the value property.
{
"modelicaPath": "Buildings.Templates.AirHandlersFans.VAVMultiZone.secOutRel",
"type": "Buildings.Templates.AirHandlersFans.Components.OutdoorReliefReturnSection.MixedAirWithDamper",
"value": "Buildings.Templates.AirHandlersFans.Components.OutdoorReliefReturnSection.MixedAirWithDamper",
"replaceable": true,Class modifications with redeclare are then parsed by assigning the redeclared type to the expression property and using "redeclare": true.
"Buildings.Fluid.BaseClasses.PartialThreeWayResistance.res2": {
"expression": {
"operator": "none",
"operands": [
"Buildings.Fluid.FixedResistances.PressureDrop"
]
},
"redeclare": trueThis design choice raises an issue for record types that can be both (re)declared and assigned a new (composite) value.
replaceable RecordType rec = localRecordInstance;
// or
extends Model(
redeclare NewRecordType rec=localRecordInstance);Proposition
To support such constructs it makes sense to revisit the parser schema and use
typeproperty to store the actual typevalueproperty to store the actual assignment (if any)undefinedinstead of""for the value property if there's no assignmentredeclareproperty to store the redeclared type – theredeclareproperty would become a string instead of a boolean
Short Class Definitions
Short class definitions raise a question because in that case the aliased type is "assigned" to the short class.
model ShortClass = Aliased.Type;For consistency with the redesigned schema, we'll stick to the type property to store Aliased.Type and use the modelicaPath property to store the short class name, appended to the fully qualified class name containing the definition.
{
"modelicaPath": "Fully.Qualified.Enclosing.Class.Name.ShortClass",
"type": "Aliased.Type"Selection Schema
This is not problematic because:
- Users only select one thing at a time - either a type or a value
- The context (which option is being configured) indicates which kind of selection it is