Ejemplo n.º 1
0
static void sf_gateway_c38_Expriment_FacialExpr
  (SFc38_Expriment_FacialExprInstanceStruct *chartInstance)
{
  real_T *c38_V;
  real_T *c38_e;
  real_T *c38_A;
  c38_A = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c38_e = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c38_V = (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, 18U, chartInstance->c38_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c38_V, 0U);
  chartInstance->c38_sfEvent = CALL_EVENT;
  c38_chartstep_c38_Expriment_FacialExpr(chartInstance);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Expriment_FacialExprMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c38_e, 1U);
  _SFD_DATA_RANGE_CHECK(*c38_A, 2U);
}
Ejemplo n.º 2
0
static void sf_c6_Array(SFc6_ArrayInstanceStruct *chartInstance)
{
  real_T *c6_V;
  real_T *c6_I;
  real_T *c6_Radiacion;
  real_T *c6_Temp;
  c6_Temp = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c6_Radiacion = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c6_I = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c6_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 5U, chartInstance->c6_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c6_V, 0U);
  _SFD_DATA_RANGE_CHECK(*c6_I, 1U);
  _SFD_DATA_RANGE_CHECK(*c6_Radiacion, 2U);
  _SFD_DATA_RANGE_CHECK(*c6_Temp, 3U);
  chartInstance->c6_sfEvent = CALL_EVENT;
  c6_chartstep_c6_Array(chartInstance);
  sf_debug_check_for_state_inconsistency(_ArrayMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Ejemplo n.º 3
0
static void sf_gateway_c12_Demo_EP_IdleRandMerg
  (SFc12_Demo_EP_IdleRandMergInstanceStruct *chartInstance)
{
  real_T *c12_V;
  real_T *c12_e;
  real_T *c12_A;
  c12_A = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c12_e = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c12_V = (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, 8U, chartInstance->c12_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c12_V, 0U);
  chartInstance->c12_sfEvent = CALL_EVENT;
  c12_chartstep_c12_Demo_EP_IdleRandMerg(chartInstance);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Demo_EP_IdleRandMergMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c12_e, 1U);
  _SFD_DATA_RANGE_CHECK(*c12_A, 2U);
}
Ejemplo n.º 4
0
static void sf_c1_Qmod(SFc1_QmodInstanceStruct *chartInstance)
{
  int32_T c1_i2;
  int32_T c1_i3;
  int32_T c1_i4;
  real_T *c1_k;
  real_T *c1_m;
  real_T *c1_g;
  real_T (*c1_R)[9];
  real_T (*c1_y)[3];
  real_T (*c1_T)[4];
  c1_R = (real_T (*)[9])ssGetInputPortSignal(chartInstance->S, 4);
  c1_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  c1_g = (real_T *)ssGetInputPortSignal(chartInstance->S, 3);
  c1_m = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c1_k = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c1_T = (real_T (*)[4])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  for (c1_i2 = 0; c1_i2 < 4; c1_i2++) {
    _SFD_DATA_RANGE_CHECK((*c1_T)[c1_i2], 0U);
  }

  _SFD_DATA_RANGE_CHECK(*c1_k, 1U);
  _SFD_DATA_RANGE_CHECK(*c1_m, 2U);
  _SFD_DATA_RANGE_CHECK(*c1_g, 3U);
  for (c1_i3 = 0; c1_i3 < 3; c1_i3++) {
    _SFD_DATA_RANGE_CHECK((*c1_y)[c1_i3], 4U);
  }

  for (c1_i4 = 0; c1_i4 < 9; c1_i4++) {
    _SFD_DATA_RANGE_CHECK((*c1_R)[c1_i4], 5U);
  }

  chartInstance->c1_sfEvent = CALL_EVENT;
  c1_chartstep_c1_Qmod(chartInstance);
  sf_debug_check_for_state_inconsistency(_QmodMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_c2_Quadsim(SFc2_QuadsimInstanceStruct *chartInstance)
{
  int32_T c2_i2;
  int32_T c2_i3;
  real_T (*c2_Xin)[16];
  real_T (*c2_Xout)[12];
  c2_Xin = (real_T (*)[16])ssGetInputPortSignal(chartInstance->S, 0);
  c2_Xout = (real_T (*)[12])ssGetOutputPortSignal(chartInstance->S, 1);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  for (c2_i2 = 0; c2_i2 < 12; c2_i2++) {
    _SFD_DATA_RANGE_CHECK((*c2_Xout)[c2_i2], 0U);
  }

  for (c2_i3 = 0; c2_i3 < 16; c2_i3++) {
    _SFD_DATA_RANGE_CHECK((*c2_Xin)[c2_i3], 1U);
  }

  chartInstance->c2_sfEvent = CALL_EVENT;
  c2_chartstep_c2_Quadsim(chartInstance);
  sf_debug_check_for_state_inconsistency(_QuadsimMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_gateway_c1_VrSubsystem(SFc1_VrSubsystemInstanceStruct
  *chartInstance)
{
  int32_T c1_i1;
  int32_T c1_i2;
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  for (c1_i1 = 0; c1_i1 < 320; c1_i1++) {
    _SFD_DATA_RANGE_CHECK((*chartInstance->c1_u)[c1_i1], 0U, 1U, 0U,
                          chartInstance->c1_sfEvent, false);
  }

  chartInstance->c1_sfEvent = CALL_EVENT;
  c1_chartstep_c1_VrSubsystem(chartInstance);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_VrSubsystemMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  for (c1_i2 = 0; c1_i2 < 128; c1_i2++) {
    _SFD_DATA_RANGE_CHECK((*chartInstance->c1_y)[c1_i2], 1U, 1U, 0U,
                          chartInstance->c1_sfEvent, false);
  }
}
Ejemplo n.º 7
0
static void sf_c2_gesamtmodell(SFc2_gesamtmodellInstanceStruct *chartInstance)
{
  int32_T c2_i2;
  int32_T c2_i3;
  real_T (*c2_y)[3];
  real_T (*c2_u)[4];
  c2_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  c2_u = (real_T (*)[4])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 < 4; c2_i2++) {
    _SFD_DATA_RANGE_CHECK((*c2_u)[c2_i2], 0U);
  }

  for (c2_i3 = 0; c2_i3 < 3; c2_i3++) {
    _SFD_DATA_RANGE_CHECK((*c2_y)[c2_i3], 1U);
  }

  chartInstance->c2_sfEvent = CALL_EVENT;
  c2_chartstep_c2_gesamtmodell(chartInstance);
  sf_debug_check_for_state_inconsistency(_gesamtmodellMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void update_debugger_state_c2_Pedal_Interpretation_exe(void)
{
  uint32_T c2_prevAniVal;
  c2_prevAniVal = sf_debug_get_animation();
  sf_debug_set_animation(0U);
  if (chartInstance.c2_is_active_c2_Pedal_Interpretation_exe == 1) {
    _SFD_CC_CALL(CHART_ENTER_ENTRY_FUNCTION_TAG,0);
  }

  if (chartInstance.c2_is_c2_Pedal_Interpretation_exe == c2_IN_TestCase1) {
    _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
  } else {
    _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
  }

  if (chartInstance.c2_is_c2_Pedal_Interpretation_exe == c2_IN_TestCase2) {
    _SFD_CS_CALL(STATE_ACTIVE_TAG,1);
  } else {
    _SFD_CS_CALL(STATE_INACTIVE_TAG,1);
  }

  if (chartInstance.c2_is_c2_Pedal_Interpretation_exe == c2_IN_TestCase3) {
    _SFD_CS_CALL(STATE_ACTIVE_TAG,2);
  } else {
    _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
  }

  if (chartInstance.c2_is_c2_Pedal_Interpretation_exe == c2_IN_TestCase4) {
    _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
  } else {
    _SFD_CS_CALL(STATE_INACTIVE_TAG,3);
  }

  sf_debug_set_animation(c2_prevAniVal);
  _SFD_ANIMATE();
}
static void sf_c6_motor_control(SFc6_motor_controlInstanceStruct *chartInstance)
{
  real_T *c6_Xd;
  real_T *c6_Xalpha;
  real_T *c6_Xq;
  real_T *c6_theta;
  real_T *c6_Xbeta;
  c6_Xbeta = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c6_theta = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c6_Xq = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c6_Xalpha = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c6_Xd = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 5U, chartInstance->c6_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c6_Xd, 0U);
  _SFD_DATA_RANGE_CHECK(*c6_Xalpha, 1U);
  _SFD_DATA_RANGE_CHECK(*c6_Xq, 2U);
  _SFD_DATA_RANGE_CHECK(*c6_theta, 3U);
  _SFD_DATA_RANGE_CHECK(*c6_Xbeta, 4U);
  chartInstance->c6_sfEvent = CALL_EVENT;
  c6_chartstep_c6_motor_control(chartInstance);
  sf_debug_check_for_state_inconsistency(_motor_controlMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Ejemplo n.º 10
0
static void sf_c25_CusakisME4901arcs2(SFc25_CusakisME4901arcs2InstanceStruct
  *chartInstance)
{
  int32_T c25_i2;
  int32_T c25_i3;
  real_T c25_hoistedGlobal;
  real_T c25_b_hoistedGlobal;
  real_T c25_c_hoistedGlobal;
  int32_T c25_i4;
  real_T c25_u[3];
  real_T c25_b_mt;
  real_T c25_b_mb;
  real_T c25_b_m;
  uint32_T c25_debug_family_var_map[8];
  real_T c25_r;
  real_T c25_nargin = 4.0;
  real_T c25_nargout = 1.0;
  real_T c25_a[6];
  real_T c25_b;
  real_T c25_y;
  real_T c25_A;
  real_T c25_B;
  real_T c25_x;
  real_T c25_b_y;
  real_T c25_b_x;
  real_T c25_c_y;
  int32_T c25_i5;
  real_T c25_b_a;
  real_T c25_b_b;
  real_T c25_d_y;
  real_T c25_c_a;
  real_T c25_c_b;
  real_T c25_e_y;
  real_T c25_d_a;
  real_T c25_d_b;
  real_T c25_f_y;
  int32_T c25_i6;
  real_T (*c25_e_a)[6];
  real_T (*c25_b_u)[3];
  c25_e_a = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1);
  c25_b_u = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 23U, chartInstance->c25_sfEvent);
  for (c25_i2 = 0; c25_i2 < 3; c25_i2++) {
    _SFD_DATA_RANGE_CHECK((*c25_b_u)[c25_i2], 0U);
  }

  _SFD_DATA_RANGE_CHECK(chartInstance->c25_mt, 1U);
  for (c25_i3 = 0; c25_i3 < 6; c25_i3++) {
    _SFD_DATA_RANGE_CHECK((*c25_e_a)[c25_i3], 2U);
  }

  _SFD_DATA_RANGE_CHECK(chartInstance->c25_mb, 3U);
  _SFD_DATA_RANGE_CHECK(chartInstance->c25_m, 4U);
  chartInstance->c25_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 23U, chartInstance->c25_sfEvent);
  c25_hoistedGlobal = chartInstance->c25_mt;
  c25_b_hoistedGlobal = chartInstance->c25_mb;
  c25_c_hoistedGlobal = chartInstance->c25_m;
  for (c25_i4 = 0; c25_i4 < 3; c25_i4++) {
    c25_u[c25_i4] = (*c25_b_u)[c25_i4];
  }

  c25_b_mt = c25_hoistedGlobal;
  c25_b_mb = c25_b_hoistedGlobal;
  c25_b_m = c25_c_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 8U, 8U, c25_debug_family_names,
    c25_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_r, 0U, c25_b_sf_marshallOut,
    c25_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_nargin, 1U, c25_b_sf_marshallOut,
    c25_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_nargout, 2U, c25_b_sf_marshallOut,
    c25_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c25_u, 3U, c25_c_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_b_mt, 4U, c25_b_sf_marshallOut,
    c25_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_b_mb, 5U, c25_b_sf_marshallOut,
    c25_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c25_b_m, 6U, c25_b_sf_marshallOut,
    c25_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c25_a, 7U, c25_sf_marshallOut,
    c25_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, 7);
  c25_b = c25_b_m;
  c25_y = 3.0 * c25_b;
  c25_A = c25_b_mt;
  c25_B = c25_b_mb + c25_y;
  c25_x = c25_A;
  c25_b_y = c25_B;
  c25_b_x = c25_x;
  c25_c_y = c25_b_y;
  c25_r = c25_b_x / c25_c_y;
  _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, 8);
  for (c25_i5 = 0; c25_i5 < 6; c25_i5++) {
    c25_a[c25_i5] = 0.0;
  }

  _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, 10);
  c25_b_a = -c25_r;
  c25_b_b = c25_u[0];
  c25_d_y = c25_b_a * c25_b_b;
  c25_a[0] = c25_d_y;
  _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, 11);
  c25_c_a = -c25_r;
  c25_c_b = c25_u[1];
  c25_e_y = c25_c_a * c25_c_b;
  c25_a[1] = c25_e_y;
  _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, 12);
  c25_d_a = -c25_r;
  c25_d_b = c25_u[2];
  c25_f_y = c25_d_a * c25_d_b;
  c25_a[5] = c25_f_y;
  _SFD_EML_CALL(0U, chartInstance->c25_sfEvent, -12);
  _SFD_SYMBOL_SCOPE_POP();
  for (c25_i6 = 0; c25_i6 < 6; c25_i6++) {
    (*c25_e_a)[c25_i6] = c25_a[c25_i6];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 23U, chartInstance->c25_sfEvent);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_CusakisME4901arcs2MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Ejemplo n.º 11
0
static void c11_chartstep_c11_Batman_Code(SFc11_Batman_CodeInstanceStruct
  *chartInstance)
{
  int32_T c11_i5;
  uint32_T c11_msg[2];
  int32_T c11_i6;
  uint16_T c11_cell_temperatures_in[12];
  uint32_T c11_debug_family_var_map[9];
  uint16_T c11_x1;
  uint16_T c11_x2;
  uint16_T c11_x3;
  uint16_T c11_x4;
  real_T c11_nargin = 2.0;
  real_T c11_nargout = 1.0;
  uint16_T c11_cell_temperatures_out[12];
  uint32_T c11_a;
  uint32_T c11_a1;
  uint32_T c11_c;
  uint32_T c11_b;
  uint32_T c11_b_c;
  uint32_T c11_u0;
  uint32_T c11_b_a;
  uint32_T c11_b_a1;
  uint32_T c11_c_c;
  uint32_T c11_b_b;
  uint32_T c11_d_c;
  uint32_T c11_u1;
  uint32_T c11_c_a;
  uint32_T c11_c_a1;
  uint32_T c11_e_c;
  uint32_T c11_c_b;
  uint32_T c11_f_c;
  uint32_T c11_u2;
  uint32_T c11_d_a;
  uint32_T c11_d_a1;
  uint32_T c11_g_c;
  uint32_T c11_d_b;
  uint32_T c11_h_c;
  uint32_T c11_u3;
  int32_T c11_i7;
  int32_T c11_i8;
  uint16_T (*c11_b_cell_temperatures_out)[12];
  uint16_T (*c11_b_cell_temperatures_in)[12];
  uint32_T (*c11_b_msg)[2];
  c11_b_cell_temperatures_out = (uint16_T (*)[12])ssGetOutputPortSignal
    (chartInstance->S, 1);
  c11_b_cell_temperatures_in = (uint16_T (*)[12])ssGetInputPortSignal
    (chartInstance->S, 1);
  c11_b_msg = (uint32_T (*)[2])ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 7U, chartInstance->c11_sfEvent);
  for (c11_i5 = 0; c11_i5 < 2; c11_i5++) {
    c11_msg[c11_i5] = (*c11_b_msg)[c11_i5];
  }

  for (c11_i6 = 0; c11_i6 < 12; c11_i6++) {
    c11_cell_temperatures_in[c11_i6] = (*c11_b_cell_temperatures_in)[c11_i6];
  }

  sf_debug_symbol_scope_push_eml(0U, 9U, 9U, c11_debug_family_names,
    c11_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(&c11_x1, 0U, c11_d_sf_marshallOut,
    c11_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c11_x2, 1U, c11_d_sf_marshallOut,
    c11_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c11_x3, 2U, c11_d_sf_marshallOut,
    c11_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c11_x4, 3U, c11_d_sf_marshallOut,
    c11_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c11_nargin, 4U, c11_c_sf_marshallOut,
    c11_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c11_nargout, 5U,
    c11_c_sf_marshallOut, c11_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(c11_msg, 6U, c11_b_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(c11_cell_temperatures_in, 7U, c11_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(c11_cell_temperatures_out, 8U,
    c11_sf_marshallOut, c11_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 6);
  c11_a = c11_msg[0];
  c11_a1 = c11_a;
  c11_c = c11_a1;
  c11_b = c11_c;
  c11_b_c = c11_b & 65535U;
  c11_u0 = c11_b_c;
  if (c11_u0 > 65535U) {
    c11_u0 = 65535U;
  }

  c11_x1 = (uint16_T)c11_u0;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 7);
  c11_b_a = c11_msg[0];
  c11_b_a1 = c11_b_a;
  c11_c_c = c11_b_a1 >> 16U;
  c11_b_b = c11_c_c;
  c11_d_c = c11_b_b & 65535U;
  c11_u1 = c11_d_c;
  if (c11_u1 > 65535U) {
    c11_u1 = 65535U;
  }

  c11_x2 = (uint16_T)c11_u1;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 8);
  c11_c_a = c11_msg[1];
  c11_c_a1 = c11_c_a;
  c11_e_c = c11_c_a1;
  c11_c_b = c11_e_c;
  c11_f_c = c11_c_b & 65535U;
  c11_u2 = c11_f_c;
  if (c11_u2 > 65535U) {
    c11_u2 = 65535U;
  }

  c11_x3 = (uint16_T)c11_u2;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 9);
  c11_d_a = c11_msg[1];
  c11_d_a1 = c11_d_a;
  c11_g_c = c11_d_a1 >> 16U;
  c11_d_b = c11_g_c;
  c11_h_c = c11_d_b & 65535U;
  c11_u3 = c11_h_c;
  if (c11_u3 > 65535U) {
    c11_u3 = 65535U;
  }

  c11_x4 = (uint16_T)c11_u3;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 11);
  c11_cell_temperatures_in[8] = c11_x1;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 12);
  c11_cell_temperatures_in[9] = c11_x2;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 13);
  c11_cell_temperatures_in[10] = c11_x3;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 14);
  c11_cell_temperatures_in[11] = c11_x4;
  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, 18);
  for (c11_i7 = 0; c11_i7 < 12; c11_i7++) {
    c11_cell_temperatures_out[c11_i7] = c11_cell_temperatures_in[c11_i7];
  }

  _SFD_EML_CALL(0U, chartInstance->c11_sfEvent, -18);
  sf_debug_symbol_scope_pop();
  for (c11_i8 = 0; c11_i8 < 12; c11_i8++) {
    (*c11_b_cell_temperatures_out)[c11_i8] = c11_cell_temperatures_out[c11_i8];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 7U, chartInstance->c11_sfEvent);
}
Ejemplo n.º 12
0
static void sf_gateway_c6_CSE1_DP(SFc6_CSE1_DPInstanceStruct *chartInstance)
{
  real_T c6_hoistedGlobal;
  real_T c6_u_BT;
  int32_T c6_i0;
  real_T c6_nu[3];
  uint32_T c6_debug_family_var_map[15];
  real_T c6_u;
  real_T c6_a;
  real_T c6_b;
  real_T c6_c;
  real_T c6_d;
  real_T c6_y0;
  real_T c6_a0;
  real_T c6_a1;
  real_T c6_b1;
  real_T c6_c1;
  real_T c6_nargin = 2.0;
  real_T c6_nargout = 1.0;
  real_T c6_F_y;
  real_T c6_x;
  real_T c6_b_x;
  real_T c6_c_x;
  real_T c6_d_x;
  real_T c6_e_x;
  real_T c6_f_x;
  real_T c6_g_x;
  real_T c6_h_x;
  real_T c6_i_x;
  real_T c6_j_x;
  real_T c6_A;
  real_T c6_k_x;
  real_T c6_l_x;
  real_T c6_m_x;
  int32_T c6_i1;
  real_T *c6_b_u_BT;
  real_T *c6_b_F_y;
  real_T (*c6_b_nu)[3];
  c6_b_nu = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 1);
  c6_b_F_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c6_b_u_BT = (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, 5U, chartInstance->c6_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c6_b_u_BT, 0U);
  chartInstance->c6_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 5U, chartInstance->c6_sfEvent);
  c6_hoistedGlobal = *c6_b_u_BT;
  c6_u_BT = c6_hoistedGlobal;
  for (c6_i0 = 0; c6_i0 < 3; c6_i0++) {
    c6_nu[c6_i0] = (*c6_b_nu)[c6_i0];
  }

  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 15U, 15U, c6_debug_family_names,
    c6_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_u, 0U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_a, 1U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_b, 2U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_c, 3U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_d, 4U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_y0, 5U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_a0, 6U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_a1, 7U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_b1, 8U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_c1, 9U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_nargin, 10U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_nargout, 11U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_u_BT, 12U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(c6_nu, 13U, c6_b_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_F_y, 14U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 3);
  c6_u = c6_nu[0];
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 5);
  if (CV_EML_IF(0, 1, 0, c6_u_BT > 0.0879)) {
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 6);
    c6_a = 2.515;
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 7);
    c6_b = 0.1174;
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 8);
    c6_c = -2.807;
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 9);
    c6_d = -1.131;
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 10);
    c6_x = 0.1174 * c6_u_BT;
    c6_b_x = c6_x;
    c6_b_x = muDoubleScalarExp(c6_b_x);
    c6_c_x = -1.131 * c6_u_BT;
    c6_d_x = c6_c_x;
    c6_d_x = muDoubleScalarExp(c6_d_x);
    c6_y0 = 2.515 * c6_b_x + -2.807 * c6_d_x;
  } else {
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 11);
    if (CV_EML_IF(0, 1, 1, c6_u_BT < -0.059)) {
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 12);
      c6_a = -548.0;
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 13);
      c6_b = 0.193;
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 14);
      c6_c = 548.2;
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 15);
      c6_d = 0.1992;
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 16);
      c6_e_x = 0.193 * c6_u_BT;
      c6_f_x = c6_e_x;
      c6_f_x = muDoubleScalarExp(c6_f_x);
      c6_g_x = 0.1992 * c6_u_BT;
      c6_h_x = c6_g_x;
      c6_h_x = muDoubleScalarExp(c6_h_x);
      c6_y0 = -548.0 * c6_f_x + 548.2 * c6_h_x;
    } else {
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 18);
      c6_y0 = 0.0;
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 21);
  c6_a0 = 0.7561;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 22);
  c6_a1 = 0.3075;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 23);
  c6_b1 = -10.22;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 24);
  c6_c1 = 2.947;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 25);
  c6_i_x = -10.22 * c6_u + c6_c1;
  c6_j_x = c6_i_x;
  c6_j_x = muDoubleScalarAtan(c6_j_x);
  c6_A = c6_y0 * (c6_a0 + 0.3075 * c6_j_x);
  c6_k_x = c6_A;
  c6_l_x = c6_k_x;
  c6_m_x = c6_l_x;
  c6_F_y = c6_m_x / 1.1385;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -25);
  _SFD_SYMBOL_SCOPE_POP();
  *c6_b_F_y = c6_F_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 5U, chartInstance->c6_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_CSE1_DPMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c6_b_F_y, 1U);
  for (c6_i1 = 0; c6_i1 < 3; c6_i1++) {
    _SFD_DATA_RANGE_CHECK((*c6_b_nu)[c6_i1], 2U);
  }
}
Ejemplo n.º 13
0
static void sf_gateway_c6_Demo_Kinect(SFc6_Demo_KinectInstanceStruct
  *chartInstance)
{
  real_T c6_hoistedGlobal;
  real_T c6_z;
  uint32_T c6_debug_family_var_map[8];
  boolean_T c6_aVarTruthTableCondition_1;
  boolean_T c6_aVarTruthTableCondition_2;
  boolean_T c6_aVarTruthTableCondition_3;
  boolean_T c6_aVarTruthTableCondition_4;
  real_T c6_nargin = 1.0;
  real_T c6_nargout = 1.0;
  real_T c6_y;
  boolean_T c6_b0;
  boolean_T c6_b1;
  real_T *c6_b_z;
  real_T *c6_b_y;
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  c6_b_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c6_b_z = (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, 4U, chartInstance->c6_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c6_b_z, 0U);
  chartInstance->c6_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 4U, chartInstance->c6_sfEvent);
  c6_hoistedGlobal = *c6_b_z;
  c6_z = c6_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 8U, 8U, c6_debug_family_names,
    c6_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_aVarTruthTableCondition_1, 0U,
    c6_b_sf_marshallOut, c6_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_aVarTruthTableCondition_2, 1U,
    c6_b_sf_marshallOut, c6_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_aVarTruthTableCondition_3, 2U,
    c6_b_sf_marshallOut, c6_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_aVarTruthTableCondition_4, 3U,
    c6_b_sf_marshallOut, c6_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_nargin, 4U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_nargout, 5U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c6_z, 6U, c6_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c6_y, 7U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 3);
  c6_aVarTruthTableCondition_1 = false;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 4);
  c6_aVarTruthTableCondition_2 = false;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 5);
  c6_aVarTruthTableCondition_3 = false;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 6);
  c6_aVarTruthTableCondition_4 = false;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 11);
  c6_aVarTruthTableCondition_1 = (c6_z >= 240.0);
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 15);
  guard2 = false;
  if (c6_z < 100.0) {
    if (c6_z != 0.0) {
      c6_b0 = true;
    } else {
      guard2 = true;
    }
  } else {
    guard2 = true;
  }

  if (guard2 == true) {
    c6_b0 = false;
  }

  c6_aVarTruthTableCondition_2 = c6_b0;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 19);
  guard1 = false;
  if (c6_z >= 100.0) {
    if (c6_z < 240.0) {
      c6_b1 = true;
    } else {
      guard1 = true;
    }
  } else {
    guard1 = true;
  }

  if (guard1 == true) {
    c6_b1 = false;
  }

  c6_aVarTruthTableCondition_3 = c6_b1;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 23);
  c6_aVarTruthTableCondition_4 = (c6_z == 0.0);
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 25);
  if (CV_EML_IF(0, 1, 0, c6_aVarTruthTableCondition_1)) {
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 26);
    CV_EML_FCN(0, 1);
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 41);
    c6_y = 2.0;
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -41);
  } else {
    _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 27);
    if (CV_EML_IF(0, 1, 1, c6_aVarTruthTableCondition_2)) {
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 28);
      CV_EML_FCN(0, 2);
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 47);
      c6_y = 1.0;
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -47);
    } else {
      _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 29);
      if (CV_EML_IF(0, 1, 2, c6_aVarTruthTableCondition_3)) {
        _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 30);
        CV_EML_FCN(0, 3);
        _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 53);
        c6_y = 0.0;
        _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -53);
      } else {
        _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 31);
        if (CV_EML_IF(0, 1, 3, c6_aVarTruthTableCondition_4)) {
          _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 32);
          CV_EML_FCN(0, 4);
          _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 59);
          c6_y = 3.0;
          _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -59);
        } else {
          _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 34);
          CV_EML_FCN(0, 4);
          _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 59);
          c6_y = 3.0;
          _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -59);
        }
      }
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -34);
  _SFD_SYMBOL_SCOPE_POP();
  *c6_b_y = c6_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 4U, chartInstance->c6_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Demo_KinectMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c6_b_y, 1U);
}
Ejemplo n.º 14
0
static void sf_c3_car_model(SFc3_car_modelInstanceStruct *chartInstance)
{
  int32_T c3_i3;
  int32_T c3_i4;
  int32_T c3_i5;
  int32_T c3_previousEvent;
  int32_T c3_i6;
  real_T c3_hoistedGlobal[4];
  int32_T c3_i7;
  real_T c3_b_hoistedGlobal[3];
  int32_T c3_i8;
  real_T c3_X[4];
  int32_T c3_i9;
  real_T c3_u[3];
  uint32_T c3_debug_family_var_map[22];
  real_T c3_l_F;
  real_T c3_l_R;
  real_T c3_Vx;
  real_T c3_Vy;
  real_T c3_r;
  real_T c3_psi;
  real_T c3_f_Fx;
  real_T c3_f_Rx;
  real_T c3_delta;
  real_T c3_beta;
  real_T c3_V;
  real_T c3_s_Fy_num;
  real_T c3_s_Fy_denum;
  real_T c3_s_Fy;
  real_T c3_s_Ry_num;
  real_T c3_s_Ry_denum;
  real_T c3_s_Ry;
  real_T c3_nargin = 2.0;
  real_T c3_nargout = 1.0;
  real_T c3_s[2];
  real_T c3_A;
  real_T c3_B;
  real_T c3_x;
  real_T c3_y;
  real_T c3_b_x;
  real_T c3_b_y;
  real_T c3_c_x;
  real_T c3_c_y;
  real_T c3_d_y;
  real_T c3_d_x;
  real_T c3_e_x;
  real_T c3_f_x;
  real_T c3_g_x;
  real_T c3_h_x;
  real_T c3_i_x;
  real_T c3_j_x;
  real_T c3_a;
  real_T c3_b;
  real_T c3_e_y;
  real_T c3_b_a;
  real_T c3_f_y;
  real_T c3_k_x;
  real_T c3_l_x;
  real_T c3_m_x;
  real_T c3_c_a;
  real_T c3_b_b;
  real_T c3_g_y;
  real_T c3_n_x;
  real_T c3_o_x;
  real_T c3_p_x;
  real_T c3_d_a;
  real_T c3_c_b;
  real_T c3_h_y;
  real_T c3_e_a;
  real_T c3_i_y;
  real_T c3_q_x;
  real_T c3_r_x;
  real_T c3_s_x;
  real_T c3_f_a;
  real_T c3_d_b;
  real_T c3_j_y;
  real_T c3_b_A;
  real_T c3_b_B;
  real_T c3_t_x;
  real_T c3_k_y;
  real_T c3_u_x;
  real_T c3_l_y;
  real_T c3_v_x;
  real_T c3_m_y;
  real_T c3_w_x;
  real_T c3_x_x;
  real_T c3_y_x;
  real_T c3_g_a;
  real_T c3_e_b;
  real_T c3_n_y;
  real_T c3_h_a;
  real_T c3_o_y;
  real_T c3_ab_x;
  real_T c3_bb_x;
  real_T c3_cb_x;
  real_T c3_i_a;
  real_T c3_f_b;
  real_T c3_c_A;
  real_T c3_c_B;
  real_T c3_db_x;
  real_T c3_p_y;
  real_T c3_eb_x;
  real_T c3_q_y;
  real_T c3_fb_x;
  real_T c3_r_y;
  int32_T c3_i10;
  real_T (*c3_b_s)[2];
  real_T (*c3_b_u)[3];
  real_T (*c3_b_X)[4];
  c3_b_u = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 1);
  c3_b_s = (real_T (*)[2])ssGetOutputPortSignal(chartInstance->S, 1);
  c3_b_X = (real_T (*)[4])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,2);
  for (c3_i3 = 0; c3_i3 < 4; c3_i3 = c3_i3 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_b_X)[c3_i3], 0U);
  }

  for (c3_i4 = 0; c3_i4 < 2; c3_i4 = c3_i4 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_b_s)[c3_i4], 1U);
  }

  for (c3_i5 = 0; c3_i5 < 3; c3_i5 = c3_i5 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_b_u)[c3_i5], 2U);
  }

  c3_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,2);
  for (c3_i6 = 0; c3_i6 < 4; c3_i6 = c3_i6 + 1) {
    c3_hoistedGlobal[c3_i6] = (*c3_b_X)[c3_i6];
  }

  for (c3_i7 = 0; c3_i7 < 3; c3_i7 = c3_i7 + 1) {
    c3_b_hoistedGlobal[c3_i7] = (*c3_b_u)[c3_i7];
  }

  for (c3_i8 = 0; c3_i8 < 4; c3_i8 = c3_i8 + 1) {
    c3_X[c3_i8] = c3_hoistedGlobal[c3_i8];
  }

  for (c3_i9 = 0; c3_i9 < 3; c3_i9 = c3_i9 + 1) {
    c3_u[c3_i9] = c3_b_hoistedGlobal[c3_i9];
  }

  sf_debug_symbol_scope_push_eml(0U, 22U, 22U, c3_debug_family_names,
    c3_debug_family_var_map);
  sf_debug_symbol_scope_add_eml(&c3_l_F, c3_d_sf_marshall, 0U);
  sf_debug_symbol_scope_add_eml(&c3_l_R, c3_d_sf_marshall, 1U);
  sf_debug_symbol_scope_add_eml(&c3_Vx, c3_d_sf_marshall, 2U);
  sf_debug_symbol_scope_add_eml(&c3_Vy, c3_d_sf_marshall, 3U);
  sf_debug_symbol_scope_add_eml(&c3_r, c3_d_sf_marshall, 4U);
  sf_debug_symbol_scope_add_eml(&c3_psi, c3_d_sf_marshall, 5U);
  sf_debug_symbol_scope_add_eml(&c3_f_Fx, c3_d_sf_marshall, 6U);
  sf_debug_symbol_scope_add_eml(&c3_f_Rx, c3_d_sf_marshall, 7U);
  sf_debug_symbol_scope_add_eml(&c3_delta, c3_d_sf_marshall, 8U);
  sf_debug_symbol_scope_add_eml(&c3_beta, c3_d_sf_marshall, 9U);
  sf_debug_symbol_scope_add_eml(&c3_V, c3_d_sf_marshall, 10U);
  sf_debug_symbol_scope_add_eml(&c3_s_Fy_num, c3_d_sf_marshall, 11U);
  sf_debug_symbol_scope_add_eml(&c3_s_Fy_denum, c3_d_sf_marshall, 12U);
  sf_debug_symbol_scope_add_eml(&c3_s_Fy, c3_d_sf_marshall, 13U);
  sf_debug_symbol_scope_add_eml(&c3_s_Ry_num, c3_d_sf_marshall, 14U);
  sf_debug_symbol_scope_add_eml(&c3_s_Ry_denum, c3_d_sf_marshall, 15U);
  sf_debug_symbol_scope_add_eml(&c3_s_Ry, c3_d_sf_marshall, 16U);
  sf_debug_symbol_scope_add_eml(&c3_nargin, c3_d_sf_marshall, 17U);
  sf_debug_symbol_scope_add_eml(&c3_nargout, c3_d_sf_marshall, 18U);
  sf_debug_symbol_scope_add_eml(&c3_X, c3_c_sf_marshall, 19U);
  sf_debug_symbol_scope_add_eml(&c3_u, c3_b_sf_marshall, 20U);
  sf_debug_symbol_scope_add_eml(&c3_s, c3_sf_marshall, 21U);
  CV_EML_FCN(0, 0);

  /*  l_F = param.l_F; */
  /*  l_R = param.l_R; */
  _SFD_EML_CALL(0,7);
  c3_l_F = 1.1;
  _SFD_EML_CALL(0,8);
  c3_l_R = 1.6;
  _SFD_EML_CALL(0,10);
  c3_Vx = c3_X[0];
  _SFD_EML_CALL(0,11);
  c3_Vy = c3_X[1];
  _SFD_EML_CALL(0,12);
  c3_r = c3_X[2];
  _SFD_EML_CALL(0,13);
  c3_psi = c3_X[3];
  _SFD_EML_CALL(0,15);
  c3_f_Fx = c3_u[0];
  _SFD_EML_CALL(0,16);
  c3_f_Rx = c3_u[1];
  _SFD_EML_CALL(0,17);
  c3_delta = c3_u[2];
  _SFD_EML_CALL(0,20);
  if (CV_EML_COND(0, 0, c3_Vx == 0.0)) {
    if (CV_EML_COND(0, 1, c3_Vy == 0.0)) {
      CV_EML_MCDC(0, 0, TRUE);
      CV_EML_IF(0, 0, TRUE);
      _SFD_EML_CALL(0,21);
      c3_beta = 0.0;
      goto label_1;
    }
  }

  CV_EML_MCDC(0, 0, FALSE);
  CV_EML_IF(0, 0, FALSE);
  _SFD_EML_CALL(0,23);
  c3_A = c3_Vy;
  c3_B = c3_Vx;
  c3_x = c3_A;
  c3_y = c3_B;
  c3_b_x = c3_x;
  c3_b_y = c3_y;
  c3_c_x = c3_b_x;
  c3_c_y = c3_b_y;
  c3_d_y = c3_c_x / c3_c_y;
  c3_d_x = c3_d_y;
  c3_beta = c3_d_x;
  c3_e_x = c3_beta;
  c3_beta = c3_e_x;
  c3_beta = muDoubleScalarAtan(c3_beta);
 label_1:
  ;
  _SFD_EML_CALL(0,26);
  c3_f_x = c3_mpower(chartInstance, c3_Vx) + c3_mpower(chartInstance, c3_Vy);
  c3_V = c3_f_x;
  if (c3_V < 0.0) {
    c3_eml_error(chartInstance);
  }

  c3_g_x = c3_V;
  c3_V = c3_g_x;
  c3_V = muDoubleScalarSqrt(c3_V);
  _SFD_EML_CALL(0,28);
  c3_h_x = c3_beta - c3_delta;
  c3_i_x = c3_h_x;
  c3_j_x = c3_i_x;
  c3_i_x = c3_j_x;
  c3_i_x = muDoubleScalarSin(c3_i_x);
  c3_a = c3_V;
  c3_b = c3_i_x;
  c3_e_y = c3_a * c3_b;
  c3_b_a = c3_r;
  c3_f_y = c3_b_a * 1.1;
  c3_k_x = c3_delta;
  c3_l_x = c3_k_x;
  c3_m_x = c3_l_x;
  c3_l_x = c3_m_x;
  c3_l_x = muDoubleScalarCos(c3_l_x);
  c3_c_a = c3_f_y;
  c3_b_b = c3_l_x;
  c3_g_y = c3_c_a * c3_b_b;
  c3_s_Fy_num = c3_e_y + c3_g_y;
  _SFD_EML_CALL(0,29);
  c3_n_x = c3_beta - c3_delta;
  c3_o_x = c3_n_x;
  c3_p_x = c3_o_x;
  c3_o_x = c3_p_x;
  c3_o_x = muDoubleScalarCos(c3_o_x);
  c3_d_a = c3_V;
  c3_c_b = c3_o_x;
  c3_h_y = c3_d_a * c3_c_b;
  c3_e_a = c3_r;
  c3_i_y = c3_e_a * 1.1;
  c3_q_x = c3_delta;
  c3_r_x = c3_q_x;
  c3_s_x = c3_r_x;
  c3_r_x = c3_s_x;
  c3_r_x = muDoubleScalarSin(c3_r_x);
  c3_f_a = c3_i_y;
  c3_d_b = c3_r_x;
  c3_j_y = c3_f_a * c3_d_b;
  c3_s_Fy_denum = c3_h_y + c3_j_y;
  _SFD_EML_CALL(0,31);
  if (CV_EML_COND(0, 2, c3_s_Fy_num == 0.0)) {
    if (CV_EML_COND(0, 3, c3_s_Fy_denum == 0.0)) {
      CV_EML_MCDC(0, 1, TRUE);
      CV_EML_IF(0, 1, TRUE);
      _SFD_EML_CALL(0,32);
      c3_s_Fy = 0.0;
      goto label_2;
    }
  }

  CV_EML_MCDC(0, 1, FALSE);
  CV_EML_IF(0, 1, FALSE);
  _SFD_EML_CALL(0,34);
  c3_b_A = c3_s_Fy_num;
  c3_b_B = c3_s_Fy_denum;
  c3_t_x = c3_b_A;
  c3_k_y = c3_b_B;
  c3_u_x = c3_t_x;
  c3_l_y = c3_k_y;
  c3_v_x = c3_u_x;
  c3_m_y = c3_l_y;
  c3_s_Fy = c3_v_x / c3_m_y;
 label_2:
  ;
  _SFD_EML_CALL(0,37);
  c3_w_x = c3_beta;
  c3_x_x = c3_w_x;
  c3_y_x = c3_x_x;
  c3_x_x = c3_y_x;
  c3_x_x = muDoubleScalarSin(c3_x_x);
  c3_g_a = c3_V;
  c3_e_b = c3_x_x;
  c3_n_y = c3_g_a * c3_e_b;
  c3_h_a = c3_r;
  c3_o_y = c3_h_a * 1.6;
  c3_s_Ry_num = c3_n_y - c3_o_y;
  _SFD_EML_CALL(0,38);
  c3_ab_x = c3_beta;
  c3_bb_x = c3_ab_x;
  c3_cb_x = c3_bb_x;
  c3_bb_x = c3_cb_x;
  c3_bb_x = muDoubleScalarCos(c3_bb_x);
  c3_i_a = c3_V;
  c3_f_b = c3_bb_x;
  c3_s_Ry_denum = c3_i_a * c3_f_b;
  _SFD_EML_CALL(0,40);
  if (CV_EML_COND(0, 4, c3_s_Ry_num == 0.0)) {
    if (CV_EML_COND(0, 5, c3_s_Ry_denum == 0.0)) {
      CV_EML_MCDC(0, 2, TRUE);
      CV_EML_IF(0, 2, TRUE);
      _SFD_EML_CALL(0,41);
      c3_s_Ry = 0.0;
      goto label_3;
    }
  }

  CV_EML_MCDC(0, 2, FALSE);
  CV_EML_IF(0, 2, FALSE);
  _SFD_EML_CALL(0,43);
  c3_c_A = c3_s_Ry_num;
  c3_c_B = c3_s_Ry_denum;
  c3_db_x = c3_c_A;
  c3_p_y = c3_c_B;
  c3_eb_x = c3_db_x;
  c3_q_y = c3_p_y;
  c3_fb_x = c3_eb_x;
  c3_r_y = c3_q_y;
  c3_s_Ry = c3_fb_x / c3_r_y;
 label_3:
  ;
  _SFD_EML_CALL(0,46);
  c3_s[0] = c3_s_Fy;
  c3_s[1] = c3_s_Ry;
  _SFD_EML_CALL(0,-46);
  sf_debug_symbol_scope_pop();
  for (c3_i10 = 0; c3_i10 < 2; c3_i10 = c3_i10 + 1) {
    (*c3_b_s)[c3_i10] = c3_s[c3_i10];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
  _sfEvent_ = c3_previousEvent;
  sf_debug_check_for_state_inconsistency(_car_modelMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_c7_Pedal_Interpretation_exe(void)
{
  uint8_T c7_previousEvent;
  real_T *c7_TDPre;
  real_T *c7_Activate;
  c7_TDPre = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1);
  c7_Activate = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,3);
  _SFD_DATA_RANGE_CHECK(*c7_Activate, 0U);
  _SFD_DATA_RANGE_CHECK(*c7_TDPre, 1U);
  c7_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,3);
  if (chartInstance.c7_temporalCounter_i1 < 1023) {
    chartInstance.c7_temporalCounter_i1 = (uint16_T)
      (chartInstance.c7_temporalCounter_i1 + 1);
  }

  if (chartInstance.c7_is_active_c7_Pedal_Interpretation_exe == 0) {
    _SFD_CC_CALL(CHART_ENTER_ENTRY_FUNCTION_TAG,3);
    chartInstance.c7_is_active_c7_Pedal_Interpretation_exe = 1U;
    _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,3);
    _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,0);
    _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,0);
    chartInstance.c7_is_c7_Pedal_Interpretation_exe = (uint8_T)c7_IN_wait;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,5);
    chartInstance.c7_temporalCounter_i1 = 0U;
    chartInstance.c7_tp_wait = 1U;
    *c7_TDPre = 2.0;
    _SFD_DATA_RANGE_CHECK(*c7_TDPre, 1U);
  } else {
    switch (chartInstance.c7_is_c7_Pedal_Interpretation_exe) {
     case c7_IN_Precondition1:
      CV_CHART_EVAL(3,0,1);
      _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,0);
      switch (chartInstance.c7_is_Precondition1) {
       case c7_IN_Init1:
        CV_STATE_EVAL(0,0,1);
        _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,1);
        _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,2);
        if (CV_TRANSITION_EVAL(2U, (_SFD_CCP_CALL(2,0,((1)!=0)) != 0) &&
                               (_SFD_CCP_CALL(2,1,
               ((chartInstance.c7_temporalCounter_i1 >= 50)!=0))
              != 0)) != 0) {
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,2);
          _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,1);
          chartInstance.c7_tp_Init1 = 0U;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,1);
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,1);
          chartInstance.c7_is_Precondition1 = (uint8_T)c7_IN_TDataPre1;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
          chartInstance.c7_temporalCounter_i1 = 0U;
          chartInstance.c7_tp_TDataPre1 = 1U;
          *c7_TDPre = 1.0;
          _SFD_DATA_RANGE_CHECK(*c7_TDPre, 1U);
        }

        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,1);
        break;

       case c7_IN_Stabilise1:
        CV_STATE_EVAL(0,0,2);
        _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,2);
        _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,3);
        if (CV_TRANSITION_EVAL(3U, (_SFD_CCP_CALL(3,0,((1)!=0)) != 0) &&
                               (_SFD_CCP_CALL(3,1,
               ((chartInstance.c7_temporalCounter_i1 >= 50)!=0))
              != 0)) != 0) {
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,3);
          _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,2);
          chartInstance.c7_tp_Stabilise1 = 0U;
          chartInstance.c7_is_Precondition1 = (uint8_T)c7_IN_NO_ACTIVE_CHILD;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
          _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,0);
          chartInstance.c7_tp_Precondition1 = 0U;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
          chartInstance.c7_is_c7_Pedal_Interpretation_exe = (uint8_T)c7_IN_stop;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,4);
          chartInstance.c7_tp_stop = 1U;
        }

        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
        break;

       case c7_IN_TDataPre1:
        CV_STATE_EVAL(0,0,3);
        _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,3);
        _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,4);
        if (CV_TRANSITION_EVAL(4U, (_SFD_CCP_CALL(4,0,((1)!=0)) != 0) &&
                               (_SFD_CCP_CALL(4,1,
               ((chartInstance.c7_temporalCounter_i1 >= 100)!=0))
              != 0)) != 0) {
          _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,4);
          _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,3);
          chartInstance.c7_tp_TDataPre1 = 0U;
          _SFD_CS_CALL(STATE_INACTIVE_TAG,3);
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,3);
          chartInstance.c7_is_Precondition1 = (uint8_T)c7_IN_Stabilise1;
          _SFD_CS_CALL(STATE_ACTIVE_TAG,2);
          chartInstance.c7_temporalCounter_i1 = 0U;
          chartInstance.c7_tp_Stabilise1 = 1U;
          *c7_TDPre = 1.0;
          _SFD_DATA_RANGE_CHECK(*c7_TDPre, 1U);
        }

        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,3);
        break;

       default:
        CV_STATE_EVAL(0,0,0);
        chartInstance.c7_is_Precondition1 = (uint8_T)c7_IN_NO_ACTIVE_CHILD;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,1);
        break;
      }

      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
      break;

     case c7_IN_stop:
      CV_CHART_EVAL(3,0,2);
      _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,4);
      _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,5);
      _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,5);
      _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,4);
      chartInstance.c7_tp_stop = 0U;
      _SFD_CS_CALL(STATE_INACTIVE_TAG,4);
      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,4);
      chartInstance.c7_is_c7_Pedal_Interpretation_exe = (uint8_T)
        c7_IN_Precondition1;
      _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
      chartInstance.c7_tp_Precondition1 = 1U;
      _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,1);
      _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,1);
      chartInstance.c7_is_Precondition1 = (uint8_T)c7_IN_Init1;
      _SFD_CS_CALL(STATE_ACTIVE_TAG,1);
      chartInstance.c7_temporalCounter_i1 = 0U;
      chartInstance.c7_tp_Init1 = 1U;
      *c7_TDPre = 1.0;
      _SFD_DATA_RANGE_CHECK(*c7_TDPre, 1U);
      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,4);
      break;

     case c7_IN_wait:
      CV_CHART_EVAL(3,0,3);
      _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,5);
      _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,6);
      if (CV_TRANSITION_EVAL(6U, (_SFD_CCP_CALL(6,0,((1)!=0)) != 0) &&
                             (_SFD_CCP_CALL(6,1,
             ((chartInstance.c7_temporalCounter_i1 >= 800)!=0))
            != 0)) != 0) {
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,6);
        _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,5);
        chartInstance.c7_tp_wait = 0U;
        chartInstance.c7_is_c7_Pedal_Interpretation_exe = (uint8_T)
          c7_IN_NO_ACTIVE_CHILD;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
        chartInstance.c7_is_c7_Pedal_Interpretation_exe = (uint8_T)
          c7_IN_Precondition1;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
        chartInstance.c7_tp_Precondition1 = 1U;
        _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,1);
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,1);
        chartInstance.c7_is_Precondition1 = (uint8_T)c7_IN_Init1;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,1);
        chartInstance.c7_temporalCounter_i1 = 0U;
        chartInstance.c7_tp_Init1 = 1U;
        *c7_TDPre = 1.0;
        _SFD_DATA_RANGE_CHECK(*c7_TDPre, 1U);
      }

      _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
      break;

     default:
      CV_CHART_EVAL(3,0,0);
      chartInstance.c7_is_c7_Pedal_Interpretation_exe = (uint8_T)
        c7_IN_NO_ACTIVE_CHILD;
      _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
      break;
    }
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,3);
  _sfEvent_ = c7_previousEvent;
  sf_debug_check_for_state_inconsistency(_Pedal_Interpretation_exeMachineNumber_,
    chartInstance.chartNumber, chartInstance.
    instanceNumber);
}
Ejemplo n.º 16
0
static void sf_c3_ErdMond(SFc3_ErdMondInstanceStruct *chartInstance)
{
  int32_T c3_i2;
  int32_T c3_i3;
  int32_T c3_i4;
  real_T c3_xAktuell[2];
  uint32_T c3_debug_family_var_map[16];
  real_T c3_xE[2];
  real_T c3_eSE[2];
  real_T c3_xM[2];
  real_T c3_vSM[2];
  real_T c3_rSM;
  real_T c3_eSM[2];
  real_T c3_r;
  real_T c3_mE;
  real_T c3_mM;
  real_T c3_G;
  real_T c3_F_SE[2];
  real_T c3_F_SM[2];
  real_T c3_nargin = 1.0;
  real_T c3_nargout = 1.0;
  real_T c3_a[2];
  int32_T c3_i5;
  real_T c3_A[2];
  int32_T c3_i6;
  real_T c3_b_xAktuell[2];
  real_T c3_B;
  real_T c3_y;
  real_T c3_b_y;
  int32_T c3_i7;
  int32_T c3_i8;
  int32_T c3_i9;
  int32_T c3_i10;
  int32_T c3_i11;
  int32_T c3_i12;
  real_T c3_b_vSM[2];
  int32_T c3_i13;
  int32_T c3_i14;
  real_T c3_c_vSM[2];
  real_T c3_b_B;
  real_T c3_c_y;
  real_T c3_d_y;
  int32_T c3_i15;
  int32_T c3_i16;
  real_T c3_c_xAktuell[2];
  real_T c3_c_B;
  real_T c3_e_y;
  real_T c3_f_y;
  real_T c3_g_y;
  real_T c3_b_a;
  int32_T c3_i17;
  int32_T c3_i18;
  real_T c3_d_B;
  real_T c3_h_y;
  real_T c3_i_y;
  real_T c3_j_y;
  real_T c3_c_a;
  int32_T c3_i19;
  int32_T c3_i20;
  int32_T c3_i21;
  int32_T c3_i22;
  real_T (*c3_d_a)[2];
  real_T (*c3_d_xAktuell)[2];
  c3_d_a = (real_T (*)[2])ssGetOutputPortSignal(chartInstance->S, 1);
  c3_d_xAktuell = (real_T (*)[2])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  for (c3_i2 = 0; c3_i2 < 2; c3_i2++) {
    _SFD_DATA_RANGE_CHECK((*c3_d_xAktuell)[c3_i2], 0U);
  }

  for (c3_i3 = 0; c3_i3 < 2; c3_i3++) {
    _SFD_DATA_RANGE_CHECK((*c3_d_a)[c3_i3], 1U);
  }

  chartInstance->c3_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  for (c3_i4 = 0; c3_i4 < 2; c3_i4++) {
    c3_xAktuell[c3_i4] = (*c3_d_xAktuell)[c3_i4];
  }

  sf_debug_symbol_scope_push_eml(0U, 16U, 16U, c3_debug_family_names,
    c3_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(c3_xE, 0U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(c3_eSE, 1U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(c3_xM, 2U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(c3_vSM, 3U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c3_rSM, 4U, c3_b_sf_marshallOut,
    c3_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(c3_eSM, 5U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c3_r, 6U, c3_b_sf_marshallOut,
    c3_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c3_mE, 7U, c3_b_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c3_mM, 8U, c3_b_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c3_G, 9U, c3_b_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(c3_F_SE, 10U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(c3_F_SM, 11U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c3_nargin, 12U, c3_b_sf_marshallOut,
    c3_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c3_nargout, 13U, c3_b_sf_marshallOut,
    c3_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(c3_xAktuell, 14U, c3_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(c3_a, 15U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 4);
  for (c3_i5 = 0; c3_i5 < 2; c3_i5++) {
    c3_A[c3_i5] = c3_xAktuell[c3_i5];
  }

  for (c3_i6 = 0; c3_i6 < 2; c3_i6++) {
    c3_b_xAktuell[c3_i6] = c3_xAktuell[c3_i6];
  }

  c3_B = c3_norm(chartInstance, c3_b_xAktuell);
  c3_y = c3_B;
  c3_b_y = c3_y;
  for (c3_i7 = 0; c3_i7 < 2; c3_i7++) {
    c3_xE[c3_i7] = c3_A[c3_i7] / c3_b_y;
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 5);
  for (c3_i8 = 0; c3_i8 < 2; c3_i8++) {
    c3_A[c3_i8] = c3_xE[c3_i8];
  }

  for (c3_i9 = 0; c3_i9 < 2; c3_i9++) {
    c3_eSE[c3_i9] = -c3_A[c3_i9];
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 7);
  for (c3_i10 = 0; c3_i10 < 2; c3_i10++) {
    c3_xM[c3_i10] = -3.8E+8 * (real_T)c3_i10;
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 8);
  for (c3_i11 = 0; c3_i11 < 2; c3_i11++) {
    c3_vSM[c3_i11] = c3_xM[c3_i11] - c3_xAktuell[c3_i11];
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 9);
  for (c3_i12 = 0; c3_i12 < 2; c3_i12++) {
    c3_b_vSM[c3_i12] = c3_vSM[c3_i12];
  }

  c3_rSM = c3_norm(chartInstance, c3_b_vSM);
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 10);
  for (c3_i13 = 0; c3_i13 < 2; c3_i13++) {
    c3_A[c3_i13] = c3_vSM[c3_i13];
  }

  for (c3_i14 = 0; c3_i14 < 2; c3_i14++) {
    c3_c_vSM[c3_i14] = c3_vSM[c3_i14];
  }

  c3_b_B = c3_norm(chartInstance, c3_c_vSM);
  c3_c_y = c3_b_B;
  c3_d_y = c3_c_y;
  for (c3_i15 = 0; c3_i15 < 2; c3_i15++) {
    c3_eSM[c3_i15] = c3_A[c3_i15] / c3_d_y;
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 12);
  for (c3_i16 = 0; c3_i16 < 2; c3_i16++) {
    c3_c_xAktuell[c3_i16] = c3_xAktuell[c3_i16];
  }

  c3_r = c3_norm(chartInstance, c3_c_xAktuell);
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 14);
  c3_mE = 5.9736000000000006E+24;
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 15);
  c3_mM = 7.348E+22;
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 16);
  c3_G = 6.6743E-11;
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 18);
  c3_c_B = c3_mpower(chartInstance, c3_r);
  c3_e_y = c3_c_B;
  c3_f_y = c3_e_y;
  c3_g_y = 3.986959848E+14 / c3_f_y;
  c3_b_a = c3_g_y;
  for (c3_i17 = 0; c3_i17 < 2; c3_i17++) {
    c3_A[c3_i17] = c3_eSE[c3_i17];
  }

  for (c3_i18 = 0; c3_i18 < 2; c3_i18++) {
    c3_F_SE[c3_i18] = c3_b_a * c3_A[c3_i18];
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 19);
  c3_d_B = c3_mpower(chartInstance, c3_rSM);
  c3_h_y = c3_d_B;
  c3_i_y = c3_h_y;
  c3_j_y = 4.904275639999999E+12 / c3_i_y;
  c3_c_a = c3_j_y;
  for (c3_i19 = 0; c3_i19 < 2; c3_i19++) {
    c3_A[c3_i19] = c3_eSM[c3_i19];
  }

  for (c3_i20 = 0; c3_i20 < 2; c3_i20++) {
    c3_F_SM[c3_i20] = c3_c_a * c3_A[c3_i20];
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 21);
  for (c3_i21 = 0; c3_i21 < 2; c3_i21++) {
    c3_a[c3_i21] = c3_F_SE[c3_i21] + c3_F_SM[c3_i21];
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, -21);
  sf_debug_symbol_scope_pop();
  for (c3_i22 = 0; c3_i22 < 2; c3_i22++) {
    (*c3_d_a)[c3_i22] = c3_a[c3_i22];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  sf_debug_check_for_state_inconsistency(_ErdMondMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void c6_chartstep_c6_motor_control(SFc6_motor_controlInstanceStruct
  *chartInstance)
{
  real_T c6_hoistedGlobal;
  real_T c6_b_hoistedGlobal;
  real_T c6_c_hoistedGlobal;
  real_T c6_Xd;
  real_T c6_Xq;
  real_T c6_theta;
  uint32_T c6_debug_family_var_map[11];
  real_T c6_c;
  real_T c6_s;
  real_T c6_ipm[4];
  real_T c6_xab[2];
  real_T c6_nargin = 3.0;
  real_T c6_nargout = 2.0;
  real_T c6_Xalpha;
  real_T c6_Xbeta;
  real_T c6_x;
  real_T c6_b_x;
  real_T c6_c_x;
  real_T c6_d_x;
  int32_T c6_i0;
  real_T c6_a[4];
  real_T c6_b_Xd[2];
  int32_T c6_i1;
  real_T c6_b[2];
  int32_T c6_i2;
  int32_T c6_i3;
  int32_T c6_i4;
  real_T c6_C[2];
  int32_T c6_i5;
  int32_T c6_i6;
  int32_T c6_i7;
  int32_T c6_i8;
  int32_T c6_i9;
  int32_T c6_i10;
  real_T *c6_c_Xd;
  real_T *c6_b_Xq;
  real_T *c6_b_theta;
  real_T *c6_b_Xalpha;
  real_T *c6_b_Xbeta;
  c6_b_Xbeta = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c6_b_theta = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c6_b_Xq = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c6_b_Xalpha = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c6_c_Xd = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 5U, chartInstance->c6_sfEvent);
  c6_hoistedGlobal = *c6_c_Xd;
  c6_b_hoistedGlobal = *c6_b_Xq;
  c6_c_hoistedGlobal = *c6_b_theta;
  c6_Xd = c6_hoistedGlobal;
  c6_Xq = c6_b_hoistedGlobal;
  c6_theta = c6_c_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 11U, 11U, c6_debug_family_names,
    c6_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(&c6_c, 0U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c6_s, 1U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(c6_ipm, 2U, c6_c_sf_marshallOut,
    c6_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(c6_xab, 3U, c6_b_sf_marshallOut,
    c6_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c6_nargin, 4U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c6_nargout, 5U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c6_Xd, 6U, c6_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c6_Xq, 7U, c6_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c6_theta, 8U, c6_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c6_Xalpha, 9U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c6_Xbeta, 10U, c6_sf_marshallOut,
    c6_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 5);
  c6_x = c6_theta;
  c6_c = c6_x;
  c6_b_x = c6_c;
  c6_c = c6_b_x;
  c6_c = muDoubleScalarCos(c6_c);
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 6);
  c6_c_x = c6_theta;
  c6_s = c6_c_x;
  c6_d_x = c6_s;
  c6_s = c6_d_x;
  c6_s = muDoubleScalarSin(c6_s);
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 8);
  c6_ipm[0] = c6_c;
  c6_ipm[2] = -c6_s;
  c6_ipm[1] = c6_s;
  c6_ipm[3] = c6_c;
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 10);
  for (c6_i0 = 0; c6_i0 < 4; c6_i0++) {
    c6_a[c6_i0] = c6_ipm[c6_i0];
  }

  c6_b_Xd[0] = c6_Xd;
  c6_b_Xd[1] = c6_Xq;
  for (c6_i1 = 0; c6_i1 < 2; c6_i1++) {
    c6_b[c6_i1] = c6_b_Xd[c6_i1];
  }

  c6_eml_scalar_eg(chartInstance);
  c6_eml_scalar_eg(chartInstance);
  for (c6_i2 = 0; c6_i2 < 2; c6_i2++) {
    c6_xab[c6_i2] = 0.0;
  }

  for (c6_i3 = 0; c6_i3 < 2; c6_i3++) {
    c6_xab[c6_i3] = 0.0;
  }

  for (c6_i4 = 0; c6_i4 < 2; c6_i4++) {
    c6_C[c6_i4] = c6_xab[c6_i4];
  }

  for (c6_i5 = 0; c6_i5 < 2; c6_i5++) {
    c6_xab[c6_i5] = c6_C[c6_i5];
  }

  for (c6_i6 = 0; c6_i6 < 2; c6_i6++) {
    c6_C[c6_i6] = c6_xab[c6_i6];
  }

  for (c6_i7 = 0; c6_i7 < 2; c6_i7++) {
    c6_xab[c6_i7] = c6_C[c6_i7];
  }

  for (c6_i8 = 0; c6_i8 < 2; c6_i8++) {
    c6_xab[c6_i8] = 0.0;
    c6_i9 = 0;
    for (c6_i10 = 0; c6_i10 < 2; c6_i10++) {
      c6_xab[c6_i8] += c6_a[c6_i9 + c6_i8] * c6_b[c6_i10];
      c6_i9 += 2;
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 12);
  c6_Xalpha = c6_xab[0];
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, 13);
  c6_Xbeta = c6_xab[1];
  _SFD_EML_CALL(0U, chartInstance->c6_sfEvent, -13);
  sf_debug_symbol_scope_pop();
  *c6_b_Xalpha = c6_Xalpha;
  *c6_b_Xbeta = c6_Xbeta;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 5U, chartInstance->c6_sfEvent);
}
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_gateway_c10_experiment_lib2(SFc10_experiment_lib2InstanceStruct
  *chartInstance)
{
  int32_T c10_i2;
  real_T c10_hoistedGlobal;
  real_T c10_b_hoistedGlobal;
  int32_T c10_i3;
  real_T c10_V[4];
  real_T c10_val;
  real_T c10_b_a;
  uint32_T c10_debug_family_var_map[6];
  real_T c10_nargin = 3.0;
  real_T c10_nargout = 1.0;
  real_T c10_out[4];
  int32_T c10_i4;
  int32_T c10_i5;
  int32_T c10_i6;
  real_T *c10_b_val;
  real_T (*c10_b_out)[4];
  real_T (*c10_b_V)[4];
  c10_b_val = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c10_b_out = (real_T (*)[4])ssGetOutputPortSignal(chartInstance->S, 1);
  c10_b_V = (real_T (*)[4])ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 3U, chartInstance->c10_sfEvent);
  for (c10_i2 = 0; c10_i2 < 4; c10_i2++) {
    _SFD_DATA_RANGE_CHECK((*c10_b_V)[c10_i2], 0U);
  }

  chartInstance->c10_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 3U, chartInstance->c10_sfEvent);
  c10_hoistedGlobal = *c10_b_val;
  c10_b_hoistedGlobal = chartInstance->c10_a;
  for (c10_i3 = 0; c10_i3 < 4; c10_i3++) {
    c10_V[c10_i3] = (*c10_b_V)[c10_i3];
  }

  c10_val = c10_hoistedGlobal;
  c10_b_a = c10_b_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 6U, 6U, c10_debug_family_names,
    c10_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c10_nargin, 0U, c10_b_sf_marshallOut,
    c10_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c10_nargout, 1U, c10_b_sf_marshallOut,
    c10_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c10_V, 2U, c10_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c10_val, 3U, c10_b_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c10_b_a, 4U, c10_b_sf_marshallOut,
    c10_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c10_out, 5U, c10_sf_marshallOut,
    c10_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, 2);
  for (c10_i4 = 0; c10_i4 < 4; c10_i4++) {
    c10_out[c10_i4] = c10_V[c10_i4];
  }

  _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, 3);
  c10_out[_SFD_EML_ARRAY_BOUNDS_CHECK("out", (int32_T)_SFD_INTEGER_CHECK("a",
    c10_b_a), 1, 4, 1, 0) - 1] = c10_val;
  _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, -3);
  _SFD_SYMBOL_SCOPE_POP();
  for (c10_i5 = 0; c10_i5 < 4; c10_i5++) {
    (*c10_b_out)[c10_i5] = c10_out[c10_i5];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 3U, chartInstance->c10_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_experiment_lib2MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  for (c10_i6 = 0; c10_i6 < 4; c10_i6++) {
    _SFD_DATA_RANGE_CHECK((*c10_b_out)[c10_i6], 1U);
  }

  _SFD_DATA_RANGE_CHECK(*c10_b_val, 2U);
  _SFD_DATA_RANGE_CHECK(chartInstance->c10_a, 3U);
}
Ejemplo n.º 20
0
Archivo: c3_V2A1_2.c Proyecto: d-f/MTP
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);
}
Ejemplo n.º 21
0
static void sf_c2_controller1(SFc2_controller1InstanceStruct *chartInstance)
{
  int32_T c2_previousEvent;
  real_T c2_hoistedGlobal;
  real_T c2_u;
  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_x;
  real_T c2_b_x;
  real_T c2_b_y;
  real_T c2_c_x;
  real_T c2_xk;
  real_T c2_d_x;
  real_T c2_e_x;
  real_T c2_f_x;
  real_T *c2_b_u;
  real_T *c2_c_y;
  c2_c_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c2_b_u = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1);
  _SFD_DATA_RANGE_CHECK(*c2_b_u, 0U);
  _SFD_DATA_RANGE_CHECK(*c2_c_y, 1U);
  c2_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1);
  c2_hoistedGlobal = *c2_b_u;
  c2_u = 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(&c2_nargin, c2_sf_marshall, 0U);
  sf_debug_symbol_scope_add_eml(&c2_nargout, c2_sf_marshall, 1U);
  sf_debug_symbol_scope_add_eml(&c2_u, c2_sf_marshall, 2U);
  sf_debug_symbol_scope_add_eml(&c2_y, c2_sf_marshall, 3U);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0, 2);
  c2_x = c2_u;
  c2_b_x = c2_x;
  c2_b_y = muDoubleScalarAbs(c2_b_x);
  if (CV_EML_IF(0, 0, c2_b_y > 90.0)) {
    _SFD_EML_CALL(0, 3);
    c2_c_x = c2_u;
    c2_eml_scalar_eg(chartInstance);
    c2_xk = c2_c_x;
    c2_d_x = c2_xk;
    c2_eml_scalar_eg(chartInstance);
    c2_e_x = c2_d_x / 90.0;
    c2_f_x = c2_e_x;
    c2_f_x = muDoubleScalarFloor(c2_f_x);
    c2_u = c2_d_x - c2_f_x * 90.0;
  }

  _SFD_EML_CALL(0, 5);
  c2_y = c2_u;
  _SFD_EML_CALL(0, -5);
  sf_debug_symbol_scope_pop();
  *c2_c_y = c2_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1);
  _sfEvent_ = c2_previousEvent;
  sf_debug_check_for_state_inconsistency(_controller1MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Ejemplo n.º 22
0
static void c12_chartstep_c12_DemoWave_K(SFc12_DemoWave_KInstanceStruct
  *chartInstance)
{
  real_T c12_hoistedGlobal;
  real_T c12_b_hoistedGlobal;
  real_T c12_V;
  real_T c12_A;
  uint32_T c12_debug_family_var_map[13];
  boolean_T c12_aVarTruthTableCondition_1;
  boolean_T c12_aVarTruthTableCondition_2;
  boolean_T c12_aVarTruthTableCondition_3;
  boolean_T c12_aVarTruthTableCondition_4;
  boolean_T c12_aVarTruthTableCondition_5;
  boolean_T c12_aVarTruthTableCondition_6;
  boolean_T c12_aVarTruthTableCondition_7;
  boolean_T c12_aVarTruthTableCondition_8;
  real_T c12_nargin = 2.0;
  real_T c12_nargout = 1.0;
  real_T c12_e;
  boolean_T c12_b0;
  boolean_T c12_b1;
  boolean_T c12_b2;
  boolean_T c12_b3;
  boolean_T c12_b4;
  boolean_T c12_b5;
  boolean_T c12_b6;
  boolean_T c12_b7;
  real_T *c12_b_e;
  real_T *c12_b_V;
  real_T *c12_b_A;
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  c12_b_A = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c12_b_e = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c12_b_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 9U, chartInstance->c12_sfEvent);
  c12_hoistedGlobal = *c12_b_V;
  c12_b_hoistedGlobal = *c12_b_A;
  c12_V = c12_hoistedGlobal;
  c12_A = c12_b_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 13U, 13U, c12_debug_family_names,
    c12_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_1, 0U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_2, 1U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_3, 2U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_4, 3U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_5, 4U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_6, 5U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_7, 6U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_aVarTruthTableCondition_8, 7U,
    c12_b_sf_marshallOut, c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_nargin, 8U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_nargout, 9U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c12_V, 10U, c12_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c12_A, 11U, c12_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_e, 12U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 3);
  c12_aVarTruthTableCondition_1 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 4);
  c12_aVarTruthTableCondition_2 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 5);
  c12_aVarTruthTableCondition_3 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 6);
  c12_aVarTruthTableCondition_4 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 7);
  c12_aVarTruthTableCondition_5 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 8);
  c12_aVarTruthTableCondition_6 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 9);
  c12_aVarTruthTableCondition_7 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 10);
  c12_aVarTruthTableCondition_8 = false;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 15);
  guard11 = false;
  guard12 = false;
  if (c12_V > 15.0) {
    if (c12_A < 15.0) {
      if (c12_A > 0.0) {
        c12_b0 = true;
      } else {
        guard11 = true;
      }
    } else {
      guard12 = true;
    }
  } else {
    guard12 = true;
  }

  if (guard12 == true) {
    guard11 = true;
  }

  if (guard11 == true) {
    c12_b0 = false;
  }

  c12_aVarTruthTableCondition_1 = c12_b0;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 19);
  guard10 = false;
  if (c12_V > 0.0) {
    if (c12_A > 15.0) {
      c12_b1 = true;
    } else {
      guard10 = true;
    }
  } else {
    guard10 = true;
  }

  if (guard10 == true) {
    c12_b1 = false;
  }

  c12_aVarTruthTableCondition_2 = c12_b1;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 23);
  guard9 = false;
  if (c12_V < 0.0) {
    if (c12_A > 15.0) {
      c12_b2 = true;
    } else {
      guard9 = true;
    }
  } else {
    guard9 = true;
  }

  if (guard9 == true) {
    c12_b2 = false;
  }

  c12_aVarTruthTableCondition_3 = c12_b2;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 27);
  guard7 = false;
  guard8 = false;
  if (c12_V < -15.0) {
    if (c12_A < 15.0) {
      if (c12_A > 0.0) {
        c12_b3 = true;
      } else {
        guard7 = true;
      }
    } else {
      guard8 = true;
    }
  } else {
    guard8 = true;
  }

  if (guard8 == true) {
    guard7 = true;
  }

  if (guard7 == true) {
    c12_b3 = false;
  }

  c12_aVarTruthTableCondition_4 = c12_b3;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 31);
  guard5 = false;
  guard6 = false;
  if (c12_V > 15.0) {
    if (c12_A < 0.0) {
      if (c12_A > -15.0) {
        c12_b4 = true;
      } else {
        guard5 = true;
      }
    } else {
      guard6 = true;
    }
  } else {
    guard6 = true;
  }

  if (guard6 == true) {
    guard5 = true;
  }

  if (guard5 == true) {
    c12_b4 = false;
  }

  c12_aVarTruthTableCondition_5 = c12_b4;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 35);
  guard4 = false;
  if (c12_V > 0.0) {
    if (c12_A < -15.0) {
      c12_b5 = true;
    } else {
      guard4 = true;
    }
  } else {
    guard4 = true;
  }

  if (guard4 == true) {
    c12_b5 = false;
  }

  c12_aVarTruthTableCondition_6 = c12_b5;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 39);
  guard3 = false;
  if (c12_V < 0.0) {
    if (c12_A < -15.0) {
      c12_b6 = true;
    } else {
      guard3 = true;
    }
  } else {
    guard3 = true;
  }

  if (guard3 == true) {
    c12_b6 = false;
  }

  c12_aVarTruthTableCondition_7 = c12_b6;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 43);
  guard1 = false;
  guard2 = false;
  if (c12_V < -15.0) {
    if (c12_A < 0.0) {
      if (c12_A > -15.0) {
        c12_b7 = true;
      } else {
        guard1 = true;
      }
    } else {
      guard2 = true;
    }
  } else {
    guard2 = true;
  }

  if (guard2 == true) {
    guard1 = true;
  }

  if (guard1 == true) {
    c12_b7 = false;
  }

  c12_aVarTruthTableCondition_8 = c12_b7;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 45);
  if (CV_EML_IF(0, 1, 0, c12_aVarTruthTableCondition_1)) {
    _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 46);
    CV_EML_FCN(0, 1);
    _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 69);
    c12_e = 7.0;
    _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -69);
  } else {
    _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 47);
    if (CV_EML_IF(0, 1, 1, c12_aVarTruthTableCondition_2)) {
      _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 48);
      CV_EML_FCN(0, 2);
      _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 75);
      c12_e = 8.0;
      _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -75);
    } else {
      _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 49);
      if (CV_EML_IF(0, 1, 2, c12_aVarTruthTableCondition_3)) {
        _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 50);
        CV_EML_FCN(0, 3);
        _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 81);
        c12_e = 4.0;
        _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -81);
      } else {
        _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 51);
        if (CV_EML_IF(0, 1, 3, c12_aVarTruthTableCondition_4)) {
          _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 52);
          CV_EML_FCN(0, 4);
          _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 87);
          c12_e = 3.0;
          _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -87);
        } else {
          _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 53);
          if (CV_EML_IF(0, 1, 4, c12_aVarTruthTableCondition_5)) {
            _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 54);
            CV_EML_FCN(0, 5);
            _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 93);
            c12_e = 6.0;
            _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -93);
          } else {
            _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 55);
            if (CV_EML_IF(0, 1, 5, c12_aVarTruthTableCondition_6)) {
              _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 56);
              CV_EML_FCN(0, 6);
              _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 99);
              c12_e = 5.0;
              _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -99);
            } else {
              _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 57);
              if (CV_EML_IF(0, 1, 6, c12_aVarTruthTableCondition_7)) {
                _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 58);
                CV_EML_FCN(0, 7);
                _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 105);
                c12_e = 1.0;
                _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -105);
              } else {
                _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 59);
                if (CV_EML_IF(0, 1, 7, c12_aVarTruthTableCondition_8)) {
                  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 60);
                  CV_EML_FCN(0, 8);
                  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 111);
                  c12_e = 2.0;
                  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -111);
                } else {
                  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 62);
                  CV_EML_FCN(0, 5);
                  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 93);
                  c12_e = 6.0;
                  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -93);
                }
              }
            }
          }
        }
      }
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -62);
  _SFD_SYMBOL_SCOPE_POP();
  *c12_b_e = c12_e;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 9U, chartInstance->c12_sfEvent);
}
Ejemplo n.º 23
0
static void sf_gateway_c2_Demo_AU_VA1(SFc2_Demo_AU_VA1InstanceStruct
  *chartInstance)
{
  real_T c2_hoistedGlobal;
  real_T c2_randv;
  uint32_T c2_debug_family_var_map[6];
  real_T c2_randTrigger;
  real_T c2_nargin = 1.0;
  real_T c2_nargout = 2.0;
  real_T c2_v_trigW;
  real_T c2_v_trig;
  real_T c2_x;
  real_T c2_b_x;
  real_T c2_c_x;
  real_T c2_d_x;
  real_T *c2_b_randv;
  real_T *c2_b_v_trigW;
  real_T *c2_b_v_trig;
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  c2_b_v_trig = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c2_b_v_trigW = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c2_b_randv = (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_randv, 0U);
  chartInstance->c2_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  c2_hoistedGlobal = *c2_b_randv;
  c2_randv = c2_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 6U, 6U, c2_debug_family_names,
    c2_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_randTrigger, 0U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargin, 1U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargout, 2U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c2_randv, 3U, c2_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_v_trigW, 4U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_v_trig, 5U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 3);
  c2_v_trigW = 0.0;
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 5);
  c2_x = c2_randv;
  c2_randTrigger = c2_x;
  c2_b_x = c2_randTrigger;
  c2_randTrigger = c2_b_x;
  c2_randTrigger = muDoubleScalarFloor(c2_randTrigger);
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 7);
  guard2 = false;
  if (CV_EML_COND(0, 1, 0, 0.0 < c2_randTrigger)) {
    if (CV_EML_COND(0, 1, 1, c2_randTrigger < 30.0)) {
      CV_EML_MCDC(0, 1, 0, true);
      CV_EML_IF(0, 1, 0, true);
      _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 8);
      c2_v_trigW += 0.1;
    } else {
      guard2 = true;
    }
  } else {
    guard2 = true;
  }

  if (guard2 == true) {
    CV_EML_MCDC(0, 1, 0, false);
    CV_EML_IF(0, 1, 0, false);
  }

  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 10);
  guard1 = false;
  if (CV_EML_COND(0, 1, 2, 30.0 < c2_randTrigger)) {
    if (CV_EML_COND(0, 1, 3, c2_randTrigger < 60.0)) {
      CV_EML_MCDC(0, 1, 1, true);
      CV_EML_IF(0, 1, 1, true);
      _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 11);
      c2_v_trigW -= 0.1;
    } else {
      guard1 = true;
    }
  } else {
    guard1 = true;
  }

  if (guard1 == true) {
    CV_EML_MCDC(0, 1, 1, false);
    CV_EML_IF(0, 1, 1, false);
  }

  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 14);
  if (CV_EML_IF(0, 1, 2, c2_v_trigW > 0.0)) {
    _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 15);
    c2_v_trig = 1.0;
  } else {
    _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 16);
    if (CV_EML_IF(0, 1, 3, c2_v_trigW < 0.0)) {
      _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 17);
      c2_v_trig = -1.0;
      _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 18);
      c2_c_x = c2_v_trigW;
      c2_d_x = c2_c_x;
      c2_v_trigW = muDoubleScalarAbs(c2_d_x);
    } else {
      _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 20);
      c2_v_trig = 0.0;
      _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 20);
      c2_v_trigW = 0.0;
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -20);
  _SFD_SYMBOL_SCOPE_POP();
  *c2_b_v_trigW = c2_v_trigW;
  *c2_b_v_trig = c2_v_trig;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Demo_AU_VA1MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c2_b_v_trigW, 1U);
  _SFD_DATA_RANGE_CHECK(*c2_b_v_trig, 2U);
}
Ejemplo n.º 24
0
static void sf_gateway_c54_Expriment_FacialExpr
(SFc54_Expriment_FacialExprInstanceStruct *chartInstance)
{
    real_T c54_hoistedGlobal;
    real_T c54_v1;
    uint32_T c54_debug_family_var_map[6];
    boolean_T c54_aVarTruthTableCondition_1;
    boolean_T c54_aVarTruthTableCondition_2;
    real_T c54_nargin = 1.0;
    real_T c54_nargout = 1.0;
    real_T c54_v2;
    real_T *c54_b_v2;
    real_T *c54_b_v1;
    c54_b_v1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
    c54_b_v2 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
    _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
    _sfTime_ = sf_get_time(chartInstance->S);
    _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 30U, chartInstance->c54_sfEvent);
    chartInstance->c54_sfEvent = CALL_EVENT;
    _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 30U, chartInstance->c54_sfEvent);
    c54_hoistedGlobal = *c54_b_v1;
    c54_v1 = c54_hoistedGlobal;
    _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 6U, 6U, c54_debug_family_names,
                               c54_debug_family_var_map);
    _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c54_aVarTruthTableCondition_1, 0U,
                                         c54_b_sf_marshallOut, c54_b_sf_marshallIn);
    _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c54_aVarTruthTableCondition_2, 1U,
                                         c54_b_sf_marshallOut, c54_b_sf_marshallIn);
    _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c54_nargin, 2U, c54_sf_marshallOut,
                                         c54_sf_marshallIn);
    _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c54_nargout, 3U, c54_sf_marshallOut,
                                         c54_sf_marshallIn);
    _SFD_SYMBOL_SCOPE_ADD_EML(&c54_v1, 4U, c54_sf_marshallOut);
    _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c54_v2, 5U, c54_sf_marshallOut,
                                         c54_sf_marshallIn);
    CV_EML_FCN(0, 0);
    _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 3);
    c54_aVarTruthTableCondition_1 = false;
    _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 4);
    c54_aVarTruthTableCondition_2 = false;
    _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 8);
    c54_aVarTruthTableCondition_1 = (c54_v1 > 25.0);
    _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 11);
    c54_aVarTruthTableCondition_2 = (c54_v1 < -25.0);
    _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 13);
    if (CV_EML_IF(0, 1, 0, c54_aVarTruthTableCondition_1)) {
        _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 14);
        CV_EML_FCN(0, 1);
        _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 24);
        c54_v2 = c54_v1;
        _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, -24);
    } else {
        _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 15);
        if (CV_EML_IF(0, 1, 1, c54_aVarTruthTableCondition_2)) {
            _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 16);
            CV_EML_FCN(0, 2);
            _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 29);
            c54_v2 = c54_v1;
            _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, -29);
        } else {
            _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 18);
            CV_EML_FCN(0, 3);
            _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, 34);
            c54_v2 = 0.0;
            _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, -34);
        }
    }

    _SFD_EML_CALL(0U, chartInstance->c54_sfEvent, -18);
    _SFD_SYMBOL_SCOPE_POP();
    *c54_b_v2 = c54_v2;
    _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 30U, chartInstance->c54_sfEvent);
    _SFD_SYMBOL_SCOPE_POP();
    _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Expriment_FacialExprMachineNumber_,
                                       chartInstance->chartNumber, chartInstance->instanceNumber);
    _SFD_DATA_RANGE_CHECK(*c54_b_v2, 0U);
    _SFD_DATA_RANGE_CHECK(*c54_b_v1, 1U);
}
Ejemplo n.º 25
0
static void sf_c7_ekffedepre(SFc7_ekffedepreInstanceStruct *chartInstance)
{
  real_T c7_hoistedGlobal;
  real_T c7_b_hoistedGlobal;
  real_T c7_c_hoistedGlobal;
  real_T c7_d_hoistedGlobal;
  real_T c7_e_hoistedGlobal;
  real_T c7_sfasamento;
  real_T c7_ampiezza;
  real_T c7_frequenza;
  real_T c7_noise;
  real_T c7_t;
  uint32_T c7_debug_family_var_map[8];
  real_T c7_nargin = 5.0;
  real_T c7_nargout = 1.0;
  real_T c7_wave;
  real_T c7_b;
  real_T c7_y;
  real_T c7_a;
  real_T c7_b_b;
  real_T c7_b_y;
  real_T c7_x;
  real_T c7_b_x;
  real_T c7_b_a;
  real_T c7_c_b;
  real_T c7_c_y;
  real_T *c7_b_sfasamento;
  real_T *c7_b_wave;
  real_T *c7_b_ampiezza;
  real_T *c7_b_frequenza;
  real_T *c7_b_noise;
  real_T *c7_b_t;
  c7_b_t = (real_T *)ssGetInputPortSignal(chartInstance->S, 4);
  c7_b_noise = (real_T *)ssGetInputPortSignal(chartInstance->S, 3);
  c7_b_frequenza = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c7_b_ampiezza = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c7_b_wave = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c7_b_sfasamento = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 6U, chartInstance->c7_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c7_b_sfasamento, 0U);
  _SFD_DATA_RANGE_CHECK(*c7_b_wave, 1U);
  _SFD_DATA_RANGE_CHECK(*c7_b_ampiezza, 2U);
  _SFD_DATA_RANGE_CHECK(*c7_b_frequenza, 3U);
  _SFD_DATA_RANGE_CHECK(*c7_b_noise, 4U);
  _SFD_DATA_RANGE_CHECK(*c7_b_t, 5U);
  chartInstance->c7_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 6U, chartInstance->c7_sfEvent);
  c7_hoistedGlobal = *c7_b_sfasamento;
  c7_b_hoistedGlobal = *c7_b_ampiezza;
  c7_c_hoistedGlobal = *c7_b_frequenza;
  c7_d_hoistedGlobal = *c7_b_noise;
  c7_e_hoistedGlobal = *c7_b_t;
  c7_sfasamento = c7_hoistedGlobal;
  c7_ampiezza = c7_b_hoistedGlobal;
  c7_frequenza = c7_c_hoistedGlobal;
  c7_noise = c7_d_hoistedGlobal;
  c7_t = c7_e_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 8U, 8U, c7_debug_family_names,
    c7_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(&c7_nargin, 0U, c7_sf_marshallOut,
    c7_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c7_nargout, 1U, c7_sf_marshallOut,
    c7_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c7_sfasamento, 2U, c7_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c7_ampiezza, 3U, c7_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c7_frequenza, 4U, c7_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c7_noise, 5U, c7_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c7_t, 6U, c7_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c7_wave, 7U, c7_sf_marshallOut,
    c7_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c7_sfEvent, 4);
  c7_b = c7_frequenza;
  c7_y = 6.2831853071795862 * c7_b;
  c7_a = c7_y;
  c7_b_b = c7_t;
  c7_b_y = c7_a * c7_b_b;
  c7_x = c7_sfasamento + c7_b_y;
  c7_b_x = c7_x;
  c7_b_x = muDoubleScalarSin(c7_b_x);
  c7_b_a = c7_ampiezza;
  c7_c_b = c7_b_x;
  c7_c_y = c7_b_a * c7_c_b;
  c7_wave = c7_c_y + c7_noise;
  _SFD_EML_CALL(0U, chartInstance->c7_sfEvent, -4);
  sf_debug_symbol_scope_pop();
  *c7_b_wave = c7_wave;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 6U, chartInstance->c7_sfEvent);
  sf_debug_check_for_state_inconsistency(_ekffedepreMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Ejemplo n.º 26
0
static void sf_c12_CusakisME4901arcs(SFc12_CusakisME4901arcsInstanceStruct
  *chartInstance)
{
  int32_T c12_i2;
  int32_T c12_i3;
  int32_T c12_i4;
  real_T c12_M[16];
  uint32_T c12_debug_family_var_map[11];
  real_T c12_m;
  real_T c12_n;
  real_T c12_a[16];
  real_T c12_MM[16];
  real_T c12_i;
  real_T c12_mm;
  real_T c12_j;
  real_T c12_nargin = 1.0;
  real_T c12_nargout = 1.0;
  real_T c12_DD[16];
  int32_T c12_i5;
  int32_T c12_i6;
  int32_T c12_b_mm;
  int32_T c12_b_j;
  int32_T c12_i7;
  int32_T c12_i8;
  real_T (*c12_b_DD)[16];
  real_T (*c12_b_M)[16];
  c12_b_DD = (real_T (*)[16])ssGetOutputPortSignal(chartInstance->S, 1);
  c12_b_M = (real_T (*)[16])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 11U, chartInstance->c12_sfEvent);
  for (c12_i2 = 0; c12_i2 < 16; c12_i2++) {
    _SFD_DATA_RANGE_CHECK((*c12_b_M)[c12_i2], 0U);
  }

  for (c12_i3 = 0; c12_i3 < 16; c12_i3++) {
    _SFD_DATA_RANGE_CHECK((*c12_b_DD)[c12_i3], 1U);
  }

  chartInstance->c12_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 11U, chartInstance->c12_sfEvent);
  for (c12_i4 = 0; c12_i4 < 16; c12_i4++) {
    c12_M[c12_i4] = (*c12_b_M)[c12_i4];
  }

  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 11U, 11U, c12_debug_family_names,
    c12_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c12_m, 0U, c12_c_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c12_n, 1U, c12_c_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c12_a, 2U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c12_MM, 3U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_i, 4U, c12_c_sf_marshallOut,
    c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_mm, 5U, c12_c_sf_marshallOut,
    c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_j, 6U, c12_c_sf_marshallOut,
    c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_nargin, 7U, c12_c_sf_marshallOut,
    c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_nargout, 8U, c12_c_sf_marshallOut,
    c12_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c12_M, 9U, c12_b_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c12_DD, 10U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 3);
  c12_m = 2.0;
  c12_n = 8.0;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 4);
  for (c12_i5 = 0; c12_i5 < 16; c12_i5++) {
    c12_a[c12_i5] = 0.0;
  }

  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 5);
  for (c12_i6 = 0; c12_i6 < 16; c12_i6++) {
    c12_MM[c12_i6] = 0.0;
  }

  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 6);
  c12_i = 1.0;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 7);
  c12_mm = 0.0;
  c12_b_mm = 0;
  while (c12_b_mm < 8) {
    c12_mm = (real_T)c12_b_mm * 2.0;
    CV_EML_FOR(0, 1, 0, 1);
    _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 8);
    c12_j = 1.0;
    c12_b_j = 0;
    while (c12_b_j < 2) {
      c12_j = 1.0 + (real_T)c12_b_j;
      CV_EML_FOR(0, 1, 1, 1);
      _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 9);
      c12_a[(int32_T)(real_T)_SFD_EML_ARRAY_BOUNDS_CHECK("a", (int32_T)
        _SFD_INTEGER_CHECK("j+mm", c12_j + c12_mm), 1, 16, 1, 0) - 1] = c12_M
        [((int32_T)(real_T)_SFD_EML_ARRAY_BOUNDS_CHECK("M", (int32_T)
           _SFD_INTEGER_CHECK("j", c12_j), 1, 2, 1, 0) + (((int32_T)(real_T)
            _SFD_EML_ARRAY_BOUNDS_CHECK("M", (int32_T)_SFD_INTEGER_CHECK("i",
              c12_i), 1, 8, 2, 0) - 1) << 1)) - 1];
      c12_b_j++;
      _SF_MEX_LISTEN_FOR_CTRL_C(chartInstance->S);
    }

    CV_EML_FOR(0, 1, 1, 0);
    _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 11);
    c12_i++;
    c12_b_mm++;
    _SF_MEX_LISTEN_FOR_CTRL_C(chartInstance->S);
  }

  CV_EML_FOR(0, 1, 0, 0);
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 13);
  for (c12_i7 = 0; c12_i7 < 16; c12_i7++) {
    c12_DD[c12_i7] = c12_a[c12_i7];
  }

  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -13);
  _SFD_SYMBOL_SCOPE_POP();
  for (c12_i8 = 0; c12_i8 < 16; c12_i8++) {
    (*c12_b_DD)[c12_i8] = c12_DD[c12_i8];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 11U, chartInstance->c12_sfEvent);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_CusakisME4901arcsMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Ejemplo n.º 27
0
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 void sf_c1_QPSK_Transmit_v5_w_FIFO
  (SFc1_QPSK_Transmit_v5_w_FIFOInstanceStruct *chartInstance)
{
  real_T c1_hoistedGlobal;
  real_T c1_d_in;
  uint32_T c1_debug_family_var_map[7];
  real_T c1_OS_RATE;
  real_T c1_f[17];
  real_T c1_nargin = 1.0;
  real_T c1_nargout = 1.0;
  creal_T c1_d_out;
  uint32_T c1_b_debug_family_var_map[3];
  real_T c1_y[17];
  real_T c1_b_nargin = 0.0;
  real_T c1_b_nargout = 1.0;
  int32_T c1_i2;
  static real_T c1_b[17] = { 0.006690562067, -0.00576859381, -0.011827354519,
    0.020586915021, 0.016726405168, -0.053692342207, -0.020253031546,
    0.196043589067, 0.33682241319, 0.196043589067, -0.020253031546,
    -0.053692342207, 0.016726405168, 0.020586915021, -0.011827354519,
    -0.00576859381, 0.006690562067 };

  int32_T c1_i3;
  int32_T c1_i4;
  int32_T c1_i5;
  creal_T c1_dcv1[17];
  int32_T c1_i6;
  int32_T c1_i7;
  creal_T c1_b_hoistedGlobal[17];
  creal_T c1_dc0;
  int32_T c1_i8;
  creal_T c1_b_b;
  creal_T c1_c_hoistedGlobal;
  real_T *c1_b_d_in;
  creal_T *c1_b_d_out;
  c1_b_d_out = (creal_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c1_b_d_in = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c1_b_d_in, 0U);
  chartInstance->c1_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  c1_hoistedGlobal = *c1_b_d_in;
  c1_d_in = c1_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 7U, 7U, c1_debug_family_names,
    c1_debug_family_var_map);
  sf_debug_symbol_scope_add_eml(&c1_OS_RATE, 0U, c1_c_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(c1_f, 1U, c1_d_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c1_nargin, 2U, c1_c_sf_marshallOut,
    c1_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c1_nargout, 3U, c1_c_sf_marshallOut,
    c1_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c1_d_in, 4U, c1_c_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c1_d_out, 5U, c1_b_sf_marshallOut,
    c1_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(chartInstance->c1_buf, 6U,
    c1_sf_marshallOut, c1_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 3);
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 5);
  c1_OS_RATE = 8.0;
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 6);
  sf_debug_symbol_scope_push_eml(0U, 3U, 3U, c1_b_debug_family_names,
    c1_b_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(c1_y, 0U, c1_d_sf_marshallOut,
    c1_d_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c1_b_nargin, 1U, c1_c_sf_marshallOut,
    c1_c_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c1_b_nargout, 2U,
    c1_c_sf_marshallOut, c1_c_sf_marshallIn);
  CV_SCRIPT_FCN(0, 0);
  _SFD_SCRIPT_CALL(0U, chartInstance->c1_sfEvent, 3);
  for (c1_i2 = 0; c1_i2 < 17; c1_i2++) {
    c1_y[c1_i2] = c1_b[c1_i2];
  }

  _SFD_SCRIPT_CALL(0U, chartInstance->c1_sfEvent, -3);
  sf_debug_symbol_scope_pop();
  for (c1_i3 = 0; c1_i3 < 17; c1_i3++) {
    c1_f[c1_i3] = c1_b[c1_i3];
  }

  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 8);
  if (CV_EML_IF(0, 1, 0, !chartInstance->c1_buf_not_empty)) {
    _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 9);
    for (c1_i4 = 0; c1_i4 < 17; c1_i4++) {
      chartInstance->c1_buf[c1_i4].re = 0.0;
      chartInstance->c1_buf[c1_i4].im = 0.0;
    }

    chartInstance->c1_buf_not_empty = TRUE;
  }

  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 12);
  for (c1_i5 = 0; c1_i5 < 16; c1_i5++) {
    c1_dcv1[c1_i5] = chartInstance->c1_buf[c1_i5 + 1];
  }

  c1_dcv1[16].re = c1_d_in;
  c1_dcv1[16].im = 0.0;
  for (c1_i6 = 0; c1_i6 < 17; c1_i6++) {
    chartInstance->c1_buf[c1_i6] = c1_dcv1[c1_i6];
  }

  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 14);
  for (c1_i7 = 0; c1_i7 < 17; c1_i7++) {
    c1_b_hoistedGlobal[c1_i7] = chartInstance->c1_buf[c1_i7];
  }

  c1_dc0.re = 0.0;
  c1_dc0.im = 0.0;
  for (c1_i8 = 0; c1_i8 < 17; c1_i8++) {
    c1_b_b.re = c1_b[c1_i8];
    c1_b_b.im = 0.0;
    c1_c_hoistedGlobal.re = c1_b_hoistedGlobal[c1_i8].re * c1_b_b.re -
      c1_b_hoistedGlobal[c1_i8].im * c1_b_b.im;
    c1_c_hoistedGlobal.im = c1_b_hoistedGlobal[c1_i8].re * c1_b_b.im +
      c1_b_hoistedGlobal[c1_i8].im * c1_b_b.re;
    c1_dc0.re += c1_c_hoistedGlobal.re;
    c1_dc0.im += c1_c_hoistedGlobal.im;
  }

  c1_d_out = c1_dc0;
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, -14);
  sf_debug_symbol_scope_pop();
  c1_b_d_out->re = c1_d_out.re;
  c1_b_d_out->im = c1_d_out.im;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  sf_debug_check_for_state_inconsistency(_QPSK_Transmit_v5_w_FIFOMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Ejemplo n.º 29
0
static void c9_chartstep_c9_Array(SFc9_ArrayInstanceStruct *chartInstance)
{
  real_T c9_hoistedGlobal;
  real_T c9_b_hoistedGlobal;
  real_T c9_c_hoistedGlobal;
  real_T c9_V;
  real_T c9_Radiacion;
  real_T c9_Temp;
  uint32_T c9_debug_family_var_map[23];
  real_T c9_q;
  real_T c9_K;
  real_T c9_n;
  real_T c9_T;
  real_T c9_Rs;
  real_T c9_Rp;
  real_T c9_Vt;
  real_T c9_Ns;
  real_T c9_Vc;
  real_T c9_Isc;
  real_T c9_Alfa;
  real_T c9_Iph;
  real_T c9_Voc_ref;
  real_T c9_Beta;
  real_T c9_Voc;
  real_T c9_Io;
  real_T c9_Ir;
  real_T c9_nargin = 3.0;
  real_T c9_nargout = 1.0;
  real_T c9_I;
  real_T c9_b;
  real_T c9_y;
  real_T c9_A;
  real_T c9_x;
  real_T c9_b_x;
  real_T c9_c_x;
  real_T c9_d_x;
  real_T c9_b_b;
  real_T c9_b_y;
  real_T c9_b_A;
  real_T c9_e_x;
  real_T c9_f_x;
  real_T c9_c_y;
  real_T c9_c_b;
  real_T c9_d_y;
  real_T c9_a;
  real_T c9_d_b;
  real_T c9_e_b;
  real_T c9_e_y;
  real_T c9_f_b;
  real_T c9_c_A;
  real_T c9_B;
  real_T c9_g_x;
  real_T c9_f_y;
  real_T c9_h_x;
  real_T c9_g_y;
  real_T c9_h_y;
  real_T c9_i_x;
  real_T c9_j_x;
  real_T c9_b_B;
  real_T c9_i_y;
  real_T c9_j_y;
  int32_T c9_i;
  real_T c9_k_x;
  real_T c9_k_y;
  real_T c9_l_x;
  real_T c9_l_y;
  real_T c9_z;
  real_T c9_m_x;
  real_T c9_n_x;
  real_T c9_d_A;
  real_T c9_o_x;
  real_T c9_p_x;
  real_T c9_m_y;
  real_T c9_n_y;
  real_T c9_o_y;
  real_T c9_b_z;
  real_T c9_b_a;
  real_T c9_g_b;
  real_T c9_p_y;
  real_T c9_q_x;
  real_T c9_q_y;
  real_T c9_r_x;
  real_T c9_r_y;
  real_T c9_c_z;
  real_T c9_s_x;
  real_T c9_t_x;
  real_T c9_u_x;
  real_T c9_s_y;
  real_T c9_v_x;
  real_T c9_t_y;
  real_T c9_d_z;
  real_T *c9_b_Temp;
  real_T *c9_b_Radiacion;
  real_T *c9_b_V;
  real_T *c9_b_I;
  c9_b_Temp = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c9_b_Radiacion = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c9_b_I = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c9_b_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 8U, chartInstance->c9_sfEvent);
  c9_hoistedGlobal = *c9_b_V;
  c9_b_hoistedGlobal = *c9_b_Radiacion;
  c9_c_hoistedGlobal = *c9_b_Temp;
  c9_V = c9_hoistedGlobal;
  c9_Radiacion = c9_b_hoistedGlobal;
  c9_Temp = c9_c_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 23U, 23U, c9_debug_family_names,
    c9_debug_family_var_map);
  sf_debug_symbol_scope_add_eml(&c9_q, 0U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c9_K, 1U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c9_n, 2U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_T, 3U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c9_Rs, 4U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c9_Rp, 5U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_Vt, 6U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c9_Ns, 7U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_Vc, 8U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c9_Isc, 9U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c9_Alfa, 10U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_Iph, 11U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c9_Voc_ref, 12U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c9_Beta, 13U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_Voc, 14U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c9_Io, 15U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c9_Ir, 16U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c9_nargin, 17U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c9_nargout, 18U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c9_V, 19U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c9_Radiacion, 20U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c9_Temp, 21U, c9_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_I, 22U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 3);
  c9_q = 1.602176E-19;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 5);
  c9_K = 1.3806488E-23;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 7);
  c9_n = 1.3;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 9);
  c9_T = 273.15 + c9_Temp;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 11);
  c9_Rs = 0.015;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 13);
  c9_Rp = 100.0;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 15);
  c9_b = c9_T;
  c9_y = 1.79484344E-23 * c9_b;
  c9_A = c9_y;
  c9_x = c9_A;
  c9_b_x = c9_x;
  c9_Vt = c9_b_x / 1.602176E-19;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 16);
  c9_Ns = 36.0;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 17);
  c9_c_x = c9_V;
  c9_d_x = c9_c_x;
  c9_Vc = c9_d_x / 36.0;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 19);
  c9_Isc = 5.433;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 20);
  c9_Alfa = 0.00037;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 22);
  c9_b_b = c9_Radiacion;
  c9_b_y = 5.433 * c9_b_b;
  c9_b_A = c9_b_y;
  c9_e_x = c9_b_A;
  c9_f_x = c9_e_x;
  c9_c_y = c9_f_x / 1000.0;
  c9_c_b = c9_Temp - 25.0;
  c9_d_y = 0.00037 * c9_c_b;
  c9_a = c9_c_y;
  c9_d_b = 1.0 + c9_d_y;
  c9_Iph = c9_a * c9_d_b;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 24);
  c9_Voc_ref = 0.6166666666666667;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 25);
  c9_Beta = -0.0034000000000000002;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 26);
  c9_e_b = c9_Temp - 25.0;
  c9_e_y = -0.0034000000000000002 * c9_e_b;
  c9_f_b = 1.0 + c9_e_y;
  c9_Voc = 0.6166666666666667 * c9_f_b;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 32);
  c9_c_A = c9_Voc;
  c9_B = c9_Vt;
  c9_g_x = c9_c_A;
  c9_f_y = c9_B;
  c9_h_x = c9_g_x;
  c9_g_y = c9_f_y;
  c9_h_y = c9_h_x / c9_g_y;
  c9_i_x = c9_h_y;
  c9_j_x = c9_i_x;
  c9_j_x = muDoubleScalarExp(c9_j_x);
  c9_b_B = c9_j_x - 1.0;
  c9_i_y = c9_b_B;
  c9_j_y = c9_i_y;
  c9_Io = 5.433 / c9_j_y;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 33);
  c9_Ir = c9_Io;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 36);
  c9_I = 0.0;
  c9_i = 0;
  while (c9_i < 50) {
    CV_EML_FOR(0, 1, 0, 1);
    _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 38);
    c9_k_x = c9_Vc + c9_I * c9_Rs;
    c9_k_y = c9_Vt;
    c9_l_x = c9_k_x;
    c9_l_y = c9_k_y;
    c9_z = c9_l_x / c9_l_y;
    c9_m_x = c9_z;
    c9_n_x = c9_m_x;
    c9_n_x = muDoubleScalarExp(c9_n_x);
    c9_d_A = c9_Vc + c9_I * c9_Rs;
    c9_o_x = c9_d_A;
    c9_p_x = c9_o_x;
    c9_m_y = c9_p_x / 100.0;
    c9_n_y = c9_Vt;
    c9_o_y = c9_n_y;
    c9_b_z = 0.015 / c9_o_y;
    c9_b_a = c9_Ir;
    c9_g_b = c9_b_z;
    c9_p_y = c9_b_a * c9_g_b;
    c9_q_x = c9_Vc + c9_I * c9_Rs;
    c9_q_y = c9_Vt;
    c9_r_x = c9_q_x;
    c9_r_y = c9_q_y;
    c9_c_z = c9_r_x / c9_r_y;
    c9_s_x = c9_c_z;
    c9_t_x = c9_s_x;
    c9_t_x = muDoubleScalarExp(c9_t_x);
    c9_u_x = ((c9_Iph - c9_I) - c9_Ir * (c9_n_x - 1.0)) + c9_m_y;
    c9_s_y = (-1.0 - c9_p_y * c9_t_x) - 0.00015;
    c9_v_x = c9_u_x;
    c9_t_y = c9_s_y;
    c9_d_z = c9_v_x / c9_t_y;
    c9_I -= c9_d_z;
    c9_i++;
    sf_mex_listen_for_ctrl_c(chartInstance->S);
  }

  CV_EML_FOR(0, 1, 0, 0);
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, -38);
  sf_debug_symbol_scope_pop();
  *c9_b_I = c9_I;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 8U, chartInstance->c9_sfEvent);
}
Ejemplo n.º 30
0
static void c4_chartstep_c4_iC_3ph_MR2(SFc4_iC_3ph_MR2InstanceStruct
  *chartInstance)
{
  real_T c4_hoistedGlobal;
  real_T c4_b_hoistedGlobal;
  real_T c4_c_hoistedGlobal;
  real_T c4_up_alpha;
  real_T c4_up_beta;
  real_T c4_up_0;
  uint32_T c4_debug_family_var_map[9];
  real_T c4_abc[3];
  real_T c4_nargin = 3.0;
  real_T c4_nargout = 3.0;
  real_T c4_up_a;
  real_T c4_up_b;
  real_T c4_up_c;
  real_T c4_b[3];
  int32_T c4_i0;
  int32_T c4_i1;
  int32_T c4_i2;
  real_T c4_C[3];
  int32_T c4_i3;
  int32_T c4_i4;
  int32_T c4_i5;
  int32_T c4_i6;
  int32_T c4_i7;
  int32_T c4_i8;
  static real_T c4_a[9] = { 1.0, -0.5, -0.5, 0.0, 0.8660254037844386,
    -0.8660254037844386, 1.0, 1.0, 1.0 };

  real_T *c4_b_up_alpha;
  real_T *c4_b_up_beta;
  real_T *c4_b_up_0;
  real_T *c4_b_up_a;
  real_T *c4_b_up_b;
  real_T *c4_b_up_c;
  c4_b_up_0 = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c4_b_up_beta = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c4_b_up_c = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3);
  c4_b_up_b = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c4_b_up_alpha = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  c4_b_up_a = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 3U, chartInstance->c4_sfEvent);
  c4_hoistedGlobal = *c4_b_up_alpha;
  c4_b_hoistedGlobal = *c4_b_up_beta;
  c4_c_hoistedGlobal = *c4_b_up_0;
  c4_up_alpha = c4_hoistedGlobal;
  c4_up_beta = c4_b_hoistedGlobal;
  c4_up_0 = c4_c_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 9U, 9U, c4_debug_family_names,
    c4_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(c4_abc, 0U, c4_b_sf_marshallOut,
    c4_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c4_nargin, 1U, c4_sf_marshallOut,
    c4_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c4_nargout, 2U, c4_sf_marshallOut,
    c4_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c4_up_alpha, 3U, c4_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c4_up_beta, 4U, c4_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c4_up_0, 5U, c4_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c4_up_a, 6U, c4_sf_marshallOut,
    c4_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c4_up_b, 7U, c4_sf_marshallOut,
    c4_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c4_up_c, 8U, c4_sf_marshallOut,
    c4_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c4_sfEvent, 4);
  c4_b[0] = c4_up_alpha;
  c4_b[1] = c4_up_beta;
  c4_b[2] = c4_up_0;
  c4_eml_scalar_eg(chartInstance);
  c4_eml_scalar_eg(chartInstance);
  for (c4_i0 = 0; c4_i0 < 3; c4_i0++) {
    c4_abc[c4_i0] = 0.0;
  }

  for (c4_i1 = 0; c4_i1 < 3; c4_i1++) {
    c4_abc[c4_i1] = 0.0;
  }

  for (c4_i2 = 0; c4_i2 < 3; c4_i2++) {
    c4_C[c4_i2] = c4_abc[c4_i2];
  }

  for (c4_i3 = 0; c4_i3 < 3; c4_i3++) {
    c4_abc[c4_i3] = c4_C[c4_i3];
  }

  for (c4_i4 = 0; c4_i4 < 3; c4_i4++) {
    c4_C[c4_i4] = c4_abc[c4_i4];
  }

  for (c4_i5 = 0; c4_i5 < 3; c4_i5++) {
    c4_abc[c4_i5] = c4_C[c4_i5];
  }

  for (c4_i6 = 0; c4_i6 < 3; c4_i6++) {
    c4_abc[c4_i6] = 0.0;
    c4_i7 = 0;
    for (c4_i8 = 0; c4_i8 < 3; c4_i8++) {
      c4_abc[c4_i6] += c4_a[c4_i7 + c4_i6] * c4_b[c4_i8];
      c4_i7 += 3;
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c4_sfEvent, 7);
  c4_up_a = c4_abc[0];
  _SFD_EML_CALL(0U, chartInstance->c4_sfEvent, 8);
  c4_up_b = c4_abc[1];
  _SFD_EML_CALL(0U, chartInstance->c4_sfEvent, 9);
  c4_up_c = c4_abc[2];
  _SFD_EML_CALL(0U, chartInstance->c4_sfEvent, -9);
  sf_debug_symbol_scope_pop();
  *c4_b_up_a = c4_up_a;
  *c4_b_up_b = c4_up_b;
  *c4_b_up_c = c4_up_c;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 3U, chartInstance->c4_sfEvent);
}