Skip to content

Commit

Permalink
Add --logging-on option to fmusim
Browse files Browse the repository at this point in the history
fixes #552
  • Loading branch information
t-sommer committed Aug 14, 2024
1 parent 14ea739 commit 9a4ff26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fmusim/fmusim.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ void printUsage() {
" --output-variable [name] record a specific variable\n"
" --input-file [FILE] read input from a CSV file\n"
" --output-file [FILE] write output to a CSV file\n"
" --logging-on enable FMU logging\n"
" --log-fmi-calls log FMI calls\n"
" --fmi-log-file [FILE] set the FMI log file\n"
" --solver [euler|cvode] the solver to use\n"
Expand All @@ -124,6 +125,7 @@ void printUsage() {

int main(int argc, const char* argv[]) {

bool loggingOn = false;
bool logFMICalls = false;

FMIInterfaceType interfaceType = -1;
Expand Down Expand Up @@ -180,7 +182,9 @@ int main(int argc, const char* argv[]) {

const char* v = argv[i];

if (!strcmp(v, "--log-fmi-calls")) {
if (!strcmp(v, "--logging-on")) {
loggingOn = true;
} else if (!strcmp(v, "--log-fmi-calls")) {
logFMICalls = true;
} else if (!strcmp(v, "--interface-type")) {
if (!strcmp(argv[i + 1], "cs")) {
Expand Down Expand Up @@ -435,6 +439,8 @@ int main(int argc, const char* argv[]) {
settings.recordIntermediateValues = recordIntermediateValues;
settings.initialFMUStateFile = initialFMUStateFile;
settings.finalFMUStateFile = finalFMUStateFile;
settings.visible = false;
settings.loggingOn = loggingOn;

if (!strcmp("euler", solver)) {
settings.solverCreate = FMIEulerCreate;
Expand Down

0 comments on commit 9a4ff26

Please sign in to comment.