Skip to content

Commit

Permalink
- fixed fmu-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Walther committed Jun 10, 2015
1 parent 07d7d9a commit f778574
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SimulationRuntime/cpp/Include/FMU/FMUWrapper.h
Expand Up @@ -34,7 +34,7 @@ class FMUWrapper : public IFMUInterface
}

public:
FMUWrapper(fmiString instanceName, fmiString GUID, fmiCallbackFunctions functions, fmiBoolean loggingOn) : IFMUInterface(instanceName, GUID, functions, loggingOn)
FMUWrapper(fmiString instanceName, fmiString GUID, fmiCallbackFunctions functions, fmiBoolean loggingOn) : IFMUInterface(instanceName, GUID, functions, loggingOn), _need_update(true)
{
FMULogger::initialize(functions.logger, this, instanceName);
boost::shared_ptr<IAlgLoopSolverFactory>
Expand All @@ -52,6 +52,7 @@ class FMUWrapper : public IFMUInterface

virtual fmiStatus setDebugLogging (fmiBoolean loggingOn)
{
Logger::setEnabled(loggingOn);
return fmiOK;
}

Expand All @@ -66,6 +67,9 @@ class FMUWrapper : public IFMUInterface
virtual fmiStatus setContinuousStates (const fmiReal states[], size_t nx)
{
// to set states do the folowing
std::stringstream message;
message << "Setting continuous states";
Logger::writeInfo(message.str());
_model->setContinuousStates(states);
_need_update = true;
return fmiOK;
Expand Down Expand Up @@ -140,6 +144,7 @@ class FMUWrapper : public IFMUInterface

virtual fmiStatus getDerivatives (fmiReal derivatives[] , size_t nx)
{
Logger::writeInfo("Try to get derivatives");
updateModel();
_model->getRHS(derivatives);
return fmiOK;
Expand Down

0 comments on commit f778574

Please sign in to comment.