Closed zuckerruebe closed 2 years ago
@danielcarbonell @ignasigurruchagagarcia: What do you think? It would mean having to add !
in the relevant ddcks...
@martin-neugebauer Any passionate opinions? :D
We've decided to pursue a different direction: https://github.com/SPF-OST/pytrnsys/issues/134
Context
E.g. in our collector we have the following statement:
In "GUI mode", i.e. when we're not just using the default,
TCollOut
won't be defined. If that variable is referenced somewhere else in the ddck we'll get an error. The same holds if it's referenced somewhere outside the ddck (and the hydraulics ddck as it shouldn't be referenced there because that file is under the GUI's control), say in the control ddck.Additionally defining
TCollOut
like soor so
seems to solve the problem for GUI mode but it looks confusing and, worse, it breaks when using the "no-GUI mode" as there
TCollOut
would be defined twice.Proposed solution
We should add the option to additionaly define the output temperature variable when in GUI mode (note the
!
)@temp!(Out, TCollOut) = [42,7]
which is replaced by
TCollOut = [42, 7]
in the no-GUI case and
in the GUI case (
TCollector
is the automatically created/connected name).Outlook / interoperability with "local and global variables"
In the near future we should have "local" and "global" variables in ddcks. Most likely a local variable
X
in a component's ddck will just be prefixed with the component's name. Let's say the component's name is "Collector" than the local variable will be replaced byCollectorX
. Global variables will be left as is:Y
will remainY
.For the sake of this discussion let's assume a local variable is designated by prefixing it with a colon
:
, i.e.:X
in the ddck will be replaced byCollectorX
in the dck file (other implementations are possible, e.g. prefixing global variables with$
).Then we can support different use cases.
!
in@temp
)