-
Notifications
You must be signed in to change notification settings - Fork 41
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
Conditional placement of connector's instance #3376
Comments
To me the more standard way of handling this would be:
I can understand that using Does Wolfram System Modeler handle this model in some way? The first argument also has a use: if there is no default for inputButtom, or its expression is too complicated we at least have some graphical annotation (well - in this case it is overkill, but in general it could be useful). This is also different from some of the other linked cases where we really need to use the correct value or things break. |
No, there is no way to get this behavior in System Modeler currently. |
Just to be clear - does System Modeler support DynamicSelect for non-parameters in some situation?
|
@HansOlsson and @maltelenz Thanks for your response. In particular, I refer to changes in https://github.com/DLR-SR/ThermofluidStream/blob/main/ThermofluidStream/HeatExchangers/Internal/PartialDiscretizedHEX.mo where connector's instance
was introduced. I'm curious whether this is common or not, or whether there is an alternative solution (as e.g. using DynamicSelect) since this would be applicable on some more models in ThermofluidStream (e.g. JunctionT1.mo and JunctionT2.mo which are of the same functionality but differ in connector instances placement). |
System Modeler has two different views/states of diagrams, as mentioned in 18.6.6:
An additional restriction is that it looks like we don't support I don't like using |
I can understand that but/and:
|
My interpretation is that the second argument of Static expressions, either as a direct binding to an annotation attribute, or as the first argument of a This (sensible) approach has been common practice for quite some time. Have a look at Please do not change this! Let us keep differentiating between expressions needing/not needing simulation data when evaluated. The initial example by @tobolar looks perfectly fine to me. It's a static configuration of a component and should not use the dynamic part of |
Based on what I understood for #3464, let me add that the scope of this ticket is completely different from that of DynamicSelect. The point here is to make base classes flexible enough. When you define a base class, you define an abstract interface (e.g. connectors) that are found in all derived classes. However, it is often the case that it is too early to define their concrete placement in the icon. That should be changeable when you inherit from the base class to define a concrete model. This is completely static and not at all dynamic, the new location is defined once and for all in the class and never changes when instantiating or simulating. |
This is exactly the idea behnid! |
Is it common to Modelica Specification to define the placement of connector's instance (
rotation
andorigin
in the example below) conditional in the icon layer?Example:
The text was updated successfully, but these errors were encountered: