/* Function Definitions */ static void initialize_c9_QPSK_Transmit_v12d (SFc9_QPSK_Transmit_v12dInstanceStruct *chartInstance) { chartInstance->c9_sfEvent = CALL_EVENT; _sfTime_ = (real_T)ssGetT(chartInstance->S); chartInstance->c9_is_active_c9_QPSK_Transmit_v12d = 0U; sf_mex_assign(&c9_c_eml_mx, sf_mex_call_debug("fimath", 1U, 42U, 15, "RoundMode", 15, "nearest", 15, "RoundingMethod", 15, "Nearest", 15, "OverflowMode", 15, "saturate", 15, "OverflowAction", 15, "Saturate", 15, "ProductMode", 15, "FullPrecision", 15, "ProductWordLength", 6, 32.0, 15, "MaxProductWordLength", 6, 65535.0, 15, "ProductFractionLength", 6, 30.0, 15, "ProductFixedExponent", 6, -30.0, 15, "ProductSlope", 6, 9.3132257461547852E-10, 15, "ProductSlopeAdjustmentFactor", 6, 1.0, 15, "ProductBias", 6, 0.0, 15, "SumMode", 15, "FullPrecision", 15, "SumWordLength", 6, 32.0, 15, "MaxSumWordLength", 6, 65535.0, 15, "SumFractionLength", 6, 30.0, 15, "SumFixedExponent", 6, -30.0, 15, "SumSlope", 6, 9.3132257461547852E-10, 15, "SumSlopeAdjustmentFactor", 6, 1.0, 15, "SumBias", 6, 0.0, 15, "CastBeforeSum", 3, TRUE), TRUE); sf_mex_assign(&c9_b_eml_mx, sf_mex_call_debug("numerictype", 1U, 10U, 15, "WordLength", 6, 12.0, 15, "FractionLength", 6, 11.0, 15, "BinaryPoint", 6, 11.0, 15, "Slope", 6, 0.00048828125, 15, "FixedExponent", 6, -11.0), TRUE); sf_mex_assign(&c9_eml_mx, sf_mex_call_debug("fimath", 1U, 42U, 15, "RoundMode", 15, "floor", 15, "RoundingMethod", 15, "Floor", 15, "OverflowMode", 15, "wrap", 15, "OverflowAction", 15, "Wrap", 15, "ProductMode", 15, "FullPrecision", 15, "ProductWordLength", 6, 32.0, 15, "MaxProductWordLength", 6, 128.0, 15, "ProductFractionLength", 6, 30.0, 15, "ProductFixedExponent", 6, -30.0, 15, "ProductSlope", 6, 9.3132257461547852E-10, 15, "ProductSlopeAdjustmentFactor", 6, 1.0, 15, "ProductBias", 6, 0.0, 15, "SumMode", 15, "FullPrecision", 15, "SumWordLength", 6, 32.0, 15, "MaxSumWordLength", 6, 128.0, 15, "SumFractionLength", 6, 30.0, 15, "SumFixedExponent", 6, -30.0, 15, "SumSlope", 6, 9.3132257461547852E-10, 15, "SumSlopeAdjustmentFactor", 6, 1.0, 15, "SumBias", 6, 0.0, 15, "CastBeforeSum", 3, TRUE), TRUE); }
static void c2_eml_error (SFc2_MigrationOWBG_Proto4_1DLinear2DNonLinearInstanceStruct *chartInstance) { int32_T c2_i1; static char_T c2_cv0[30] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'E', 'l', 'F', 'u', 'n', 'D', 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' }; char_T c2_u[30]; const mxArray *c2_y = NULL; int32_T c2_i2; static char_T c2_cv1[4] = { 's', 'q', 'r', 't' }; char_T c2_b_u[4]; const mxArray *c2_b_y = NULL; for (c2_i1 = 0; c2_i1 < 30; c2_i1++) { c2_u[c2_i1] = c2_cv0[c2_i1]; } c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", c2_u, 10, 0U, 1U, 0U, 2, 1, 30), FALSE); for (c2_i2 = 0; c2_i2 < 4; c2_i2++) { c2_b_u[c2_i2] = c2_cv1[c2_i2]; } c2_b_y = NULL; sf_mex_assign(&c2_b_y, sf_mex_create("y", c2_b_u, 10, 0U, 1U, 0U, 2, 1, 4), FALSE); sf_mex_call_debug("error", 0U, 1U, 14, sf_mex_call_debug("message", 1U, 2U, 14, c2_y, 14, c2_b_y)); }
static void c4_eml_error(SFc4_MigrationBGOW_Proto6_MultiSwarmInstanceStruct *chartInstance) { int32_T c4_i1; static char_T c4_cv0[30] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'E', 'l', 'F', 'u', 'n', 'D', 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' }; char_T c4_u[30]; const mxArray *c4_y = NULL; int32_T c4_i2; static char_T c4_cv1[4] = { 's', 'q', 'r', 't' }; char_T c4_b_u[4]; const mxArray *c4_b_y = NULL; for (c4_i1 = 0; c4_i1 < 30; c4_i1++) { c4_u[c4_i1] = c4_cv0[c4_i1]; } c4_y = NULL; sf_mex_assign(&c4_y, sf_mex_create("y", c4_u, 10, 0U, 1U, 0U, 2, 1, 30), FALSE); for (c4_i2 = 0; c4_i2 < 4; c4_i2++) { c4_b_u[c4_i2] = c4_cv1[c4_i2]; } c4_b_y = NULL; sf_mex_assign(&c4_b_y, sf_mex_create("y", c4_b_u, 10, 0U, 1U, 0U, 2, 1, 4), FALSE); sf_mex_call_debug("error", 0U, 1U, 14, sf_mex_call_debug("message", 1U, 2U, 14, c4_y, 14, c4_b_y)); }
static void c7_eml_error(SFc7_WEC_Sim_DriverInstanceStruct *chartInstance) { int32_T c7_i14; static char_T c7_cv0[30] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'E', 'l', 'F', 'u', 'n', 'D', 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' }; char_T c7_u[30]; const mxArray *c7_y = NULL; int32_T c7_i15; static char_T c7_cv1[4] = { 'a', 's', 'i', 'n' }; char_T c7_b_u[4]; const mxArray *c7_b_y = NULL; for (c7_i14 = 0; c7_i14 < 30; c7_i14++) { c7_u[c7_i14] = c7_cv0[c7_i14]; } c7_y = NULL; sf_mex_assign(&c7_y, sf_mex_create("y", c7_u, 10, 0U, 1U, 0U, 2, 1, 30), FALSE); for (c7_i15 = 0; c7_i15 < 4; c7_i15++) { c7_b_u[c7_i15] = c7_cv1[c7_i15]; } c7_b_y = NULL; sf_mex_assign(&c7_b_y, sf_mex_create("y", c7_b_u, 10, 0U, 1U, 0U, 2, 1, 4), FALSE); sf_mex_call_debug("error", 0U, 1U, 14, sf_mex_call_debug("message", 1U, 2U, 14, c7_y, 14, c7_b_y)); }
static void c7_eml_error(void) { int32_T c7_i27; static char_T c7_cv0[77] = { 'D', 'o', 'm', 'a', 'i', 'n', ' ', 'e', 'r', 'r', 'o', 'r', '.', ' ', 'T', 'o', ' ', 'c', 'o', 'm', 'p' , 'u', 't', 'e', ' ', 'c', 'o', 'm', 'p', 'l', 'e', 'x', ' ', 'r', 'e', 's', 'u', 'l', 't', 's', ' ', 'f', 'r', 'o', 'm', ' ', 'r', 'e', 'a', 'l', ' ', 'x', ',', ' ', 'u', 's', 'e', ' ', '\'', 's', 'q', 'r', 't', '(', 'c', 'o', 'm', 'p', 'l', 'e', 'x', '(', 'x', ')', ')', '\'', '.' }; char_T c7_u[77]; const mxArray *c7_y = NULL; int32_T c7_i28; static char_T c7_cv1[31] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd', 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'q', 'r', 't', ':', 'd' , 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' }; char_T c7_b_u[31]; const mxArray *c7_b_y = NULL; for (c7_i27 = 0; c7_i27 < 77; c7_i27 = c7_i27 + 1) { c7_u[c7_i27] = c7_cv0[c7_i27]; } c7_y = NULL; sf_mex_assign(&c7_y, sf_mex_create("y", &c7_u, 10, 0U, 1U, 0U, 2, 1, 77)); for (c7_i28 = 0; c7_i28 < 31; c7_i28 = c7_i28 + 1) { c7_b_u[c7_i28] = c7_cv1[c7_i28]; } c7_b_y = NULL; sf_mex_assign(&c7_b_y, sf_mex_create("y", &c7_b_u, 10, 0U, 1U, 0U, 2, 1, 31)); sf_mex_call_debug("error", 0U, 2U, 14, c7_b_y, 14, c7_y); }
static void c7_eml_warning(void) { int32_T c7_i29; static char_T c7_cv2[15] = { 'D', 'i', 'v', 'i', 'd', 'e', ' ', 'b', 'y', ' ', 'z', 'e', 'r', 'o', '.' }; char_T c7_u[15]; const mxArray *c7_y = NULL; int32_T c7_i30; static char_T c7_cv3[19] = { 'M', 'A', 'T', 'L', 'A', 'B', ':', 'd', 'i', 'v', 'i', 'd', 'e', 'B', 'y', 'Z', 'e', 'r', 'o' }; char_T c7_b_u[19]; const mxArray *c7_b_y = NULL; for (c7_i29 = 0; c7_i29 < 15; c7_i29 = c7_i29 + 1) { c7_u[c7_i29] = c7_cv2[c7_i29]; } c7_y = NULL; sf_mex_assign(&c7_y, sf_mex_create("y", &c7_u, 10, 0U, 1U, 0U, 2, 1, 15)); for (c7_i30 = 0; c7_i30 < 19; c7_i30 = c7_i30 + 1) { c7_b_u[c7_i30] = c7_cv3[c7_i30]; } c7_b_y = NULL; sf_mex_assign(&c7_b_y, sf_mex_create("y", &c7_b_u, 10, 0U, 1U, 0U, 2, 1, 19)); sf_mex_call_debug("warning", 0U, 2U, 14, c7_b_y, 14, c7_y); }
static void c3_eml_error(SFc3_car_modelInstanceStruct *chartInstance) { int32_T c3_i11; static char_T c3_cv0[31] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd', 'M', 'A', 'T', 'L', 'A', 'B', ':', 's', 'q', 'r', 't', ':', 'd' , 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' }; char_T c3_u[31]; const mxArray *c3_y = NULL; int32_T c3_i12; static char_T c3_cv1[77] = { 'D', 'o', 'm', 'a', 'i', 'n', ' ', 'e', 'r', 'r', 'o', 'r', '.', ' ', 'T', 'o', ' ', 'c', 'o', 'm', 'p' , 'u', 't', 'e', ' ', 'c', 'o', 'm', 'p', 'l', 'e', 'x', ' ', 'r', 'e', 's', 'u', 'l', 't', 's', ' ', 'f', 'r', 'o', 'm', ' ', 'r', 'e', 'a', 'l', ' ', 'x', ',', ' ', 'u', 's', 'e', ' ', '\'', 's', 'q', 'r', 't', '(', 'c', 'o', 'm', 'p', 'l', 'e', 'x', '(', 'x', ')', ')', '\'', '.' }; char_T c3_b_u[77]; const mxArray *c3_b_y = NULL; for (c3_i11 = 0; c3_i11 < 31; c3_i11 = c3_i11 + 1) { c3_u[c3_i11] = c3_cv0[c3_i11]; } c3_y = NULL; sf_mex_assign(&c3_y, sf_mex_create("y", &c3_u, 10, 0U, 1U, 0U, 2, 1, 31)); for (c3_i12 = 0; c3_i12 < 77; c3_i12 = c3_i12 + 1) { c3_b_u[c3_i12] = c3_cv1[c3_i12]; } c3_b_y = NULL; sf_mex_assign(&c3_b_y, sf_mex_create("y", &c3_b_u, 10, 0U, 1U, 0U, 2, 1, 77)); sf_mex_call_debug("error", 0U, 2U, 14, c3_y, 14, c3_b_y); }
static void sf_c2_linearproto(SFc2_linearprotoInstanceStruct *chartInstance) { real_T c2_hoistedGlobal; real_T c2_x; uint32_T c2_debug_family_var_map[4]; real_T c2_nargin = 1.0; real_T c2_nargout = 1.0; real_T c2_y; real_T c2_b; real_T c2_b_y; real_T c2_u; const mxArray *c2_c_y = NULL; real_T *c2_b_x; real_T *c2_d_y; c2_d_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c2_b_x = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c2_sfEvent); _SFD_DATA_RANGE_CHECK(*c2_b_x, 0U); _SFD_DATA_RANGE_CHECK(*c2_d_y, 1U); chartInstance->c2_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent); c2_hoistedGlobal = *c2_b_x; c2_x = c2_hoistedGlobal; _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c2_debug_family_names, c2_debug_family_var_map); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargin, 0U, c2_sf_marshallOut, c2_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargout, 1U, c2_sf_marshallOut, c2_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_x, 2U, c2_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_y, 3U, c2_sf_marshallOut, c2_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 4); if (CV_EML_IF(0, 1, 0, c2_x < 0.9)) { _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 6); c2_b = c2_x; c2_b_y = 13.8125 * c2_b; c2_y = c2_b_y - 9.93; sf_mex_printf("%s =\\n", "y"); c2_u = c2_y; c2_c_y = NULL; sf_mex_assign(&c2_c_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0), FALSE); sf_mex_call_debug("disp", 0U, 1U, 14, c2_c_y); } else { _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 9); c2_y = 2.5; } _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -9); _SFD_SYMBOL_SCOPE_POP(); *c2_d_y = c2_y; _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent); _SFD_CHECK_FOR_STATE_INCONSISTENCY(_linearprotoMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }
static void c1_eml_error(SFc1_my_demo_refInstanceStruct *chartInstance) { int32_T c1_i15; static char_T c1_varargin_1[30] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 's', 'q', 'r', 't', '_', 'd', 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' }; char_T c1_u[30]; const mxArray *c1_y = NULL; for (c1_i15 = 0; c1_i15 < 30; c1_i15++) { c1_u[c1_i15] = c1_varargin_1[c1_i15]; } c1_y = NULL; sf_mex_assign(&c1_y, sf_mex_create("y", c1_u, 10, 0U, 1U, 0U, 2, 1, 30), FALSE); sf_mex_call_debug("error", 0U, 1U, 14, sf_mex_call_debug("message", 1U, 1U, 14, c1_y)); }
static void sf_c11_kinematics(SFc11_kinematicsInstanceStruct *chartInstance) { int32_T c11_i2; int32_T c11_i3; int32_T c11_i4; int32_T c11_i5; real_T c11_body_velocity[6]; int32_T c11_i6; real_T c11_euler_angles_vehicle[3]; uint32_T c11_debug_family_var_map[6]; const mxArray *c11_J = NULL; real_T c11_nargin = 2.0; real_T c11_nargout = 1.0; real_T c11_vehicle_rates[6]; int32_T c11_i7; real_T c11_u[3]; const mxArray *c11_y = NULL; int32_T c11_i8; int32_T c11_i9; real_T c11_b_u[6]; const mxArray *c11_b_y = NULL; real_T c11_dv1[6]; int32_T c11_i10; int32_T c11_i11; real_T (*c11_b_vehicle_rates)[6]; real_T (*c11_b_euler_angles_vehicle)[3]; real_T (*c11_b_body_velocity)[6]; c11_b_euler_angles_vehicle = (real_T (*)[3])ssGetInputPortSignal (chartInstance->S, 1); c11_b_vehicle_rates = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1); c11_b_body_velocity = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 0); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 8U, chartInstance->c11_sfEvent); for (c11_i2 = 0; c11_i2 < 6; c11_i2++) { _SFD_DATA_RANGE_CHECK((*c11_b_body_velocity)[c11_i2], 0U); } for (c11_i3 = 0; c11_i3 < 6; c11_i3++) { _SFD_DATA_RANGE_CHECK((*c11_b_vehicle_rates)[c11_i3], 1U); } for (c11_i4 = 0; c11_i4 < 3; c11_i4++) { _SFD_DATA_RANGE_CHECK((*c11_b_euler_angles_vehicle)[c11_i4], 2U); } chartInstance->c11_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 8U, chartInstance->c11_sfEvent); for (c11_i5 = 0; c11_i5 < 6; c11_i5++) { c11_body_velocity[c11_i5] = (*c11_b_body_velocity)[c11_i5]; } for (c11_i6 = 0; c11_i6 < 3; c11_i6++) { c11_euler_angles_vehicle[c11_i6] = (*c11_b_euler_angles_vehicle)[c11_i6]; } sf_debug_symbol_scope_push_eml(0U, 6U, 6U, c11_debug_family_names, c11_debug_family_var_map); sf_debug_symbol_scope_add_eml(&c11_J, 0U, c11_d_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(&c11_nargin, 1U, c11_c_sf_marshallOut, c11_b_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c11_nargout, 2U, c11_c_sf_marshallOut, c11_b_sf_marshallIn); sf_debug_symbol_scope_add_eml(c11_body_velocity, 3U, c11_sf_marshallOut); sf_debug_symbol_scope_add_eml(c11_euler_angles_vehicle, 4U, c11_b_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(c11_vehicle_rates, 5U, c11_sf_marshallOut, c11_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 3); _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 4); for (c11_i7 = 0; c11_i7 < 3; c11_i7++) { c11_u[c11_i7] = c11_euler_angles_vehicle[c11_i7]; } c11_y = NULL; sf_mex_assign(&c11_y, sf_mex_create("y", c11_u, 0, 0U, 1U, 0U, 1, 3), FALSE); sf_mex_assign(&c11_J, sf_mex_call_debug("analytical_jacobian", 1U, 1U, 14, c11_y), FALSE); _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 6); for (c11_i8 = 0; c11_i8 < 6; c11_i8++) { c11_vehicle_rates[c11_i8] = 0.0; } _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 7); for (c11_i9 = 0; c11_i9 < 6; c11_i9++) { c11_b_u[c11_i9] = c11_body_velocity[c11_i9]; } c11_b_y = NULL; sf_mex_assign(&c11_b_y, sf_mex_create("y", c11_b_u, 0, 0U, 1U, 0U, 1, 6), FALSE); c11_b_emlrt_marshallIn(chartInstance, sf_mex_call_debug("mtimes", 1U, 2U, 14, sf_mex_dup(c11_J), 14, c11_b_y), "mtimes", c11_dv1); for (c11_i10 = 0; c11_i10 < 6; c11_i10++) { c11_vehicle_rates[c11_i10] = c11_dv1[c11_i10]; } _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, -7); sf_debug_symbol_scope_pop(); sf_mex_destroy(&c11_J); for (c11_i11 = 0; c11_i11 < 6; c11_i11++) { (*c11_b_vehicle_rates)[c11_i11] = c11_vehicle_rates[c11_i11]; } _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 8U, chartInstance->c11_sfEvent); sf_debug_check_for_state_inconsistency(_kinematicsMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }
static void sf_gateway_c2_Expriment_Pose(SFc2_Expriment_PoseInstanceStruct *chartInstance) { real_T c2_hoistedGlobal; real_T c2_b_hoistedGlobal; real_T c2_c_hoistedGlobal; real_T c2_d_hoistedGlobal; real_T c2_e_hoistedGlobal; real_T c2_f_hoistedGlobal; real_T c2_g_hoistedGlobal; real_T c2_gameStatus; real_T c2_bradHand; real_T c2_userHand; real_T c2_win; real_T c2_bTotal; real_T c2_uTotal; real_T c2_gameNum; uint32_T c2_debug_family_var_map[9]; real_T c2_nargin = 7.0; real_T c2_nargout = 0.0; real_T c2_u; const mxArray *c2_y = NULL; int32_T c2_i0; static char_T c2_cv0[10] = { 'g', 'a', 'm', 'e', 'S', 't', 'a', 't', 'u', 's' }; char_T c2_b_u[10]; const mxArray *c2_b_y = NULL; real_T c2_c_u; const mxArray *c2_c_y = NULL; real_T c2_d_u; const mxArray *c2_d_y = NULL; int32_T c2_i1; static char_T c2_cv1[8] = { 'b', 'r', 'a', 'd', 'H', 'a', 'n', 'd' }; char_T c2_e_u[8]; const mxArray *c2_e_y = NULL; real_T c2_f_u; const mxArray *c2_f_y = NULL; real_T c2_g_u; const mxArray *c2_g_y = NULL; int32_T c2_i2; static char_T c2_cv2[8] = { 'u', 's', 'e', 'r', 'H', 'a', 'n', 'd' }; char_T c2_h_u[8]; const mxArray *c2_h_y = NULL; real_T c2_i_u; const mxArray *c2_i_y = NULL; real_T c2_j_u; const mxArray *c2_j_y = NULL; int32_T c2_i3; static char_T c2_cv3[3] = { 'w', 'i', 'n' }; char_T c2_k_u[3]; const mxArray *c2_k_y = NULL; real_T c2_l_u; const mxArray *c2_l_y = NULL; real_T c2_m_u; const mxArray *c2_m_y = NULL; int32_T c2_i4; static char_T c2_cv4[6] = { 'u', 'T', 'o', 't', 'a', 'l' }; char_T c2_n_u[6]; const mxArray *c2_n_y = NULL; real_T c2_o_u; const mxArray *c2_o_y = NULL; real_T c2_p_u; const mxArray *c2_p_y = NULL; int32_T c2_i5; static char_T c2_cv5[6] = { 'b', 'T', 'o', 't', 'a', 'l' }; char_T c2_q_u[6]; const mxArray *c2_q_y = NULL; real_T c2_r_u; const mxArray *c2_r_y = NULL; real_T c2_s_u; const mxArray *c2_s_y = NULL; int32_T c2_i6; static char_T c2_cv6[7] = { 'g', 'a', 'm', 'e', 'N', 'u', 'm' }; char_T c2_t_u[7]; const mxArray *c2_t_y = NULL; real_T c2_u_u; const mxArray *c2_u_y = NULL; real_T *c2_b_gameStatus; real_T *c2_b_bradHand; real_T *c2_b_userHand; real_T *c2_b_win; real_T *c2_b_bTotal; real_T *c2_b_uTotal; real_T *c2_b_gameNum; c2_b_gameNum = (real_T *)ssGetInputPortSignal(chartInstance->S, 6); c2_b_uTotal = (real_T *)ssGetInputPortSignal(chartInstance->S, 5); c2_b_bTotal = (real_T *)ssGetInputPortSignal(chartInstance->S, 4); c2_b_win = (real_T *)ssGetInputPortSignal(chartInstance->S, 3); c2_b_userHand = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c2_b_bradHand = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c2_b_gameStatus = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SYMBOL_SCOPE_PUSH(0U, 0U); _sfTime_ = sf_get_time(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c2_sfEvent); _SFD_DATA_RANGE_CHECK(*c2_b_gameStatus, 0U); _SFD_DATA_RANGE_CHECK(*c2_b_bradHand, 1U); _SFD_DATA_RANGE_CHECK(*c2_b_userHand, 2U); _SFD_DATA_RANGE_CHECK(*c2_b_win, 3U); _SFD_DATA_RANGE_CHECK(*c2_b_bTotal, 4U); _SFD_DATA_RANGE_CHECK(*c2_b_uTotal, 5U); _SFD_DATA_RANGE_CHECK(*c2_b_gameNum, 6U); chartInstance->c2_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent); c2_hoistedGlobal = *c2_b_gameStatus; c2_b_hoistedGlobal = *c2_b_bradHand; c2_c_hoistedGlobal = *c2_b_userHand; c2_d_hoistedGlobal = *c2_b_win; c2_e_hoistedGlobal = *c2_b_bTotal; c2_f_hoistedGlobal = *c2_b_uTotal; c2_g_hoistedGlobal = *c2_b_gameNum; c2_gameStatus = c2_hoistedGlobal; c2_bradHand = c2_b_hoistedGlobal; c2_userHand = c2_c_hoistedGlobal; c2_win = c2_d_hoistedGlobal; c2_bTotal = c2_e_hoistedGlobal; c2_uTotal = c2_f_hoistedGlobal; c2_gameNum = c2_g_hoistedGlobal; _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 9U, 9U, c2_debug_family_names, c2_debug_family_var_map); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargin, 0U, c2_sf_marshallOut, c2_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargout, 1U, c2_sf_marshallOut, c2_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_gameStatus, 2U, c2_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_bradHand, 3U, c2_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_userHand, 4U, c2_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_win, 5U, c2_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_bTotal, 6U, c2_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_uTotal, 7U, c2_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c2_gameNum, 8U, c2_sf_marshallOut); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 3); c2_u = 0.0; c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0), false); for (c2_i0 = 0; c2_i0 < 10; c2_i0++) { c2_b_u[c2_i0] = c2_cv0[c2_i0]; } c2_b_y = NULL; sf_mex_assign(&c2_b_y, sf_mex_create("y", c2_b_u, 10, 0U, 1U, 0U, 2, 1, 10), false); c2_c_u = c2_gameStatus; c2_c_y = NULL; sf_mex_assign(&c2_c_y, sf_mex_create("y", &c2_c_u, 0, 0U, 0U, 0U, 0), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "setappdata", 0U, 3U, 14, c2_y, 14, c2_b_y, 14, c2_c_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 4); c2_d_u = 0.0; c2_d_y = NULL; sf_mex_assign(&c2_d_y, sf_mex_create("y", &c2_d_u, 0, 0U, 0U, 0U, 0), false); for (c2_i1 = 0; c2_i1 < 8; c2_i1++) { c2_e_u[c2_i1] = c2_cv1[c2_i1]; } c2_e_y = NULL; sf_mex_assign(&c2_e_y, sf_mex_create("y", c2_e_u, 10, 0U, 1U, 0U, 2, 1, 8), false); c2_f_u = c2_bradHand; c2_f_y = NULL; sf_mex_assign(&c2_f_y, sf_mex_create("y", &c2_f_u, 0, 0U, 0U, 0U, 0), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "setappdata", 0U, 3U, 14, c2_d_y, 14, c2_e_y, 14, c2_f_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 5); c2_g_u = 0.0; c2_g_y = NULL; sf_mex_assign(&c2_g_y, sf_mex_create("y", &c2_g_u, 0, 0U, 0U, 0U, 0), false); for (c2_i2 = 0; c2_i2 < 8; c2_i2++) { c2_h_u[c2_i2] = c2_cv2[c2_i2]; } c2_h_y = NULL; sf_mex_assign(&c2_h_y, sf_mex_create("y", c2_h_u, 10, 0U, 1U, 0U, 2, 1, 8), false); c2_i_u = c2_userHand; c2_i_y = NULL; sf_mex_assign(&c2_i_y, sf_mex_create("y", &c2_i_u, 0, 0U, 0U, 0U, 0), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "setappdata", 0U, 3U, 14, c2_g_y, 14, c2_h_y, 14, c2_i_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 6); c2_j_u = 0.0; c2_j_y = NULL; sf_mex_assign(&c2_j_y, sf_mex_create("y", &c2_j_u, 0, 0U, 0U, 0U, 0), false); for (c2_i3 = 0; c2_i3 < 3; c2_i3++) { c2_k_u[c2_i3] = c2_cv3[c2_i3]; } c2_k_y = NULL; sf_mex_assign(&c2_k_y, sf_mex_create("y", c2_k_u, 10, 0U, 1U, 0U, 2, 1, 3), false); c2_l_u = c2_win; c2_l_y = NULL; sf_mex_assign(&c2_l_y, sf_mex_create("y", &c2_l_u, 0, 0U, 0U, 0U, 0), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "setappdata", 0U, 3U, 14, c2_j_y, 14, c2_k_y, 14, c2_l_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 7); c2_m_u = 0.0; c2_m_y = NULL; sf_mex_assign(&c2_m_y, sf_mex_create("y", &c2_m_u, 0, 0U, 0U, 0U, 0), false); for (c2_i4 = 0; c2_i4 < 6; c2_i4++) { c2_n_u[c2_i4] = c2_cv4[c2_i4]; } c2_n_y = NULL; sf_mex_assign(&c2_n_y, sf_mex_create("y", c2_n_u, 10, 0U, 1U, 0U, 2, 1, 6), false); c2_o_u = c2_uTotal; c2_o_y = NULL; sf_mex_assign(&c2_o_y, sf_mex_create("y", &c2_o_u, 0, 0U, 0U, 0U, 0), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "setappdata", 0U, 3U, 14, c2_m_y, 14, c2_n_y, 14, c2_o_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 8); c2_p_u = 0.0; c2_p_y = NULL; sf_mex_assign(&c2_p_y, sf_mex_create("y", &c2_p_u, 0, 0U, 0U, 0U, 0), false); for (c2_i5 = 0; c2_i5 < 6; c2_i5++) { c2_q_u[c2_i5] = c2_cv5[c2_i5]; } c2_q_y = NULL; sf_mex_assign(&c2_q_y, sf_mex_create("y", c2_q_u, 10, 0U, 1U, 0U, 2, 1, 6), false); c2_r_u = c2_bTotal; c2_r_y = NULL; sf_mex_assign(&c2_r_y, sf_mex_create("y", &c2_r_u, 0, 0U, 0U, 0U, 0), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "setappdata", 0U, 3U, 14, c2_p_y, 14, c2_q_y, 14, c2_r_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 9); c2_s_u = 0.0; c2_s_y = NULL; sf_mex_assign(&c2_s_y, sf_mex_create("y", &c2_s_u, 0, 0U, 0U, 0U, 0), false); for (c2_i6 = 0; c2_i6 < 7; c2_i6++) { c2_t_u[c2_i6] = c2_cv6[c2_i6]; } c2_t_y = NULL; sf_mex_assign(&c2_t_y, sf_mex_create("y", c2_t_u, 10, 0U, 1U, 0U, 2, 1, 7), false); c2_u_u = c2_gameNum; c2_u_y = NULL; sf_mex_assign(&c2_u_y, sf_mex_create("y", &c2_u_u, 0, 0U, 0U, 0U, 0), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "setappdata", 0U, 3U, 14, c2_s_y, 14, c2_t_y, 14, c2_u_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -9); _SFD_SYMBOL_SCOPE_POP(); _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent); _SFD_SYMBOL_SCOPE_POP(); _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Expriment_PoseMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }
static real_T c1_mean(SFc1_VrSubsystemInstanceStruct *chartInstance, real_T c1_x_data[], int32_T c1_x_sizes) { boolean_T c1_b9; const mxArray *c1_c_y = NULL; static char_T c1_b_u[36] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'a', 'u', 't', 'o', 'D', 'i', 'm', 'I', 'n', 'c', 'o', 'm', 'p', 'a', 't', 'i', 'b', 'i', 'l', 'i', 't', 'y' }; int32_T c1_b_x_sizes; int32_T c1_loop_ub; int32_T c1_i19; real_T c1_b_x_data[320]; boolean_T c1_b10; const mxArray *c1_d_y = NULL; static char_T c1_c_u[37] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o', 'l', 'b', 'o', 'x', ':', 'U', 'n', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd', 'S', 'p', 'e', 'c', 'i', 'a', 'l', 'E', 'm', 'p', 't', 'y' }; int32_T c1_c_x_sizes; int32_T c1_b_loop_ub; int32_T c1_i20; real_T c1_c_x_data[320]; boolean_T c1_b11; const mxArray *c1_e_y = NULL; real_T c1_f_y; int32_T c1_vlen; int32_T c1_b_vlen; int32_T c1_k; int32_T c1_b_k; real_T c1_x; real_T c1_g_y; real_T c1_b_x; real_T c1_h_y; boolean_T guard1 = false; guard1 = false; if (c1_x_sizes == 1) { guard1 = true; } else if ((real_T)c1_x_sizes != 1.0) { guard1 = true; } else { c1_b9 = false; } if (guard1 == true) { c1_b9 = true; } if (c1_b9) { } else { c1_c_y = NULL; sf_mex_assign(&c1_c_y, sf_mex_create("y", c1_b_u, 10, 0U, 1U, 0U, 2, 1, 36), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_c_y)); } c1_b_x_sizes = c1_x_sizes; c1_loop_ub = c1_x_sizes - 1; for (c1_i19 = 0; c1_i19 <= c1_loop_ub; c1_i19++) { c1_b_x_data[c1_i19] = c1_x_data[c1_i19]; } c1_b10 = !c1_isequal(chartInstance, c1_b_x_data, c1_b_x_sizes); if (c1_b10) { } else { c1_d_y = NULL; sf_mex_assign(&c1_d_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 37), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_d_y)); } c1_c_x_sizes = c1_x_sizes; c1_b_loop_ub = c1_x_sizes - 1; for (c1_i20 = 0; c1_i20 <= c1_b_loop_ub; c1_i20++) { c1_c_x_data[c1_i20] = c1_x_data[c1_i20]; } c1_b11 = !c1_isequal(chartInstance, c1_c_x_data, c1_c_x_sizes); if (c1_b11) { } else { c1_e_y = NULL; sf_mex_assign(&c1_e_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 37), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_e_y)); } if (c1_x_sizes == 0) { c1_f_y = 0.0; } else { c1_vlen = c1_x_sizes; c1_f_y = c1_x_data[0]; c1_b_vlen = c1_vlen; for (c1_k = 2; c1_k <= c1_b_vlen; c1_k++) { c1_b_k = c1_k - 1; c1_f_y += c1_x_data[c1_b_k]; } } c1_x = c1_f_y; c1_g_y = (real_T)c1_x_sizes; c1_b_x = c1_x; c1_h_y = c1_g_y; return c1_b_x / c1_h_y; }
static void sf_c3_V2A1_2(SFc3_V2A1_2InstanceStruct *chartInstance) { int32_T c3_i2; real_T c3_hoistedGlobal; real_T c3_b_hoistedGlobal; real_T c3_delta; real_T c3_hoehe; uint32_T c3_debug_family_var_map[9]; real_T c3_er; real_T c3_bogen_delta; real_T c3_x; real_T c3_y; real_T c3_nargin = 2.0; real_T c3_nargout = 1.0; real_T c3_x0[2]; real_T c3_a; real_T c3_b_y; real_T c3_A; real_T c3_b_x; real_T c3_c_x; real_T c3_d_x; real_T c3_e_x; real_T c3_b_a; real_T c3_b; real_T c3_f_x; real_T c3_g_x; real_T c3_c_a; real_T c3_b_b; int32_T c3_i3; real_T c3_u[2]; const mxArray *c3_c_y = NULL; int32_T c3_i4; real_T *c3_b_hoehe; real_T *c3_b_delta; real_T (*c3_b_x0)[2]; c3_b_hoehe = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c3_b_x0 = (real_T (*)[2])ssGetOutputPortSignal(chartInstance->S, 1); c3_b_delta = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _SFD_SYMBOL_SCOPE_PUSH(0U, 0U); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 2U, chartInstance->c3_sfEvent); _SFD_DATA_RANGE_CHECK(*c3_b_delta, 0U); for (c3_i2 = 0; c3_i2 < 2; c3_i2++) { _SFD_DATA_RANGE_CHECK((*c3_b_x0)[c3_i2], 1U); } _SFD_DATA_RANGE_CHECK(*c3_b_hoehe, 2U); chartInstance->c3_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent); c3_hoistedGlobal = *c3_b_delta; c3_b_hoistedGlobal = *c3_b_hoehe; c3_delta = c3_hoistedGlobal; c3_hoehe = c3_b_hoistedGlobal; _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 9U, 9U, c3_debug_family_names, c3_debug_family_var_map); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_er, 0U, c3_b_sf_marshallOut, c3_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_bogen_delta, 1U, c3_b_sf_marshallOut, c3_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_x, 2U, c3_b_sf_marshallOut, c3_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_y, 3U, c3_b_sf_marshallOut, c3_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargin, 4U, c3_b_sf_marshallOut, c3_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargout, 5U, c3_b_sf_marshallOut, c3_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML(&c3_delta, 6U, c3_b_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c3_hoehe, 7U, c3_b_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c3_x0, 8U, c3_sf_marshallOut, c3_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 2); c3_er = 6.378E+6; _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 3); c3_a = c3_delta; c3_b_y = c3_a * 3.1415926535897931; c3_A = c3_b_y; c3_b_x = c3_A; c3_c_x = c3_b_x; c3_bogen_delta = c3_c_x / 180.0; _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 4); c3_d_x = c3_bogen_delta; c3_e_x = c3_d_x; c3_e_x = muDoubleScalarCos(c3_e_x); c3_b_a = c3_e_x; c3_b = c3_er + c3_hoehe; c3_x = c3_b_a * c3_b; _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 5); c3_f_x = c3_bogen_delta; c3_g_x = c3_f_x; c3_g_x = muDoubleScalarSin(c3_g_x); c3_c_a = c3_g_x; c3_b_b = c3_er + c3_hoehe; c3_y = c3_c_a * c3_b_b; _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 7); c3_x0[0] = c3_x; c3_x0[1] = c3_y; sf_mex_printf("%s =\\n", "x0"); for (c3_i3 = 0; c3_i3 < 2; c3_i3++) { c3_u[c3_i3] = c3_x0[c3_i3]; } c3_c_y = NULL; sf_mex_assign(&c3_c_y, sf_mex_create("y", c3_u, 0, 0U, 1U, 0U, 1, 2), FALSE); sf_mex_call_debug("disp", 0U, 1U, 14, c3_c_y); _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, -7); _SFD_SYMBOL_SCOPE_POP(); for (c3_i4 = 0; c3_i4 < 2; c3_i4++) { (*c3_b_x0)[c3_i4] = c3_x0[c3_i4]; } _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent); _SFD_SYMBOL_SCOPE_POP(); _SFD_CHECK_FOR_STATE_INCONSISTENCY(_V2A1_2MachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }
static void c1_chartstep_c1_VrSubsystem(SFc1_VrSubsystemInstanceStruct *chartInstance) { int32_T c1_i3; real_T c1_b_u[320]; uint32_T c1_debug_family_var_map[10]; real_T c1_pixelsFold; real_T c1_remainder; real_T c1_sideThreshold; real_T c1_nextFold; real_T c1_i; real_T c1_endFold; real_T c1_nargin = 1.0; real_T c1_nargout = 1.0; real_T c1_b_y[128]; int32_T c1_i4; int32_T c1_b_i; const mxArray *c1_c_y = NULL; static char_T c1_c_u[30] = { 'C', 'o', 'd', 'e', 'r', ':', 'b', 'u', 'i', 'l', 't', 'i', 'n', 's', ':', 'A', 's', 's', 'e', 'r', 't', 'i', 'o', 'n', 'F', 'a', 'i', 'l', 'e', 'd' }; const mxArray *c1_d_y = NULL; boolean_T c1_b0; boolean_T c1_b1; boolean_T c1_b2; int32_T c1_i5; int32_T c1_i6; int32_T c1_u_sizes; int32_T c1_loop_ub; int32_T c1_i7; real_T c1_u_data[320]; int32_T c1_c_i; const mxArray *c1_e_y = NULL; const mxArray *c1_f_y = NULL; boolean_T c1_b3; boolean_T c1_b4; boolean_T c1_b5; int32_T c1_i8; int32_T c1_i9; int32_T c1_b_u_sizes; int32_T c1_b_loop_ub; int32_T c1_i10; real_T c1_b_u_data[320]; int32_T c1_d_i; const mxArray *c1_g_y = NULL; const mxArray *c1_h_y = NULL; boolean_T c1_b6; boolean_T c1_b7; boolean_T c1_b8; int32_T c1_i11; int32_T c1_i12; int32_T c1_c_u_sizes; int32_T c1_c_loop_ub; int32_T c1_i13; real_T c1_c_u_data[320]; int32_T c1_i14; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent); for (c1_i3 = 0; c1_i3 < 320; c1_i3++) { c1_b_u[c1_i3] = (*chartInstance->c1_u)[c1_i3]; } _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 10U, 10U, c1_debug_family_names, c1_debug_family_var_map); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_pixelsFold, 0U, c1_c_sf_marshallOut, c1_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML(&c1_remainder, 1U, c1_c_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML(&c1_sideThreshold, 2U, c1_c_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nextFold, 3U, c1_c_sf_marshallOut, c1_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_i, 4U, c1_c_sf_marshallOut, c1_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_endFold, 5U, c1_c_sf_marshallOut, c1_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargin, 6U, c1_c_sf_marshallOut, c1_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargout, 7U, c1_c_sf_marshallOut, c1_b_sf_marshallIn); _SFD_SYMBOL_SCOPE_ADD_EML(c1_b_u, 8U, c1_b_sf_marshallOut); _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c1_b_y, 9U, c1_sf_marshallOut, c1_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 7); c1_pixelsFold = 2.0; _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 9); c1_remainder = 64.0; _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 15); for (c1_i4 = 0; c1_i4 < 128; c1_i4++) { c1_b_y[c1_i4] = 0.0; } _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 16); c1_sideThreshold = 32.0; _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 18); c1_nextFold = 1.0; _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 19); c1_i = 1.0; c1_b_i = 0; while (c1_b_i < 32) { c1_i = 1.0 + (real_T)c1_b_i; CV_EML_FOR(0, 1, 0, 1); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 20); c1_endFold = c1_nextFold + 2.0; _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 21); if (c1_nextFold <= 500.0) { } else { c1_c_y = NULL; sf_mex_assign(&c1_c_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 30), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_c_y)); } _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 22); if (c1_endFold <= 500.0) { } else { c1_d_y = NULL; sf_mex_assign(&c1_d_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 30), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_d_y)); } _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 23); c1_b0 = (c1_nextFold > c1_endFold); c1_b1 = c1_b0; c1_b2 = c1_b1; if (c1_b2) { c1_i5 = 1; c1_i6 = 0; } else { c1_i5 = sf_eml_array_bounds_check(sfGlobalDebugInstanceStruct, chartInstance->S, 1U, 822, 19, MAX_uint32_T, (int32_T)c1_nextFold, 1, 320); c1_i6 = sf_eml_array_bounds_check(sfGlobalDebugInstanceStruct, chartInstance->S, 1U, 822, 19, MAX_uint32_T, (int32_T)c1_endFold, 1, 320); } c1_u_sizes = (c1_i6 - c1_i5) + 1; c1_loop_ub = c1_i6 - c1_i5; for (c1_i7 = 0; c1_i7 <= c1_loop_ub; c1_i7++) { c1_u_data[c1_i7] = c1_b_u[(c1_i5 + c1_i7) - 1]; } c1_b_y[(int32_T)c1_i - 1] = c1_mean(chartInstance, c1_u_data, c1_u_sizes); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 24); c1_nextFold = c1_endFold + 1.0; c1_b_i++; _SF_MEX_LISTEN_FOR_CTRL_C(chartInstance->S); } CV_EML_FOR(0, 1, 0, 0); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 27); c1_i = 33.0; c1_c_i = 0; while (c1_c_i < 64) { c1_i = 33.0 + (real_T)c1_c_i; CV_EML_FOR(0, 1, 1, 1); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 28); c1_endFold = (c1_nextFold + 2.0) - 1.0; _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 29); if (c1_nextFold <= 500.0) { } else { c1_e_y = NULL; sf_mex_assign(&c1_e_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 30), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_e_y)); } _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 30); if (c1_endFold <= 500.0) { } else { c1_f_y = NULL; sf_mex_assign(&c1_f_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 30), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_f_y)); } _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 31); c1_b3 = (c1_nextFold > c1_endFold); c1_b4 = c1_b3; c1_b5 = c1_b4; if (c1_b5) { c1_i8 = 1; c1_i9 = 0; } else { c1_i8 = sf_eml_array_bounds_check(sfGlobalDebugInstanceStruct, chartInstance->S, 1U, 1021, 19, MAX_uint32_T, (int32_T)c1_nextFold, 1, 320); c1_i9 = sf_eml_array_bounds_check(sfGlobalDebugInstanceStruct, chartInstance->S, 1U, 1021, 19, MAX_uint32_T, (int32_T)c1_endFold, 1, 320); } c1_b_u_sizes = (c1_i9 - c1_i8) + 1; c1_b_loop_ub = c1_i9 - c1_i8; for (c1_i10 = 0; c1_i10 <= c1_b_loop_ub; c1_i10++) { c1_b_u_data[c1_i10] = c1_b_u[(c1_i8 + c1_i10) - 1]; } c1_b_y[(int32_T)c1_i - 1] = c1_mean(chartInstance, c1_b_u_data, c1_b_u_sizes); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 32); c1_nextFold = c1_endFold + 1.0; c1_c_i++; _SF_MEX_LISTEN_FOR_CTRL_C(chartInstance->S); } CV_EML_FOR(0, 1, 1, 0); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 35); c1_i = 97.0; c1_d_i = 0; while (c1_d_i < 32) { c1_i = 97.0 + (real_T)c1_d_i; CV_EML_FOR(0, 1, 2, 1); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 36); c1_endFold = c1_nextFold + 2.0; _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 37); if (c1_nextFold <= 500.0) { } else { c1_g_y = NULL; sf_mex_assign(&c1_g_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 30), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_g_y)); } _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 38); if (c1_endFold <= 500.0) { } else { c1_h_y = NULL; sf_mex_assign(&c1_h_y, sf_mex_create("y", c1_c_u, 10, 0U, 1U, 0U, 2, 1, 30), false); sf_mex_call_debug(sfGlobalDebugInstanceStruct, "error", 0U, 1U, 14, sf_mex_call_debug(sfGlobalDebugInstanceStruct, "message", 1U, 1U, 14, c1_h_y)); } _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 39); c1_b6 = (c1_nextFold > c1_endFold); c1_b7 = c1_b6; c1_b8 = c1_b7; if (c1_b8) { c1_i11 = 1; c1_i12 = 0; } else { c1_i11 = sf_eml_array_bounds_check(sfGlobalDebugInstanceStruct, chartInstance->S, 1U, 1208, 19, MAX_uint32_T, (int32_T)c1_nextFold, 1, 320); c1_i12 = sf_eml_array_bounds_check(sfGlobalDebugInstanceStruct, chartInstance->S, 1U, 1208, 19, MAX_uint32_T, (int32_T)c1_endFold, 1, 320); } c1_c_u_sizes = (c1_i12 - c1_i11) + 1; c1_c_loop_ub = c1_i12 - c1_i11; for (c1_i13 = 0; c1_i13 <= c1_c_loop_ub; c1_i13++) { c1_c_u_data[c1_i13] = c1_b_u[(c1_i11 + c1_i13) - 1]; } c1_b_y[(int32_T)c1_i - 1] = c1_mean(chartInstance, c1_c_u_data, c1_c_u_sizes); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 40); c1_nextFold = c1_endFold + 1.0; c1_d_i++; _SF_MEX_LISTEN_FOR_CTRL_C(chartInstance->S); } CV_EML_FOR(0, 1, 2, 0); _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, -40); _SFD_SYMBOL_SCOPE_POP(); for (c1_i14 = 0; c1_i14 < 128; c1_i14++) { (*chartInstance->c1_y)[c1_i14] = c1_b_y[c1_i14]; } _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent); }
static void sf_c9_testing_control_with_estimate (SFc9_testing_control_with_estimateInstanceStruct *chartInstance) { real_T c9_hoistedGlobal; real_T c9_b_hoistedGlobal; real_T c9_c_hoistedGlobal; real_T c9_d_hoistedGlobal; real_T c9_s1; real_T c9_dc1; real_T c9_s2; real_T c9_dc2; uint32_T c9_debug_family_var_map[10]; real_T c9_dc[3]; real_T c9_nargin = 4.0; real_T c9_nargout = 3.0; real_T c9_Va; real_T c9_Vb; real_T c9_Vc; int32_T c9_i0; int32_T c9_i1; real_T c9_u[3]; const mxArray *c9_y = NULL; int32_T c9_i2; real_T c9_b_u[3]; const mxArray *c9_b_y = NULL; real_T c9_a; real_T c9_b_a; real_T c9_c_a; real_T *c9_b_s1; real_T *c9_b_Va; real_T *c9_b_dc1; real_T *c9_b_s2; real_T *c9_b_dc2; real_T *c9_b_Vb; real_T *c9_b_Vc; c9_b_Vc = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3); c9_b_Vb = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2); c9_b_dc2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 3); c9_b_s2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 2); c9_b_dc1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 1); c9_b_Va = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1); c9_b_s1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 5U, chartInstance->c9_sfEvent); _SFD_DATA_RANGE_CHECK(*c9_b_s1, 0U); _SFD_DATA_RANGE_CHECK(*c9_b_Va, 1U); _SFD_DATA_RANGE_CHECK(*c9_b_dc1, 2U); _SFD_DATA_RANGE_CHECK(*c9_b_s2, 3U); _SFD_DATA_RANGE_CHECK(*c9_b_dc2, 4U); _SFD_DATA_RANGE_CHECK(*c9_b_Vb, 5U); _SFD_DATA_RANGE_CHECK(*c9_b_Vc, 6U); chartInstance->c9_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 5U, chartInstance->c9_sfEvent); c9_hoistedGlobal = *c9_b_s1; c9_b_hoistedGlobal = *c9_b_dc1; c9_c_hoistedGlobal = *c9_b_s2; c9_d_hoistedGlobal = *c9_b_dc2; c9_s1 = c9_hoistedGlobal; c9_dc1 = c9_b_hoistedGlobal; c9_s2 = c9_c_hoistedGlobal; c9_dc2 = c9_d_hoistedGlobal; sf_debug_symbol_scope_push_eml(0U, 10U, 10U, c9_debug_family_names, c9_debug_family_var_map); sf_debug_symbol_scope_add_eml_importable(c9_dc, 0U, c9_b_sf_marshallOut, c9_b_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c9_nargin, 1U, c9_sf_marshallOut, c9_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c9_nargout, 2U, c9_sf_marshallOut, c9_sf_marshallIn); sf_debug_symbol_scope_add_eml(&c9_s1, 3U, c9_sf_marshallOut); sf_debug_symbol_scope_add_eml(&c9_dc1, 4U, c9_sf_marshallOut); sf_debug_symbol_scope_add_eml(&c9_s2, 5U, c9_sf_marshallOut); sf_debug_symbol_scope_add_eml(&c9_dc2, 6U, c9_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(&c9_Va, 7U, c9_sf_marshallOut, c9_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c9_Vb, 8U, c9_sf_marshallOut, c9_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c9_Vc, 9U, c9_sf_marshallOut, c9_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 10); for (c9_i0 = 0; c9_i0 < 3; c9_i0++) { c9_dc[c9_i0] = 0.0; } _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 12); switch ((int32_T)_SFD_INTEGER_CHECK("s1", c9_s1)) { case 1: CV_EML_SWITCH(0, 1, 0, 1); _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 15); if (CV_EML_IF(0, 1, 0, c9_s2 == 2.0)) { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 16); c9_dc[0] = c9_dc1 + c9_dc2; c9_dc[1] = c9_dc2; c9_dc[2] = 0.0; } else { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 18); c9_dc[0] = c9_dc1 + c9_dc2; c9_dc[1] = 0.0; c9_dc[2] = c9_dc2; } break; case 2: CV_EML_SWITCH(0, 1, 0, 2); _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 21); if (CV_EML_IF(0, 1, 1, c9_s2 == 3.0)) { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 22); c9_dc[0] = c9_dc1; c9_dc[1] = c9_dc1 + c9_dc2; c9_dc[2] = 0.0; } else { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 24); c9_dc[0] = c9_dc1 + c9_dc2; c9_dc[1] = c9_dc1; c9_dc[2] = 0.0; } break; case 3: CV_EML_SWITCH(0, 1, 0, 3); _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 27); if (CV_EML_IF(0, 1, 2, c9_s2 == 4.0)) { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 28); c9_dc[0] = 0.0; c9_dc[1] = c9_dc1 + c9_dc2; c9_dc[2] = c9_dc2; } else { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 30); c9_dc[0] = c9_dc2; c9_dc[1] = c9_dc1 + c9_dc2; c9_dc[2] = 0.0; } break; case 4: CV_EML_SWITCH(0, 1, 0, 4); _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 33); if (CV_EML_IF(0, 1, 3, c9_s2 == 5.0)) { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 34); c9_dc[0] = 0.0; c9_dc[1] = c9_dc1; c9_dc[2] = c9_dc1 + c9_dc2; } else { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 36); c9_dc[0] = 0.0; c9_dc[1] = c9_dc1 + c9_dc2; c9_dc[2] = c9_dc1; sf_mex_printf("%s =\\n", "dc"); for (c9_i1 = 0; c9_i1 < 3; c9_i1++) { c9_u[c9_i1] = c9_dc[c9_i1]; } c9_y = NULL; sf_mex_assign(&c9_y, sf_mex_create("y", c9_u, 0, 0U, 1U, 0U, 2, 1, 3), FALSE); sf_mex_call_debug("disp", 0U, 1U, 14, c9_y); } break; case 5: CV_EML_SWITCH(0, 1, 0, 5); _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 39); if (CV_EML_IF(0, 1, 4, c9_s2 == 6.0)) { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 40); c9_dc[0] = c9_dc2; c9_dc[1] = 0.0; c9_dc[2] = c9_dc1 + c9_dc2; } else { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 42); c9_dc[0] = 0.0; c9_dc[1] = c9_dc2; c9_dc[2] = c9_dc1 + c9_dc2; } break; case 6: CV_EML_SWITCH(0, 1, 0, 6); _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 46); if (CV_EML_IF(0, 1, 5, c9_s2 == 1.0)) { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 47); c9_dc[0] = c9_dc1 + c9_dc2; c9_dc[1] = 0.0; c9_dc[2] = c9_dc1; } else { _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 49); c9_dc[0] = c9_dc1; c9_dc[1] = 0.0; c9_dc[2] = c9_dc1 + c9_dc2; sf_mex_printf("%s =\\n", "dc"); for (c9_i2 = 0; c9_i2 < 3; c9_i2++) { c9_b_u[c9_i2] = c9_dc[c9_i2]; } c9_b_y = NULL; sf_mex_assign(&c9_b_y, sf_mex_create("y", c9_b_u, 0, 0U, 1U, 0U, 2, 1, 3), FALSE); sf_mex_call_debug("disp", 0U, 1U, 14, c9_b_y); } break; default: CV_EML_SWITCH(0, 1, 0, 0); break; } _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 54); c9_a = c9_dc[0]; c9_Va = c9_a * 12.0; _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 55); c9_b_a = c9_dc[1]; c9_Vb = c9_b_a * 12.0; _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 56); c9_c_a = c9_dc[2]; c9_Vc = c9_c_a * 12.0; _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, -56); sf_debug_symbol_scope_pop(); *c9_b_Va = c9_Va; *c9_b_Vb = c9_Vb; *c9_b_Vc = c9_Vc; _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 5U, chartInstance->c9_sfEvent); sf_debug_check_for_state_inconsistency (_testing_control_with_estimateMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }
static void sf_c10_dynamics_kinematics(SFc10_dynamics_kinematicsInstanceStruct *chartInstance) { int32_T c10_i2; int32_T c10_i3; int32_T c10_i4; real_T c10_q[6]; uint32_T c10_debug_family_var_map[4]; real_T c10_nargin = 1.0; real_T c10_nargout = 1.0; real_T c10_M[144]; int32_T c10_i5; int32_T c10_i6; real_T c10_u[6]; const mxArray *c10_y = NULL; real_T c10_dv1[144]; int32_T c10_i7; int32_T c10_i8; real_T (*c10_b_M)[144]; real_T (*c10_b_q)[6]; c10_b_q = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 0); c10_b_M = (real_T (*)[144])ssGetOutputPortSignal(chartInstance->S, 1); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 9U, chartInstance->c10_sfEvent); for (c10_i2 = 0; c10_i2 < 144; c10_i2++) { _SFD_DATA_RANGE_CHECK((*c10_b_M)[c10_i2], 0U); } for (c10_i3 = 0; c10_i3 < 6; c10_i3++) { _SFD_DATA_RANGE_CHECK((*c10_b_q)[c10_i3], 1U); } chartInstance->c10_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 9U, chartInstance->c10_sfEvent); for (c10_i4 = 0; c10_i4 < 6; c10_i4++) { c10_q[c10_i4] = (*c10_b_q)[c10_i4]; } sf_debug_symbol_scope_push_eml(0U, 4U, 4U, c10_debug_family_names, c10_debug_family_var_map); sf_debug_symbol_scope_add_eml_importable(&c10_nargin, 0U, c10_c_sf_marshallOut, c10_b_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c10_nargout, 1U, c10_c_sf_marshallOut, c10_b_sf_marshallIn); sf_debug_symbol_scope_add_eml(c10_q, 2U, c10_b_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(c10_M, 3U, c10_sf_marshallOut, c10_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, 3); _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, 4); for (c10_i5 = 0; c10_i5 < 144; c10_i5++) { c10_M[c10_i5] = 0.0; } _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, 5); for (c10_i6 = 0; c10_i6 < 6; c10_i6++) { c10_u[c10_i6] = c10_q[c10_i6]; } c10_y = NULL; sf_mex_assign(&c10_y, sf_mex_create("y", c10_u, 0, 0U, 1U, 0U, 1, 6), FALSE); c10_b_emlrt_marshallIn(chartInstance, sf_mex_call_debug("getInertia", 1U, 1U, 14, c10_y), "getInertia", c10_dv1); for (c10_i7 = 0; c10_i7 < 144; c10_i7++) { c10_M[c10_i7] = c10_dv1[c10_i7]; } _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, -5); sf_debug_symbol_scope_pop(); for (c10_i8 = 0; c10_i8 < 144; c10_i8++) { (*c10_b_M)[c10_i8] = c10_M[c10_i8]; } _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 9U, chartInstance->c10_sfEvent); sf_debug_check_for_state_inconsistency(_dynamics_kinematicsMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }
static void sf_c2_kinematics(SFc2_kinematicsInstanceStruct *chartInstance) { int32_T c2_i2; int32_T c2_i3; int32_T c2_i4; real_T c2_q[6]; uint32_T c2_debug_family_var_map[5]; real_T c2_newq[6]; int32_T c2_newq_sizes[2]; real_T c2_newq_data[6]; real_T c2_nargin = 1.0; real_T c2_nargout = 1.0; real_T c2_Jacobian_body[72]; int32_T c2_i5; int32_T c2_i6; int32_T c2_b_newq; int32_T c2_c_newq; int32_T c2_i7; int32_T c2_u_sizes[2]; int32_T c2_u; int32_T c2_b_u; int32_T c2_loop_ub; int32_T c2_i8; real_T c2_u_data[6]; const mxArray *c2_y = NULL; real_T c2_dv1[72]; int32_T c2_i9; int32_T c2_i10; real_T (*c2_b_Jacobian_body)[72]; real_T (*c2_b_q)[6]; c2_b_Jacobian_body = (real_T (*)[72])ssGetOutputPortSignal(chartInstance->S, 1); c2_b_q = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 0); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c2_sfEvent); for (c2_i2 = 0; c2_i2 < 6; c2_i2++) { _SFD_DATA_RANGE_CHECK((*c2_b_q)[c2_i2], 0U); } for (c2_i3 = 0; c2_i3 < 72; c2_i3++) { _SFD_DATA_RANGE_CHECK((*c2_b_Jacobian_body)[c2_i3], 1U); } chartInstance->c2_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent); for (c2_i4 = 0; c2_i4 < 6; c2_i4++) { c2_q[c2_i4] = (*c2_b_q)[c2_i4]; } sf_debug_symbol_scope_push_eml(0U, 5U, 6U, c2_debug_family_names, c2_debug_family_var_map); sf_debug_symbol_scope_add_eml_importable(c2_newq, MAX_uint32_T, c2_e_sf_marshallOut, c2_d_sf_marshallIn); sf_debug_symbol_scope_add_eml_dyn_importable(c2_newq_data, (const int32_T *) &c2_newq_sizes, NULL, 0, -1, (void *)c2_d_sf_marshallOut, (void *) c2_c_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_nargin, 1U, c2_c_sf_marshallOut, c2_b_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_nargout, 2U, c2_c_sf_marshallOut, c2_b_sf_marshallIn); sf_debug_symbol_scope_add_eml(c2_q, 3U, c2_b_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(c2_Jacobian_body, 4U, c2_sf_marshallOut, c2_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 4); for (c2_i5 = 0; c2_i5 < 72; c2_i5++) { c2_Jacobian_body[c2_i5] = 0.0; } _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 5); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 6); for (c2_i6 = 0; c2_i6 < 6; c2_i6++) { c2_newq[c2_i6] = 0.0; } sf_debug_symbol_switch(0U, 0U); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 7); c2_newq_sizes[0] = 6; c2_newq_sizes[1] = 1; c2_b_newq = c2_newq_sizes[0]; c2_c_newq = c2_newq_sizes[1]; for (c2_i7 = 0; c2_i7 < 6; c2_i7++) { c2_newq_data[c2_i7] = c2_q[c2_i7]; } sf_debug_symbol_switch(0U, 1U); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 8); c2_u_sizes[0] = 6; c2_u_sizes[1] = 1; c2_u = c2_u_sizes[0]; c2_b_u = c2_u_sizes[1]; c2_loop_ub = c2_newq_sizes[0] * c2_newq_sizes[1] - 1; for (c2_i8 = 0; c2_i8 <= c2_loop_ub; c2_i8++) { c2_u_data[c2_i8] = c2_newq_data[c2_i8]; } c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", c2_u_data, 0, 0U, 1U, 0U, 2, c2_u_sizes[0], c2_u_sizes[1]), FALSE); c2_d_emlrt_marshallIn(chartInstance, sf_mex_call_debug("body_jacobian", 1U, 1U, 14, c2_y), "body_jacobian", c2_dv1); for (c2_i9 = 0; c2_i9 < 72; c2_i9++) { c2_Jacobian_body[c2_i9] = c2_dv1[c2_i9]; } _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -8); sf_debug_symbol_scope_pop(); for (c2_i10 = 0; c2_i10 < 72; c2_i10++) { (*c2_b_Jacobian_body)[c2_i10] = c2_Jacobian_body[c2_i10]; } _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent); sf_debug_check_for_state_inconsistency(_kinematicsMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }
static void sf_c2_Leda(SFc2_LedaInstanceStruct *chartInstance) { real_T c2_hoistedGlobal; real_T c2_nota; uint32_T c2_debug_family_var_map[4]; real_T c2_nargin = 1.0; real_T c2_nargout = 0.0; int32_T c2_i2; int32_T c2_i; real_T c2_b_i; real_T c2_u; const mxArray *c2_y = NULL; int32_T c2_i3; static char_T c2_cv0[4] = { '.', 'j', 'p', 'g' }; char_T c2_b_u[4]; const mxArray *c2_b_y = NULL; static real_T c2_dv1[435483]; int32_T c2_c_i; int32_T c2_i4; int32_T c2_i5; int32_T c2_i6; int32_T c2_i7; static real_T c2_b_hoistedGlobal[33096708]; int32_T c2_b_nota; int32_T c2_i8; int32_T c2_i9; int32_T c2_i10; static real_T c2_c_u[435483]; const mxArray *c2_c_y = NULL; real_T *c2_c_nota; c2_c_nota = (real_T *)ssGetInputPortSignal(chartInstance->S, 0); _sfTime_ = (real_T)ssGetT(chartInstance->S); _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c2_sfEvent); _SFD_DATA_RANGE_CHECK(*c2_c_nota, 0U); chartInstance->c2_sfEvent = CALL_EVENT; _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent); c2_hoistedGlobal = *c2_c_nota; c2_nota = c2_hoistedGlobal; sf_debug_symbol_scope_push_eml(0U, 4U, 4U, c2_debug_family_names, c2_debug_family_var_map); sf_debug_symbol_scope_add_eml_importable(&c2_nargin, 0U, c2_b_sf_marshallOut, c2_b_sf_marshallIn); sf_debug_symbol_scope_add_eml_importable(&c2_nargout, 1U, c2_b_sf_marshallOut, c2_b_sf_marshallIn); sf_debug_symbol_scope_add_eml(&c2_nota, 2U, c2_b_sf_marshallOut); sf_debug_symbol_scope_add_eml_importable(chartInstance->c2_pent, 3U, c2_sf_marshallOut, c2_sf_marshallIn); CV_EML_FCN(0, 0); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 3); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 4); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 9); if (CV_EML_IF(0, 1, 0, !chartInstance->c2_pent_not_empty)) { _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 10); for (c2_i2 = 0; c2_i2 < 33096708; c2_i2++) { chartInstance->c2_pent[c2_i2] = 0.0; } chartInstance->c2_pent_not_empty = TRUE; c2_i = 0; while (c2_i < 73) { c2_b_i = 4.0 + (real_T)c2_i; CV_EML_FOR(0, 1, 0, 1); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 13); c2_u = c2_b_i; c2_y = NULL; sf_mex_assign(&c2_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0), FALSE); for (c2_i3 = 0; c2_i3 < 4; c2_i3++) { c2_b_u[c2_i3] = c2_cv0[c2_i3]; } c2_b_y = NULL; sf_mex_assign(&c2_b_y, sf_mex_create("y", c2_b_u, 10, 0U, 1U, 0U, 2, 1, 4), FALSE); c2_d_emlrt_marshallIn(chartInstance, sf_mex_call_debug("imread", 1U, 1U, 14, sf_mex_call_debug("horzcat", 1U, 2U, 14, sf_mex_call_debug("num2str", 1U, 1U, 14, c2_y), 14, c2_b_y)), "imread", c2_dv1); c2_c_i = _SFD_EML_ARRAY_BOUNDS_CHECK("pent", (int32_T)_SFD_INTEGER_CHECK( "i", c2_b_i), 1, 76, 4, 0) - 1; for (c2_i4 = 0; c2_i4 < 3; c2_i4++) { for (c2_i5 = 0; c2_i5 < 381; c2_i5++) { for (c2_i6 = 0; c2_i6 < 381; c2_i6++) { chartInstance->c2_pent[((c2_i6 + 381 * c2_i5) + 145161 * c2_i4) + 435483 * c2_c_i] = c2_dv1[(c2_i6 + 381 * c2_i5) + 145161 * c2_i4]; } } } c2_i++; sf_mex_listen_for_ctrl_c(chartInstance->S); } CV_EML_FOR(0, 1, 0, 0); } _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 19); if (CV_EML_IF(0, 1, 1, c2_nota < 4.0)) { _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 20); c2_nota = 4.0; } _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 22); if (CV_EML_IF(0, 1, 2, c2_nota > 76.0)) { _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 23); c2_nota = 76.0; } _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 26); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 32); for (c2_i7 = 0; c2_i7 < 33096708; c2_i7++) { c2_b_hoistedGlobal[c2_i7] = chartInstance->c2_pent[c2_i7]; } c2_b_nota = _SFD_EML_ARRAY_BOUNDS_CHECK("pent", (int32_T)_SFD_INTEGER_CHECK( "nota", c2_nota), 1, 76, 4, 0) - 1; for (c2_i8 = 0; c2_i8 < 3; c2_i8++) { for (c2_i9 = 0; c2_i9 < 381; c2_i9++) { for (c2_i10 = 0; c2_i10 < 381; c2_i10++) { c2_c_u[(c2_i10 + 381 * c2_i9) + 145161 * c2_i8] = c2_b_hoistedGlobal [((c2_i10 + 381 * c2_i9) + 145161 * c2_i8) + 435483 * c2_b_nota]; } } } c2_c_y = NULL; sf_mex_assign(&c2_c_y, sf_mex_create("y", c2_c_u, 0, 0U, 1U, 0U, 3, 381, 381, 3), FALSE); sf_mex_call_debug("imshow", 0U, 1U, 14, c2_c_y); _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -32); sf_debug_symbol_scope_pop(); _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent); sf_debug_check_for_state_inconsistency(_LedaMachineNumber_, chartInstance->chartNumber, chartInstance->instanceNumber); }