Skip to content

Commit

Permalink
Set sim_path based on provided resource_location.
Browse files Browse the repository at this point in the history
Signed-off-by: Rule Timothy (VM/EMT3) <[email protected]>
  • Loading branch information
timrulebosch committed Aug 19, 2024
1 parent 3b58a00 commit 2e2f1e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dse/fmimodelc/examples/network_fmu/fmi2importer.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int main(int argc, char** argv)
fmi2Instantiate instantiate = dlsym(handle, "fmi2Instantiate");
if (instantiate == NULL) return EINVAL;
fmu = instantiate(
"network_fmu", fmi2CoSimulation, "guid", "resource", NULL, true, false);
"network_fmu", fmi2CoSimulation, "guid", "resources", NULL, true, false);
if (fmu == NULL) return EINVAL;

/* fmi2ExitInitializationMode */
Expand Down
5 changes: 3 additions & 2 deletions dse/fmimodelc/fmi2fmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fmi2Status fmi2ExitInitializationMode(fmi2Component c)
.runtime = {
.runtime_model = fmu->instance.name,
.model_name = fmu->instance.name,
.sim_path = "resources/sim",
.sim_path = dse_path_cat(fmu->instance.resource_location, "sim"),
.simulation_yaml = "data/simulation.yaml",
.end_time = END_TIME,
.log_level = 5,
Expand Down Expand Up @@ -517,8 +517,9 @@ void fmi2FreeInstance(fmi2Component c)
assert(m);

_log("Call model_runtime_destroy() ...");
free(m->runtime.sim_path);
model_runtime_destroy(m);
if (m->model.sim) free(m->model.sim);
free(m->model.sim);

_log("Destroy the index");
hashmap_destroy(&fmu->runtime.scalar.input);
Expand Down

0 comments on commit 2e2f1e0

Please sign in to comment.