From 2e2f1e0d1147913f0f1ea6b29c89df1cfe9f70e4 Mon Sep 17 00:00:00 2001 From: "Rule Timothy (VM/EMT3)" Date: Mon, 19 Aug 2024 09:27:04 +0200 Subject: [PATCH] Set sim_path based on provided resource_location. Signed-off-by: Rule Timothy (VM/EMT3) --- dse/fmimodelc/examples/network_fmu/fmi2importer.c | 2 +- dse/fmimodelc/fmi2fmu.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dse/fmimodelc/examples/network_fmu/fmi2importer.c b/dse/fmimodelc/examples/network_fmu/fmi2importer.c index 361529f..12acba1 100644 --- a/dse/fmimodelc/examples/network_fmu/fmi2importer.c +++ b/dse/fmimodelc/examples/network_fmu/fmi2importer.c @@ -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 */ diff --git a/dse/fmimodelc/fmi2fmu.c b/dse/fmimodelc/fmi2fmu.c index ff2fe1e..add9baa 100644 --- a/dse/fmimodelc/fmi2fmu.c +++ b/dse/fmimodelc/fmi2fmu.c @@ -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, @@ -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);