?? c5_std5.c
字號(hào):
}
static creal_T *c5_channel_est(void)
{
return (creal_T *)ssGetInputPortSignal(chartInstance.S, 1);
}
static creal_T *c5_corrected_syms(void)
{
return (creal_T *)ssGetOutputPortSignal(chartInstance.S, 1);
}
static creal_T *c5_freq_data_syms(void)
{
return (creal_T *)ssGetInputPortSignal(chartInstance.S, 2);
}
static creal_T *c5_freq_pilot_syms(void)
{
return (creal_T *)ssGetInputPortSignal(chartInstance.S, 3);
}
static void init_dsm_address_info(void)
{
}
/* SFunction Glue Code */
void sf_c5_std5_get_check_sum(mxArray *plhs[])
{
((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3999266585U);
((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3559107680U);
((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1159229873U);
((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(781394664U);
}
mxArray *sf_c5_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)(1059207646U);
pr[1] = (double)(1078132583U);
pr[2] = (double)(2624059389U);
pr[3] = (double)(1291124744U);
mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
}
{
const char *dataFields[] = {"size","type","complexity"};
mxArray *mxData = mxCreateStructMatrix(1,4,3,dataFields);
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(4);
pr[1] = (double)(2);
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)(52);
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(1));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(48);
pr[1] = (double)(2);
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(1));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(4);
pr[1] = (double)(2);
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(1));
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)(48);
pr[1] = (double)(2);
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,"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_,
5,
1,
1,
5,
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[2];
dimVector[0]= 4;
dimVector[1]= 2;
_SFD_SET_DATA_PROPS(2,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,1.0,0,"PilotSubcSymbols",0,c5_sf_marshall);
}
{
unsigned int dimVector[1];
dimVector[0]= 52;
_SFD_SET_DATA_PROPS(4,1,1,0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"channel_est",1,c5_b_sf_marshall);
}
{
unsigned int dimVector[2];
dimVector[0]= 48;
dimVector[1]= 2;
_SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,1.0,0,"corrected_syms",1,c5_e_sf_marshall);
}
{
unsigned int dimVector[2];
dimVector[0]= 48;
dimVector[1]= 2;
_SFD_SET_DATA_PROPS(3,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,1.0,0,"freq_data_syms",1,c5_c_sf_marshall);
}
{
unsigned int dimVector[2];
dimVector[0]= 4;
dimVector[1]= 2;
_SFD_SET_DATA_PROPS(0,1,1,0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,1.0,0,"freq_pilot_syms",1,c5_d_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,0,0,0,0);
_SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",2,-1,1523);
_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(2U, c5_PilotSubcSymbols());
_SFD_SET_DATA_VALUE_PTR(4U, c5_channel_est());
_SFD_SET_DATA_VALUE_PTR(1U, c5_corrected_syms());
_SFD_SET_DATA_VALUE_PTR(3U, c5_freq_data_syms());
_SFD_SET_DATA_VALUE_PTR(0U, c5_freq_pilot_syms());
}
}
} else {
sf_debug_reset_current_state_configuration(_std5MachineNumber_,chartInstance.chartNumber,chartInstance.instanceNumber);
}
}
static void sf_opaque_initialize_c5_std5(void *chartInstanceVar)
{
chart_debug_initialization(chartInstance.S,0);
initialize_params_c5_std5();
initialize_c5_std5();
}
static void sf_opaque_enable_c5_std5(void *chartInstanceVar)
{
enable_c5_std5();
}
static void sf_opaque_disable_c5_std5(void *chartInstanceVar)
{
disable_c5_std5();
}
static void sf_opaque_gateway_c5_std5(void *chartInstanceVar)
{
sf_c5_std5();
}
static void sf_opaque_terminate_c5_std5(void *chartInstanceVar)
{
if (sim_mode_is_rtw_gen(chartInstance.S)) {
sf_clear_rtw_identifier(chartInstance.S);
}
finalize_c5_std5();
}
static void mdlProcessParameters_c5_std5(SimStruct *S)
{
int i;
for(i=0;i<ssGetNumRunTimeParams(S);i++) {
if(ssGetSFcnParamTunable(S,i)) {
ssUpdateDlgParamAsRunTimeParam(S,i);
}
}
initialize_params_c5_std5();
}
static void mdlSetWorkWidths_c5_std5(SimStruct *S)
{
if(sim_mode_is_rtw_gen(S)) {
int_T chartIsInlinable =
(int_T)sf_is_chart_inlinable("std5",5);
ssSetStateflowIsInlinable(S,chartIsInlinable);
ssSetEnableFcnIsTrivial(S,1);
ssSetDisableFcnIsTrivial(S,1);
ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop("std5",5,"gatewayCannotBeInlinedMultipleTimes"));
if(chartIsInlinable) {
ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL);
ssSetInputPortOptimOpts(S, 2, SS_REUSABLE_AND_LOCAL);
ssSetInputPortOptimOpts(S, 3, SS_REUSABLE_AND_LOCAL);
sf_mark_chart_expressionable_inputs(S,"std5",5,4);
sf_mark_chart_reusable_outputs(S,"std5",5,1);
}
if (!sf_is_chart_instance_optimized_out("std5",5)) {
int dtId;
char *chartInstanceTypedefName =
sf_chart_instance_typedef_name("std5",5);
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,(1390012336U));
ssSetChecksum1(S,(3897384210U));
ssSetChecksum2(S,(2998635135U));
ssSetChecksum3(S,(2045368220U));
ssSetExplicitFCSSCtrl(S,1);
}
static void mdlRTW_c5_std5(SimStruct *S)
{
if(sim_mode_is_rtw_gen(S)) {
sf_write_symbol_mapping(S, "std5", 5);
ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
}
}
static void mdlStart_c5_std5(SimStruct *S)
{
chartInstance.chartInfo.chartInstance = NULL;
chartInstance.chartInfo.isEMLChart = 1;
chartInstance.chartInfo.chartInitialized = 0;
chartInstance.chartInfo.sFunctionGateway = sf_opaque_gateway_c5_std5;
chartInstance.chartInfo.initializeChart = sf_opaque_initialize_c5_std5;
chartInstance.chartInfo.terminateChart = sf_opaque_terminate_c5_std5;
chartInstance.chartInfo.enableChart = sf_opaque_enable_c5_std5;
chartInstance.chartInfo.disableChart = sf_opaque_disable_c5_std5;
chartInstance.chartInfo.mdlRTW = mdlRTW_c5_std5;
chartInstance.chartInfo.mdlStart = mdlStart_c5_std5;
chartInstance.chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c5_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 c5_std5_method_dispatcher(SimStruct *S, int_T method, void *data)
{
switch (method) {
case SS_CALL_MDL_START:
mdlStart_c5_std5(S);
break;
case SS_CALL_MDL_SET_WORK_WIDTHS:
mdlSetWorkWidths_c5_std5(S);
break;
case SS_CALL_MDL_PROCESS_PARAMETERS:
mdlProcessParameters_c5_std5(S);
break;
default:
/* Unhandled method */
sf_mex_error_message("Stateflow Internal Error:\n"
"Error calling c5_std5_method_dispatcher.\n"
"Can't handle method %d.\n", method);
break;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -