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

📄 parc_sfun.c

📁 CDMA移动通信系统中一种速率功率联合控制方法
💻 C
字号:
/*
 *
 * Stateflow code generation for machine:
 *    parc
 * 
 * Target Name                          : sfun
 * Model Version                        : 1.188
 * Stateflow Version                    : 5.0.0.13.00.1.000001
 * Date of code generation              : 25-May-2007 15:31:02
 *
 */

#include "parc_sfun.h"
#include "parc_sfun_c1.h"
#include "parc_sfun_c2.h"

/* Global machine event */
uint8_T _sfEvent_;
#include "parc_sfun_debug_macros.h"
unsigned int _parcMachineNumber_=UNREASONABLE_NUMBER;
unsigned int sf_parc_process_check_sum_call( int nlhs, mxArray * plhs[], int
 nrhs, const mxArray * prhs[] )
{
#ifdef MATLAB_MEX_FILE
  char commandName[20];
  if (nrhs<1 || !mxIsChar(prhs[0]) ) return 0;
  /* Possible call to get the checksum */
  mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char));
  commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
  if(strcmp(commandName,"sf_get_check_sum")) return 0;
  plhs[0] = mxCreateDoubleMatrix( 1,4,mxREAL);
  if(nrhs>1 && mxIsChar(prhs[1])) {
    mxGetString(prhs[1], commandName,sizeof(commandName)/sizeof(char));
    commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
    if(!strcmp(commandName,"machine")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(616647747U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(815527752U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1024454729U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2097313988U);
    }else if(!strcmp(commandName,"exportedFcn")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0U);
    }else if(!strcmp(commandName,"makefile")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(1829435614U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(2917466206U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(3255949798U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2003380780U);
    }else if(nrhs==3 && !strcmp(commandName,"chart")) {
      unsigned int chartFileNumber;
      chartFileNumber = (unsigned int)mxGetScalar(prhs[2]);
      switch(chartFileNumber) {
       case 1:
        {
          extern void sf_parc_sfun_c1_get_check_sum(mxArray *plhs[]);
          sf_parc_sfun_c1_get_check_sum(plhs);
          break;
        }

       case 2:
        {
          extern void sf_parc_sfun_c2_get_check_sum(mxArray *plhs[]);
          sf_parc_sfun_c2_get_check_sum(plhs);
          break;
        }

       default:
        ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0.0);
      }
    }else if(!strcmp(commandName,"target")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3999121187U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3958564854U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2850127047U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(464156950U);
    }else {
      return 0;
    }
  } else{
    ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(709131439U);
    ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(2844607464U);
    ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(994464391U);
    ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(3079357944U);
  }
  return 1;
#else
  return 0;
#endif
}
/* Stateflow time variable */
real_T _sfTime_;

/* Machine initialize */
void parc_initializer(void)
{
  /* Initialize machine's broadcast event variable */
  _sfEvent_ = CALL_EVENT;

  _parcMachineNumber_ = sf_debug_initialize_machine("parc","sfun",0,2,0,0,0);
  sf_debug_set_machine_event_thresholds(_parcMachineNumber_,0,0);
  sf_debug_set_machine_data_thresholds(_parcMachineNumber_,0);
}

unsigned int parc_registry(SimStruct *simstructPtr,char *chartName, int
 initializeFlag)
{
  if(!strcmp_ignore_ws(chartName,"parc/Mobile/Mobile Controller/ SFunction ")) {
    parc_sfun_c1_registry(simstructPtr);
    return 1;
  }
  if(!strcmp_ignore_ws(chartName,"parc/Base Station/Base Station Controller/ SFunction "))
  {
    parc_sfun_c2_registry(simstructPtr);
    return 1;
  }
  return 0;
}
unsigned int parc_sizes_registry(SimStruct *simstructPtr,char *chartName)
{
  if(!strcmp_ignore_ws(chartName,"parc/Mobile/Mobile Controller/ SFunction ")) {
    parc_sfun_c1_sizes_registry(simstructPtr);
    return 1;
  }
  if(!strcmp_ignore_ws(chartName,"parc/Base Station/Base Station Controller/ SFunction "))
  {
    parc_sfun_c2_sizes_registry(simstructPtr);
    return 1;
  }
  return 0;
}
void parc_terminator(void)
{
}

⌨️ 快捷键说明

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