Skip to content

Commit

Permalink
common_fmu2: Add Fmi2TypeToString() function
Browse files Browse the repository at this point in the history
  • Loading branch information
klausschuch committed Jul 11, 2024
1 parent 0727977 commit e08d0dd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/fmu/common_fmu2.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@ ChannelType Fmi2TypeToChannelType(fmi2_base_type_enu_t type) {
}
}

const char * Fmi2TypeToString(fmi2_base_type_enu_t type) {
switch (type) {
case fmi2_base_type_real:
return "fmi2Real";
case fmi2_base_type_int:
return "fmi2Integer";
case fmi2_base_type_bool:
return "fmi2Bool";
case fmi2_base_type_str:
return "fmi2String";
case fmi2_base_type_enum:
return "fmi2Enum";
}
return "fmi2Unknown";
}


McxStatus Fmu2CommonStructInit(Fmu2CommonStruct * fmu) {
fmu->fmiImport = NULL;

Expand Down
1 change: 1 addition & 0 deletions src/fmu/common_fmu2.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extern "C" {
#endif /* __cplusplus */

ChannelType Fmi2TypeToChannelType(fmi2_base_type_enu_t type);
const char * Fmi2TypeToString(fmi2_base_type_enu_t type);

struct Fmu2CommonStruct;

Expand Down

0 comments on commit e08d0dd

Please sign in to comment.