/* Function Definitions */
static void initialize_c1_EVdemo_6(SFc1_EVdemo_6InstanceStruct *chartInstance)
{
  uint8_T *c1_Mode;
  boolean_T *c1_BrakeSet;
  c1_BrakeSet = (boolean_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c1_Mode = (uint8_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  chartInstance->c1_sfEvent = CALL_EVENT;
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  chartInstance->c1_doSetSimStateSideEffects = 0U;
  chartInstance->c1_setSimStateSideEffectsInfo = NULL;
  chartInstance->c1_tp_Accel = 0U;
  chartInstance->c1_temporalCounter_i1 = 0U;
  chartInstance->c1_tp_Decel = 0U;
  chartInstance->c1_temporalCounter_i1 = 0U;
  chartInstance->c1_tp_Stop = 0U;
  chartInstance->c1_is_active_c1_EVdemo_6 = 0U;
  chartInstance->c1_is_c1_EVdemo_6 = c1_IN_NO_ACTIVE_CHILD;
  if (!(cdrGetOutputPortReusable(chartInstance->S, 1) != 0)) {
    *c1_Mode = 0U;
  }

  if (!(cdrGetOutputPortReusable(chartInstance->S, 2) != 0)) {
    *c1_BrakeSet = FALSE;
  }
}
Пример #2
0
/* Function Definitions */
static void initialize_c1_newtons_cradle(SFc1_newtons_cradleInstanceStruct
  *chartInstance)
{
  int32_T c1_i0;
  real_T (*c1_p)[3];
  real_T (*c1_v)[3];
  real_T (*c1_p_out)[3];
  real_T (*c1_v_out)[3];
  c1_v = (real_T (*)[3])(ssGetContStates(chartInstance->S) + 3);
  c1_p = (real_T (*)[3])(ssGetContStates(chartInstance->S) + 0);
  c1_v_out = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 2);
  c1_p_out = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  chartInstance->c1_doSetSimStateSideEffects = 0U;
  chartInstance->c1_setSimStateSideEffectsInfo = NULL;
  chartInstance->c1_is_active_c1_newtons_cradle = 0U;
  chartInstance->c1_is_c1_newtons_cradle = c1_IN_NO_ACTIVE_CHILD;
  for (c1_i0 = 0; c1_i0 < 3; c1_i0++) {
    (*c1_p)[c1_i0] = 0.0;
    (*c1_v)[c1_i0] = 0.0;
  }

  chartInstance->c1_g = 9.81;
  chartInstance->c1_l = 1.0;
  chartInstance->c1_pi = 3.141;
  chartInstance->c1_k = 3;
  if (!(cdrGetOutputPortReusable(chartInstance->S, 1) != 0)) {
    for (c1_i0 = 0; c1_i0 < 3; c1_i0++) {
      (*c1_p_out)[c1_i0] = 0.0;
    }
  }

  if (!(cdrGetOutputPortReusable(chartInstance->S, 2) != 0)) {
    for (c1_i0 = 0; c1_i0 < 3; c1_i0++) {
      (*c1_v_out)[c1_i0] = 0.0;
    }
  }

  chartInstance->c1_is_active_c1_newtons_cradle = 1U;
  for (c1_i0 = 0; c1_i0 < 3; c1_i0++) {
    (*c1_p)[c1_i0] = 0.0;
    (*c1_v)[c1_i0] = 0.0;
  }

  (*c1_p)[0] = 1.5705;
  (*c1_p)[1] = 0.392625;
  (*c1_p)[2] = -0.78525;
  chartInstance->c1_is_c1_newtons_cradle = c1_IN_FreeDynamics;
}
/* Function Definitions */
static void initialize_c2_Pedal_Interpretation_exe(void)
{
  real_T *c2_TestCase;
  real_T *c2_variant;
  c2_TestCase = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1);
  c2_variant = (real_T *)ssGetOutputPortSignal(chartInstance.S, 2);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  chartInstance.c2_tp_TestCase1 = 0U;
  chartInstance.c2_tp_TestCase2 = 0U;
  chartInstance.c2_tp_TestCase3 = 0U;
  chartInstance.c2_tp_TestCase4 = 0U;
  chartInstance.c2_is_active_c2_Pedal_Interpretation_exe = 0U;
  chartInstance.c2_is_c2_Pedal_Interpretation_exe = 0U;
  if (!(cdrGetOutputPortReusable(chartInstance.S, 1) != 0)) {
    *c2_TestCase = 0.0;
  }

  if (!(cdrGetOutputPortReusable(chartInstance.S, 2) != 0)) {
    *c2_variant = 0.0;
  }
}
/* Function Definitions */
static void initialize_c7_Pedal_Interpretation_exe(void)
{
  real_T *c7_TDPre;
  c7_TDPre = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1);
  _sfTime_ = (real_T)ssGetT(chartInstance.S);
  chartInstance.c7_is_Precondition1 = 0U;
  chartInstance.c7_tp_Precondition1 = 0U;
  chartInstance.c7_tp_Init1 = 0U;
  chartInstance.c7_tp_Stabilise1 = 0U;
  chartInstance.c7_tp_TDataPre1 = 0U;
  chartInstance.c7_tp_stop = 0U;
  chartInstance.c7_tp_wait = 0U;
  chartInstance.c7_is_active_c7_Pedal_Interpretation_exe = 0U;
  chartInstance.c7_is_c7_Pedal_Interpretation_exe = 0U;
  if (!(cdrGetOutputPortReusable(chartInstance.S, 1) != 0)) {
    *c7_TDPre = 0.0;
  }
}