📄 c2_std5.c
字号:
c2_b_u[c2_i42].re = (*(creal_T (*)[480])c2_u)[c2_i42].re;
c2_b_u[c2_i42].im = (*(creal_T (*)[480])c2_u)[c2_i42].im;
}
c2_b_y = NULL;
sf_mex_assign(&c2_b_y, sf_mex_create(&c2_b_u, "y", 0, 1U, 1U, 1, 480));
sf_mex_assign(&c2_y, c2_b_y);
return c2_y;
}
static const mxArray *c2_gb_sf_marshall(void *c2_chartInstance, void *c2_u)
{
const mxArray *c2_y = NULL;
int32_T c2_i43;
real_T c2_b_u[1000];
const mxArray *c2_b_y = NULL;
c2_y = NULL;
for(c2_i43 = 0; c2_i43 < 1000; c2_i43 = c2_i43 + 1) {
c2_b_u[c2_i43] = (*(real_T (*)[1000])c2_u)[c2_i43];
}
c2_b_y = NULL;
sf_mex_assign(&c2_b_y, sf_mex_create(&c2_b_u, "y", 0, 0U, 1U, 2, 1, 1000));
sf_mex_assign(&c2_y, c2_b_y);
return c2_y;
}
static const mxArray *c2_hb_sf_marshall(void *c2_chartInstance, void *c2_u)
{
const mxArray *c2_y = NULL;
int32_T c2_i44;
real_T c2_b_u[1000];
const mxArray *c2_b_y = NULL;
c2_y = NULL;
for(c2_i44 = 0; c2_i44 < 1000; c2_i44 = c2_i44 + 1) {
c2_b_u[c2_i44] = (*(real_T (*)[1000])c2_u)[c2_i44];
}
c2_b_y = NULL;
sf_mex_assign(&c2_b_y, sf_mex_create(&c2_b_u, "y", 0, 0U, 1U, 2, 1, 1000));
sf_mex_assign(&c2_y, c2_b_y);
return c2_y;
}
const mxArray *sf_c2_std5_get_eml_resolved_functions_info(void)
{
const mxArray *c2_nameCaptureInfo = NULL;
c2_nameCaptureInfo = NULL;
sf_mex_assign(&c2_nameCaptureInfo, sf_mex_create(NULL, "nameCaptureInfo", 0,
0U, 1U, 2, 0, 1));
return c2_nameCaptureInfo;
}
static real_T *c2_dreal_syble(void)
{
return (real_T *)ssGetOutputPortSignal(chartInstance.S, 1);
}
static creal_T *c2_input_signal(void)
{
return (creal_T *)ssGetInputPortSignal(chartInstance.S, 0);
}
static real_T *c2_dimag_syble(void)
{
return (real_T *)ssGetOutputPortSignal(chartInstance.S, 2);
}
static real_T *c2_coarse_time_est(void)
{
return (real_T *)ssGetOutputPortSignal(chartInstance.S, 3);
}
static real_T *c2_coarse_errfre(void)
{
return (real_T *)ssGetOutputPortSignal(chartInstance.S, 4);
}
static creal_T *c2_freq_offset(void)
{
return (creal_T *)ssGetOutputPortSignal(chartInstance.S, 5);
}
static void init_dsm_address_info(void)
{
}
/* SFunction Glue Code */
void sf_c2_std5_get_check_sum(mxArray *plhs[])
{
((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3214804546U);
((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3928951113U);
((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(366808919U);
((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(3408514072U);
}
mxArray *sf_c2_std5_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)(224123010U);
pr[1] = (double)(2433024508U);
pr[2] = (double)(4056842163U);
pr[3] = (double)(1407102452U);
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)(480);
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(10));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
mxSetField(mxData,0,"type",mxType);
}
mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(1));
mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
}
{
mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,mxREAL));
}
{
const char *dataFields[] = {"size","type","complexity"};
mxArray *mxData = mxCreateStructMatrix(1,5,3,dataFields);
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1000);
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(10));
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));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1000);
pr[1] = (double)(1);
mxSetField(mxData,1,"size",mxSize);
}
{
const char *typeFields[] = {"base","aliasId","fixpt"};
mxArray *mxType = mxCreateStructMatrix(1,1,3,typeFields);
mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
mxSetField(mxData,1,"type",mxType);
}
mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
pr[1] = (double)(1);
mxSetField(mxData,2,"size",mxSize);
}
{
const char *typeFields[] = {"base","aliasId","fixpt"};
mxArray *mxType = mxCreateStructMatrix(1,1,3,typeFields);
mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
mxSetField(mxData,2,"type",mxType);
}
mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
pr[1] = (double)(1);
mxSetField(mxData,3,"size",mxSize);
}
{
const char *typeFields[] = {"base","aliasId","fixpt"};
mxArray *mxType = mxCreateStructMatrix(1,1,3,typeFields);
mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
mxSetField(mxData,3,"type",mxType);
}
mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
pr[1] = (double)(1);
mxSetField(mxData,4,"size",mxSize);
}
{
const char *typeFields[] = {"base","aliasId","fixpt"};
mxArray *mxType = mxCreateStructMatrix(1,1,3,typeFields);
mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
mxSetField(mxData,4,"type",mxType);
}
mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(1));
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(_std5MachineNumber_,
2,
1,
1,
6,
0,
0,
0,
0,
&(chartInstance.chartNumber),
&(chartInstance.instanceNumber),
ssGetPath(S),
(void *)S);
if(chartAlreadyPresent==0) {
/* this is the first instance */
sf_debug_set_chart_disable_implicit_casting(_std5MachineNumber_,chartInstance.chartNumber,1);
sf_debug_set_chart_event_thresholds(_std5MachineNumber_,
chartInstance.chartNumber,
0,
0,
0);
{
unsigned int dimVector[1];
dimVector[0]= 1000;
_SFD_SET_DATA_PROPS(4,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"dreal_syble",0,c2_b_sf_marshall);
}
{
unsigned int dimVector[1];
dimVector[0]= 480;
_SFD_SET_DATA_PROPS(1,1,1,0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"input_signal",1,c2_sf_marshall);
}
{
unsigned int dimVector[1];
dimVector[0]= 1000;
_SFD_SET_DATA_PROPS(5,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"dimag_syble",0,c2_c_sf_marshall);
}
_SFD_SET_DATA_PROPS(0,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"coarse_time_est",0,c2_d_sf_marshall);
_SFD_SET_DATA_PROPS(3,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"coarse_errfre",0,c2_e_sf_marshall);
_SFD_SET_DATA_PROPS(2,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"freq_offset",1,c2_f_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,0,0,4,0,0,0);
_SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",2,-1,2829);
_SFD_CV_INIT_EML_FOR(0,0,513,532,1133);
_SFD_CV_INIT_EML_FOR(0,1,622,633,851);
_SFD_CV_INIT_EML_FOR(0,2,1342,1354,1462);
_SFD_CV_INIT_EML_FOR(0,3,2153,2199,2319);
_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);
}
_SFD_SET_DATA_VALUE_PTR(4U, c2_dreal_syble());
_SFD_SET_DATA_VALUE_PTR(1U, c2_input_signal());
_SFD_SET_DATA_VALUE_PTR(5U, c2_dimag_syble());
_SFD_SET_DATA_VALUE_PTR(0U, c2_coarse_time_est());
_SFD_SET_DATA_VALUE_PTR(3U, c2_coarse_errfre());
_SFD_SET_DATA_VALUE_PTR(2U, c2_freq_offset());
}
}
} else {
sf_debug_reset_current_state_configuration(_std5MachineNumber_,chartInstance.chartNumber,chartInstance.instanceNumber);
}
}
static void sf_opaque_initialize_c2_std5(void *chartInstanceVar)
{
chart_debug_initialization(chartInstance.S,0);
initialize_params_c2_std5();
initialize_c2_std5();
}
static void sf_opaque_enable_c2_std5(void *chartInstanceVar)
{
enable_c2_std5();
}
static void sf_opaque_disable_c2_std5(void *chartInstanceVar)
{
disable_c2_std5();
}
static void sf_opaque_gateway_c2_std5(void *chartInstanceVar)
{
sf_c2_std5();
}
static void sf_opaque_terminate_c2_std5(void *chartInstanceVar)
{
if (sim_mode_is_rtw_gen(chartInstance.S)) {
sf_clear_rtw_identifier(chartInstance.S);
}
finalize_c2_std5();
}
static void mdlProcessParameters_c2_std5(SimStruct *S)
{
int i;
for(i=0;i<ssGetNumRunTimeParams(S);i++) {
if(ssGetSFcnParamTunable(S,i)) {
ssUpdateDlgParamAsRunTimeParam(S,i);
}
}
initialize_params_c2_std5();
}
static void mdlSetWorkWidths_c2_std5(SimStruct *S)
{
if(sim_mode_is_rtw_gen(S)) {
int_T chartIsInlinable =
(int_T)sf_is_chart_inlinable("std5",2);
ssSetStateflowIsInlinable(S,chartIsInlinable);
ssSetEnableFcnIsTrivial(S,1);
ssSetDisableFcnIsTrivial(S,1);
ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop("std5",2,"gatewayCannotBeInlinedMultipleTimes"));
if(chartIsInlinable) {
ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
sf_mark_chart_expressionable_inputs(S,"std5",2,1);
sf_mark_chart_reusable_outputs(S,"std5",2,5);
}
if (!sf_is_chart_instance_optimized_out("std5",2)) {
int dtId;
char *chartInstanceTypedefName =
sf_chart_instance_typedef_name("std5",2);
dtId = ssRegisterDataType(S, chartInstanceTypedefName);
if (dtId == INVALID_DTYPE_ID ) return;
/* Register the size of the udt */
if (!ssSetDataTypeSize(S, dtId, 8)) return;
if(!ssSetNumDWork(S,1)) return;
ssSetDWorkDataType(S, 0, dtId);
ssSetDWorkWidth(S, 0, 1);
ssSetDWorkName(S, 0, "ChartInstance"); /*optional name, less than 16 chars*/
sf_set_rtw_identifier(S);
}
ssSetHasSubFunctions(S,!(chartIsInlinable));
ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
}
ssSetChecksum0(S,(405030743U));
ssSetChecksum1(S,(444941173U));
ssSetChecksum2(S,(3350164863U));
ssSetChecksum3(S,(1944165073U));
ssSetExplicitFCSSCtrl(S,1);
}
static void mdlRTW_c2_std5(SimStruct *S)
{
if(sim_mode_is_rtw_gen(S)) {
sf_write_symbol_mapping(S, "std5", 2);
ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
}
}
static void mdlStart_c2_std5(SimStruct *S)
{
chartInstance.chartInfo.chartInstance = NULL;
chartInstance.chartInfo.isEMLChart = 1;
chartInstance.chartInfo.chartInitialized = 0;
chartInstance.chartInfo.sFunctionGateway = sf_opaque_gateway_c2_std5;
chartInstance.chartInfo.initializeChart = sf_opaque_initialize_c2_std5;
chartInstance.chartInfo.terminateChart = sf_opaque_terminate_c2_std5;
chartInstance.chartInfo.enableChart = sf_opaque_enable_c2_std5;
chartInstance.chartInfo.disableChart = sf_opaque_disable_c2_std5;
chartInstance.chartInfo.mdlRTW = mdlRTW_c2_std5;
chartInstance.chartInfo.mdlStart = mdlStart_c2_std5;
chartInstance.chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c2_std5;
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 c2_std5_method_dispatcher(SimStruct *S, int_T method, void *data)
{
switch (method) {
case SS_CALL_MDL_START:
mdlStart_c2_std5(S);
break;
case SS_CALL_MDL_SET_WORK_WIDTHS:
mdlSetWorkWidths_c2_std5(S);
break;
case SS_CALL_MDL_PROCESS_PARAMETERS:
mdlProcessParameters_c2_std5(S);
break;
default:
/* Unhandled method */
sf_mex_error_message("Stateflow Internal Error:\n"
"Error calling c2_std5_method_dispatcher.\n"
"Can't handle method %d.\n", method);
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -