📄 c8_mysin4.c
字号:
c8_info[47].fileTime2 = 0U;
c8_info[48].context =
"[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m/binary_isequal";
c8_info[48].name = "all";
c8_info[48].dominantType = "logical";
c8_info[48].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/all.m";
c8_info[48].fileLength = 400U;
c8_info[48].fileTime1 = 1192445304U;
c8_info[48].fileTime2 = 0U;
c8_info[49].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m";
c8_info[49].name = "int32";
c8_info[49].dominantType = "double";
c8_info[49].resolved = "[B]int32";
c8_info[49].fileLength = 0U;
c8_info[49].fileTime1 = 0U;
c8_info[49].fileTime2 = 0U;
c8_info[50].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m";
c8_info[50].name = "ge";
c8_info[50].dominantType = "double";
c8_info[50].resolved = "[B]ge";
c8_info[50].fileLength = 0U;
c8_info[50].fileTime1 = 0U;
c8_info[50].fileTime2 = 0U;
c8_info[51].context = "[I]$matlabroot$/toolbox/eml/lib/matlab/ops/all.m";
c8_info[51].name = "eml_all_or_any";
c8_info[51].dominantType = "char";
c8_info[51].resolved =
"[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_all_or_any.m";
c8_info[51].fileLength = 3266U;
c8_info[51].fileTime1 = 1192445164U;
c8_info[51].fileTime2 = 0U;
c8_info[52].context =
"[I]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_check_dim.m";
c8_info[52].name = "intmax";
c8_info[52].dominantType = "char";
c8_info[52].resolved = "[I]$matlabroot$/toolbox/eml/lib/matlab/elmat/intmax.m";
c8_info[52].fileLength = 1535U;
c8_info[52].fileTime1 = 1192445128U;
c8_info[52].fileTime2 = 0U;
c8_info[53].context =
"[I]$matlabroot$/toolbox/eml/lib/fixedpoint/@embedded/@fi/plus.m";
c8_info[53].name = "isscalar";
c8_info[53].dominantType = "embedded.fi";
c8_info[53].resolved = "[B]isscalar";
c8_info[53].fileLength = 0U;
c8_info[53].fileTime1 = 0U;
c8_info[53].fileTime2 = 0U;
c8_info[54].context =
"[I]$matlabroot$/toolbox/eml/lib/fixedpoint/fi.m/fi_helper";
c8_info[54].name = "eml_fi_checkforntype";
c8_info[54].dominantType = "embedded.fi";
c8_info[54].resolved =
"[I]$matlabroot$/toolbox/eml/lib/fixedpoint/eml_fi_checkforntype.m";
c8_info[54].fileLength = 675U;
c8_info[54].fileTime1 = 1192444894U;
c8_info[54].fileTime2 = 0U;
}
static void init_dsm_address_info(void)
{
}
/* SFunction Glue Code */
void sf_c8_mysin4_get_check_sum(mxArray *plhs[])
{
((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3751173846U);
((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3716839122U);
((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(3745200789U);
((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2090397158U);
}
mxArray *sf_c8_mysin4_get_autoinheritance_info(void)
{
const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters",
"outputs" };
mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,4,
autoinheritanceFields);
{
mxArray *mxChecksum = mxCreateDoubleMatrix(4,1,mxREAL);
double *pr = mxGetPr(mxChecksum);
pr[0] = (double)(629229713U);
pr[1] = (double)(1039798465U);
pr[2] = (double)(2045577751U);
pr[3] = (double)(1394754902U);
mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
}
{
const char *dataFields[] = { "size", "type", "complexity" };
mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields);
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
pr[1] = (double)(1);
mxSetField(mxData,0,"size",mxSize);
}
{
const char *typeFields[] = { "base", "aliasId", "fixpt" };
mxArray *mxType = mxCreateStructMatrix(1,1,3,typeFields);
mxSetField(mxType,0,"base",mxCreateDoubleScalar(1));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
mxSetField(mxData,0,"type",mxType);
}
mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));
mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
}
{
mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,
mxREAL));
}
{
const char *dataFields[] = { "size", "type", "complexity" };
mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields);
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
pr[1] = (double)(1);
mxSetField(mxData,0,"size",mxSize);
}
{
const char *typeFields[] = { "base", "aliasId", "fixpt" };
mxArray *mxType = mxCreateStructMatrix(1,1,3,typeFields);
mxSetField(mxType,0,"base",mxCreateDoubleScalar(11));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
{
const char *fixptFields[] = { "isSigned", "wordLength", "bias", "slope",
"exponent" };
mxArray *mxFixpt = mxCreateStructMatrix(1,1,5,fixptFields);
mxSetField(mxFixpt,0,"isSigned",mxCreateDoubleScalar(0));
mxSetField(mxFixpt,0,"wordLength",mxCreateDoubleScalar(5));
mxSetField(mxFixpt,0,"bias",mxCreateDoubleScalar(0));
mxSetField(mxFixpt,0,"slope",mxCreateDoubleScalar(1));
mxSetField(mxFixpt,0,"exponent",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxFixpt);
}
mxSetField(mxData,0,"type",mxType);
}
mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));
mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData);
}
return(mxAutoinheritanceInfo);
}
static void chart_debug_initialization(SimStruct *S, unsigned int
fullDebuggerInitialization)
{
if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) {
/* do this only if simulation is starting */
if (!sim_mode_is_rtw_gen(S)) {
{
unsigned int chartAlreadyPresent;
chartAlreadyPresent = sf_debug_initialize_chart(_mysin4MachineNumber_,
8,
1,
1,
2,
0,
0,
0,
0,
0,
&(chartInstance.chartNumber),
&(chartInstance.instanceNumber),
ssGetPath(S),
(void *)S);
if (chartAlreadyPresent==0) {
/* this is the first instance */
init_script_number_translation(_mysin4MachineNumber_,
chartInstance.chartNumber);
sf_debug_set_chart_disable_implicit_casting(_mysin4MachineNumber_,
chartInstance.chartNumber,1);
sf_debug_set_chart_event_thresholds(_mysin4MachineNumber_,
chartInstance.chartNumber,
0,
0,
0);
_SFD_SET_DATA_PROPS(0,1,1,0,SF_UINT8,0,NULL,0,0,0,0.0,1.0,0,"preset",0,
c8_sf_marshall);
_SFD_SET_DATA_PROPS(1,2,0,1,SF_UINT8,0,NULL,1,0,5,0,1,0,"counter",0,
c8_b_sf_marshall);
_SFD_STATE_INFO(0,0,2);
_SFD_CH_SUBSTATE_COUNT(0);
_SFD_CH_SUBSTATE_DECOMP(0);
}
_SFD_CV_INIT_CHART(0,0,0,0);
{
_SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL);
}
_SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL);
/* Initialization of EML Model Coverage */
_SFD_CV_INIT_EML(0,1,2,0,0,0,0,0);
_SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,529);
_SFD_CV_INIT_EML_IF(0,0,331,348,-1,374);
_SFD_CV_INIT_EML_IF(0,1,376,385,408,510);
_SFD_TRANS_COV_WTS(0,0,0,1,0);
if (chartAlreadyPresent==0) {
_SFD_TRANS_COV_MAPS(0,
0,NULL,NULL,
0,NULL,NULL,
1,NULL,NULL,
0,NULL,NULL);
}
{
boolean_T *c8_preset;
uint8_T *c8_counter;
c8_counter = (uint8_T *)ssGetOutputPortSignal(chartInstance.S, 1);
c8_preset = (boolean_T *)ssGetInputPortSignal(chartInstance.S, 0);
_SFD_SET_DATA_VALUE_PTR(0U, c8_preset);
_SFD_SET_DATA_VALUE_PTR(1U, c8_counter);
}
}
}
} else {
sf_debug_reset_current_state_configuration(_mysin4MachineNumber_,
chartInstance.chartNumber,chartInstance.instanceNumber);
}
}
static void sf_opaque_initialize_c8_mysin4(void *chartInstanceVar)
{
chart_debug_initialization(chartInstance.S,0);
initialize_params_c8_mysin4();
initialize_c8_mysin4();
}
static void sf_opaque_enable_c8_mysin4(void *chartInstanceVar)
{
enable_c8_mysin4();
}
static void sf_opaque_disable_c8_mysin4(void *chartInstanceVar)
{
disable_c8_mysin4();
}
static void sf_opaque_gateway_c8_mysin4(void *chartInstanceVar)
{
sf_c8_mysin4();
}
static void sf_opaque_terminate_c8_mysin4(void *chartInstanceVar)
{
if (sim_mode_is_rtw_gen(chartInstance.S) || sim_mode_is_external
(chartInstance.S)) {
sf_clear_rtw_identifier(chartInstance.S);
}
finalize_c8_mysin4();
}
extern unsigned int sf_machine_global_initializer_called(void);
static void mdlProcessParameters_c8_mysin4(SimStruct *S)
{
int i;
for (i=0;i<ssGetNumRunTimeParams(S);i++) {
if (ssGetSFcnParamTunable(S,i)) {
ssUpdateDlgParamAsRunTimeParam(S,i);
}
}
if (sf_machine_global_initializer_called()) {
initialize_params_c8_mysin4();
}
}
static void mdlSetWorkWidths_c8_mysin4(SimStruct *S)
{
if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
int_T chartIsInlinable =
(int_T)sf_is_chart_inlinable("mysin4","mysin4",8);
ssSetStateflowIsInlinable(S,chartIsInlinable);
ssSetRTWCG(S,sf_rtw_info_uint_prop("mysin4","mysin4",8,"RTWCG"));
ssSetEnableFcnIsTrivial(S,1);
ssSetDisableFcnIsTrivial(S,1);
ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop("mysin4","mysin4",8,
"gatewayCannotBeInlinedMultipleTimes"));
if (chartIsInlinable) {
ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
sf_mark_chart_expressionable_inputs(S,"mysin4","mysin4",8,1);
sf_mark_chart_reusable_outputs(S,"mysin4","mysin4",8,1);
}
sf_set_rtw_dwork_info(S,"mysin4","mysin4",8);
ssSetHasSubFunctions(S,!(chartIsInlinable));
ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
}
ssSetChecksum0(S,(2363353773U));
ssSetChecksum1(S,(2382160402U));
ssSetChecksum2(S,(132913954U));
ssSetChecksum3(S,(3336831302U));
ssSetmdlDerivatives(S, NULL);
ssSetExplicitFCSSCtrl(S,1);
}
static void mdlRTW_c8_mysin4(SimStruct *S)
{
if (sim_mode_is_rtw_gen(S)) {
sf_write_symbol_mapping(S, "mysin4", "mysin4",8);
ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
}
}
static void mdlStart_c8_mysin4(SimStruct *S)
{
chartInstance.chartInfo.chartInstance = NULL;
chartInstance.chartInfo.isEMLChart = 1;
chartInstance.chartInfo.chartInitialized = 0;
chartInstance.chartInfo.sFunctionGateway = sf_opaque_gateway_c8_mysin4;
chartInstance.chartInfo.initializeChart = sf_opaque_initialize_c8_mysin4;
chartInstance.chartInfo.terminateChart = sf_opaque_terminate_c8_mysin4;
chartInstance.chartInfo.enableChart = sf_opaque_enable_c8_mysin4;
chartInstance.chartInfo.disableChart = sf_opaque_disable_c8_mysin4;
chartInstance.chartInfo.zeroCrossings = NULL;
chartInstance.chartInfo.outputs = NULL;
chartInstance.chartInfo.derivatives = NULL;
chartInstance.chartInfo.mdlRTW = mdlRTW_c8_mysin4;
chartInstance.chartInfo.mdlStart = mdlStart_c8_mysin4;
chartInstance.chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c8_mysin4;
chartInstance.chartInfo.extModeExec = NULL;
chartInstance.chartInfo.restoreLastMajorStepConfiguration = NULL;
chartInstance.chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
chartInstance.chartInfo.storeCurrentConfiguration = NULL;
chartInstance.S = S;
ssSetUserData(S,(void *)(&(chartInstance.chartInfo)));/* register the chart instance with simstruct */
if (!sim_mode_is_rtw_gen(S)) {
init_dsm_address_info();
}
chart_debug_initialization(S,1);
}
void c8_mysin4_method_dispatcher(SimStruct *S, int_T method, void *data)
{
switch (method) {
case SS_CALL_MDL_START:
mdlStart_c8_mysin4(S);
break;
case SS_CALL_MDL_SET_WORK_WIDTHS:
mdlSetWorkWidths_c8_mysin4(S);
break;
case SS_CALL_MDL_PROCESS_PARAMETERS:
mdlProcessParameters_c8_mysin4(S);
break;
default:
/* Unhandled method */
sf_mex_error_message("Stateflow Internal Error:\n"
"Error calling c8_mysin4_method_dispatcher.\n"
"Can't handle method %d.\n", method);
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -