⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parc_sfun_c1.c

📁 CDMA移动通信系统中一种速率功率联合控制方法
💻 C
📖 第 1 页 / 共 5 页
字号:
  _SFD_CS_CALL(STATE_ENTER_ENTRY_FUNCTION_TAG,13);
  _SFD_CCS_CALL(STATE_ENTRY_COVERAGE_TAG,13,0);
  chartInstance.State.is_m0_c1_s13_System_Access_6_6_3 =
    IN_m0_c1_s14_Access_Probe;
  _SFD_CS_CALL(STATE_ACTIVE_TAG,13);
  chartInstance.Counters.i2 = 0;
  _SFD_CS_CALL(STATE_BEFORE_ENTRY_ACTION_TAG,13);
  OutputData_m0_c1_d16_Tx_Power =
    (((-chartInstance.LocalData.m0_c1_d2_Input_Power - 73.0) +
    chartInstance.LocalData.m0_c1_d3_Nom_Pwr) +
    chartInstance.LocalData.m0_c1_d1_Init_Pwr) +
    chartInstance.LocalData.m0_c1_d10_Sum_Access_Probe_Corrections;
  _SFD_CCS_CALL(STATE_ENTRY_COVERAGE_TAG,13,1);
  OutputData_m0_c1_d15_Access_Tx_Enable = 1.0;
  _SFD_CCS_CALL(STATE_ENTRY_COVERAGE_TAG,13,2);
  _SFD_CS_CALL(STATE_AFTER_ENTRY_ACTION_TAG,13);
  _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,13);
}

static void exit_atomic_m0_c1_s14_Access_Probe(void)
{
  _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,13);
  _SFD_CCS_CALL(STATE_EXIT_COVERAGE_TAG,13,0);
  chartInstance.State.is_m0_c1_s13_System_Access_6_6_3 = IN_NO_ACTIVE_CHILD;
  _SFD_CS_CALL(STATE_INACTIVE_TAG,13);
  _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,13);
}

static void exit_atomic_m0_c1_s15_Wait(void)
{
  _SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,6);
  _SFD_CCS_CALL(STATE_EXIT_COVERAGE_TAG,6,0);
  _SFD_CS_CALL(STATE_BEFORE_EXIT_ACTION_TAG,6);
  chartInstance.LocalData.m0_c1_d2_Input_Power =
    InputData_m0_c1_d13_Current_Input_Power;
  _SFD_CCS_CALL(STATE_EXIT_COVERAGE_TAG,6,1);
  _SFD_CS_CALL(STATE_AFTER_EXIT_ACTION_TAG,6);
  chartInstance.State.is_m0_c1_s13_System_Access_6_6_3 = IN_NO_ACTIVE_CHILD;
  _SFD_CS_CALL(STATE_INACTIVE_TAG,6);
  _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,6);
}

static void broadcast_m0_c1_e18_Start_Chart(void)
{
  uint8_T previousEvent;
  previousEvent = _sfEvent_;
  _sfEvent_ = event_m0_c1_e18_Start_Chart;
  _SFD_CE_CALL(EVENT_ENTER_BROADCAST_FUNCTION_TAG,event_m0_c1_e18_Start_Chart);
  _SFD_CE_CALL(EVENT_BEFORE_BROADCAST_TAG,event_m0_c1_e18_Start_Chart);
  sf_mex_listen_for_ctrl_c(chartInstance.S);
  parc_sfun_c1();
  _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,event_m0_c1_e18_Start_Chart);
  _sfEvent_ = previousEvent;
}

static void broadcast_m0_c1_e19_Start_Access(void)
{
  uint8_T previousEvent;
  previousEvent = _sfEvent_;
  _sfEvent_ = event_m0_c1_e19_Start_Access;
  _SFD_CE_CALL(EVENT_ENTER_BROADCAST_FUNCTION_TAG,event_m0_c1_e19_Start_Access);
  _SFD_CE_CALL(EVENT_BEFORE_BROADCAST_TAG,event_m0_c1_e19_Start_Access);
  sf_mex_listen_for_ctrl_c(chartInstance.S);
  parc_sfun_c1();
  _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,event_m0_c1_e19_Start_Access);
  _sfEvent_ = previousEvent;
}

static void broadcast_m0_c1_e20_BS_Response(void)
{
  uint8_T previousEvent;
  previousEvent = _sfEvent_;
  _sfEvent_ = event_m0_c1_e20_BS_Response;
  _SFD_CE_CALL(EVENT_ENTER_BROADCAST_FUNCTION_TAG,event_m0_c1_e20_BS_Response);
  _SFD_CE_CALL(EVENT_BEFORE_BROADCAST_TAG,event_m0_c1_e20_BS_Response);
  sf_mex_listen_for_ctrl_c(chartInstance.S);
  parc_sfun_c1();
  _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,event_m0_c1_e20_BS_Response);
  _sfEvent_ = previousEvent;
}

static void broadcast_m0_c1_e21_PCG_Clock(void)
{
  uint8_T previousEvent;
  previousEvent = _sfEvent_;
  _sfEvent_ = event_m0_c1_e21_PCG_Clock;
  _SFD_CE_CALL(EVENT_ENTER_BROADCAST_FUNCTION_TAG,event_m0_c1_e21_PCG_Clock);
  _SFD_CE_CALL(EVENT_BEFORE_BROADCAST_TAG,event_m0_c1_e21_PCG_Clock);
  sf_mex_listen_for_ctrl_c(chartInstance.S);
  parc_sfun_c1();
  _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,event_m0_c1_e21_PCG_Clock);
  _sfEvent_ = previousEvent;
}

static void broadcast_m0_c1_e22_End_Call(void)
{
  uint8_T previousEvent;
  previousEvent = _sfEvent_;
  _sfEvent_ = event_m0_c1_e22_End_Call;
  _SFD_CE_CALL(EVENT_ENTER_BROADCAST_FUNCTION_TAG,event_m0_c1_e22_End_Call);
  _SFD_CE_CALL(EVENT_BEFORE_BROADCAST_TAG,event_m0_c1_e22_End_Call);
  sf_mex_listen_for_ctrl_c(chartInstance.S);
  parc_sfun_c1();
  _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,event_m0_c1_e22_End_Call);
  _sfEvent_ = previousEvent;
}

static void broadcast_m0_c1_e23_MS_Clock(void)
{
  uint8_T previousEvent;
  previousEvent = _sfEvent_;
  _sfEvent_ = event_m0_c1_e23_MS_Clock;
  _SFD_CE_CALL(EVENT_ENTER_BROADCAST_FUNCTION_TAG,event_m0_c1_e23_MS_Clock);
  _SFD_CE_CALL(EVENT_BEFORE_BROADCAST_TAG,event_m0_c1_e23_MS_Clock);
  sf_mex_listen_for_ctrl_c(chartInstance.S);
  parc_sfun_c1();
  _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,event_m0_c1_e23_MS_Clock);
  _sfEvent_ = previousEvent;
}

void sf_parc_sfun_c1_get_check_sum(mxArray *plhs[])
{
  ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(1493980700U);
  ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(798737831U);
  ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1069833340U);
  ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(462111241U);
}
/*
 * Chart initialization function
 */
/* work around the buggy macro in simstruc.h until it is fixed */
#define cdrGetOutputPortReusable(S,port) \
  ( (S)->portInfo.outputs[(port)].attributes.optimOpts != \
   SS_NOT_REUSABLE_AND_GLOBAL )

static void initialize_parc_sfun_c1( SimStruct *S)
{

  {
    chartInstance.LocalData.m0_c1_d2_Input_Power = 10.0;
    chartInstance.LocalData.m0_c1_d7_Num_Step = 8.0;
    chartInstance.LocalData.m0_c1_d1_Init_Pwr = 1.0;
    chartInstance.LocalData.m0_c1_d3_Nom_Pwr = 5.0;
    chartInstance.LocalData.m0_c1_d8_Pwr_Step = 5.0;
    chartInstance.LocalData.m0_c1_d11_Sum_Power_Bit_Corrections = 0.0;
    chartInstance.LocalData.m0_c1_d10_Sum_Access_Probe_Corrections = 0.0;
    chartInstance.LocalData.m0_c1_d6_Num_Access_Probes = 0.0;
    chartInstance.LocalData.m0_c1_d4_Num0 = 0.0;
    chartInstance.LocalData.m0_c1_d5_Num1 = 0.0;
    chartInstance.LocalData.m0_c1_d9_Rate_Case = 0.0;
    if(!cdrGetOutputPortReusable(S,1)) {
      OutputData_m0_c1_d14_Traffic_Tx_Enable = 0.0;
    }
    if(!cdrGetOutputPortReusable(S,2)) {
      OutputData_m0_c1_d15_Access_Tx_Enable = 0.0;
    }
    if(!cdrGetOutputPortReusable(S,3)) {
      OutputData_m0_c1_d16_Tx_Power = -50.0;
    }
    if(!cdrGetOutputPortReusable(S,4)) {
      OutputData_m0_c1_d17_Tx_Rate = 0.0;
    }
  }

  /* Initialize chart's state configuration */
  memset((void*)&(chartInstance.State),0,sizeof(chartInstance.State));

  {
    if(ssIsFirstInitCond(S)) {
      /* do this only if simulation is starting */
      if(!sim_mode_is_rtw_gen(S)) {
        {
          unsigned int chartAlreadyPresent;
          chartAlreadyPresent = sf_debug_initialize_chart(_parcMachineNumber_,
            1,
            15,
            30,
            17,
            6,
            0,
            0,
            0,
            &(chartInstance.chartNumber),
            &(chartInstance.instanceNumber),
            ssGetPath((SimStruct *)S),
            (void *)S);
          if(chartAlreadyPresent==0) {
            /* this is the first instance */
            sf_debug_set_chart_disable_implicit_casting(_parcMachineNumber_,chartInstance.chartNumber,0);
            sf_debug_set_chart_event_thresholds(_parcMachineNumber_,
             chartInstance.chartNumber,
             6,
             6,
             6);

            _SFD_SET_DATA_PROPS(9,
             1,
             1,
             0,
             SF_UINT8,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(2,
             1,
             1,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(5,
             0,
             0,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(10,
             0,
             0,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(14,
             2,
             0,
             1,
             SF_UINT8,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(13,
             2,
             0,
             1,
             SF_UINT8,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(0,
             0,
             0,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(11,
             0,
             0,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(6,
             0,
             0,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(15,
             0,
             0,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);
            _SFD_SET_DATA_PROPS(3,
             0,
             0,
             0,
             SF_DOUBLE,
             0,
             NULL,
             0,
             0.0,
             1.0,
             0);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -