static void sf_c11_Batman_Code(SFc11_Batman_CodeInstanceStruct *chartInstance)
{
  int32_T c11_i2;
  int32_T c11_i3;
  int32_T c11_i4;
  uint16_T (*c11_cell_temperatures_out)[12];
  uint16_T (*c11_cell_temperatures_in)[12];
  uint32_T (*c11_msg)[2];
  c11_cell_temperatures_out = (uint16_T (*)[12])ssGetOutputPortSignal
    (chartInstance->S, 1);
  c11_cell_temperatures_in = (uint16_T (*)[12])ssGetInputPortSignal
    (chartInstance->S, 1);
  c11_msg = (uint32_T (*)[2])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 7U, chartInstance->c11_sfEvent);
  for (c11_i2 = 0; c11_i2 < 2; c11_i2++) {
    _SFD_DATA_RANGE_CHECK((real_T)(*c11_msg)[c11_i2], 0U);
  }

  for (c11_i3 = 0; c11_i3 < 12; c11_i3++) {
    _SFD_DATA_RANGE_CHECK((real_T)(*c11_cell_temperatures_in)[c11_i3], 1U);
  }

  for (c11_i4 = 0; c11_i4 < 12; c11_i4++) {
    _SFD_DATA_RANGE_CHECK((real_T)(*c11_cell_temperatures_out)[c11_i4], 2U);
  }

  chartInstance->c11_sfEvent = CALL_EVENT;
  c11_chartstep_c11_Batman_Code(chartInstance);
  sf_debug_check_for_state_inconsistency(_Batman_CodeMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
static void sf_c30_adcs_v15_integral_Power(void)
{
  int32_T c30_i3;
  int32_T c30_i4;
  int32_T c30_previousEvent;
  real_T *c30_t;
  real_T (*c30_r_I)[3];
  real_T (*c30_r_ECEF)[3];
  c30_r_ECEF = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
  c30_t = (real_T *)ssGetInputPortSignal(chartInstance.S, 1);
  c30_r_I = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,23);
  _SFD_DATA_RANGE_CHECK(chartInstance.c30_today, 0U);
  for (c30_i3 = 0; c30_i3 < 3; c30_i3 = c30_i3 + 1) {
    _SFD_DATA_RANGE_CHECK((*c30_r_ECEF)[c30_i3], 1U);
  }

  _SFD_DATA_RANGE_CHECK(chartInstance.c30_equinox, 2U);
  for (c30_i4 = 0; c30_i4 < 3; c30_i4 = c30_i4 + 1) {
    _SFD_DATA_RANGE_CHECK((*c30_r_I)[c30_i4], 3U);
  }

  _SFD_DATA_RANGE_CHECK(*c30_t, 4U);
  c30_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  c30_c30_adcs_v15_integral_Power();
  _sfEvent_ = c30_previousEvent;
  sf_debug_check_for_state_inconsistency(_adcs_v15_integral_PowerMachineNumber_,
    chartInstance.chartNumber, chartInstance.
    instanceNumber);
}
static void sf_c26_HIL_model_experiments2
  (SFc26_HIL_model_experiments2InstanceStruct *chartInstance)
{
  int32_T c26_i2;
  int32_T c26_i3;
  int32_T c26_i4;
  real_T (*c26_nu_ref)[3];
  real_T (*c26_eta_dot_ref)[3];
  real_T (*c26_eta_ref)[3];
  c26_nu_ref = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 1);
  c26_eta_dot_ref = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  c26_eta_ref = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 14U, chartInstance->c26_sfEvent);
  for (c26_i2 = 0; c26_i2 < 3; c26_i2++) {
    _SFD_DATA_RANGE_CHECK((*c26_eta_ref)[c26_i2], 0U);
  }

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

  for (c26_i4 = 0; c26_i4 < 3; c26_i4++) {
    _SFD_DATA_RANGE_CHECK((*c26_nu_ref)[c26_i4], 2U);
  }

  chartInstance->c26_sfEvent = CALL_EVENT;
  c26_chartstep_c26_HIL_model_experiments2(chartInstance);
  _SFD_CHECK_FOR_STATE_INCONSISTENCY(_HIL_model_experiments2MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Example #4
0
static void sf_c1_minimalist14(void)
{
  int32_T c1_previousEvent;
  uint32_T *c1_numIter;
  uint8_T *c1_value;
  c1_value = (uint8_T *)ssGetInputPortSignal(chartInstance.S, 1);
  c1_numIter = (uint32_T *)ssGetInputPortSignal(chartInstance.S, 0);
  c1_set_sim_state_side_effects_c1_minimalist14();
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,0);
  _SFD_DATA_RANGE_CHECK((real_T)*c1_numIter, 0U);
  _SFD_DATA_RANGE_CHECK((real_T)*c1_value, 1U);
  c1_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,0);
  if ((int16_T)chartInstance.c1_is_active_c1_minimalist14 == 0) {
    _SFD_CC_CALL(CHART_ENTER_ENTRY_FUNCTION_TAG,0);
    chartInstance.c1_is_active_c1_minimalist14 = 1U;
    _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
    _SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,0);
    _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,0);
    chartInstance.c1_is_c1_minimalist14 = (uint8_T)c1_IN_step;
    _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
    chartInstance.c1_tp_step = 1U;
    c1_set_buffer_receive_nav_mode(_SFD_ARRAY_BOUNDS_CHECK(2U, (int32_T)
      *c1_numIter, 0, 36, 1, 0), *c1_value);
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
  _sfEvent_ = c1_previousEvent;
  sf_debug_check_for_state_inconsistency(_minimalist14MachineNumber_,
    chartInstance.chartNumber, chartInstance.instanceNumber);
}
Example #5
0
static void c35_sendSBM(SFc35_Expriment_PoseInstanceStruct *chartInstance,
  real_T c35_In2[1000])
{
  int32_T c35_i14;
  int32_T c35_i15;
  int32_T c35_i16;
  real_T (*c35_b_In2)[1000];
  c35_b_In2 = (real_T (*)[1000])ssGetOutputPortSignal(chartInstance->S, 1);
  for (c35_i14 = 0; c35_i14 < 1000; c35_i14++) {
    _SFD_DATA_RANGE_CHECK(c35_In2[c35_i14], 0U);
  }

  _SFD_SET_DATA_VALUE_PTR(0U, c35_In2);
  _SFD_CS_CALL(FUNCTION_ACTIVE_TAG, 0U, chartInstance->c35_sfEvent);
  _SFD_SYMBOL_SCOPE_PUSH(1U, 0U);
  _SFD_SYMBOL_SCOPE_ADD_IMPORTABLE("In2", c35_In2, c35_g_sf_marshallOut,
    c35_e_sf_marshallIn);
  _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c35_sfEvent);
  for (c35_i15 = 0; c35_i15 < 1000; c35_i15++) {
    (*c35_b_In2)[c35_i15] = c35_In2[c35_i15];
  }

  for (c35_i16 = 0; c35_i16 < 1000; c35_i16++) {
    _SFD_DATA_RANGE_CHECK((*c35_b_In2)[c35_i16], 0U);
  }

  sf_call_output_fcn_call(chartInstance->S, 0, "sendSBM", 0);
  _SFD_SYMBOL_SCOPE_POP();
  _SFD_CS_CALL(FUNCTION_INACTIVE_TAG, 0U, chartInstance->c35_sfEvent);
  _SFD_UNSET_DATA_VALUE_PTR(0U);
  _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c35_sfEvent);
}
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_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_c20_adcs_v15_integral_Power_nom(void)
{
  int32_T c20_i3;
  int32_T c20_i4;
  int32_T c20_i5;
  int32_T c20_previousEvent;
  real_T (*c20_v_B)[3];
  real_T (*c20_x)[7];
  real_T (*c20_v_I)[3];
  c20_v_I = (real_T (*)[3])ssGetInputPortSignal(chartInstance.S, 0);
  c20_v_B = (real_T (*)[3])ssGetOutputPortSignal(chartInstance.S, 1);
  c20_x = (real_T (*)[7])ssGetInputPortSignal(chartInstance.S, 1);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,14);
  for (c20_i3 = 0; c20_i3 < 3; c20_i3 = c20_i3 + 1) {
    _SFD_DATA_RANGE_CHECK((*c20_v_I)[c20_i3], 0U);
  }

  for (c20_i4 = 0; c20_i4 < 7; c20_i4 = c20_i4 + 1) {
    _SFD_DATA_RANGE_CHECK((*c20_x)[c20_i4], 1U);
  }

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

  c20_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  c20_c20_adcs_v15_integral_Power_nom();
  _sfEvent_ = c20_previousEvent;
  sf_debug_check_for_state_inconsistency
    (_adcs_v15_integral_Power_nomMachineNumber_, chartInstance.chartNumber,
     chartInstance.
     instanceNumber);
}
static void sf_c6_motor_control_with_homebrew_SVPWM
  (SFc6_motor_control_with_homebrew_SVPWMInstanceStruct *chartInstance)
{
  real_T *c6_Xd;
  real_T *c6_Xalpha;
  real_T *c6_Xq;
  real_T *c6_theta;
  real_T *c6_Xbeta;
  c6_Xbeta = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c6_theta = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
  c6_Xq = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c6_Xalpha = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c6_Xd = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 5U, chartInstance->c6_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c6_Xd, 0U);
  _SFD_DATA_RANGE_CHECK(*c6_Xalpha, 1U);
  _SFD_DATA_RANGE_CHECK(*c6_Xq, 2U);
  _SFD_DATA_RANGE_CHECK(*c6_theta, 3U);
  _SFD_DATA_RANGE_CHECK(*c6_Xbeta, 4U);
  chartInstance->c6_sfEvent = CALL_EVENT;
  c6_chartstep_c6_motor_control_with_homebrew_SVPWM(chartInstance);
  sf_debug_check_for_state_inconsistency
    (_motor_control_with_homebrew_SVPWMMachineNumber_,
     chartInstance->chartNumber, chartInstance->instanceNumber);
}
Example #10
0
static void sf_c16_ekffede(SFc16_ekffedeInstanceStruct *chartInstance)
{
  int32_T c16_i2;
  int32_T c16_i3;
  int32_T c16_i4;
  real_T (*c16_quat)[4];
  real_T (*c16_quat_dot)[4];
  real_T (*c16_gyro)[3];
  c16_quat = (real_T (*)[4])ssGetInputPortSignal(chartInstance->S, 1);
  c16_quat_dot = (real_T (*)[4])ssGetOutputPortSignal(chartInstance->S, 1);
  c16_gyro = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 15U, chartInstance->c16_sfEvent);
  for (c16_i2 = 0; c16_i2 < 3; c16_i2++) {
    _SFD_DATA_RANGE_CHECK((*c16_gyro)[c16_i2], 0U);
  }

  for (c16_i3 = 0; c16_i3 < 4; c16_i3++) {
    _SFD_DATA_RANGE_CHECK((*c16_quat_dot)[c16_i3], 1U);
  }

  for (c16_i4 = 0; c16_i4 < 4; c16_i4++) {
    _SFD_DATA_RANGE_CHECK((*c16_quat)[c16_i4], 2U);
  }

  chartInstance->c16_sfEvent = CALL_EVENT;
  c16_chartstep_c16_ekffede(chartInstance);
  sf_debug_check_for_state_inconsistency(_ekffedeMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
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_c22_BuckBoost1(SFc22_BuckBoost1InstanceStruct *chartInstance)
{
  real_T c22_hoistedGlobal;
  real_T c22_b_hoistedGlobal;
  real_T c22_Carrier;
  real_T c22_Duty;
  uint32_T c22_debug_family_var_map[6];
  real_T c22_Err1;
  real_T c22_nargin = 2.0;
  real_T c22_nargout = 1.0;
  real_T c22_PWM;
  real_T *c22_b_PWM;
  real_T *c22_b_Carrier;
  real_T *c22_b_Duty;
  c22_b_Duty = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
  c22_b_Carrier = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  c22_b_PWM = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 3U, chartInstance->c22_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c22_b_PWM, 0U);
  _SFD_DATA_RANGE_CHECK(*c22_b_Carrier, 1U);
  _SFD_DATA_RANGE_CHECK(*c22_b_Duty, 2U);
  chartInstance->c22_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 3U, chartInstance->c22_sfEvent);
  c22_hoistedGlobal = *c22_b_Carrier;
  c22_b_hoistedGlobal = *c22_b_Duty;
  c22_Carrier = c22_hoistedGlobal;
  c22_Duty = c22_b_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 6U, 6U, c22_debug_family_names,
    c22_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(&c22_Err1, 0U, c22_sf_marshallOut,
    c22_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c22_nargin, 1U, c22_sf_marshallOut,
    c22_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c22_nargout, 2U, c22_sf_marshallOut,
    c22_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c22_Carrier, 3U, c22_sf_marshallOut);
  sf_debug_symbol_scope_add_eml(&c22_Duty, 4U, c22_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c22_PWM, 5U, c22_sf_marshallOut,
    c22_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c22_sfEvent, 3);
  c22_Err1 = c22_Duty - c22_Carrier;
  _SFD_EML_CALL(0U, chartInstance->c22_sfEvent, 5);
  if (CV_EML_IF(0, 1, 0, c22_Err1 > 0.0)) {
    _SFD_EML_CALL(0U, chartInstance->c22_sfEvent, 6);
    c22_PWM = 1.0;
  } else {
    _SFD_EML_CALL(0U, chartInstance->c22_sfEvent, 8);
    c22_PWM = 0.0;
  }

  _SFD_EML_CALL(0U, chartInstance->c22_sfEvent, -8);
  sf_debug_symbol_scope_pop();
  *c22_b_PWM = c22_PWM;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 3U, chartInstance->c22_sfEvent);
  sf_debug_check_for_state_inconsistency(_BuckBoost1MachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Example #13
0
static void sf_c2_hapticsSimBlk_pd(SFc2_hapticsSimBlk_pdInstanceStruct
  *chartInstance)
{
  int32_T c2_i2;
  int32_T c2_i3;
  int32_T c2_i4;
  real_T c2_u[3];
  uint32_T c2_debug_family_var_map[4];
  real_T c2_nargin = 1.0;
  real_T c2_nargout = 1.0;
  real_T c2_y[3];
  int32_T c2_i5;
  int32_T c2_i6;
  real_T (*c2_b_y)[3];
  real_T (*c2_b_u)[3];
  c2_b_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  c2_b_u = (real_T (*)[3])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  for (c2_i2 = 0; c2_i2 < 3; c2_i2++) {
    _SFD_DATA_RANGE_CHECK((*c2_b_u)[c2_i2], 0U);
  }

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

  chartInstance->c2_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  for (c2_i4 = 0; c2_i4 < 3; c2_i4++) {
    c2_u[c2_i4] = (*c2_b_u)[c2_i4];
  }

  sf_debug_symbol_scope_push_eml(0U, 4U, 4U, c2_debug_family_names,
    c2_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(&c2_nargin, 0U, c2_b_sf_marshallOut,
    c2_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c2_nargout, 1U, c2_b_sf_marshallOut,
    c2_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(c2_u, 2U, c2_sf_marshallOut);
  sf_debug_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, 5);
  for (c2_i5 = 0; c2_i5 < 3; c2_i5++) {
    c2_y[c2_i5] = c2_u[c2_i5];
  }

  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -5);
  sf_debug_symbol_scope_pop();
  for (c2_i6 = 0; c2_i6 < 3; c2_i6++) {
    (*c2_b_y)[c2_i6] = c2_y[c2_i6];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c2_sfEvent);
  sf_debug_check_for_state_inconsistency(_hapticsSimBlk_pdMachineNumber_,
    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_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 #16
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);
}
Example #17
0
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);
}
Example #18
0
static void sf_c2_tablerot_id(SFc2_tablerot_idInstanceStruct *chartInstance)
{
int32_T c2_i3;
int32_T c2_i4;
int32_T c2_previousEvent;
int32_T c2_i5;
real_T c2_hoistedGlobal[6];
int32_T c2_i6;
real_T c2_u[6];
uint32_T c2_debug_family_var_map[4];
static const char *c2_sv0[4] = { "nargin", "nargout", "u", "y" };
real_T c2_nargin = 1.0;
real_T c2_nargout = 1.0;
real_T c2_y[3];
int32_T c2_i7;
int32_T c2_i8;
real_T (*c2_b_y)[3];
real_T (*c2_b_u)[6];
c2_b_y = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
c2_b_u = (real_T (*)[6])ssGetInputPortSignal(chartInstance->S, 0);
_sfTime_ = (real_T)ssGetT(chartInstance->S);
_SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,1);
for(c2_i3 = 0; c2_i3 < 6; c2_i3 = c2_i3 + 1) {
_SFD_DATA_RANGE_CHECK((*c2_b_u)[c2_i3], 0U);
}
for(c2_i4 = 0; c2_i4 < 3; c2_i4 = c2_i4 + 1) {
_SFD_DATA_RANGE_CHECK((*c2_b_y)[c2_i4], 1U);
}
c2_previousEvent = _sfEvent_;
_sfEvent_ = CALL_EVENT;
_SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,1);
for(c2_i5 = 0; c2_i5 < 6; c2_i5 = c2_i5 + 1) {
c2_hoistedGlobal[c2_i5] = (*c2_b_u)[c2_i5];
}
for(c2_i6 = 0; c2_i6 < 6; c2_i6 = c2_i6 + 1) {
c2_u[c2_i6] = c2_hoistedGlobal[c2_i6];
}
sf_debug_symbol_scope_push_eml(0U, 4U, 4U, c2_sv0, c2_debug_family_var_map);
sf_debug_symbol_scope_add_eml(&c2_nargin, c2_c_sf_marshall, 0U);
sf_debug_symbol_scope_add_eml(&c2_nargout, c2_c_sf_marshall, 1U);
sf_debug_symbol_scope_add_eml(&c2_u, c2_b_sf_marshall, 2U);
sf_debug_symbol_scope_add_eml(&c2_y, c2_sf_marshall, 3U);
CV_EML_FCN(0, 0);
_SFD_EML_CALL(0,4);
for(c2_i7 = 0; c2_i7 < 3; c2_i7 = c2_i7 + 1) {
c2_y[c2_i7] = c2_u[c2_i7 + 3];
}
_SFD_EML_CALL(0,-4);
sf_debug_symbol_scope_pop();
for(c2_i8 = 0; c2_i8 < 3; c2_i8 = c2_i8 + 1) {
(*c2_b_y)[c2_i8] = c2_y[c2_i8];
}
_SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,1);
_sfEvent_ = c2_previousEvent;
sf_debug_check_for_state_inconsistency(_tablerot_idMachineNumber_, 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);
}
static void sf_c2_SALTStabilizationInnerOuterLoopSIM
  (SFc2_SALTStabilizationInnerOuterLoopSIMInstanceStruct *chartInstance)
{
  real32_T c2_hoistedGlobal;
  real32_T c2_u;
  uint32_T c2_debug_family_var_map[4];
  real_T c2_nargin = 1.0;
  real_T c2_nargout = 1.0;
  real32_T c2_y;
  real32_T c2_A;
  real32_T c2_x;
  real32_T c2_b_x;
  real32_T c2_b_y;
  real32_T c2_a;
  real32_T c2_c_y;
  real32_T c2_b_a;
  real32_T *c2_b_u;
  real32_T *c2_d_y;
  c2_d_y = (real32_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c2_b_u = (real32_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  _SFD_DATA_RANGE_CHECK((real_T)*c2_b_u, 0U);
  _SFD_DATA_RANGE_CHECK((real_T)*c2_d_y, 1U);
  chartInstance->c2_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  c2_hoistedGlobal = *c2_b_u;
  c2_u = c2_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 4U, 4U, c2_debug_family_names,
    c2_debug_family_var_map);
  sf_debug_symbol_scope_add_eml_importable(&c2_nargin, 0U, c2_b_sf_marshallOut,
    c2_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c2_nargout, 1U, c2_b_sf_marshallOut,
    c2_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c2_u, 2U, c2_sf_marshallOut);
  sf_debug_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);
  c2_A = c2_u;
  c2_x = c2_A;
  c2_b_x = c2_x;
  c2_b_y = c2_b_x / 131.0F;
  c2_a = c2_b_y;
  c2_c_y = c2_a * 0.0174532924F;
  c2_b_a = c2_c_y;
  c2_y = c2_b_a * 5.0F;
  _SFD_EML_CALL(0U, chartInstance->c2_sfEvent, -4);
  sf_debug_symbol_scope_pop();
  *c2_d_y = c2_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c2_sfEvent);
  sf_debug_check_for_state_inconsistency
    (_SALTStabilizationInnerOuterLoopSIMMachineNumber_,
     chartInstance->chartNumber, chartInstance->instanceNumber);
}
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 #22
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_c6_adcs_v15_integral_Power_no_charge_in_detumb(void)
{
  int32_T c6_previousEvent;
  real_T c6_a;
  real_T c6_b;
  real_T c6_nargout = 1.0;
  real_T c6_nargin = 2.0;
  real_T c6_c;
  real_T c6_y;
  real_T *c6_b_a;
  real_T *c6_b_y;
  real_T *c6_b_b;
  c6_b_y = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1);
  c6_b_a = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
  c6_b_b = (real_T *)ssGetInputPortSignal(chartInstance.S, 1);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG,4);
  _SFD_DATA_RANGE_CHECK(*c6_b_a, 0U);
  _SFD_DATA_RANGE_CHECK(*c6_b_y, 1U);
  _SFD_DATA_RANGE_CHECK(*c6_b_b, 2U);
  c6_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,4);
  c6_a = *c6_b_a;
  c6_b = *c6_b_b;
  sf_debug_symbol_scope_push(6U, 0U);
  sf_debug_symbol_scope_add("nargout", &c6_nargout, c6_sf_marshall);
  sf_debug_symbol_scope_add("nargin", &c6_nargin, c6_sf_marshall);
  sf_debug_symbol_scope_add("c", &c6_c, c6_sf_marshall);
  sf_debug_symbol_scope_add("y", &c6_y, c6_sf_marshall);
  sf_debug_symbol_scope_add("b", &c6_b, c6_sf_marshall);
  sf_debug_symbol_scope_add("a", &c6_a, c6_sf_marshall);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0,4);
  c6_c = 1.0 - c6_a;
  _SFD_EML_CALL(0,6);
  c6_y = c6_c + c6_b;
  _SFD_EML_CALL(0,7);
  if (CV_EML_IF(0, 0, c6_y > 1.0)) {
    _SFD_EML_CALL(0,8);
    c6_y = 1.0;
  }

  _SFD_EML_CALL(0,-8);
  sf_debug_symbol_scope_pop();
  *c6_b_y = c6_y;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,4);
  _sfEvent_ = c6_previousEvent;
  sf_debug_check_for_state_inconsistency
    (_adcs_v15_integral_Power_no_charge_in_detumbMachineNumber_,
     chartInstance.chartNumber,
     chartInstance.instanceNumber);
}
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 #26
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);
}
Example #27
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);
}
static void sf_c5_testing_Control(SFc5_testing_ControlInstanceStruct
  *chartInstance)
{
  real_T *c5_lambda;
  real_T *c5_lambda1;
  c5_lambda1 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c5_lambda = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 2U, chartInstance->c5_sfEvent);
  _SFD_DATA_RANGE_CHECK(*c5_lambda, 0U);
  _SFD_DATA_RANGE_CHECK(*c5_lambda1, 1U);
  chartInstance->c5_sfEvent = CALL_EVENT;
  c5_chartstep_c5_testing_Control(chartInstance);
  sf_debug_check_for_state_inconsistency(_testing_ControlMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}
Example #30
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);
}