Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --logging-on option to fmusim #559

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
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
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