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

📄 ieee80211a_sfun_c1.c

📁 802.11物理层的matlab仿真源码
💻 C
📖 第 1 页 / 共 4 页
字号:
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {22};
            _SFD_TRANS_COV_MAPS(5,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(8,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {21};
            _SFD_TRANS_COV_MAPS(8,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(11,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {21};
            _SFD_TRANS_COV_MAPS(11,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(12,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {21};
            _SFD_TRANS_COV_MAPS(12,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(2,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {21};
            _SFD_TRANS_COV_MAPS(2,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(13,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {21};
            _SFD_TRANS_COV_MAPS(13,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(1,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {21};
            _SFD_TRANS_COV_MAPS(1,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(3,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {21};
            _SFD_TRANS_COV_MAPS(3,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(6,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {22};
            _SFD_TRANS_COV_MAPS(6,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(7,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {22};
            _SFD_TRANS_COV_MAPS(7,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(14,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {22};
            _SFD_TRANS_COV_MAPS(14,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(0,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {22};
            _SFD_TRANS_COV_MAPS(0,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(9,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {22};
            _SFD_TRANS_COV_MAPS(9,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(10,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {22};
            _SFD_TRANS_COV_MAPS(10,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(4,0,0,0,0);
          if(chartAlreadyPresent==0)
          {
            _SFD_TRANS_COV_MAPS(4,
             0,NULL,NULL,
             0,NULL,NULL,
             0,NULL,NULL,
             0,NULL,NULL);
          }
          _SFD_SET_DATA_VALUE_PTR(2,(void *)(&InputData_m0_c1_d3_snrEst));
          _SFD_SET_DATA_VALUE_PTR(4,(void *)(&OutputData_m0_c1_d4_modIdx));
          _SFD_SET_DATA_VALUE_PTR(0,(void
            *)(&(chartInstance.LocalData.m0_c1_d2_thres[0])));
          _SFD_SET_DATA_VALUE_PTR(3,(void
            *)(&chartInstance.LocalData.m0_c1_d1_hyst));
          _SFD_SET_DATA_VALUE_PTR(1,(void *)(&OutputData_m0_c1_d5_bitRate));
        }
      }
    }else{
      sf_debug_reset_current_state_configuration(_ieee80211aMachineNumber_,chartInstance.chartNumber,chartInstance.instanceNumber);
    }
  }
  chartInstance.chartInfo.chartInitialized = 1;
}

void ieee80211a_sfun_c1_sizes_registry(SimStruct *S)
{
  ssSetNumInputPorts((SimStruct *)S, 1);
  ssSetInputPortDataType((SimStruct *)S,0,SS_DOUBLE); /* InputData_m0_c1_d3_snrEst */
  ssSetInputPortRequiredContiguous(S,0,1);
  ssSetInputPortWidth((SimStruct *)S,0,1);
  ssSetInputPortDirectFeedThrough((SimStruct *)S,0,1);
  ssSetNumOutputPorts((SimStruct *)S, 3);
  ssSetOutputPortDataType((SimStruct *)S,0,SS_DOUBLE);
  ssSetOutputPortWidth((SimStruct *)S,0,1);
  ssSetOutputPortDataType((SimStruct *)S,1,SS_DOUBLE); /* OutputData_m0_c1_d4_modIdx */
  ssSetOutputPortWidth((SimStruct *)S,1,1);
  ssSetOutputPortDataType((SimStruct *)S,2,SS_DOUBLE); /* OutputData_m0_c1_d5_bitRate */
  ssSetOutputPortWidth((SimStruct *)S,2,1);
  if(sim_mode_is_rtw_gen(S)) {
    int_T chartIsInlinable =
      (int_T)sf_is_chart_inlinable("ieee80211a",1);
    ssSetStateflowIsInlinable((SimStruct *)S,chartIsInlinable);
    if(chartIsInlinable) {
      ssSetInputPortReusable((SimStruct *)S,0,1);
      sf_mark_chart_expressionable_inputs((SimStruct *)S,"ieee80211a",1,1);
      sf_mark_chart_reusable_outputs((SimStruct *)S,"ieee80211a",1,2);
    }
    {
      int dtId;
      char *chartInstanceTypedefName =
        sf_chart_instance_typedef_name("ieee80211a",1);
      dtId = ssRegisterDataType(S, chartInstanceTypedefName);
      if (dtId == INVALID_DTYPE_ID ) return;
      /* Register the size of the udt */
      if (!ssSetDataTypeSize(S, dtId, 8)) return;
      if(!ssSetNumDWork(S,1)) return;
      ssSetDWorkDataType(S, 0, dtId);
      ssSetDWorkWidth(S, 0, 1);
      ssSetDWorkName(S, 0, "ChartInstance"); /*optional name, less than 16 chars*/
    }
  }
  ssSetChecksum0(S,(4203786583U));
  ssSetChecksum1(S,(1847780713U));
  ssSetChecksum2(S,(2494745738U));
  ssSetChecksum3(S,(4043134534U));
}

void terminate_ieee80211a_sfun_c1(SimStruct *S)
{
}
static void mdlRTW_ieee80211a_sfun_c1(SimStruct *S)
{
  if (!ssWriteRTWStr(S, "ChartWorkspaceData {")) return;
  {
    const mxArray *mxArrayPtr;

    sf_set_error_prefix_string("Stateflow Runtime Error (chart): Error evaluating chart workspace data 'hyst' in the chart's parent workspace.\n");
    mxArrayPtr = ml_get_typed_mx_array("hyst",
      CALLER_WORKSPACE,
      SF_DOUBLE,
      0);
    sf_set_error_prefix_string("Stateflow Runtime Error (chart): ");
    {
      int mxArrayM = mxGetM(mxArrayPtr);
      int mxArrayN = mxGetN(mxArrayPtr);
      ssWriteRTWVectParam(S,
       "hyst",mxGetData(mxArrayPtr),sf_get_sl_type_from_ml_type(mxGetClassID(mxArrayPtr)),
       1);
    }
    mxDestroyArray((mxArray *)mxArrayPtr);
  }
  {
    const mxArray *mxArrayPtr;

    sf_set_error_prefix_string("Stateflow Runtime Error (chart): Error evaluating chart workspace data 'thres' in the chart's parent workspace.\n");
    mxArrayPtr = ml_get_typed_mx_array("thres",
      CALLER_WORKSPACE,
      SF_DOUBLE,
      1, 7);
    sf_set_error_prefix_string("Stateflow Runtime Error (chart): ");
    {
      int mxArrayM = mxGetM(mxArrayPtr);
      int mxArrayN = mxGetN(mxArrayPtr);
      if(mxArrayM==1 && mxArrayN==1) {
        ssWriteRTWVectParam(S,
         "thres",mxGetData(mxArrayPtr),sf_get_sl_type_from_ml_type(mxGetClassID(mxArrayPtr)),
         1);
      }else if ( mxArrayM==1 && mxArrayN==7){
        ssWriteRTWVectParam(S,
         "thres",mxGetData(mxArrayPtr),sf_get_sl_type_from_ml_type(mxGetClassID(mxArrayPtr)),
         7);
      }else if ( mxArrayN==1 && mxArrayM==7){
        ssWriteRTWVectParam(S,
         "thres",mxGetData(mxArrayPtr),sf_get_sl_type_from_ml_type(mxGetClassID(mxArrayPtr)),
         7);
      }else{
        /*ERROR*/
      }
    }
    mxDestroyArray((mxArray *)mxArrayPtr);
  }
  if (!ssWriteRTWStr(S, "}")) return;
}

void sf_ieee80211a_sfun_c1( void *);
void ieee80211a_sfun_c1_registry(SimStruct *S)
{
  chartInstance.chartInfo.chartInstance = NULL;
  chartInstance.chartInfo.chartInitialized = 0;
  chartInstance.chartInfo.sFunctionGateway = sf_ieee80211a_sfun_c1;
  chartInstance.chartInfo.initializeChart = initialize_ieee80211a_sfun_c1;
  chartInstance.chartInfo.terminateChart = terminate_ieee80211a_sfun_c1;
  chartInstance.chartInfo.mdlRTW = mdlRTW_ieee80211a_sfun_c1;
  chartInstance.chartInfo.restoreLastMajorStepConfiguration = NULL;
  chartInstance.chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
  chartInstance.chartInfo.storeCurrentConfiguration = NULL;
  chartInstance.chartInfo.sampleTime = INHERITED_SAMPLE_TIME;
  chartInstance.S = S;
  ssSetUserData((SimStruct *)S,(void *)(&(chartInstance.chartInfo))); /* register the chart instance with simstruct */
  ssSetSampleTime((SimStruct *)S, 0, chartInstance.chartInfo.sampleTime);
  if (chartInstance.chartInfo.sampleTime == INHERITED_SAMPLE_TIME) {
    ssSetOffsetTime((SimStruct *)S, 0, FIXED_IN_MINOR_STEP_OFFSET);
  } else if (chartInstance.chartInfo.sampleTime == CONTINUOUS_SAMPLE_TIME) {
    ssSetOffsetTime((SimStruct *)S, 0, 0.0);
  }
  ssSetCallSystemOutput((SimStruct *)S,0);
}

void sf_ieee80211a_sfun_c1(void *chartInstanceVoidPtr)
{
  /* Save current event being processed */
  uint8_T previousEvent;
  previousEvent = _sfEvent_;

  /* Update Stateflow time variable */
  _sfTime_ = ssGetT(chartInstance.S);

  /* Call this chart */
  _sfEvent_ = CALL_EVENT;
  ieee80211a_sfun_c1();
  _sfEvent_ = previousEvent;
}

⌨️ 快捷键说明

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