INTO-CPS-Association / maestro

Maestro a Co-Simulation Orchestration Engine
20 stars 3 forks source link

loglevels are not returned from initialize. #349

Closed CThuleHansen closed 2 years ago

CThuleHansen commented 2 years ago

Initialize is supposed to return the loglevels from all the FMUs, but currently it does not in maestro2.

CThuleHansen commented 2 years ago
HashMap<String, List<InitializeStatusModel.LogLevelModel>> logcategoryKeyToLogCategories = new HashMap<>();
        // Load the FMUs
        for (Map.Entry<String, String> fmuKeyToFmuURI : body.getFmus().entrySet()) {
            IFmu iFmu = FmuFactory.create(fmuKeyToFmuURI.getValue());
            Fmi2ModelDescription fmi2ModelDescription = new Fmi2ModelDescription(iFmu.getModelDescription());
            List<ModelDescription.LogCategory> logCategories = fmi2ModelDescription.getLogCategories();
            logcategoryKeyToLogCategories.put(fmuKeyToFmuURI.getKey(),
                    logCategories.stream().map(x -> new InitializeStatusModel.LogLevelModel(x.getName(), x.toString())).collect(Collectors.toList()));
        }

        return new InitializeStatusModel("initialized", sessionId, logcategoryKeyToLogCategories, 0);