You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feat: Link Ressources while template generation #33
Some modelica models, like demand models, use external tables as an input. Current mako generation handles it like other variables:
%if fileNameHeat is not None:
fileNameHeat = ${str(round(fileNameHeat, 4))},
%endif
To automatically link demand tables to demand modelica models it should look like:
%if fileNameHeat is not None:
fileNameHeat = Modelica.Utilities.Files.loadResource(
"modelica://${package_name}/Resources/Inputs/demand_${str(name)}_heat.txt"
),
%endif
Problem background
In script uesgraphs/systemmodels/templates.py lines 273 to 278 identified model parameters get treated based on type:
for modelica_name, parameter in parameters.items():
python_name = check_variable_name(modelica_name)
if parameter.type == "Boolean":
param_str = f"{modelica_name} = ${{str({python_name}).lower()}}"
else:
param_str = f"{modelica_name} = ${{str(round({python_name}, 4))}}"
So currently only "Boolean" values get treated differently. That should be revised as well, since sometimes boolean parameters inherit from other classes like "XXX.YYY.Boolean" what is not classified as Boolean parameter right now.
Main problem regarding this issue is that inputFile-Variables are treated as numbers
Suggested solution
Identify unique type of InputFile variables and implement routine
Activity