/* Function: mdlInitializeSizes =============================================== * Abstract: * Setup sizes of the various vectors. */ static void mdlInitializeSizes(SimStruct *S) { slDataTypeAccess *dta = ssGetDataTypeAccess(S); int udtId; ssSetNumSFcnParams(S, 0); /* Number of expected parameters */ if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) { /* Return if number of expected != number of actual parameters */ return; } /* Obtain an integer datatype ID for the udt (user-defined type) "Data" */ udtId = ssRegisterDataType(S, "Data"); if ( udtId == INVALID_DTYPE_ID ) return; /* Register the size of the udt */ if (!ssSetDataTypeSize(S, udtId, sizeof(Data))) return; /* Register the zero of the udt */ if (!ssSetDataTypeZero(S, udtId, &zero)) return; /* Register the convert-between datatype function defined above */ if (!dtaSetConvertBetweenFcn(dta, ssGetPath(S), udtId, &DataCnvBtw)) return; /* Register the is-positive datatype function defined above*/ if (!dtaSetIsPositiveFcn(dta, ssGetPath(S), udtId, &DataIsPos)) return; /* Set input-port properties */ if (!ssSetNumInputPorts(S, 1)) return; ssSetInputPortWidth(S, 0, 1); ssSetInputPortDataType(S, 0, SS_DOUBLE); ssSetInputPortDirectFeedThrough(S, 0, 1); /* Set output port properties */ if (!ssSetNumOutputPorts(S, 1)) return; ssSetOutputPortDataType(S, 0, udtId); ssSetOutputPortWidth(S, 0, 1); /* Set miscellaneous properties */ ssSetNumContStates(S, 0); ssSetNumDiscStates(S, 0); ssSetNumSampleTimes(S, 1); ssSetNumRWork(S, 0); ssSetNumIWork(S, 0); ssSetNumPWork(S, 0); ssSetNumModes(S, 0); ssSetNumNonsampledZCs(S, 0); /* specify the sim state compliance to be same as a built-in block */ ssSetSimStateCompliance(S, USE_DEFAULT_SIM_STATE); ssSetOptions(S, SS_OPTION_WORKS_WITH_CODE_REUSE | SS_OPTION_USE_TLC_WITH_ACCELERATOR | SS_OPTION_DISALLOW_CONSTANT_SAMPLE_TIME | SS_OPTION_SFUNCTION_INLINED_FOR_RTW); }
/* * This function is called once at start of model execution. If you * have states that should be initialized once, this is the place * to do it. */ static void mdlStart (SimStruct *S) { bus_t *c; char *name; c = bus_alloc (); ssSetPWorkValue (S, 0, c); name = strrchr (ssGetPath (S), '/'); if (name) c->name = name + 1; else c->name = ssGetPath (S); }
/* Function: mdlStart ======================================================= * Abstract: * This function is called once at start of model execution. If you * have states that should be initialized once, this is the place * to do it. */ static void mdlStart(SimStruct *S) { int i; /* Bus Information */ slDataTypeAccess *dta = ssGetDataTypeAccess(S); const char *bpath = ssGetPath(S); DTypeId u_busId = ssGetDataTypeId(S, "u_bus"); DTypeId x_busId = ssGetDataTypeId(S, "x_bus"); int_T *busInfo = (int_T *)malloc((ACADO_NX+ACADO_NU)*2*sizeof(int_T)); if(busInfo==NULL) { ssSetErrorStatus(S, "Memory allocation failure"); return; } /* Calculate offsets of all primitive elements of the bus */ for( i = 0; i < ACADO_NX; i++ ) { busInfo[2*i] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,i); busInfo[2*i+1] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); } for( i = 0; i < ACADO_NU; i++ ) { busInfo[2*(ACADO_NX+i)] = dtaGetDataTypeElementOffset(dta, bpath,u_busId,i); busInfo[2*(ACADO_NX+i)+1] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); } ssSetUserData(S, busInfo); }
char_T* ssGetBlockName(SimStruct *S) { char *path = (char *)ssGetPath(S); char *slash = strrchr(path, '/'); if (slash != NULL) { return slash + 1; } return path; }
/* Function: mdlStart ======================================================= * Abstract: * This function is called once at start of model execution. If you * have states that should be initialized once, this is the place * to do it. */ static void mdlStart(SimStruct *S) { /* Bus Information */ slDataTypeAccess *dta = ssGetDataTypeAccess(S); const char *bpath = ssGetPath(S); DTypeId u_busId = ssGetDataTypeId(S, "u_bus"); DTypeId x_busId = ssGetDataTypeId(S, "x_bus"); DTypeId xref_busId = ssGetDataTypeId(S, "xref_bus"); int_T *busInfo = (int_T *)malloc(36*sizeof(int_T)); if(busInfo==NULL) { ssSetErrorStatus(S, "Memory allocation failure"); return; } /* Calculate offsets of all primitive elements of the bus */ busInfo[0] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,0); busInfo[1] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[2] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,1); busInfo[3] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[4] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,2); busInfo[5] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[6] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,3); busInfo[7] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[8] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,4); busInfo[9] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[10] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,5); busInfo[11] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[12] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,6); busInfo[13] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[14] = dtaGetDataTypeElementOffset(dta, bpath,xref_busId,7); busInfo[15] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[16] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,0); busInfo[17] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[18] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,1); busInfo[19] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[20] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,2); busInfo[21] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[22] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,3); busInfo[23] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[24] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,4); busInfo[25] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[26] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,5); busInfo[27] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[28] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,6); busInfo[29] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[30] = dtaGetDataTypeElementOffset(dta, bpath,x_busId,7); busInfo[31] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[32] = dtaGetDataTypeElementOffset(dta, bpath,u_busId,0); busInfo[33] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[34] = dtaGetDataTypeElementOffset(dta, bpath,u_busId,1); busInfo[35] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); ssSetUserData(S, busInfo); }
char *ssGetBlockName(SimStruct *S) { static char buf[MAXCHARS]; strncpy(buf, ssGetPath(S), MAXCHARS-1); char *cut = strstr(buf, "/ttkernel"); if (cut != NULL) { *cut = '\0'; } else { buf[0] = '\0'; } for (unsigned int i=0; i<strlen(buf); i++) if (buf[i]=='\n') buf[i]=' '; return buf; }
static void mdlUpdate(SimStruct *S, int_T tid) { // Check the `New pending activations available' flag boolean_T *pendingActivsAvail = (boolean_T*) ssGetDWork(S,0); if (pendingActivsAvail[0]) { mexPrintf("\n%s\n\t%s\n\t\tat time %.6f\n", ssGetPath(S), __FUNCTION__, ssGetT(S)); // Reset the values on the out ports real_T *y = ssGetOutputPortRealSignal(S,0); int_T width = ssGetOutputPortWidth(S,0); for (int i = 0; i < width; i++) y[i] = 0.0; // Reset the `New pending activations available' flag pendingActivsAvail[0] = false; } }
/* Function: mdlInitializeSampleTimes ========================================= * Abstract: * Port based sample times have already been configured, therefore this * method doesn't need to perform any action (you can check the * current port sample times). */ static void mdlInitializeSampleTimes(SimStruct *S) { #if 0 /* set to 1 to see port sample times */ const char_T *bpath = ssGetPath(S); int_T i; for (i = 0; i < NINPUTS; i++) { ssPrintf("%s input port %d sample time = [%g, %g]\n", bpath, i, ssGetInputPortSampleTime(S,i), ssGetInputPortOffsetTime(S,i)); } for (i = 0; i < NOUTPUTS; i++) { ssPrintf("%s output port %d sample time = [%g, %g]\n", bpath, i, ssGetOutputPortSampleTime(S,i), ssGetOutputPortOffsetTime(S,i)); } #endif ssSetModelReferenceSampleTimeDefaultInheritance(S); } /* end mdlInitializeSampleTimes */
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc25_CusakisME4901arcs2InstanceStruct *chartInstance; chartInstance = (SFc25_CusakisME4901arcs2InstanceStruct *) ((ChartInfoStruct *)(ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (sfGlobalDebugInstanceStruct, _CusakisME4901arcs2MachineNumber_, 25, 1, 1, 5, 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(_CusakisME4901arcs2MachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (sfGlobalDebugInstanceStruct,_CusakisME4901arcs2MachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, _CusakisME4901arcs2MachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"u"); _SFD_SET_DATA_PROPS(1,10,0,0,"mt"); _SFD_SET_DATA_PROPS(2,2,0,1,"a"); _SFD_SET_DATA_PROPS(3,10,0,0,"mb"); _SFD_SET_DATA_PROPS(4,10,0,0,"m"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,162); _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); } { unsigned int dimVector[1]; dimVector[0]= 3; _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c25_c_sf_marshallOut,(MexInFcnForType)NULL); } _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c25_b_sf_marshallOut,(MexInFcnForType) c25_b_sf_marshallIn); { unsigned int dimVector[1]; dimVector[0]= 6; _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c25_sf_marshallOut,(MexInFcnForType) c25_sf_marshallIn); } _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c25_b_sf_marshallOut,(MexInFcnForType) c25_b_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c25_b_sf_marshallOut,(MexInFcnForType) c25_b_sf_marshallIn); { real_T (*c25_u)[3]; real_T (*c25_a)[6]; c25_a = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1); c25_u = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, *c25_u); _SFD_SET_DATA_VALUE_PTR(1U, &chartInstance->c25_mt); _SFD_SET_DATA_VALUE_PTR(2U, *c25_a); _SFD_SET_DATA_VALUE_PTR(3U, &chartInstance->c25_mb); _SFD_SET_DATA_VALUE_PTR(4U, &chartInstance->c25_m); } } } else { sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, _CusakisME4901arcs2MachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc7_ekffedepreInstanceStruct *chartInstance; chartInstance = (SFc7_ekffedepreInstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_ekffedepreMachineNumber_, 7, 1, 1, 6, 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(_ekffedepreMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting(_ekffedepreMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_ekffedepreMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"sfasamento"); _SFD_SET_DATA_PROPS(1,2,0,1,"wave"); _SFD_SET_DATA_PROPS(2,1,1,0,"ampiezza"); _SFD_SET_DATA_PROPS(3,1,1,0,"frequenza"); _SFD_SET_DATA_PROPS(4,1,1,0,"noise"); _SFD_SET_DATA_PROPS(5,1,1,0,"t"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,126); _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_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c7_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c7_sf_marshallOut,(MexInFcnForType)c7_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c7_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c7_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c7_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c7_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c7_sfasamento; real_T *c7_wave; real_T *c7_ampiezza; real_T *c7_frequenza; real_T *c7_noise; real_T *c7_t; c7_t = (real_T *)ssGetInputPortSignal(chartInstance->S, 4); c7_noise = (real_T *)ssGetInputPortSignal(chartInstance->S, 3); c7_frequenza = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c7_ampiezza = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c7_wave = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c7_sfasamento = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c7_sfasamento); _SFD_SET_DATA_VALUE_PTR(1U, c7_wave); _SFD_SET_DATA_VALUE_PTR(2U, c7_ampiezza); _SFD_SET_DATA_VALUE_PTR(3U, c7_frequenza); _SFD_SET_DATA_VALUE_PTR(4U, c7_noise); _SFD_SET_DATA_VALUE_PTR(5U, c7_t); } } } else { sf_debug_reset_current_state_configuration(_ekffedepreMachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc22_BuckBoost1InstanceStruct *chartInstance; chartInstance = (SFc22_BuckBoost1InstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_BuckBoost1MachineNumber_, 22, 1, 1, 3, 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(_BuckBoost1MachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting(_BuckBoost1MachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_BuckBoost1MachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,2,0,1,"PWM"); _SFD_SET_DATA_PROPS(1,1,1,0,"Carrier"); _SFD_SET_DATA_PROPS(2,1,1,0,"Duty"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,1,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,146); _SFD_CV_INIT_EML_IF(0,1,0,100,110,122,141); _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_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c22_sf_marshallOut,(MexInFcnForType)c22_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c22_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c22_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c22_PWM; real_T *c22_Carrier; real_T *c22_Duty; c22_Duty = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c22_Carrier = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); c22_PWM = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); _SFD_SET_DATA_VALUE_PTR(0U, c22_PWM); _SFD_SET_DATA_VALUE_PTR(1U, c22_Carrier); _SFD_SET_DATA_VALUE_PTR(2U, c22_Duty); } } } else { sf_debug_reset_current_state_configuration(_BuckBoost1MachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc3_car_modelInstanceStruct *chartInstance; chartInstance = (SFc3_car_modelInstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart(_car_modelMachineNumber_, 3, 1, 1, 3, 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(_car_modelMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting(_car_modelMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_car_modelMachineNumber_, chartInstance->chartNumber, 0, 0, 0); { unsigned int dimVector[1]; dimVector[0]= 4; _SFD_SET_DATA_PROPS(0,1,1,0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,"X",0,(MexFcnForType)c3_c_sf_marshall); } { unsigned int dimVector[1]; dimVector[0]= 2; _SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,"s",0,(MexFcnForType)c3_sf_marshall); } { unsigned int dimVector[1]; dimVector[0]= 3; _SFD_SET_DATA_PROPS(2,1,1,0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,"u",0,(MexFcnForType)c3_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,3,0,0,0,0,6,3); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,665); _SFD_CV_INIT_EML_IF(0,0,197,219,234,266); _SFD_CV_INIT_EML_IF(0,1,397,434,449,489); _SFD_CV_INIT_EML_IF(0,2,554,591,606,646); { static int condStart[] = { 201, 212 }; static int condEnd[] = { 208, 218 }; static int pfixExpr[] = { 0, 1, -3 }; _SFD_CV_INIT_EML_MCDC(0,0,201,218,2,0,&(condStart[0]),&(condEnd[0]),3, &(pfixExpr[0])); } { static int condStart[] = { 401, 418 }; static int condEnd[] = { 414, 433 }; static int pfixExpr[] = { 0, 1, -3 }; _SFD_CV_INIT_EML_MCDC(0,1,401,433,2,2,&(condStart[0]),&(condEnd[0]),3, &(pfixExpr[0])); } { static int condStart[] = { 558, 575 }; static int condEnd[] = { 571, 590 }; static int pfixExpr[] = { 0, 1, -3 }; _SFD_CV_INIT_EML_MCDC(0,2,558,590,2,4,&(condStart[0]),&(condEnd[0]),3, &(pfixExpr[0])); } _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); } { real_T (*c3_X)[4]; real_T (*c3_s)[2]; real_T (*c3_u)[3]; c3_u = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 1); c3_s = (real_T (*)[2])ssGetOutputPortSignal(chartInstance->S, 1); c3_X = (real_T (*)[4])ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c3_X); _SFD_SET_DATA_VALUE_PTR(1U, c3_s); _SFD_SET_DATA_VALUE_PTR(2U, c3_u); } } } else { sf_debug_reset_current_state_configuration(_car_modelMachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc1_QPSK_Transmit_v5_w_FIFOInstanceStruct *chartInstance; chartInstance = (SFc1_QPSK_Transmit_v5_w_FIFOInstanceStruct *) ((ChartInfoStruct *)(ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_QPSK_Transmit_v5_w_FIFOMachineNumber_, 1, 1, 1, 2, 0, 0, 0, 0, 1, &(chartInstance->chartNumber), &(chartInstance->instanceNumber), ssGetPath(S), (void *)S); if (chartAlreadyPresent==0) { /* this is the first instance */ init_script_number_translation(_QPSK_Transmit_v5_w_FIFOMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (_QPSK_Transmit_v5_w_FIFOMachineNumber_,chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds (_QPSK_Transmit_v5_w_FIFOMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"d_in"); _SFD_SET_DATA_PROPS(1,2,0,1,"d_out"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,1,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,199); _SFD_CV_INIT_EML_IF(0,1,0,75,90,-1,156); _SFD_CV_INIT_SCRIPT(0,1,0,0,0,0,0,0,0,0); _SFD_CV_INIT_SCRIPT_FCN(0,0,"SRRC",0,-1,300); _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_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_c_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,1, (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)c1_b_sf_marshallIn); { real_T *c1_d_in; creal_T *c1_d_out; c1_d_out = (creal_T *)ssGetOutputPortSignal(chartInstance->S, 1); c1_d_in = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c1_d_in); _SFD_SET_DATA_VALUE_PTR(1U, c1_d_out); } } } else { sf_debug_reset_current_state_configuration (_QPSK_Transmit_v5_w_FIFOMachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S) { if(ssIsFirstInitCond(S)) { /* do this only if simulation is starting */ if(!sim_mode_is_rtw_gen(S)) { { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart(_object_tracker_intensityMachineNumber_, 1, 1, 1, 2, 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(_object_tracker_intensityMachineNumber_,chartInstance.chartNumber,1); sf_debug_set_chart_event_thresholds(_object_tracker_intensityMachineNumber_, chartInstance.chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(1,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"DirectionCode",0); _SFD_SET_DATA_PROPS(0,1,1,0,SF_INT32,0,NULL,0,0,0,0.0,1.0,0,"BlobCount",0); _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,9,0,0,0,2,1); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,1004); _SFD_CV_INIT_EML_IF(0,0,305,330,350,377); _SFD_CV_INIT_EML_IF(0,1,379,405,-1,429); _SFD_CV_INIT_EML_IF(0,2,431,457,-1,480); _SFD_CV_INIT_EML_IF(0,3,482,500,655,703); _SFD_CV_INIT_EML_IF(0,4,655,684,-1,703); _SFD_CV_INIT_EML_IF(0,5,710,756,-1,-2); _SFD_CV_INIT_EML_IF(0,6,767,790,830,958); _SFD_CV_INIT_EML_IF(0,7,830,857,892,958); _SFD_CV_INIT_EML_IF(0,8,892,918,-1,-2); { static int condStart[] = {715,741}; static int condEnd[] = {737,755}; static int pfixExpr[] = {0,1,-2}; _SFD_CV_INIT_EML_MCDC(0,0,715,755,2,0,&(condStart[0]),&(condEnd[0]),3,&(pfixExpr[0])); } _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, c1_DirectionCode()); _SFD_SET_DATA_VALUE_PTR(0U, c1_BlobCount()); } } } else { sf_debug_reset_current_state_configuration(_object_tracker_intensityMachineNumber_,chartInstance.chartNumber,chartInstance.instanceNumber); } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_minimalist14MachineNumber_, 1, 1, 1, 3, 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(_minimalist14MachineNumber_, chartInstance.chartNumber); sf_debug_set_chart_disable_implicit_casting (_minimalist14MachineNumber_,chartInstance.chartNumber,1); sf_debug_set_chart_event_thresholds(_minimalist14MachineNumber_, chartInstance.chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,SF_UINT32,0,NULL,0,0,0,0.0,1.0,0,"numIter", 0,(MexFcnForType)c1_c_sf_marshall); _SFD_SET_DATA_PROPS(1,1,1,0,SF_UINT8,0,NULL,0,0,0,0.0,1.0,0,"value",0, (MexFcnForType)c1_sf_marshall); { unsigned int dimVector[1]; dimVector[0]= 37; _SFD_SET_DATA_PROPS(2,11,0,0,SF_UINT8,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,"buffer_receive_nav_mode",0,(MexFcnForType) c1_d_sf_marshall); } _SFD_STATE_INFO(0,0,0); _SFD_CH_SUBSTATE_COUNT(1); _SFD_CH_SUBSTATE_DECOMP(0); _SFD_CH_SUBSTATE_INDEX(0,0); _SFD_ST_SUBSTATE_COUNT(0,0); } _SFD_CV_INIT_CHART(1,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); _SFD_TRANS_COV_WTS(0,0,0,0,0); if (chartAlreadyPresent==0) { _SFD_TRANS_COV_MAPS(0, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL); } { uint32_T *c1_numIter; uint8_T *c1_value; c1_value = (uint8_T *)ssGetInputPortSignal(chartInstance.S, 1); c1_numIter = (uint32_T *)ssGetInputPortSignal(chartInstance.S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c1_numIter); _SFD_SET_DATA_VALUE_PTR(1U, c1_value); _SFD_SET_DATA_VALUE_PTR(2U, chartInstance.c1_buffer_receive_nav_mode_address); } } } else { sf_debug_reset_current_state_configuration(_minimalist14MachineNumber_, chartInstance.chartNumber,chartInstance.instanceNumber); } } }
/* Function: mdlInitializeSizes =========================================== * Abstract: * The sizes information is used by Simulink to determine the S-function * block's characteristics (number of inputs, outputs, states, etc.). */ static void mdlInitializeSizes(SimStruct *S) { /* Number of expected parameters */ ssSetNumSFcnParams(S, 0); /* * Set the number of pworks. */ ssSetNumPWork(S, 0); /* * Set the number of dworks. */ if (!ssSetNumDWork(S, 0)) return; /* * Set the number of input ports. */ if (!ssSetNumInputPorts(S, 1)) return; /* * Configure the input port 1 */ ssSetInputPortDataType(S, 0, SS_INT32); ssSetInputPortWidth(S, 0, 1); ssSetInputPortComplexSignal(S, 0, COMPLEX_NO); ssSetInputPortDirectFeedThrough(S, 0, 1); ssSetInputPortAcceptExprInRTW(S, 0, 1); ssSetInputPortOverWritable(S, 0, 1); ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL); ssSetInputPortRequiredContiguous(S, 0, 1); /* * Set the number of output ports. */ if (!ssSetNumOutputPorts(S, 1)) return; /* * Configure the output port 1 */ ssSetOutputPortDataType(S, 0, SS_INT32); ssSetOutputPortWidth(S, 0, 1); ssSetOutputPortComplexSignal(S, 0, COMPLEX_NO); ssSetOutputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL); ssSetOutputPortOutputExprInRTW(S, 0, 1); /* * Register reserved identifiers to avoid name conflict */ if (ssRTWGenIsCodeGen(S)) { /* * Register reserved identifier for StartFcnSpec */ ssRegMdlInfo(S, (char*)"createAdder", MDL_INFO_ID_RESERVED, 0, 0, (void*) ssGetPath(S)); /* * Register reserved identifier for OutputFcnSpec */ ssRegMdlInfo(S, (char*)"adderOutput", MDL_INFO_ID_RESERVED, 0, 0, (void*) ssGetPath(S)); /* * Register reserved identifier for TerminateFcnSpec */ ssRegMdlInfo(S, (char*)"deleteAdder", MDL_INFO_ID_RESERVED, 0, 0, (void*) ssGetPath(S)); /* * Register reserved identifier for wrappers */ if (ssRTWGenIsModelReferenceSimTarget(S)) { /* * Register reserved identifier for StartFcnSpec for SimulationTarget */ ssRegMdlInfo(S, (char*)"sldemo_sfun_adder_cpp_wrapper_start", MDL_INFO_ID_RESERVED, 0, 0, (void*) ssGetPath(S)); /* * Register reserved identifier for OutputFcnSpec for SimulationTarget */ ssRegMdlInfo(S, (char*)"sldemo_sfun_adder_cpp_wrapper_output", MDL_INFO_ID_RESERVED, 0, 0, (void*) ssGetPath(S)); /* * Register reserved identifier for TerminateFcnSpec for SimulationTarget */ ssRegMdlInfo(S, (char*)"sldemo_sfun_adder_cpp_wrapper_terminate", MDL_INFO_ID_RESERVED, 0, 0, (void*) ssGetPath(S)); } } /* * This S-function can be used in referenced model simulating in normal mode. */ ssSetModelReferenceNormalModeSupport(S, MDL_START_AND_MDL_PROCESS_PARAMS_OK); /* * Set the number of sample time. */ ssSetNumSampleTimes(S, 1); /* * All options have the form SS_OPTION_<name> and are documented in * matlabroot/simulink/include/simstruc.h. The options should be * bitwise or'd together as in * ssSetOptions(S, (SS_OPTION_name1 | SS_OPTION_name2)) */ ssSetOptions(S, SS_OPTION_CAN_BE_CALLED_CONDITIONALLY | SS_OPTION_EXCEPTION_FREE_CODE | SS_OPTION_WORKS_WITH_CODE_REUSE | SS_OPTION_SFUNCTION_INLINED_FOR_RTW | SS_OPTION_DISALLOW_CONSTANT_SAMPLE_TIME); }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc3_V2A1_2InstanceStruct *chartInstance; chartInstance = (SFc3_V2A1_2InstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (sfGlobalDebugInstanceStruct, _V2A1_2MachineNumber_, 3, 1, 1, 3, 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(_V2A1_2MachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (sfGlobalDebugInstanceStruct,_V2A1_2MachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, _V2A1_2MachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"delta"); _SFD_SET_DATA_PROPS(1,2,0,1,"x0"); _SFD_SET_DATA_PROPS(2,1,1,0,"hoehe"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,211); _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_b_sf_marshallOut,(MexInFcnForType)NULL); { unsigned int dimVector[1]; dimVector[0]= 2; _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c3_sf_marshallOut,(MexInFcnForType) c3_sf_marshallIn); } _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_b_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c3_delta; real_T *c3_hoehe; real_T (*c3_x0)[2]; c3_hoehe = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c3_x0 = (real_T (*)[2])ssGetOutputPortSignal(chartInstance->S, 1); c3_delta = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c3_delta); _SFD_SET_DATA_VALUE_PTR(1U, *c3_x0); _SFD_SET_DATA_VALUE_PTR(2U, c3_hoehe); } } } else { sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, _V2A1_2MachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc9_CusakisME4901arcs2InstanceStruct *chartInstance; chartInstance = (SFc9_CusakisME4901arcs2InstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (sfGlobalDebugInstanceStruct, _CusakisME4901arcs2MachineNumber_, 9, 1, 1, 5, 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(_CusakisME4901arcs2MachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (sfGlobalDebugInstanceStruct,_CusakisME4901arcs2MachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, _CusakisME4901arcs2MachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,2,0,1,"u"); _SFD_SET_DATA_PROPS(1,2,0,1,"but"); _SFD_SET_DATA_PROPS(2,1,1,0,"Axes"); _SFD_SET_DATA_PROPS(3,1,1,0,"Buttons"); _SFD_SET_DATA_PROPS(4,2,0,1,"j"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,10,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,732); _SFD_CV_INIT_EML_IF(0,1,0,176,190,212,391); _SFD_CV_INIT_EML_IF(0,1,1,212,229,261,391); _SFD_CV_INIT_EML_IF(0,1,2,261,280,304,391); _SFD_CV_INIT_EML_IF(0,1,3,304,322,349,391); _SFD_CV_INIT_EML_IF(0,1,4,393,409,415,468); _SFD_CV_INIT_EML_IF(0,1,5,420,436,447,464); _SFD_CV_INIT_EML_IF(0,1,6,470,486,519,728); _SFD_CV_INIT_EML_IF(0,1,7,519,539,572,728); _SFD_CV_INIT_EML_IF(0,1,8,572,592,625,728); _SFD_CV_INIT_EML_IF(0,1,9,625,645,678,728); _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); } { unsigned int dimVector[1]; dimVector[0]= 2; _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c9_c_sf_marshallOut,(MexInFcnForType) c9_c_sf_marshallIn); } { unsigned int dimVector[1]; dimVector[0]= 4; _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c9_b_sf_marshallOut,(MexInFcnForType) c9_b_sf_marshallIn); } { unsigned int dimVector[1]; dimVector[0]= 5; _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c9_e_sf_marshallOut,(MexInFcnForType)NULL); } { unsigned int dimVector[1]; dimVector[0]= 10; _SFD_SET_DATA_COMPILED_PROPS(3,SF_UINT8,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c9_d_sf_marshallOut,(MexInFcnForType)NULL); } _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c9_sf_marshallOut,(MexInFcnForType)c9_sf_marshallIn); { real_T *c9_j; real_T (*c9_u)[2]; real_T (*c9_but)[4]; real_T (*c9_Axes)[5]; boolean_T (*c9_Buttons)[10]; c9_j = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); c9_Buttons = (boolean_T (*)[10])ssGetInputPortSignal(chartInstance->S, 1); c9_Axes = (real_T (*)[5])ssGetInputPortSignal(chartInstance->S, 0); c9_but = (real_T (*)[4])ssGetOutputPortSignal(chartInstance->S, 2); c9_u = (real_T (*)[2])ssGetOutputPortSignal(chartInstance->S, 1); _SFD_SET_DATA_VALUE_PTR(0U, *c9_u); _SFD_SET_DATA_VALUE_PTR(1U, *c9_but); _SFD_SET_DATA_VALUE_PTR(2U, *c9_Axes); _SFD_SET_DATA_VALUE_PTR(3U, *c9_Buttons); _SFD_SET_DATA_VALUE_PTR(4U, c9_j); } } } else { sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, _CusakisME4901arcs2MachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc4_iC_3ph_MR2InstanceStruct *chartInstance; chartInstance = (SFc4_iC_3ph_MR2InstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_iC_3ph_MR2MachineNumber_, 4, 1, 1, 6, 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(_iC_3ph_MR2MachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting(_iC_3ph_MR2MachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_iC_3ph_MR2MachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,2,0,1,"up_a"); _SFD_SET_DATA_PROPS(1,1,1,0,"up_alpha"); _SFD_SET_DATA_PROPS(2,2,0,1,"up_b"); _SFD_SET_DATA_PROPS(3,2,0,1,"up_c"); _SFD_SET_DATA_PROPS(4,1,1,0,"up_beta"); _SFD_SET_DATA_PROPS(5,1,1,0,"up_0"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,390); _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_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c4_sf_marshallOut,(MexInFcnForType)c4_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c4_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c4_sf_marshallOut,(MexInFcnForType)c4_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c4_sf_marshallOut,(MexInFcnForType)c4_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c4_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c4_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c4_up_a; real_T *c4_up_alpha; real_T *c4_up_b; real_T *c4_up_c; real_T *c4_up_beta; real_T *c4_up_0; c4_up_0 = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c4_up_beta = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c4_up_c = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); c4_up_b = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); c4_up_alpha = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); c4_up_a = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); _SFD_SET_DATA_VALUE_PTR(0U, c4_up_a); _SFD_SET_DATA_VALUE_PTR(1U, c4_up_alpha); _SFD_SET_DATA_VALUE_PTR(2U, c4_up_b); _SFD_SET_DATA_VALUE_PTR(3U, c4_up_c); _SFD_SET_DATA_VALUE_PTR(4U, c4_up_beta); _SFD_SET_DATA_VALUE_PTR(5U, c4_up_0); } } } else { sf_debug_reset_current_state_configuration(_iC_3ph_MR2MachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc61_heart_modelInstanceStruct *chartInstance; chartInstance = (SFc61_heart_modelInstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_heart_modelMachineNumber_, 61, 1, 4, 1, 3, 0, 0, 0, 0, &(chartInstance->chartNumber), &(chartInstance->instanceNumber), ssGetPath(S), (void *)S); if (chartAlreadyPresent==0) { /* this is the first instance */ init_script_number_translation(_heart_modelMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting(_heart_modelMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_heart_modelMachineNumber_, chartInstance->chartNumber, 3, 3, 3); _SFD_SET_DATA_PROPS(0,1,1,0,"v"); _SFD_EVENT_SCOPE(0,2); _SFD_EVENT_SCOPE(1,2); _SFD_EVENT_SCOPE(2,2); _SFD_STATE_INFO(0,0,0); _SFD_CH_SUBSTATE_COUNT(1); _SFD_CH_SUBSTATE_DECOMP(0); _SFD_CH_SUBSTATE_INDEX(0,0); _SFD_ST_SUBSTATE_COUNT(0,0); } _SFD_CV_INIT_CHART(1,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); { static unsigned int sStartGuardMap[] = { 1 }; static unsigned int sEndGuardMap[] = { 7 }; static int sPostFixPredicateTree[] = { 0 }; _SFD_CV_INIT_TRANS(3,1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),1, &(sPostFixPredicateTree[0])); } { static unsigned int sStartGuardMap[] = { 1 }; static unsigned int sEndGuardMap[] = { 5 }; static int sPostFixPredicateTree[] = { 0 }; _SFD_CV_INIT_TRANS(1,1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),1, &(sPostFixPredicateTree[0])); } { static unsigned int sStartGuardMap[] = { 1, 8 }; static unsigned int sEndGuardMap[] = { 6, 13 }; static int sPostFixPredicateTree[] = { 0, 1, -3 }; _SFD_CV_INIT_TRANS(2,2,&(sStartGuardMap[0]),&(sEndGuardMap[0]),3, &(sPostFixPredicateTree[0])); } _SFD_TRANS_COV_WTS(0,0,0,0,0); if (chartAlreadyPresent==0) { _SFD_TRANS_COV_MAPS(0, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL); } _SFD_TRANS_COV_WTS(3,0,1,0,1); if (chartAlreadyPresent==0) { static unsigned int sStartGuardMap[] = { 1 }; static unsigned int sEndGuardMap[] = { 7 }; _SFD_TRANS_COV_MAPS(3, 0,NULL,NULL, 1,&(sStartGuardMap[0]),&(sEndGuardMap[0]), 0,NULL,NULL, 1,NULL,NULL); } _SFD_TRANS_COV_WTS(1,0,1,0,1); if (chartAlreadyPresent==0) { static unsigned int sStartGuardMap[] = { 1 }; static unsigned int sEndGuardMap[] = { 5 }; _SFD_TRANS_COV_MAPS(1, 0,NULL,NULL, 1,&(sStartGuardMap[0]),&(sEndGuardMap[0]), 0,NULL,NULL, 1,NULL,NULL); } _SFD_TRANS_COV_WTS(2,0,2,0,1); if (chartAlreadyPresent==0) { static unsigned int sStartGuardMap[] = { 1, 8 }; static unsigned int sEndGuardMap[] = { 6, 13 }; _SFD_TRANS_COV_MAPS(2, 0,NULL,NULL, 2,&(sStartGuardMap[0]),&(sEndGuardMap[0]), 0,NULL,NULL, 1,NULL,NULL); } _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c61_d_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c61_v; c61_v = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c61_v); } } } else { sf_debug_reset_current_state_configuration(_heart_modelMachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
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 (_Pedal_Interpretation_exeMachineNumber_, 7, 6, 7, 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(_Pedal_Interpretation_exeMachineNumber_, chartInstance.chartNumber); sf_debug_set_chart_disable_implicit_casting (_Pedal_Interpretation_exeMachineNumber_,chartInstance.chartNumber,1); sf_debug_set_chart_event_thresholds (_Pedal_Interpretation_exeMachineNumber_, chartInstance.chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0, "Activate",0,NULL); _SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"TDPre",0, NULL); _SFD_STATE_INFO(0,0,0); _SFD_STATE_INFO(1,0,0); _SFD_STATE_INFO(2,0,0); _SFD_STATE_INFO(3,1,0); _SFD_STATE_INFO(4,0,0); _SFD_STATE_INFO(5,0,0); _SFD_CH_SUBSTATE_COUNT(3); _SFD_CH_SUBSTATE_DECOMP(0); _SFD_CH_SUBSTATE_INDEX(0,0); _SFD_CH_SUBSTATE_INDEX(1,4); _SFD_CH_SUBSTATE_INDEX(2,5); _SFD_ST_SUBSTATE_COUNT(0,3); _SFD_ST_SUBSTATE_INDEX(0,0,1); _SFD_ST_SUBSTATE_INDEX(0,1,2); _SFD_ST_SUBSTATE_INDEX(0,2,3); _SFD_ST_SUBSTATE_COUNT(1,0); _SFD_ST_SUBSTATE_COUNT(2,0); _SFD_ST_SUBSTATE_COUNT(3,0); _SFD_ST_SUBSTATE_COUNT(4,0); _SFD_ST_SUBSTATE_COUNT(5,0); } _SFD_CV_INIT_CHART(3,1,0,0); { _SFD_CV_INIT_STATE(0,3,1,0,0,0,NULL,NULL); } { _SFD_CV_INIT_STATE(1,0,0,0,0,0,NULL,NULL); } { _SFD_CV_INIT_STATE(2,0,0,0,0,0,NULL,NULL); } { _SFD_CV_INIT_STATE(3,0,0,0,0,0,NULL,NULL); } { _SFD_CV_INIT_STATE(4,0,0,0,0,0,NULL,NULL); } { _SFD_CV_INIT_STATE(5,0,0,0,0,0,NULL,NULL); } { static unsigned int sStartGuardMap[] = { 10, 0 }; static unsigned int sEndGuardMap[] = { 14, 15 }; static int sPostFixPredicateTree[] = { 0, 1, -3 }; _SFD_CV_INIT_TRANS(2,2,&(sStartGuardMap[0]),&(sEndGuardMap[0]),3, &(sPostFixPredicateTree[0])); } _SFD_CV_INIT_TRANS(5,0,NULL,NULL,0,NULL); { static unsigned int sStartGuardMap[] = { 10, 0 }; static unsigned int sEndGuardMap[] = { 14, 15 }; static int sPostFixPredicateTree[] = { 0, 1, -3 }; _SFD_CV_INIT_TRANS(3,2,&(sStartGuardMap[0]),&(sEndGuardMap[0]),3, &(sPostFixPredicateTree[0])); } { static unsigned int sStartGuardMap[] = { 11, 0 }; static unsigned int sEndGuardMap[] = { 15, 16 }; static int sPostFixPredicateTree[] = { 0, 1, -3 }; _SFD_CV_INIT_TRANS(4,2,&(sStartGuardMap[0]),&(sEndGuardMap[0]),3, &(sPostFixPredicateTree[0])); } _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL); _SFD_CV_INIT_TRANS(1,0,NULL,NULL,0,NULL); { static unsigned int sStartGuardMap[] = { 11, 0 }; static unsigned int sEndGuardMap[] = { 15, 16 }; static int sPostFixPredicateTree[] = { 0, 1, -3 }; _SFD_CV_INIT_TRANS(6,2,&(sStartGuardMap[0]),&(sEndGuardMap[0]),3, &(sPostFixPredicateTree[0])); } _SFD_TRANS_COV_WTS(2,0,2,0,0); if (chartAlreadyPresent==0) { static unsigned int sStartGuardMap[] = { 10, 0 }; static unsigned int sEndGuardMap[] = { 14, 15 }; _SFD_TRANS_COV_MAPS(2, 0,NULL,NULL, 2,&(sStartGuardMap[0]),&(sEndGuardMap[0]), 0,NULL,NULL, 0,NULL,NULL); } _SFD_TRANS_COV_WTS(5,0,0,0,0); if (chartAlreadyPresent==0) { _SFD_TRANS_COV_MAPS(5, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL); } _SFD_TRANS_COV_WTS(3,0,2,0,0); if (chartAlreadyPresent==0) { static unsigned int sStartGuardMap[] = { 10, 0 }; static unsigned int sEndGuardMap[] = { 14, 15 }; _SFD_TRANS_COV_MAPS(3, 0,NULL,NULL, 2,&(sStartGuardMap[0]),&(sEndGuardMap[0]), 0,NULL,NULL, 0,NULL,NULL); } _SFD_TRANS_COV_WTS(4,0,2,0,0); if (chartAlreadyPresent==0) { static unsigned int sStartGuardMap[] = { 11, 0 }; static unsigned int sEndGuardMap[] = { 15, 16 }; _SFD_TRANS_COV_MAPS(4, 0,NULL,NULL, 2,&(sStartGuardMap[0]),&(sEndGuardMap[0]), 0,NULL,NULL, 0,NULL,NULL); } _SFD_TRANS_COV_WTS(0,0,0,0,0); if (chartAlreadyPresent==0) { _SFD_TRANS_COV_MAPS(0, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL); } _SFD_TRANS_COV_WTS(1,0,0,0,0); if (chartAlreadyPresent==0) { _SFD_TRANS_COV_MAPS(1, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL, 0,NULL,NULL); } _SFD_TRANS_COV_WTS(6,0,2,0,0); if (chartAlreadyPresent==0) { static unsigned int sStartGuardMap[] = { 11, 0 }; static unsigned int sEndGuardMap[] = { 15, 16 }; _SFD_TRANS_COV_MAPS(6, 0,NULL,NULL, 2,&(sStartGuardMap[0]),&(sEndGuardMap[0]), 0,NULL,NULL, 0,NULL,NULL); } { real_T *c7_Activate; real_T *c7_TDPre; c7_TDPre = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1); c7_Activate = (real_T *)ssGetInputPortSignal(chartInstance.S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c7_Activate); _SFD_SET_DATA_VALUE_PTR(1U, c7_TDPre); } } } } else { sf_debug_reset_current_state_configuration (_Pedal_Interpretation_exeMachineNumber_,chartInstance.chartNumber, chartInstance.instanceNumber); } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc1_a3InstanceStruct *chartInstance; chartInstance = (SFc1_a3InstanceStruct *) ((ChartInfoStruct *)(ssGetUserData (S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (sfGlobalDebugInstanceStruct, _a3MachineNumber_, 1, 1, 1, 8, 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(_a3MachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (sfGlobalDebugInstanceStruct,_a3MachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, _a3MachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"c"); _SFD_SET_DATA_PROPS(1,1,1,0,"d"); _SFD_SET_DATA_PROPS(2,1,1,0,"xp1"); _SFD_SET_DATA_PROPS(3,1,1,0,"xp2"); _SFD_SET_DATA_PROPS(4,1,1,0,"m"); _SFD_SET_DATA_PROPS(5,1,1,0,"u"); _SFD_SET_DATA_PROPS(6,2,0,1,"xpp"); _SFD_SET_DATA_PROPS(7,1,1,0,"x"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,95); _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(6,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)c1_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(7,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c1_c; real_T *c1_d; real_T *c1_xp1; real_T *c1_xp2; real_T *c1_m; real_T *c1_u; real_T *c1_xpp; real_T *c1_x; c1_x = (real_T *)ssGetInputPortSignal(chartInstance->S, 6); c1_xpp = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c1_u = (real_T *)ssGetInputPortSignal(chartInstance->S, 5); c1_m = (real_T *)ssGetInputPortSignal(chartInstance->S, 4); c1_xp2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 3); c1_xp1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c1_d = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c1_c = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c1_c); _SFD_SET_DATA_VALUE_PTR(1U, c1_d); _SFD_SET_DATA_VALUE_PTR(2U, c1_xp1); _SFD_SET_DATA_VALUE_PTR(3U, c1_xp2); _SFD_SET_DATA_VALUE_PTR(4U, c1_m); _SFD_SET_DATA_VALUE_PTR(5U, c1_u); _SFD_SET_DATA_VALUE_PTR(6U, c1_xpp); _SFD_SET_DATA_VALUE_PTR(7U, c1_x); } } } else { sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, _a3MachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S) { if(ssIsFirstInitCond(S)) { /* do this only if simulation is starting */ if(!sim_mode_is_rtw_gen(S)) { { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart(_function_call_testMachineNumber_, 2, 1, 1, 3, 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(_function_call_testMachineNumber_,chartInstance.chartNumber,1); sf_debug_set_chart_event_thresholds(_function_call_testMachineNumber_, chartInstance.chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(2,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"a",0); _SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"y",0); _SFD_SET_DATA_PROPS(0,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"b",0); _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,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,158); _SFD_CV_INIT_EML_IF(0,0,124,135,143,158); _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, c2_a()); _SFD_SET_DATA_VALUE_PTR(1U, c2_y()); _SFD_SET_DATA_VALUE_PTR(0U, c2_b()); } } } else { sf_debug_reset_current_state_configuration(_function_call_testMachineNumber_,chartInstance.chartNumber,chartInstance.instanceNumber); } }
/* Function: mdlInitializeSizes =========================================== * Abstract: * The sizes information is used by Simulink to determine the S-function * block's characteristics (number of inputs, outputs, states, etc.). */ static void mdlInitializeSizes(SimStruct *S) { /* Number of expected parameters */ ssSetNumSFcnParams(S, 0); /* * Set the number of pworks. */ ssSetNumPWork(S, 0); /* * Set the number of dworks. */ if (!ssSetNumDWork(S, 0)) return; /* * Set the number of input ports. */ if (!ssSetNumInputPorts(S, 0)) return; /* * Set the number of output ports. */ if (!ssSetNumOutputPorts(S, 1)) return; /* * Configure the output port 1 */ ssSetOutputPortDataType(S, 0, SS_SINGLE); ssSetOutputPortWidth(S, 0, 1); ssSetOutputPortComplexSignal(S, 0, COMPLEX_NO); ssSetOutputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL); ssSetOutputPortOutputExprInRTW(S, 0, 1); /* * Register reserved identifiers to avoid name conflict */ if (ssRTWGenIsCodeGen(S) || ssGetSimMode(S)==SS_SIMMODE_EXTERNAL) { /* * Register reserved identifier for StartFcnSpec */ ssRegMdlInfo(S, "Magneto_Initialization", MDL_INFO_ID_RESERVED, 0, 0, ssGetPath(S)); /* * Register reserved identifier for OutputFcnSpec */ ssRegMdlInfo(S, "Magneto_Get_X", MDL_INFO_ID_RESERVED, 0, 0, ssGetPath(S)); /* * Register reserved identifier for wrappers */ if (ssRTWGenIsModelReferenceSimTarget(S)) { /* * Register reserved identifier for StartFcnSpec for SimulationTarget */ ssRegMdlInfo(S, "ARDrone_Magneto_X_wrapper_start", MDL_INFO_ID_RESERVED, 0, 0, ssGetPath(S)); /* * Register reserved identifier for OutputFcnSpec for SimulationTarget */ ssRegMdlInfo(S, "ARDrone_Magneto_X_wrapper_output", MDL_INFO_ID_RESERVED, 0, 0, ssGetPath(S)); } } /* * This S-function can be used in referenced model simulating in normal mode. */ ssSetModelReferenceNormalModeSupport(S, MDL_START_AND_MDL_PROCESS_PARAMS_OK); /* * Set the number of sample time. */ ssSetNumSampleTimes(S, 1); /* * All options have the form SS_OPTION_<name> and are documented in * matlabroot/simulink/include/simstruc.h. The options should be * bitwise or'd together as in * ssSetOptions(S, (SS_OPTION_name1 | SS_OPTION_name2)) */ ssSetOptions(S, SS_OPTION_USE_TLC_WITH_ACCELERATOR | SS_OPTION_CAN_BE_CALLED_CONDITIONALLY | SS_OPTION_EXCEPTION_FREE_CODE | SS_OPTION_WORKS_WITH_CODE_REUSE | SS_OPTION_SFUNCTION_INLINED_FOR_RTW | SS_OPTION_DISALLOW_CONSTANT_SAMPLE_TIME); }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc1_mainInstanceStruct *chartInstance; chartInstance = (SFc1_mainInstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (sfGlobalDebugInstanceStruct, _mainMachineNumber_, 1, 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(_mainMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (sfGlobalDebugInstanceStruct,_mainMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct, _mainMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"time"); _SFD_SET_DATA_PROPS(1,2,0,1,"y"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,3,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,179); _SFD_CV_INIT_EML_IF(0,1,0,33,46,69,175); _SFD_CV_INIT_EML_IF(0,1,1,69,85,106,175); _SFD_CV_INIT_EML_IF(0,1,2,106,123,145,175); _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)c1_sf_marshallIn); { real_T *c1_time; real_T *c1_y; c1_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c1_time = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c1_time); _SFD_SET_DATA_VALUE_PTR(1U, c1_y); } } } else { sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct, _mainMachineNumber_,chartInstance->chartNumber, chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_adcs_v15_integral_Power_no_charge_in_detumbMachineNumber_, 6, 1, 1, 3, 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 (_adcs_v15_integral_Power_no_charge_in_detumbMachineNumber_, chartInstance.chartNumber); sf_debug_set_chart_disable_implicit_casting (_adcs_v15_integral_Power_no_charge_in_detumbMachineNumber_, chartInstance.chartNumber,1); sf_debug_set_chart_event_thresholds (_adcs_v15_integral_Power_no_charge_in_detumbMachineNumber_, chartInstance.chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"a",0, (MexFcnForType)c6_sf_marshall); _SFD_SET_DATA_PROPS(1,2,0,1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"y",0, (MexFcnForType)c6_sf_marshall); _SFD_SET_DATA_PROPS(2,1,1,0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,"b",0, (MexFcnForType)c6_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,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,67); _SFD_CV_INIT_EML_IF(0,0,48,54,-1,67); _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); } { real_T *c6_a; real_T *c6_y; real_T *c6_b; c6_y = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1); c6_a = (real_T *)ssGetInputPortSignal(chartInstance.S, 0); c6_b = (real_T *)ssGetInputPortSignal(chartInstance.S, 1); _SFD_SET_DATA_VALUE_PTR(0U, c6_a); _SFD_SET_DATA_VALUE_PTR(1U, c6_y); _SFD_SET_DATA_VALUE_PTR(2U, c6_b); } } } else { sf_debug_reset_current_state_configuration (_adcs_v15_integral_Power_no_charge_in_detumbMachineNumber_, chartInstance.chartNumber,chartInstance.instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc11_Batman_CodeInstanceStruct *chartInstance; chartInstance = (SFc11_Batman_CodeInstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_Batman_CodeMachineNumber_, 11, 1, 1, 3, 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(_Batman_CodeMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting(_Batman_CodeMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_Batman_CodeMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"msg"); _SFD_SET_DATA_PROPS(1,1,1,0,"cell_temperatures_in"); _SFD_SET_DATA_PROPS(2,2,0,1,"cell_temperatures_out"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,529); _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); } { unsigned int dimVector[1]; dimVector[0]= 2; _SFD_SET_DATA_COMPILED_PROPS(0,SF_UINT32,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c11_b_sf_marshallOut,(MexInFcnForType)NULL); } { unsigned int dimVector[1]; dimVector[0]= 12; _SFD_SET_DATA_COMPILED_PROPS(1,SF_UINT16,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c11_sf_marshallOut,(MexInFcnForType)NULL); } { unsigned int dimVector[1]; dimVector[0]= 12; _SFD_SET_DATA_COMPILED_PROPS(2,SF_UINT16,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c11_sf_marshallOut,(MexInFcnForType) c11_sf_marshallIn); } { uint32_T (*c11_msg)[2]; uint16_T (*c11_cell_temperatures_in)[12]; uint16_T (*c11_cell_temperatures_out)[12]; c11_cell_temperatures_out = (uint16_T (*)[12])ssGetOutputPortSignal (chartInstance->S, 1); c11_cell_temperatures_in = (uint16_T (*)[12])ssGetInputPortSignal (chartInstance->S, 1); c11_msg = (uint32_T (*)[2])ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, *c11_msg); _SFD_SET_DATA_VALUE_PTR(1U, *c11_cell_temperatures_in); _SFD_SET_DATA_VALUE_PTR(2U, *c11_cell_temperatures_out); } } } else { sf_debug_reset_current_state_configuration(_Batman_CodeMachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc3_canudas_goal3InstanceStruct *chartInstance; chartInstance = (SFc3_canudas_goal3InstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart (_canudas_goal3MachineNumber_, 3, 1, 1, 8, 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(_canudas_goal3MachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting (_canudas_goal3MachineNumber_,chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_canudas_goal3MachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,2,0,1,"w"); _SFD_SET_DATA_PROPS(1,1,1,0,"z"); _SFD_SET_DATA_PROPS(2,1,1,0,"thetad"); _SFD_SET_DATA_PROPS(3,1,1,0,"r"); _SFD_SET_DATA_PROPS(4,2,0,1,"v"); _SFD_SET_DATA_PROPS(5,1,1,0,"qe"); _SFD_SET_DATA_PROPS(6,1,1,0,"k1"); _SFD_SET_DATA_PROPS(7,1,1,0,"k2"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,326); _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_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_sf_marshallOut,(MexInFcnForType)c3_sf_marshallIn); { unsigned int dimVector[1]; dimVector[0]= 2; _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c3_c_sf_marshallOut,(MexInFcnForType)NULL); } _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_sf_marshallOut,(MexInFcnForType)c3_sf_marshallIn); { unsigned int dimVector[1]; dimVector[0]= 3; _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0, 1.0,0,0,(MexFcnForType)c3_b_sf_marshallOut,(MexInFcnForType)NULL); } _SFD_SET_DATA_COMPILED_PROPS(6,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(7,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c3_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c3_w; real_T *c3_thetad; real_T *c3_r; real_T *c3_v; real_T *c3_k1; real_T *c3_k2; real_T (*c3_z)[2]; real_T (*c3_qe)[3]; c3_k2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 5); c3_k1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 4); c3_qe = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 3); c3_v = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); c3_r = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c3_thetad = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c3_z = (real_T (*)[2])ssGetInputPortSignal(chartInstance->S, 0); c3_w = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); _SFD_SET_DATA_VALUE_PTR(0U, c3_w); _SFD_SET_DATA_VALUE_PTR(1U, *c3_z); _SFD_SET_DATA_VALUE_PTR(2U, c3_thetad); _SFD_SET_DATA_VALUE_PTR(3U, c3_r); _SFD_SET_DATA_VALUE_PTR(4U, c3_v); _SFD_SET_DATA_VALUE_PTR(5U, *c3_qe); _SFD_SET_DATA_VALUE_PTR(6U, c3_k1); _SFD_SET_DATA_VALUE_PTR(7U, c3_k2); } } } else { sf_debug_reset_current_state_configuration(_canudas_goal3MachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
static void chart_debug_initialization(SimStruct *S, unsigned int fullDebuggerInitialization) { if (!sim_mode_is_rtw_gen(S)) { SFc9_ArrayInstanceStruct *chartInstance; chartInstance = (SFc9_ArrayInstanceStruct *) ((ChartInfoStruct *) (ssGetUserData(S)))->chartInstance; if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) { /* do this only if simulation is starting */ { unsigned int chartAlreadyPresent; chartAlreadyPresent = sf_debug_initialize_chart(_ArrayMachineNumber_, 9, 1, 1, 4, 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(_ArrayMachineNumber_, chartInstance->chartNumber); sf_debug_set_chart_disable_implicit_casting(_ArrayMachineNumber_, chartInstance->chartNumber,1); sf_debug_set_chart_event_thresholds(_ArrayMachineNumber_, chartInstance->chartNumber, 0, 0, 0); _SFD_SET_DATA_PROPS(0,1,1,0,"V"); _SFD_SET_DATA_PROPS(1,2,0,1,"I"); _SFD_SET_DATA_PROPS(2,1,1,0,"Radiacion"); _SFD_SET_DATA_PROPS(3,1,1,0,"Temp"); _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 MATLAB Function Model Coverage */ _SFD_CV_INIT_EML(0,1,1,0,0,0,1,0,0,0); _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,947); _SFD_CV_INIT_EML_FOR(0,1,0,777,788,942); _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_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c9_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c9_sf_marshallOut,(MexInFcnForType)c9_sf_marshallIn); _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c9_sf_marshallOut,(MexInFcnForType)NULL); _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0, (MexFcnForType)c9_sf_marshallOut,(MexInFcnForType)NULL); { real_T *c9_V; real_T *c9_I; real_T *c9_Radiacion; real_T *c9_Temp; c9_Temp = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c9_Radiacion = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c9_I = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c9_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SET_DATA_VALUE_PTR(0U, c9_V); _SFD_SET_DATA_VALUE_PTR(1U, c9_I); _SFD_SET_DATA_VALUE_PTR(2U, c9_Radiacion); _SFD_SET_DATA_VALUE_PTR(3U, c9_Temp); } } } else { sf_debug_reset_current_state_configuration(_ArrayMachineNumber_, chartInstance->chartNumber,chartInstance->instanceNumber); } } }
/* Function: mdlStart ======================================================= * Abstract: * This function is called once at start of model execution. If you * have states that should be initialized once, this is the place * to do it. */ static void mdlStart(SimStruct *S) { //ROS stuff int argc = 0; char** argv = NULL; ros::init(argc, argv, "MATLAB_ros_sub"); spinner = new ros::AsyncSpinner(2); spinner->start(); ros::NodeHandle n; sub = n.subscribe("/cmu/robot_pose", 1000, robotPoseCallback); /* Bus Information */ slDataTypeAccess *dta = ssGetDataTypeAccess(S); const char *bpath = ssGetPath(S); DTypeId SL_Bus_cpg_optimized_geometry_msgs_PointId = ssGetDataTypeId(S, "SL_Bus_cpg_optimized_geometry_msgs_Point"); DTypeId SL_Bus_cpg_optimized_geometry_msgs_PoseId = ssGetDataTypeId(S, "SL_Bus_cpg_optimized_geometry_msgs_Pose"); DTypeId SL_Bus_cpg_optimized_geometry_msgs_QuaternionId = ssGetDataTypeId(S, "SL_Bus_cpg_optimized_geometry_msgs_Quaternion"); DTypeId SL_Bus_cpg_optimized_geometry_msgs_Vector3Id = ssGetDataTypeId(S, "SL_Bus_cpg_optimized_geometry_msgs_Vector3"); DTypeId SL_ROS_SUB_MSGId = ssGetDataTypeId(S, "SL_ROS_SUB_MSG"); int_T *busInfo = (int_T *)malloc(46 * sizeof(int_T)); if (busInfo == NULL) { ssSetErrorStatus(S, "Memory allocation failure"); return; } /* Calculate offsets of all primitive elements of the bus */ busInfo[0] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 2); busInfo[1] = 30 * dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[2] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 3); busInfo[3] = 3 * dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[4] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 4); busInfo[5] = 2 * dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[6] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PointId, 0); busInfo[7] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[8] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PointId, 1); busInfo[9] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[10] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PointId, 2); busInfo[11] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[12] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 0); busInfo[13] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[14] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 1); busInfo[15] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[16] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 2); busInfo[17] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[18] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 3); busInfo[19] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[20] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_Vector3Id, 0); busInfo[21] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[22] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_Vector3Id, 1); busInfo[23] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[24] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_Vector3Id, 2); busInfo[25] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[26] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 5) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_Vector3Id, 0); busInfo[27] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[28] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 5) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_Vector3Id, 1); busInfo[29] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[30] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 5) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_Vector3Id, 2); busInfo[31] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[32] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 6) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PointId, 0); busInfo[33] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[34] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 6) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PointId, 1); busInfo[35] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[36] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 6) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 0) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PointId, 2); busInfo[37] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[38] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 6) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 0); busInfo[39] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[40] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 6) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 1); busInfo[41] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[42] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 6) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 2); busInfo[43] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); busInfo[44] = dtaGetDataTypeElementOffset(dta, bpath, SL_ROS_SUB_MSGId, 6) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_PoseId, 1) + dtaGetDataTypeElementOffset(dta, bpath, SL_Bus_cpg_optimized_geometry_msgs_QuaternionId, 3); busInfo[45] = dtaGetDataTypeSize(dta, bpath, ssGetDataTypeId(S, "double")); ssSetUserData(S, busInfo); }