ModelicaSpecification
ModelicaSpecification copied to clipboard
Modification of connector location after inheritance
Reported by eth on 8 Jun 2010 13:05 UTC When a model inherites of a partial one which includes connectors, it is not possible to move the connectors.
As there is no semantic on the connector location, it would be nice to be able moving it after inheritance.
In fact, there are two usages where I would like to have this feature:
-
at component level e.g. for putting ports location of a fluid bent to more suitable locations than those defined by partialTwoPort
-
at system level (like in VehicleInterfaces lib) where interface of models which inherits of it must be adapted according to models. It seems to be not logical. For example, if we have to define afterwards a more detailed model with many components, which requires modifying of attributes, and then ports locations, we must adapt the interface. And this interface will be changed in all models which inherites of it. Therefore, it should be better for developpers of new components to enable them moving connectors.
I recognize that it could be a tool issue when replacing models because links of connections should adapt. But I am quite sure it would enhance the expressivity of sketch.
This feature could be conditional and forbidden (prefix final when defining port location.)
Eric Thomas
Migrated-From: https://trac.modelica.org/Modelica/ticket/377
Comment by HansOlsson on 25 May 2011 09:18 UTC Personally I agree that this looks like a good idea; and think it should be discussed at the next meeting. I view it as an "enhancement" not a "defect".
Comment by hansolsson on 28 Feb 2012 13:49 UTC Language group: One way would be to introduce a parameter for position and be allowed to change.
Another way is to extend the annotations on extends e.g. to:
model Resistor
...
extends OnePort annotation (p(Placement(
transformation(extent= {{10,10},{20,20}}))),
IconMap(
extent={{-50,-50},{50,50}}));
Looks like a good alternative, but more discussion needed.
Comment by hansolsson on 28 Feb 2012 18:02 UTC Discussed at bigger meeting - a different possibility is to use modifier-syntax, i.e.:
model Resistor
...
extends OnePort(p annotation(Placement(
transformation(extent= {{10,10},{20,20}})))
annotation
IconMap(
extent={{-50,-50},{50,50}}));