?? c3_std5.c
字號:
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(1));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
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));
mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
}
{
mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,mxREAL));
}
{
const char *dataFields[] = {"size","type","complexity"};
mxArray *mxData = mxCreateStructMatrix(1,6,3,dataFields);
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(128);
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));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(320);
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)(320);
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(0));
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
pr[1] = (double)(128);
mxSetField(mxData,5,"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,5,"type",mxType);
}
mxSetField(mxData,5,"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_,
3,
1,
1,
8,
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]= 128;
_SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"syn",1,c3_c_sf_marshall);
}
{
unsigned int dimVector[1];
dimVector[0]= 1000;
_SFD_SET_DATA_PROPS(3,1,1,0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"input_signal",1,c3_sf_marshall);
}
{
unsigned int dimVector[1];
dimVector[0]= 320;
_SFD_SET_DATA_PROPS(7,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"dreal_syble",0,c3_d_sf_marshall);
}
{
unsigned int dimVector[1];
dimVector[0]= 320;
_SFD_SET_DATA_PROPS(4,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,1.0,0,"dimag_syble",0,c3_e_sf_marshall);
}
_SFD_SET_DATA_PROPS(2,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"fine_time_est",0,c3_f_sf_marshall);
_SFD_SET_DATA_PROPS(5,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"fine_errfre",0,c3_g_sf_marshall);
_SFD_SET_DATA_PROPS(6,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"coarse_fre",1,c3_b_sf_marshall);
{
unsigned int dimVector[2];
dimVector[0]= 1;
dimVector[1]= 128;
_SFD_SET_DATA_PROPS(0,2,0,1,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,1.0,0,"time_corr_long",1,c3_h_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,1,0,4,0,0,0);
_SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",1,-1,5796);
_SFD_CV_INIT_EML_IF(0,0,2672,2693,2755,2820);
_SFD_CV_INIT_EML_FOR(0,0,2068,2100,2502);
_SFD_CV_INIT_EML_FOR(0,1,2168,2179,2319);
_SFD_CV_INIT_EML_FOR(0,2,2847,2860,2955);
_SFD_CV_INIT_EML_FOR(0,3,3671,3686,3803);
_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(1U, c3_syn());
_SFD_SET_DATA_VALUE_PTR(3U, c3_input_signal());
_SFD_SET_DATA_VALUE_PTR(7U, c3_dreal_syble());
_SFD_SET_DATA_VALUE_PTR(4U, c3_dimag_syble());
_SFD_SET_DATA_VALUE_PTR(2U, c3_fine_time_est());
_SFD_SET_DATA_VALUE_PTR(5U, c3_fine_errfre());
_SFD_SET_DATA_VALUE_PTR(6U, c3_coarse_fre());
_SFD_SET_DATA_VALUE_PTR(0U, c3_time_corr_long());
}
}
} else {
sf_debug_reset_current_state_configuration(_std5MachineNumber_,chartInstance.chartNumber,chartInstance.instanceNumber);
}
}
static void sf_opaque_initialize_c3_std5(void *chartInstanceVar)
{
chart_debug_initialization(chartInstance.S,0);
initialize_params_c3_std5();
initialize_c3_std5();
}
static void sf_opaque_enable_c3_std5(void *chartInstanceVar)
{
enable_c3_std5();
}
static void sf_opaque_disable_c3_std5(void *chartInstanceVar)
{
disable_c3_std5();
}
static void sf_opaque_gateway_c3_std5(void *chartInstanceVar)
{
sf_c3_std5();
}
static void sf_opaque_terminate_c3_std5(void *chartInstanceVar)
{
if (sim_mode_is_rtw_gen(chartInstance.S)) {
sf_clear_rtw_identifier(chartInstance.S);
}
finalize_c3_std5();
}
static void mdlProcessParameters_c3_std5(SimStruct *S)
{
int i;
for(i=0;i<ssGetNumRunTimeParams(S);i++) {
if(ssGetSFcnParamTunable(S,i)) {
ssUpdateDlgParamAsRunTimeParam(S,i);
}
}
initialize_params_c3_std5();
}
static void mdlSetWorkWidths_c3_std5(SimStruct *S)
{
if(sim_mode_is_rtw_gen(S)) {
int_T chartIsInlinable =
(int_T)sf_is_chart_inlinable("std5",3);
ssSetStateflowIsInlinable(S,chartIsInlinable);
ssSetEnableFcnIsTrivial(S,1);
ssSetDisableFcnIsTrivial(S,1);
ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop("std5",3,"gatewayCannotBeInlinedMultipleTimes"));
if(chartIsInlinable) {
ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL);
sf_mark_chart_expressionable_inputs(S,"std5",3,2);
sf_mark_chart_reusable_outputs(S,"std5",3,6);
}
if (!sf_is_chart_instance_optimized_out("std5",3)) {
int dtId;
char *chartInstanceTypedefName =
sf_chart_instance_typedef_name("std5",3);
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,(880580124U));
ssSetChecksum1(S,(3442767567U));
ssSetChecksum2(S,(597630545U));
ssSetChecksum3(S,(1508511082U));
ssSetExplicitFCSSCtrl(S,1);
}
static void mdlRTW_c3_std5(SimStruct *S)
{
if(sim_mode_is_rtw_gen(S)) {
sf_write_symbol_mapping(S, "std5", 3);
ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
}
}
static void mdlStart_c3_std5(SimStruct *S)
{
chartInstance.chartInfo.chartInstance = NULL;
chartInstance.chartInfo.isEMLChart = 1;
chartInstance.chartInfo.chartInitialized = 0;
chartInstance.chartInfo.sFunctionGateway = sf_opaque_gateway_c3_std5;
chartInstance.chartInfo.initializeChart = sf_opaque_initialize_c3_std5;
chartInstance.chartInfo.terminateChart = sf_opaque_terminate_c3_std5;
chartInstance.chartInfo.enableChart = sf_opaque_enable_c3_std5;
chartInstance.chartInfo.disableChart = sf_opaque_disable_c3_std5;
chartInstance.chartInfo.mdlRTW = mdlRTW_c3_std5;
chartInstance.chartInfo.mdlStart = mdlStart_c3_std5;
chartInstance.chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c3_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 c3_std5_method_dispatcher(SimStruct *S, int_T method, void *data)
{
switch (method) {
case SS_CALL_MDL_START:
mdlStart_c3_std5(S);
break;
case SS_CALL_MDL_SET_WORK_WIDTHS:
mdlSetWorkWidths_c3_std5(S);
break;
case SS_CALL_MDL_PROCESS_PARAMETERS:
mdlProcessParameters_c3_std5(S);
break;
default:
/* Unhandled method */
sf_mex_error_message("Stateflow Internal Error:\n"
"Error calling c3_std5_method_dispatcher.\n"
"Can't handle method %d.\n", method);
break;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -