static void sf_c2_MigrationOWBG_Proto4_1DLinear2DNonLinear
  (SFc2_MigrationOWBG_Proto4_1DLinear2DNonLinearInstanceStruct *chartInstance)
{
  real_T c2_hoistedGlobal;
  real_T c2_b_hoistedGlobal;
  real_T c2_x;
  real_T c2_y;
  uint32_T c2_debug_family_var_map[5];
  real_T c2_nargin = 2.0;
  real_T c2_nargout = 1.0;
  real_T c2_z;
  real_T c2_b_x;
  real_T c2_c_x;
  real_T *c2_d_x;
  real_T *c2_b_y;
  real_T *c2_b_z;
  c2_b_z = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c2_b_y = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c2_d_x = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c2_d_x, 0U);
  _SFD_DATA_RANGE_CHECK(*c2_b_y, 1U);
  _SFD_DATA_RANGE_CHECK(*c2_b_z, 2U);
  chartInstance->c2_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  c2_hoistedGlobal = *c2_d_x;
  c2_b_hoistedGlobal = *c2_b_y;
  c2_x = c2_hoistedGlobal;
  c2_y = c2_b_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 5U, 5U, c2_debug_family_names,
    c2_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargin, 0U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargout, 1U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c2_x, 2U, c2_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c2_y, 3U, c2_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_z, 4U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 3);
  c2_b_x = (45.96 - c2_mpower(chartInstance, c2_y)) - c2_mpower(chartInstance,
    c2_x);
  c2_z = c2_b_x;
  if (c2_z < 0.0) {
    c2_eml_error(chartInstance);
  }

  c2_c_x = c2_z;
  c2_z = c2_c_x;
  c2_z = muDoubleScalarSqrt(c2_z);
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -3);
  _SFD_SYMBOL_SCOPE_POP();
  *c2_b_z = c2_z;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY
    (_MigrationOWBG_Proto4_1DLinear2DNonLinearMachineNumber_,
     chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_gateway_c10_hybridSysSim(SFc10_hybridSysSimInstanceStruct
  *chartInstance)
{
  real_T c10_hoistedGlobal;
  real_T c10_b_hoistedGlobal;
  real_T c10_c_hoistedGlobal;
  real_T c10_d_hoistedGlobal;
  real_T c10_b_urk;
  real_T c10_b_m;
  real_T c10_b_g;
  real_T c10_b_r;
  uint32_T c10_debug_family_var_map[7];
  real_T c10_nargin = 4.0;
  real_T c10_nargout = 1.0;
  real_T c10_b_tk;
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 9U, chartInstance->c10_sfEvent);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c10_urk, 0U);
  chartInstance->c10_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 9U, chartInstance->c10_sfEvent);
  c10_hoistedGlobal = *chartInstance->c10_urk;
  c10_b_hoistedGlobal = *chartInstance->c10_m;
  c10_c_hoistedGlobal = *chartInstance->c10_g;
  c10_d_hoistedGlobal = *chartInstance->c10_r;
  c10_b_urk = c10_hoistedGlobal;
  c10_b_m = c10_b_hoistedGlobal;
  c10_b_g = c10_c_hoistedGlobal;
  c10_b_r = c10_d_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 7U, 7U, c10_debug_family_names,
    c10_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c10_nargin, 0U, c10_sf_marshallOut,
    c10_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c10_nargout, 1U, c10_sf_marshallOut,
    c10_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c10_b_urk, 2U, c10_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c10_b_m, 3U, c10_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c10_b_g, 4U, c10_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c10_b_r, 5U, c10_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c10_b_tk, 6U, c10_sf_marshallOut,
    c10_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, 3);
  c10_b_tk = 0.66666666666666663 * c10_b_urk * c10_b_r * c10_b_m * c10_b_g;
  _SFD_EML_CALL(0U, chartInstance->c10_sfEvent, -3);
  _SFD_SYMBOL_SCOPE_POP();
  *chartInstance->c10_tk = c10_b_tk;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 9U, chartInstance->c10_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_hybridSysSimMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c10_tk, 1U);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c10_m, 2U);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c10_g, 3U);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c10_r, 4U);
}
static void sf_gateway_c12_SS6_Estimation2(SFc12_SS6_Estimation2InstanceStruct
  *chartInstance)
{
  real_T c12_hoistedGlobal;
  real_T c12_b_hoistedGlobal;
  real_T c12_b_V_x;
  real_T c12_b_r;
  uint32_T c12_debug_family_var_map[7];
  real_T c12_Tw;
  real_T c12_nargin = 2.0;
  real_T c12_nargout = 2.0;
  real_T c12_b_U_tl;
  real_T c12_b_U_tr;
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 11U, chartInstance->c12_sfEvent);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c12_V_x, 0U);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c12_r, 1U);
  chartInstance->c12_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 11U, chartInstance->c12_sfEvent);
  c12_hoistedGlobal = *chartInstance->c12_V_x;
  c12_b_hoistedGlobal = *chartInstance->c12_r;
  c12_b_V_x = c12_hoistedGlobal;
  c12_b_r = c12_b_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 7U, 7U, c12_debug_family_names,
    c12_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c12_Tw, 0U, c12_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_nargin, 1U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_nargout, 2U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c12_b_V_x, 3U, c12_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c12_b_r, 4U, c12_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_b_U_tl, 5U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c12_b_U_tr, 6U, c12_sf_marshallOut,
    c12_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 3);
  c12_Tw = 1.33;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 4);
  c12_b_U_tl = c12_b_V_x + 0.665 * c12_b_r;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, 5);
  c12_b_U_tr = c12_b_V_x - 0.665 * c12_b_r;
  _SFD_EML_CALL(0U, chartInstance->c12_sfEvent, -5);
  _SFD_SYMBOL_SCOPE_POP();
  *chartInstance->c12_U_tl = c12_b_U_tl;
  *chartInstance->c12_U_tr = c12_b_U_tr;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 11U, chartInstance->c12_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_SS6_Estimation2MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c12_U_tl, 2U);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c12_U_tr, 3U);
}
Example #4
0
static void sf_gateway_c7_hybridSysSim(SFc7_hybridSysSimInstanceStruct
  *chartInstance)
{
  real_T c7_hoistedGlobal;
  real_T c7_b_hoistedGlobal;
  real_T c7_c_hoistedGlobal;
  real_T c7_b_m;
  real_T c7_b_g;
  real_T c7_b_uk;
  uint32_T c7_debug_family_var_map[6];
  real_T c7_nargin = 3.0;
  real_T c7_nargout = 1.0;
  real_T c7_b_fky;
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 6U, chartInstance->c7_sfEvent);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c7_m, 0U);
  chartInstance->c7_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 6U, chartInstance->c7_sfEvent);
  c7_hoistedGlobal = *chartInstance->c7_m;
  c7_b_hoistedGlobal = *chartInstance->c7_g;
  c7_c_hoistedGlobal = *chartInstance->c7_uk;
  c7_b_m = c7_hoistedGlobal;
  c7_b_g = c7_b_hoistedGlobal;
  c7_b_uk = c7_c_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 6U, 6U, c7_debug_family_names,
    c7_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c7_nargin, 0U, c7_sf_marshallOut,
    c7_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c7_nargout, 1U, c7_sf_marshallOut,
    c7_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c7_b_m, 2U, c7_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c7_b_g, 3U, c7_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c7_b_uk, 4U, c7_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c7_b_fky, 5U, c7_sf_marshallOut,
    c7_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c7_sfEvent, 3);
  c7_b_fky = c7_b_m * c7_b_g * c7_b_uk;
  _SFD_EML_CALL(0U, chartInstance->c7_sfEvent, -3);
  _SFD_SYMBOL_SCOPE_POP();
  *chartInstance->c7_fky = c7_b_fky;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 6U, chartInstance->c7_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_hybridSysSimMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c7_fky, 1U);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c7_g, 2U);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c7_uk, 3U);
}
static void sf_gateway_c2_DYNctl_ver4_etud_nonlineaire
  (SFc2_DYNctl_ver4_etud_nonlineaireInstanceStruct *chartInstance)
{
  real_T c2_hoistedGlobal;
  real_T c2_b_angle;
  uint32_T c2_debug_family_var_map[4];
  real_T c2_nargin = 1.0;
  real_T c2_nargout = 1.0;
  real_T c2_b_f;
  boolean_T guard1 = false;
  _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(*chartInstance->c2_angle, 0U);
  chartInstance->c2_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  c2_hoistedGlobal = *chartInstance->c2_angle;
  c2_b_angle = c2_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c2_debug_family_names,
    c2_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargin, 0U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargout, 1U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c2_b_angle, 2U, c2_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_b_f, 3U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 4);
  guard1 = false;
  if (CV_EML_COND(0, 1, 0, CV_RELATIONAL_EVAL(4U, 0U, 0, c2_b_angle,
        0.087266462599716474, -1, 5U, c2_b_angle >= 0.087266462599716474))) {
    guard1 = true;
  } else if (CV_EML_COND(0, 1, 1, CV_RELATIONAL_EVAL(4U, 0U, 1, c2_b_angle,
               -0.087266462599716474, -1, 3U, c2_b_angle <=
               -0.087266462599716474))) {
    guard1 = true;
  } else {
    CV_EML_MCDC(0, 1, 0, false);
    CV_EML_IF(0, 1, 0, false);
    _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 7);
    c2_b_f = 0.0;
  }

  if (guard1 == true) {
    CV_EML_MCDC(0, 1, 0, true);
    CV_EML_IF(0, 1, 0, true);
    _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 5);
    c2_b_f = 1.0;
  }

  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -7);
  _SFD_SYMBOL_SCOPE_POP();
  *chartInstance->c2_f = c2_b_f;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_DYNctl_ver4_etud_nonlineaireMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c2_f, 1U);
}
static void sf_c1_main(SFc1_mainInstanceStruct *chartInstance)
{
  real_T c1_hoistedGlobal;
  real_T c1_time;
  uint32_T c1_debug_family_var_map[4];
  real_T c1_nargin = 1.0;
  real_T c1_nargout = 1.0;
  real_T c1_y;
  real_T *c1_b_time;
  real_T *c1_b_y;
  c1_b_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c1_b_time = (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, 0U, chartInstance->c1_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c1_b_time, 0U);
  _SFD_DATA_RANGE_CHECK(*c1_b_y, 1U);
  chartInstance->c1_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  c1_hoistedGlobal = *c1_b_time;
  c1_time = c1_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c1_debug_family_names,
    c1_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargin, 0U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargout, 1U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c1_time, 2U, c1_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_y, 3U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 2);
  if (CV_EML_IF(0, 1, 0, c1_time < 200.0)) {
    _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 3);
    c1_y = 1000.0;
  } else {
    _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 4);
    if (CV_EML_IF(0, 1, 1, c1_time < 30.0)) {
      _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 5);
      c1_y = 20.0;
    } else {
      _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 6);
      if (CV_EML_IF(0, 1, 2, c1_time < 40.0)) {
        _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 7);
        c1_y = 100.0;
      } else {
        _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 9);
        c1_y = 1000.0;
      }
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, -9);
  _SFD_SYMBOL_SCOPE_POP();
  *c1_b_y = c1_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_mainMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_c2_linearproto(SFc2_linearprotoInstanceStruct *chartInstance)
{
  real_T c2_hoistedGlobal;
  real_T c2_x;
  uint32_T c2_debug_family_var_map[4];
  real_T c2_nargin = 1.0;
  real_T c2_nargout = 1.0;
  real_T c2_y;
  real_T c2_b;
  real_T c2_b_y;
  real_T c2_u;
  const mxArray *c2_c_y = NULL;
  real_T *c2_b_x;
  real_T *c2_d_y;
  c2_d_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c2_b_x = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c2_b_x, 0U);
  _SFD_DATA_RANGE_CHECK(*c2_d_y, 1U);
  chartInstance->c2_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  c2_hoistedGlobal = *c2_b_x;
  c2_x = c2_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c2_debug_family_names,
    c2_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargin, 0U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_nargout, 1U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c2_x, 2U, c2_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c2_y, 3U, c2_sf_marshallOut,
    c2_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 4);
  if (CV_EML_IF(0, 1, 0, c2_x < 0.9)) {
    _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 6);
    c2_b = c2_x;
    c2_b_y = 13.8125 * c2_b;
    c2_y = c2_b_y - 9.93;
    sf_mex_printf("%s =\\n", "y");
    c2_u = c2_y;
    c2_c_y = NULL;
    sf_mex_assign(&c2_c_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0), FALSE);
    sf_mex_call_debug("disp", 0U, 1U, 14, c2_c_y);
  } else {
    _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, 9);
    c2_y = 2.5;
  }

  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -9);
  _SFD_SYMBOL_SCOPE_POP();
  *c2_d_y = c2_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_linearprotoMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Example #8
0
static void sf_c3_gif_model(SFc3_gif_modelInstanceStruct *chartInstance)
{
  int32_T c3_i2;
  int32_T c3_i3;
  int32_T c3_i4;
  real_T c3_obs[81];
  uint32_T c3_debug_family_var_map[4];
  real_T c3_nargin = 1.0;
  real_T c3_nargout = 1.0;
  real_T c3_state[6];
  int32_T c3_i5;
  int32_T c3_i6;
  real_T (*c3_b_state)[6];
  real_T (*c3_b_obs)[81];
  c3_b_state = (real_T (*)[6])ssGetOutputPortSignal(chartInstance->S, 1);
  c3_b_obs = (real_T (*)[81])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c3_sfEvent);
  for (c3_i2 = 0; c3_i2 < 81; c3_i2++) {
    _SFD_DATA_RANGE_CHECK((*c3_b_obs)[c3_i2], 0U);
  }

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

  chartInstance->c3_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c3_sfEvent);
  for (c3_i4 = 0; c3_i4 < 81; c3_i4++) {
    c3_obs[c3_i4] = (*c3_b_obs)[c3_i4];
  }

  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c3_debug_family_names,
    c3_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargin, 0U, c3_c_sf_marshallOut,
    c3_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargout, 1U, c3_c_sf_marshallOut,
    c3_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c3_obs, 2U, c3_b_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c3_state, 3U, 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 < 6; c3_i5++) {
    c3_state[c3_i5] = c3_obs[c3_i5 + 15];
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, -4);
  _SFD_SYMBOL_SCOPE_POP();
  for (c3_i6 = 0; c3_i6 < 6; c3_i6++) {
    (*c3_b_state)[c3_i6] = c3_state[c3_i6];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c3_sfEvent);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_gif_modelMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_c29_CusakisME4901arcs(SFc29_CusakisME4901arcsInstanceStruct
  *chartInstance)
{
  real_T c29_hoistedGlobal;
  real_T c29_u;
  uint32_T c29_debug_family_var_map[5];
  real_T c29_udeg;
  real_T c29_nargin = 1.0;
  real_T c29_nargout = 1.0;
  real_T c29_y;
  real_T c29_a;
  real_T c29_b_y;
  real_T c29_A;
  real_T c29_x;
  real_T c29_b_x;
  real_T c29_b_a;
  real_T *c29_b_u;
  real_T *c29_c_y;
  c29_c_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c29_b_u = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 28U, chartInstance->c29_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c29_b_u, 0U);
  _SFD_DATA_RANGE_CHECK(*c29_c_y, 1U);
  chartInstance->c29_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 28U, chartInstance->c29_sfEvent);
  c29_hoistedGlobal = *c29_b_u;
  c29_u = c29_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 5U, 5U, c29_debug_family_names,
    c29_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c29_udeg, 0U, c29_sf_marshallOut,
    c29_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c29_nargin, 1U, c29_sf_marshallOut,
    c29_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c29_nargout, 2U, c29_sf_marshallOut,
    c29_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c29_u, 3U, c29_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c29_y, 4U, c29_sf_marshallOut,
    c29_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c29_sfEvent, 3);
  c29_a = c29_u;
  c29_b_y = c29_a * 180.0;
  c29_A = c29_b_y;
  c29_x = c29_A;
  c29_b_x = c29_x;
  c29_udeg = c29_b_x / 3.1415926535897931;
  _SFD_EML_CALL(0U, chartInstance->c29_sfEvent, 6);
  c29_b_a = c29_udeg + 180.0;
  c29_y = c29_b_a * 10.0;
  _SFD_EML_CALL(0U, chartInstance->c29_sfEvent, -6);
  _SFD_SYMBOL_SCOPE_POP();
  *c29_c_y = c29_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 28U, chartInstance->c29_sfEvent);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_CusakisME4901arcsMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_gateway_c13_ARP_02_RPSs_Bdr_GK_BIS5
  (SFc13_ARP_02_RPSs_Bdr_GK_BIS5InstanceStruct *chartInstance)
{
  real_T c13_hoistedGlobal;
  real_T c13_win;
  uint32_T c13_debug_family_var_map[4];
  real_T c13_nargin = 1.0;
  real_T c13_nargout = 1.0;
  real_T c13_sat;
  real_T *c13_b_win;
  real_T *c13_b_sat;
  c13_b_sat = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c13_b_win = (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, 9U, chartInstance->c13_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c13_b_win, 0U);
  chartInstance->c13_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 9U, chartInstance->c13_sfEvent);
  c13_hoistedGlobal = *c13_b_win;
  c13_win = c13_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c13_debug_family_names,
    c13_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c13_nargin, 0U, c13_sf_marshallOut,
    c13_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c13_nargout, 1U, c13_sf_marshallOut,
    c13_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c13_win, 2U, c13_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c13_sat, 3U, c13_sf_marshallOut,
    c13_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c13_sfEvent, 8);
  if (CV_EML_IF(0, 1, 0, c13_win == 2.0)) {
    _SFD_EML_CALL(0U, chartInstance->c13_sfEvent, 9);
    c13_sat = 1.0;
  } else {
    _SFD_EML_CALL(0U, chartInstance->c13_sfEvent, 10);
    if (CV_EML_IF(0, 1, 1, c13_win == 1.0)) {
      _SFD_EML_CALL(0U, chartInstance->c13_sfEvent, 11);
      c13_sat = -1.0;
    } else {
      _SFD_EML_CALL(0U, chartInstance->c13_sfEvent, 13);
      c13_sat = 0.0;
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c13_sfEvent, -13);
  _SFD_SYMBOL_SCOPE_POP();
  *c13_b_sat = c13_sat;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 9U, chartInstance->c13_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_ARP_02_RPSs_Bdr_GK_BIS5MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c13_b_sat, 1U);
}
Example #11
0
static void sf_gateway_c24_DemoSmile_KS(SFc24_DemoSmile_KSInstanceStruct
  *chartInstance)
{
  real_T c24_hoistedGlobal;
  real_T c24_u;
  uint32_T c24_debug_family_var_map[5];
  real_T c24_smile;
  real_T c24_nargin = 1.0;
  real_T c24_nargout = 1.0;
  real_T c24_y;
  real_T *c24_b_u;
  real_T *c24_b_y;
  c24_b_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c24_b_u = (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, 15U, chartInstance->c24_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c24_b_u, 0U);
  chartInstance->c24_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 15U, chartInstance->c24_sfEvent);
  c24_hoistedGlobal = *c24_b_u;
  c24_u = c24_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 5U, 5U, c24_debug_family_names,
    c24_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c24_smile, 0U, c24_sf_marshallOut,
    c24_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c24_nargin, 1U, c24_sf_marshallOut,
    c24_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c24_nargout, 2U, c24_sf_marshallOut,
    c24_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c24_u, 3U, c24_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c24_y, 4U, c24_sf_marshallOut,
    c24_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c24_sfEvent, 3);
  if (CV_EML_IF(0, 1, 0, c24_u > 0.5)) {
    _SFD_EML_CALL(0U, chartInstance->c24_sfEvent, 4);
    c24_smile = 1.0;
  } else {
    _SFD_EML_CALL(0U, chartInstance->c24_sfEvent, 6);
    c24_smile = 0.0;
  }

  _SFD_EML_CALL(0U, chartInstance->c24_sfEvent, 8);
  c24_y = c24_smile;
  _SFD_EML_CALL(0U, chartInstance->c24_sfEvent, -8);
  _SFD_SYMBOL_SCOPE_POP();
  *c24_b_y = c24_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 15U, chartInstance->c24_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_DemoSmile_KSMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c24_b_y, 1U);
}
static void sf_gateway_c4_DisplayCANMsg(SFc4_DisplayCANMsgInstanceStruct
  *chartInstance)
{
  int32_T c4_i0;
  int32_T c4_i1;
  uint8_T c4_b_littleEndianArray[2];
  uint32_T c4_debug_family_var_map[4];
  real_T c4_nargin = 1.0;
  real_T c4_nargout = 1.0;
  int16_T c4_b_y;
  int32_T c4_i2;
  uint8_T c4_x[2];
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 3U, chartInstance->c4_sfEvent);
  for (c4_i0 = 0; c4_i0 < 2; c4_i0++) {
    _SFD_DATA_RANGE_CHECK((real_T)(*chartInstance->c4_littleEndianArray)[c4_i0],
                          0U, 1U, 0U, chartInstance->c4_sfEvent, false);
  }

  chartInstance->c4_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 3U, chartInstance->c4_sfEvent);
  for (c4_i1 = 0; c4_i1 < 2; c4_i1++) {
    c4_b_littleEndianArray[c4_i1] = (*chartInstance->c4_littleEndianArray)[c4_i1];
  }

  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c4_debug_family_names,
    c4_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c4_nargin, 0U, c4_c_sf_marshallOut,
    c4_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c4_nargout, 1U, c4_c_sf_marshallOut,
    c4_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c4_b_littleEndianArray, 2U, c4_b_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c4_b_y, 3U, c4_sf_marshallOut,
    c4_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c4_sfEvent, 2);
  for (c4_i2 = 0; c4_i2 < 2; c4_i2++) {
    c4_x[c4_i2] = c4_b_littleEndianArray[c4_i2];
  }

  memcpy(&c4_b_y, &c4_x[0], (size_t)1 * sizeof(int16_T));
  _SFD_EML_CALL(0U, chartInstance->c4_sfEvent, -2);
  _SFD_SYMBOL_SCOPE_POP();
  *chartInstance->c4_y = c4_b_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 3U, chartInstance->c4_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_DisplayCANMsgMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK((real_T)*chartInstance->c4_y, 1U, 1U, 0U,
                        chartInstance->c4_sfEvent, false);
}
static void sf_gateway_c3_NMPC_Controller(SFc3_NMPC_ControllerInstanceStruct
  *chartInstance)
{
  real_T c3_hoistedGlobal;
  real_T c3_b_u;
  uint32_T c3_debug_family_var_map[4];
  real_T c3_nargin = 1.0;
  real_T c3_nargout = 1.0;
  real_T c3_b_etaLat;
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c3_u, 0U);
  chartInstance->c3_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  c3_hoistedGlobal = *chartInstance->c3_u;
  c3_b_u = c3_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c3_debug_family_names,
    c3_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargin, 0U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargout, 1U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c3_b_u, 2U, c3_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_b_etaLat, 3U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 3);
  c3_b_etaLat = c3_b_u;
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 5);
  if (CV_EML_IF(0, 1, 0, CV_RELATIONAL_EVAL(4U, 0U, 0, c3_b_u,
        3.1415926535897931, -1, 4U, c3_b_u > 3.1415926535897931))) {
    _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 6);
    c3_b_etaLat = c3_b_u - 6.2831853071795862;
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 9);
  if (CV_EML_IF(0, 1, 1, CV_RELATIONAL_EVAL(4U, 0U, 1, c3_b_u,
        -3.1415926535897931, -1, 2U, c3_b_u < -3.1415926535897931))) {
    _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 10);
    c3_b_etaLat = c3_b_u + 6.2831853071795862;
  }

  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, -10);
  _SFD_SYMBOL_SCOPE_POP();
  *chartInstance->c3_etaLat = c3_b_etaLat;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_NMPC_ControllerMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*chartInstance->c3_etaLat, 1U);
}
Example #14
0
static void sf_gateway_c3_Ensayos_Friccion(SFc3_Ensayos_FriccionInstanceStruct
  *chartInstance)
{
  real_T c3_hoistedGlobal;
  real_T c3_u;
  uint32_T c3_debug_family_var_map[4];
  real_T c3_nargin = 1.0;
  real_T c3_nargout = 1.0;
  real_T c3_y;
  real_T c3_A;
  real_T c3_x;
  real_T c3_b_x;
  real_T c3_c_x;
  real_T *c3_b_u;
  real_T *c3_b_y;
  c3_b_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c3_b_u = (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, 2U, chartInstance->c3_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c3_b_u, 0U);
  chartInstance->c3_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  c3_hoistedGlobal = *c3_b_u;
  c3_u = c3_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c3_debug_family_names,
    c3_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargin, 0U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_nargout, 1U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c3_u, 2U, c3_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c3_y, 3U, c3_sf_marshallOut,
    c3_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, 4);
  c3_A = c3_u * 60.0;
  c3_x = c3_A;
  c3_b_x = c3_x;
  c3_c_x = c3_b_x;
  c3_y = c3_c_x / 0.90477868423386032;
  _SFD_EML_CALL(0U, chartInstance->c3_sfEvent, -4);
  _SFD_SYMBOL_SCOPE_POP();
  *c3_b_y = c3_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 2U, chartInstance->c3_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Ensayos_FriccionMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c3_b_y, 1U);
}
static void sf_gateway_c19_Demo_GazeFWaveIdleRand
  (SFc19_Demo_GazeFWaveIdleRandInstanceStruct *chartInstance)
{
  real_T c19_hoistedGlobal;
  real_T c19_state;
  uint32_T c19_debug_family_var_map[4];
  real_T c19_nargin = 1.0;
  real_T c19_nargout = 1.0;
  real_T c19_stateOver;
  real_T *c19_b_state;
  real_T *c19_b_stateOver;
  c19_b_stateOver = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c19_b_state = (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, 12U, chartInstance->c19_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c19_b_state, 0U);
  chartInstance->c19_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 12U, chartInstance->c19_sfEvent);
  c19_hoistedGlobal = *c19_b_state;
  c19_state = c19_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c19_debug_family_names,
    c19_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c19_nargin, 0U, c19_sf_marshallOut,
    c19_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c19_nargout, 1U, c19_sf_marshallOut,
    c19_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c19_state, 2U, c19_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c19_stateOver, 3U, c19_sf_marshallOut,
    c19_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c19_sfEvent, 13);
  if (CV_EML_IF(0, 1, 0, c19_state == 3.0)) {
    _SFD_EML_CALL(0U, chartInstance->c19_sfEvent, 15);
    c19_stateOver = 1.0;
  } else {
    _SFD_EML_CALL(0U, chartInstance->c19_sfEvent, 17);
    c19_stateOver = 0.0;
  }

  _SFD_EML_CALL(0U, chartInstance->c19_sfEvent, -17);
  _SFD_SYMBOL_SCOPE_POP();
  *c19_b_stateOver = c19_stateOver;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 12U, chartInstance->c19_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Demo_GazeFWaveIdleRandMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  _SFD_DATA_RANGE_CHECK(*c19_b_stateOver, 1U);
}
Example #16
0
static void sf_c1_model(SFc1_modelInstanceStruct *chartInstance)
{
  real_T c1_hoistedGlobal;
  real_T c1_u;
  uint32_T c1_debug_family_var_map[4];
  real_T c1_nargin = 1.0;
  real_T c1_nargout = 1.0;
  real_T c1_y;
  real_T c1_x;
  real_T c1_b_x;
  real_T *c1_b_u;
  real_T *c1_b_y;
  c1_b_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c1_b_u = (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, 0U, chartInstance->c1_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c1_b_u, 0U);
  _SFD_DATA_RANGE_CHECK(*c1_b_y, 1U);
  chartInstance->c1_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  c1_hoistedGlobal = *c1_b_u;
  c1_u = c1_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c1_debug_family_names,
    c1_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargin, 0U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargout, 1U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c1_u, 2U, c1_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_y, 3U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 4);
  c1_x = c1_u;
  c1_y = c1_x;
  c1_b_x = c1_y;
  c1_y = c1_b_x;
  c1_y = muDoubleScalarCos(c1_y);
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, -4);
  _SFD_SYMBOL_SCOPE_POP();
  *c1_b_y = c1_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_modelMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
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);
}
Example #18
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_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);
  }
}
Example #20
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);
}
Example #21
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);
}
Example #22
0
static void c35_enter_atomic_stateCreatePawn(SFc35_Expriment_PoseInstanceStruct *
  chartInstance)
{
  uint32_T c35_debug_family_var_map[2];
  real_T c35_nargin = 0.0;
  real_T c35_nargout = 0.0;
  uint32_T c35_b_debug_family_var_map[9];
  real_T c35_maxarrsize;
  real_T c35_arr[58];
  real_T c35_ss;
  real_T c35_padsize;
  real_T c35_tt[1000];
  char_T c35_mystr[58];
  real_T c35_b_nargin = 1.0;
  real_T c35_b_nargout = 1.0;
  real_T c35_myarr256[1000];
  int32_T c35_i0;
  static char_T c35_cv0[58] = { 's', 'c', 'e', 'n', 'e', '.', 'g', 'e', 't', 'P',
    'a', 'w', 'n', '(', '\\', '\"', 'g', 'a', 'z', 'e', 'T', 'a', 'r', 'g', 'e',
    't', '\\', '\"', ')', '.', 's', 'e', 't', 'P', 'o', 's', 'i', 't', 'i', 'o',
    'n', '(', 'S', 'r', 'V', 'e', 'c', '(', '0', ',', '1', '.', '6', ',', '1',
    '0', ')', ')' };

  int32_T c35_i1;
  static real_T c35_dv0[58] = { 115.0, 99.0, 101.0, 110.0, 101.0, 46.0, 103.0,
    101.0, 116.0, 80.0, 97.0, 119.0, 110.0, 40.0, 92.0, 34.0, 103.0, 97.0, 122.0,
    101.0, 84.0, 97.0, 114.0, 103.0, 101.0, 116.0, 92.0, 34.0, 41.0, 46.0, 115.0,
    101.0, 116.0, 80.0, 111.0, 115.0, 105.0, 116.0, 105.0, 111.0, 110.0, 40.0,
    83.0, 114.0, 86.0, 101.0, 99.0, 40.0, 48.0, 44.0, 49.0, 46.0, 54.0, 44.0,
    49.0, 48.0, 41.0, 41.0 };

  int32_T c35_i2;
  int32_T c35_i3;
  int32_T c35_i4;
  int32_T c35_i5;
  real_T c35_b_myarr256[1000];
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 2U, 2U, c35_debug_family_names,
    c35_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c35_nargin, 0U, c35_sf_marshallOut,
    c35_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c35_nargout, 1U, c35_sf_marshallOut,
    c35_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 9U, 9U, c35_b_debug_family_names,
    c35_b_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c35_maxarrsize, 0U, c35_sf_marshallOut,
    c35_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c35_arr, 1U, c35_d_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c35_ss, 2U, c35_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c35_padsize, 3U, c35_sf_marshallOut,
    c35_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c35_tt, 4U, c35_b_sf_marshallOut,
    c35_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c35_mystr, 5U, c35_c_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c35_b_nargin, 6U, c35_sf_marshallOut,
    c35_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c35_b_nargout, 7U, c35_sf_marshallOut,
    c35_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c35_myarr256, 8U, c35_b_sf_marshallOut,
    c35_b_sf_marshallIn);
  for (c35_i0 = 0; c35_i0 < 58; c35_i0++) {
    c35_mystr[c35_i0] = c35_cv0[c35_i0];
  }

  CV_SCRIPT_FCN(0, 0);
  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 3);
  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 4);
  c35_maxarrsize = 1000.0;
  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 6);
  for (c35_i1 = 0; c35_i1 < 58; c35_i1++) {
    c35_arr[c35_i1] = c35_dv0[c35_i1];
  }

  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 7);
  c35_ss = 58.0;
  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 8);
  c35_padsize = c35_maxarrsize - c35_ss;
  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 9);
  for (c35_i2 = 0; c35_i2 < 1000; c35_i2++) {
    c35_tt[c35_i2] = 0.0;
  }

  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 10);
  for (c35_i3 = 0; c35_i3 < 58; c35_i3++) {
    c35_tt[c35_i3] = c35_arr[c35_i3];
  }

  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, 11);
  for (c35_i4 = 0; c35_i4 < 1000; c35_i4++) {
    c35_myarr256[c35_i4] = c35_tt[c35_i4];
  }

  _SFD_SCRIPT_CALL(0U, chartInstance->c35_sfEvent, -11);
  _SFD_SYMBOL_SCOPE_POP();
  for (c35_i5 = 0; c35_i5 < 1000; c35_i5++) {
    c35_b_myarr256[c35_i5] = c35_myarr256[c35_i5];
  }

  c35_sendSBM(chartInstance, c35_b_myarr256);
  _SFD_SYMBOL_SCOPE_POP();
}
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);
}
static void sf_gateway_c39_CSE1_Oculus_gesture
  (SFc39_CSE1_Oculus_gestureInstanceStruct *chartInstance)
{
  int32_T c39_i2;
  real_T c39_K_p1[3];
  uint32_T c39_debug_family_var_map[4];
  real_T c39_nargin = 1.0;
  real_T c39_nargout = 1.0;
  real_T c39_K_p[9];
  int32_T c39_i3;
  real_T c39_v[3];
  int32_T c39_i4;
  int32_T c39_j;
  int32_T c39_b_j;
  int32_T c39_i5;
  int32_T c39_i6;
  int32_T c39_i7;
  real_T (*c39_b_K_p)[9];
  real_T (*c39_b_K_p1)[3];
  c39_b_K_p1 = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0);
  c39_b_K_p = (real_T (*)[9])ssGetOutputPortSignal(chartInstance->S, 1);
  _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
  _sfTime_ = sf_get_time(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 25U, chartInstance->c39_sfEvent);
  chartInstance->c39_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 25U, chartInstance->c39_sfEvent);
  for (c39_i2 = 0; c39_i2 < 3; c39_i2++) {
    c39_K_p1[c39_i2] = (*c39_b_K_p1)[c39_i2];
  }

  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 4U, 4U, c39_debug_family_names,
    c39_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c39_nargin, 0U, c39_c_sf_marshallOut,
    c39_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c39_nargout, 1U, c39_c_sf_marshallOut,
    c39_b_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(c39_K_p1, 2U, c39_b_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c39_K_p, 3U, c39_sf_marshallOut,
    c39_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c39_sfEvent, 4);
  for (c39_i3 = 0; c39_i3 < 3; c39_i3++) {
    c39_v[c39_i3] = c39_K_p1[c39_i3];
  }

  for (c39_i4 = 0; c39_i4 < 9; c39_i4++) {
    c39_K_p[c39_i4] = 0.0;
  }

  for (c39_j = 1; c39_j < 4; c39_j++) {
    c39_b_j = c39_j;
    c39_K_p[(_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)_SFD_INTEGER_CHECK("",
               (real_T)c39_b_j), 1, 3, 1, 0) + 3 * (_SFD_EML_ARRAY_BOUNDS_CHECK(
               "", (int32_T)_SFD_INTEGER_CHECK("", (real_T)c39_b_j), 1, 3, 2, 0)
              - 1)) - 1] = c39_v[_SFD_EML_ARRAY_BOUNDS_CHECK("", (int32_T)
      _SFD_INTEGER_CHECK("", (real_T)c39_b_j), 1, 3, 1, 0) - 1];
  }

  _SFD_EML_CALL(0U, chartInstance->c39_sfEvent, -4);
  _SFD_SYMBOL_SCOPE_POP();
  for (c39_i5 = 0; c39_i5 < 9; c39_i5++) {
    (*c39_b_K_p)[c39_i5] = c39_K_p[c39_i5];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 25U, chartInstance->c39_sfEvent);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_CSE1_Oculus_gestureMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
  for (c39_i6 = 0; c39_i6 < 9; c39_i6++) {
    _SFD_DATA_RANGE_CHECK((*c39_b_K_p)[c39_i6], 0U);
  }

  for (c39_i7 = 0; c39_i7 < 3; c39_i7++) {
    _SFD_DATA_RANGE_CHECK((*c39_b_K_p1)[c39_i7], 1U);
  }
}
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);
}
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);
}
Example #27
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);
}
Example #28
0
File: c3_V2A1_2.c Project: 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);
}
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);
}
Example #30
0
static void sf_c1_Pointing_Cntrl_Act(SFc1_Pointing_Cntrl_ActInstanceStruct
  *chartInstance)
{
  real_T c1_hoistedGlobal;
  real_T c1_b_hoistedGlobal;
  real_T c1_c_hoistedGlobal;
  real_T c1_u;
  real_T c1_Lmax;
  real_T c1_Lsat;
  uint32_T c1_debug_family_var_map[7];
  real_T c1_Llim;
  real_T c1_nargin = 3.0;
  real_T c1_nargout = 1.0;
  real_T c1_y;
  real_T c1_varargin_1;
  real_T c1_varargin_2;
  real_T c1_b_varargin_2;
  real_T c1_varargin_3;
  real_T c1_x;
  real_T c1_b_y;
  real_T c1_b_x;
  real_T c1_c_y;
  real_T c1_xk;
  real_T c1_yk;
  real_T c1_c_x;
  real_T c1_d_y;
  real_T c1_b_varargin_1;
  real_T c1_c_varargin_2;
  real_T c1_d_varargin_2;
  real_T c1_b_varargin_3;
  real_T c1_d_x;
  real_T c1_e_y;
  real_T c1_e_x;
  real_T c1_f_y;
  real_T c1_b_xk;
  real_T c1_b_yk;
  real_T c1_f_x;
  real_T c1_g_y;
  real_T *c1_b_u;
  real_T *c1_h_y;
  real_T *c1_b_Lmax;
  real_T *c1_b_Lsat;
  c1_b_Lsat = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c1_b_Lmax = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c1_h_y = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c1_b_u = (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_u, 0U);
  _SFD_DATA_RANGE_CHECK(*c1_h_y, 1U);
  _SFD_DATA_RANGE_CHECK(*c1_b_Lmax, 2U);
  _SFD_DATA_RANGE_CHECK(*c1_b_Lsat, 3U);
  chartInstance->c1_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  c1_hoistedGlobal = *c1_b_u;
  c1_b_hoistedGlobal = *c1_b_Lmax;
  c1_c_hoistedGlobal = *c1_b_Lsat;
  c1_u = c1_hoistedGlobal;
  c1_Lmax = c1_b_hoistedGlobal;
  c1_Lsat = c1_c_hoistedGlobal;
  _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 7U, 7U, c1_debug_family_names,
    c1_debug_family_var_map);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_Llim, 0U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargin, 1U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargout, 2U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c1_u, 3U, c1_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c1_Lmax, 4U, c1_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML(&c1_Lsat, 5U, c1_sf_marshallOut);
  _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_y, 6U, c1_sf_marshallOut,
    c1_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 4);
  if (CV_EML_IF(0, 1, 0, c1_u >= 0.0)) {
    _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 5);
    c1_Llim = c1_Lmax - c1_Lsat;
    _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 6);
    if (CV_EML_IF(0, 1, 1, c1_Llim < 0.0)) {
      _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 7);
      c1_y = 0.0;
    } else {
      _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 9);
      c1_varargin_1 = c1_Llim;
      c1_varargin_2 = c1_u;
      c1_b_varargin_2 = c1_varargin_1;
      c1_varargin_3 = c1_varargin_2;
      c1_x = c1_b_varargin_2;
      c1_b_y = c1_varargin_3;
      c1_b_x = c1_x;
      c1_c_y = c1_b_y;
      c1_eml_scalar_eg(chartInstance);
      c1_xk = c1_b_x;
      c1_yk = c1_c_y;
      c1_c_x = c1_xk;
      c1_d_y = c1_yk;
      c1_eml_scalar_eg(chartInstance);
      c1_y = muDoubleScalarMin(c1_c_x, c1_d_y);
    }
  } else {
    _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 12);
    c1_Llim = -c1_Lmax - c1_Lsat;
    _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 13);
    if (CV_EML_IF(0, 1, 2, c1_Llim > 0.0)) {
      _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 14);
      c1_y = 0.0;
    } else {
      _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 16);
      c1_b_varargin_1 = c1_Llim;
      c1_c_varargin_2 = c1_u;
      c1_d_varargin_2 = c1_b_varargin_1;
      c1_b_varargin_3 = c1_c_varargin_2;
      c1_d_x = c1_d_varargin_2;
      c1_e_y = c1_b_varargin_3;
      c1_e_x = c1_d_x;
      c1_f_y = c1_e_y;
      c1_eml_scalar_eg(chartInstance);
      c1_b_xk = c1_e_x;
      c1_b_yk = c1_f_y;
      c1_f_x = c1_b_xk;
      c1_g_y = c1_b_yk;
      c1_eml_scalar_eg(chartInstance);
      c1_y = muDoubleScalarMax(c1_f_x, c1_g_y);
    }
  }

  _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, -16);
  _SFD_SYMBOL_SCOPE_POP();
  *c1_h_y = c1_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Pointing_Cntrl_ActMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}