Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

added fmuResourceLocation to Instance Structure #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fmu20/src/models/fmuTemplate.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ fmi2Component fmi2Instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2Str
comp->isPositive = (fmi2Boolean *)functions->allocateMemory(NUMBER_OF_EVENT_INDICATORS,
sizeof(fmi2Boolean));
comp->instanceName = (char *)functions->allocateMemory(1 + strlen(instanceName), sizeof(char));
comp->fmuResourceLocation = (char *)functions->allocateMemory(1 + strlen(fmuResourceLocation), sizeof(char));
comp->GUID = (char *)functions->allocateMemory(1 + strlen(fmuGUID), sizeof(char));

// set all categories to on or off. fmi2SetDebugLogging should be called to choose specific categories.
Expand All @@ -177,6 +178,7 @@ fmi2Component fmi2Instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2Str
}
comp->time = 0; // overwrite in fmi2SetupExperiment, fmi2SetTime
strcpy((char *)comp->instanceName, (char *)instanceName);
strcpy((char *)comp->fmuResourceLocation, (char *)fmuResourceLocation);
comp->type = fmuType;
strcpy((char *)comp->GUID, (char *)fmuGUID);
comp->functions = functions;
Expand Down
1 change: 1 addition & 0 deletions fmu20/src/models/fmuTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ typedef struct {

fmi2Real time;
fmi2String instanceName;
fmi2String fmuResourceLocation;
fmi2Type type;
fmi2String GUID;
const fmi2CallbackFunctions *functions;
Expand Down