//This file is generated by the Sfunction 'step_DataStructMng_Inspc_SfH' in Simulink Runtime. 
//The source to generate it is programmed in 'emc/source/Inspc/DataStruct_Inspc.c' made by Hartmut Schorrig, Version 2018-11 
//The content is controlled by the parameter of the Sfunction in its Simulink environment of the calling model. 
//Especially the name of the struct is the parameter 'Name Type' in this SFblock. 
//Do not modify. 
#include <genSrcInspc/Device_ObjMod.h> 


#ifdef DEF_REFLECTION_FULL
  #include <genSrcInspc/Device_ObjMod.crefl>
#elif !defined(DEFINED_refl_Test_Ctrl) && !defined(DEF_REFLECTION_NO)  //may defined in the *.refloffs.c file
  ClassJc const refl_Device_ObjMod = INIZ_ClassJc(refl_Device_ObjMod, "Device_ObjMod");
#endif


void ctor_Device_ObjMod(Device_ObjMod_s* thiz) {
  STACKTRC_ENTRY("ctor_Device_ObjMod");
    CTOR_ObjectJc(&thiz->base.object, thiz, sizeof(*thiz), refl_Device_ObjMod, 0);
  STACKTRC_RETURN;
} //ctor_...


bool init__Device_ObjMod(Device_ObjMod_s* thiz, uint16 const* stop_Optimize, uint32 const* controller, uint32 const* parOptimizer, uint32 const* refValueCtrl) {

  bool bInit = true;
  thiz->stop_Optimize = *stop_Optimize;
  //In the simulink data a handle is stored, in the generated struct it is a really pointer. Convert it:
  thiz->controller = PTR_Handle2Ptr( *controller, struct Controller_ObjMod_t);
  bInit &= (thiz->controller !=null);
  //In the simulink data a handle is stored, in the generated struct it is a really pointer. Convert it:
  thiz->parOptimizer = PTR_Handle2Ptr( *parOptimizer, struct ParamOptimizer_ObjMod_t);
  bInit &= (thiz->parOptimizer !=null);
  //In the simulink data a handle is stored, in the generated struct it is a really pointer. Convert it:
  thiz->refValueCtrl = PTR_Handle2Ptr( *refValueCtrl, struct RefValueCtrl_t);
  bInit &= (thiz->refValueCtrl !=null);
  return bInit;
}



void step__Device_ObjMod(Device_ObjMod_s* thiz, float const* refValues, bool const* run, float const* Yport, uint32 const* measPrep) {

  memcpy(thiz->refValues, refValues, sizeof(thiz->refValues));//float
  thiz->run = *run;
  memcpy(thiz->Yport, Yport, sizeof(thiz->Yport));//float
  //In the simulink data a handle is stored, in the generated struct it is a really pointer. Convert it:
  thiz->measPrep = PTR_Handle2Ptr( *measPrep, struct MeasPrep_ProgrSimpleExmplA_t);
}

