%if EXISTS("_CACHEGENERALDATAINMATINFOFILE_") == 0
%assign _CACHEGENERALDATAINMATINFOFILE_ = 1
%function CacheGeneralDataIntoMatInfoFile() void
%with ::CompiledModel
%createrecord GeneralDataToAddToBinfo { Name "%<Name>"}
%if MatFileLogging==1 && GenRTModel
%addtorecord GeneralDataToAddToBinfo RTMLoggingObjectExpression RTMGetLoggingObject()
%addtorecord GeneralDataToAddToBinfo RTMTPtrExpression RTMSpecAccsGetTPtr(RTMGetRTModelRecShell().TPtr,RTMGetModelSS())
%endif
%if SLibIsERTTarget()
%if SLibAutosarActive()
%assign autosar = ::CompiledModel.RTWAutosar
%assign numAutosarRunnables = SIZE(autosar.AutosarRunnables.Runnable, 1)
%foreach rIdx = numAutosarRunnables
%assign runnable = autosar.AutosarRunnables.Runnable[rIdx]
%assign locName = runnable.Name
%assign locSymbol = runnable.Symbol
%addtorecord GeneralDataToAddToBinfo AutosarPeriodicRunnables { /
Name locName; /
Symbol locSymbol /
}
%endforeach
%assign initRunnable = ::CompiledModel.RTWAutosar.InitRunnables.Runnable
%assert(SIZE(initRunnable, 1) == 1)
%addtorecord GeneralDataToAddToBinfo AutosarInitRunnable {/
Name initRunnable.Name; /
Symbol initRunnable.Symbol /
}
%if IncludeMdlTerminateFcn
%assign termRunnable = ::CompiledModel.RTWAutosar.TerminateRunnables.Runnable
%assert(SIZE(termRunnable, 1) == 1)
%addtorecord GeneralDataToAddToBinfo AutosarTermRunnable {/
Name termRunnable.Name; /
Symbol termRunnable.Symbol /
}
%endif
%endif
%endif
%endwith
%<CacheDataInBinfoMatFile(Name, "addGeneralDataFromTLC", GeneralDataToAddToBinfo)>
%endfunction
%function CacheDataInBinfoMatFile(mdl, type, interface) void
%if IsModelReferenceTarget()
%assign targetType = IsModelReferenceSimTarget() ? "SIM" : "RTW"
%else
%assign targetType = "NONE"
%endif
%assign rtwinfomat = FEVAL("coder.internal.infoMATFileMgr", ...
type, "binfo", "%<mdl>", ...
"%<targetType>", interface)
%endfunction
%endif