Exemplo n.º 1
0
 def Fmi2DoStep(self, request, context):
     logger.info(
         f"DoStep called on slave with current_time: {request.current_time}, step_size: {request.step_size}, and no_step_prior: {request.no_step_prior}"
     )
     status = self.fmu.do_step(request.current_time, request.step_size,
                               request.no_step_prior)
     return StatusReturn(status=status)
Exemplo n.º 2
0
 def Fmi2SetupExperiment(self, request, context):
     logger.info(
         f"SetupExperiment called on slave with start_time: {request.start_time}, stop_time: {request.stop_time}, tolerance: {request.tolerance}"
     )
     stop_time = request.stop_time
     tolerance = request.tolerance
     if request.has_stop_time == False:
         stop_time = None
     if request.has_tolerance == False:
         tolerance = None
     status = self.fmu.setup_experiment(request.start_time, stop_time,
                                        tolerance)
     return StatusReturn(status=status)
Exemplo n.º 3
0
 def Fmi2SetDebugLogging(self, request, context):
     logger.info(f"SetDebugLogging called on slave")
     status = self.fmu.set_debug_logging(request.categories,
                                         request.logging_on)
     return StatusReturn(status=status)
Exemplo n.º 4
0
 def Deserialize(self, request, context):
     logger.info(f"Deserialize called on slave")
     status = self.fmu.deserialize(request.state)
     return StatusReturn(status=status)
Exemplo n.º 5
0
 def Fmi2SetString(self, request, context):
     logger.info(
         f"SetString called on slave with references {request.references} and values {request.values}"
     )
     status = self.fmu.set_xxx(request.references, request.values)
     return StatusReturn(status=status)
Exemplo n.º 6
0
 def Fmi2FreeInstance(self, request, context):
     logger.info(f"FreeInstance called on slave")
     server.stop(None)
     return StatusReturn(status=FmiStatus.Ok)
Exemplo n.º 7
0
 def Fmi2Reset(self, request, context):
     logger.info(f"Reset called on slave")
     status = self.fmu.reset()
     return StatusReturn(status=status)
Exemplo n.º 8
0
 def Fmi2Terminate(self, request, context):
     logger.info(f"Terminate called on slave")
     status = self.fmu.terminate()
     return StatusReturn(status=status)
Exemplo n.º 9
0
 def Fmi2CancelStep(self, request, context):
     logger.info(f"CancelStep called on slave")
     status = self.fmu.cancel_step()
     return StatusReturn(status=status)
Exemplo n.º 10
0
 def Fmi2ExitInitializationMode(self, request, context):
     logger.info(f"ExitInitializationMode called on slave")
     status = self.fmu.exit_initialization_mode()
     return StatusReturn(status=status)