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

📄 auto_netcon_sfun_c1.c

📁 RFID读卡器与标签之间在AWGN和加入其它读写器干扰下的BER仿真
💻 C
📖 第 1 页 / 共 4 页
字号:
            _SFD_STATE_COV_MAPS(2,
             2,&(sStartEntryMap[0]),&(sEndEntryMap[0]),
             1,&(sStartDuringMap[0]),&(sEndDuringMap[0]),
             1,&(sStartExitMap[0]),&(sEndExitMap[0]));
          }
          _SFD_STATE_COV_WTS(4,1,1,1);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartEntryMap[] = {0};
            static unsigned int sEndEntryMap[] = {0};
            static unsigned int sStartDuringMap[] = {0};
            static unsigned int sEndDuringMap[] = {0};
            static unsigned int sStartExitMap[] = {0};
            static unsigned int sEndExitMap[] = {0};

            _SFD_STATE_COV_MAPS(4,
             1,&(sStartEntryMap[0]),&(sEndEntryMap[0]),
             1,&(sStartDuringMap[0]),&(sEndDuringMap[0]),
             1,&(sStartExitMap[0]),&(sEndExitMap[0]));
          }
          _SFD_STATE_COV_WTS(3,1,1,1);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartEntryMap[] = {0};
            static unsigned int sEndEntryMap[] = {0};
            static unsigned int sStartDuringMap[] = {0};
            static unsigned int sEndDuringMap[] = {0};
            static unsigned int sStartExitMap[] = {0};
            static unsigned int sEndExitMap[] = {0};

            _SFD_STATE_COV_MAPS(3,
             1,&(sStartEntryMap[0]),&(sEndEntryMap[0]),
             1,&(sStartDuringMap[0]),&(sEndDuringMap[0]),
             1,&(sStartExitMap[0]),&(sEndExitMap[0]));
          }
          _SFD_TRANS_COV_WTS(1,0,0,3,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartConditionActionMap[] = {1,9,21};
            static unsigned int sEndConditionActionMap[] = {9,21,33};
            _SFD_TRANS_COV_MAPS(1,
             0,NULL,NULL,
             0,NULL,NULL,
             3,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(7,0,1,4,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {8};
            static unsigned int sStartConditionActionMap[] = {10,22,34,49};
            static unsigned int sEndConditionActionMap[] = {22,34,49,57};
            _SFD_TRANS_COV_MAPS(7,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             4,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(8,0,1,0,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {8};
            _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,5,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {5};
            static unsigned int sStartConditionActionMap[] = {7,15,27,39,54};
            static unsigned int sEndConditionActionMap[] = {14,27,39,54,62};
            _SFD_TRANS_COV_MAPS(11,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             5,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(3,0,0,3,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartConditionActionMap[] = {1,17,21};
            static unsigned int sEndConditionActionMap[] = {17,21,25};
            _SFD_TRANS_COV_MAPS(3,
             0,NULL,NULL,
             0,NULL,NULL,
             3,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(4,0,1,4,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {8};
            static unsigned int sStartConditionActionMap[] = {10,22,34,49};
            static unsigned int sEndConditionActionMap[] = {22,34,49,57};
            _SFD_TRANS_COV_MAPS(4,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             4,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(12,0,1,4,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {4};
            static unsigned int sStartConditionActionMap[] = {6,18,30,45};
            static unsigned int sEndConditionActionMap[] = {18,30,45,53};
            _SFD_TRANS_COV_MAPS(12,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             4,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(0,0,1,5,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {5};
            static unsigned int sStartConditionActionMap[] = {7,19,31,46,54};
            static unsigned int sEndConditionActionMap[] = {19,31,46,54,58};
            _SFD_TRANS_COV_MAPS(0,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             5,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(6,0,1,5,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {5};
            static unsigned int sStartConditionActionMap[] = {7,15,27,39,54};
            static unsigned int sEndConditionActionMap[] = {14,27,39,54,62};
            _SFD_TRANS_COV_MAPS(6,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             5,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(5,0,1,4,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {4};
            static unsigned int sStartConditionActionMap[] = {6,18,30,45};
            static unsigned int sEndConditionActionMap[] = {18,30,45,53};
            _SFD_TRANS_COV_MAPS(5,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             4,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(9,0,1,4,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {4};
            static unsigned int sStartConditionActionMap[] = {6,18,30,45};
            static unsigned int sEndConditionActionMap[] = {18,30,45,53};
            _SFD_TRANS_COV_MAPS(9,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             4,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(10,0,1,5,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {5};
            static unsigned int sStartConditionActionMap[] = {7,19,31,46,54};
            static unsigned int sEndConditionActionMap[] = {19,31,46,54,58};
            _SFD_TRANS_COV_MAPS(10,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             5,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_TRANS_COV_WTS(2,0,1,4,0);
          if(chartAlreadyPresent==0)
          {
            static unsigned int sStartGuardMap[] = {1};
            static unsigned int sEndGuardMap[] = {4};
            static unsigned int sStartConditionActionMap[] = {6,18,30,45};
            static unsigned int sEndConditionActionMap[] = {18,30,45,53};
            _SFD_TRANS_COV_MAPS(2,
             0,NULL,NULL,
             1,&(sStartGuardMap[0]),&(sEndGuardMap[0]),
             4,&(sStartConditionActionMap[0]),&(sEndConditionActionMap[0]),
             0,NULL,NULL);
          }
          _SFD_SET_DATA_VALUE_PTR(2,(void
            *)(&chartInstance.LocalData.m0_c1_d1_code));
          _SFD_SET_DATA_VALUE_PTR(6,(void
            *)(&(chartInstance.LocalData.m0_c1_d2_convec[0])));
          _SFD_SET_DATA_VALUE_PTR(5,(void
            *)(&chartInstance.LocalData.m0_c1_d4_i));
          _SFD_SET_DATA_VALUE_PTR(0,(void
            *)(&chartInstance.LocalData.m0_c1_d3_count));
          _SFD_SET_DATA_VALUE_PTR(4,(void *)(&OutputData_m0_c1_d8_outdp));
          _SFD_SET_DATA_VALUE_PTR(1,(void
            *)(&chartInstance.LocalData.m0_c1_d5_i1));
          _SFD_SET_DATA_VALUE_PTR(3,(void
            *)(&chartInstance.LocalData.m0_c1_d6_j));
          _SFD_SET_DATA_VALUE_PTR(7,(void *)(&InputData_m0_c1_d7_indp));
        }
      }
    }else{
      sf_debug_reset_current_state_configuration(_auto_netconMachineNumber_,chartInstance.chartNumber,chartInstance.instanceNumber);
    }
  }
  chartInstance.chartInfo.chartInitialized = 1;
}

void auto_netcon_sfun_c1_sizes_registry(SimStruct *S)
{
  ssSetNumInputPorts((SimStruct *)S, 2);
  ssSetInputPortDataType((SimStruct *)S,0,SS_DOUBLE); /* InputData_m0_c1_d7_indp */
  ssSetInputPortRequiredContiguous(S,0,1);
  ssSetInputPortWidth((SimStruct *)S,0,1);
  ssSetInputPortDirectFeedThrough((SimStruct *)S,0,1);
  ssSetInputPortDataType((SimStruct *)S,1,SS_INT8);
  ssSetInputPortWidth((SimStruct *)S,1,1);
  ssSetInputPortDirectFeedThrough((SimStruct *)S,1,1);
  ssSetInputPortReusable((SimStruct *)S,1,1);
  ssSetNumOutputPorts((SimStruct *)S, 2);
  ssSetOutputPortDataType((SimStruct *)S,0,SS_DOUBLE);
  ssSetOutputPortWidth((SimStruct *)S,0,1);
  ssSetOutputPortDataType((SimStruct *)S,1,SS_DOUBLE); /* OutputData_m0_c1_d8_outdp */
  ssSetOutputPortWidth((SimStruct *)S,1,1);
  if(sim_mode_is_rtw_gen(S)) {
    int_T chartIsInlinable =
      (int_T)sf_is_chart_inlinable("auto_netcon",1);
    ssSetStateflowIsInlinable((SimStruct *)S,chartIsInlinable);
    if(chartIsInlinable) {
      ssSetInputPortReusable((SimStruct *)S,0,1);
      ssSetInputPortReusable((SimStruct *)S,1,1);
      sf_mark_chart_expressionable_inputs((SimStruct *)S,"auto_netcon",1,1);
      sf_mark_chart_reusable_outputs((SimStruct *)S,"auto_netcon",1,1);
    }
    {
      int dtId;
      char *chartInstanceTypedefName =
        sf_chart_instance_typedef_name("auto_netcon",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,(864784673U));
  ssSetChecksum1(S,(3771725052U));
  ssSetChecksum2(S,(2042347735U));
  ssSetChecksum3(S,(3144464656U));
}

void terminate_auto_netcon_sfun_c1(SimStruct *S)
{
}
static void mdlRTW_auto_netcon_sfun_c1(SimStruct *S)
{
}

void sf_auto_netcon_sfun_c1( void *);
void auto_netcon_sfun_c1_registry(SimStruct *S)
{
  chartInstance.chartInfo.chartInstance = NULL;
  chartInstance.chartInfo.chartInitialized = 0;
  chartInstance.chartInfo.sFunctionGateway = sf_auto_netcon_sfun_c1;
  chartInstance.chartInfo.initializeChart = initialize_auto_netcon_sfun_c1;
  chartInstance.chartInfo.terminateChart = terminate_auto_netcon_sfun_c1;
  chartInstance.chartInfo.mdlRTW = mdlRTW_auto_netcon_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_auto_netcon_sfun_c1(void *chartInstanceVoidPtr)
{
  /* Save current event being processed */
  uint8_T previousEvent;
  previousEvent = _sfEvent_;

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

  /* Broadcast of input event(s) */

  broadcast_m0_c1_e9_event();
}

⌨️ 快捷键说明

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