📄 c2_qam16.c
字号:
/* Include files */
#include "Qam16_sfun.h"
#include "c2_Qam16.h"
#define CHARTINSTANCE_CHARTNUMBER (chartInstance.chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER (chartInstance.instanceNumber)
#include "Qam16_sfun_debug_macros.h"
/* Type Definitions */
/* Named Constants */
#define c2_IN_NO_ACTIVE_CHILD (0)
/* Variable Declarations */
/* Variable Definitions */
static SFc2_Qam16InstanceStruct chartInstance;
/* Function Declarations */
static void initialize_c2_Qam16(void);
static void initialize_params_c2_Qam16(void);
static void enable_c2_Qam16(void);
static void disable_c2_Qam16(void);
static void finalize_c2_Qam16(void);
static void sf_c2_Qam16(void);
static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
c2_chartNumber);
static const mxArray *c2_sf_marshall(void *c2_chartInstance, void *c2_u);
static const mxArray *c2_b_sf_marshall(void *c2_chartInstance, void *c2_u);
static void init_dsm_address_info(void);
/* Function Definitions */
static void initialize_c2_Qam16(void)
{
_sfTime_ = (real_T)ssGetT(chartInstance.S);
chartInstance.c2_is_active_c2_Qam16 = 0U;
}
static void initialize_params_c2_Qam16(void)
{
}
static void enable_c2_Qam16(void)
{
}
static void disable_c2_Qam16(void)
{
}
static void finalize_c2_Qam16(void)
{
}
static void sf_c2_Qam16(void)
{
uint8_T c2_previousEvent;
real_T c2_u;
real_T c2_y;
real_T *c2_b_u;
real_T *c2_b_y;
c2_b_u = (real_T *)ssGetInputPortSignal(chartInstance.S, 0);
c2_b_y = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1);
_sfTime_ = (real_T)ssGetT(chartInstance.S);
_SFD_DATA_RANGE_CHECK(*c2_b_u, 1U);
_SFD_DATA_RANGE_CHECK(*c2_b_y, 0U);
c2_previousEvent = _sfEvent_;
_sfEvent_ = CALL_EVENT;
_SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,1);
c2_u = *c2_b_u;
sf_debug_symbol_scope_push(2U, 0U);
sf_debug_symbol_scope_add("y", &c2_y, c2_b_sf_marshall);
sf_debug_symbol_scope_add("u", &c2_u, c2_sf_marshall);
CV_EML_FCN(0, 0);
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,4);
if(CV_EML_IF(0, 0, c2_u > 2.0)) {
/* This block supports an embeddable subset of the MATLAB language. */
/* See the help menu for details. */
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,5);
c2_y = 3.0;
} else {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,6);
if(CV_EML_IF(0, 1, c2_u > 0.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,7);
c2_y = 1.0;
} else {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,8);
if(CV_EML_IF(0, 2, c2_u > -2.0)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,9);
c2_y = -1.0;
} else {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,11);
c2_y = -3.0;
}
}
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,-11);
sf_debug_symbol_scope_pop();
*c2_b_y = c2_y;
_SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,1);
_sfEvent_ = c2_previousEvent;
sf_debug_check_for_state_inconsistency(_Qam16MachineNumber_,
chartInstance.chartNumber, chartInstance.instanceNumber);
}
static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
c2_chartNumber)
{
}
static const mxArray *c2_sf_marshall(void *c2_chartInstance, void *c2_u)
{
const mxArray *c2_y = NULL;
real_T c2_b_u;
const mxArray *c2_b_y = NULL;
c2_y = NULL;
c2_b_u = *((real_T *)c2_u);
c2_b_y = NULL;
sf_mex_assign(&c2_b_y, sf_mex_create(&c2_b_u, "y", 0, 0U, 0U, 0));
sf_mex_assign(&c2_y, c2_b_y);
return c2_y;
}
static const mxArray *c2_b_sf_marshall(void *c2_chartInstance, void *c2_u)
{
const mxArray *c2_y = NULL;
real_T c2_b_u;
const mxArray *c2_b_y = NULL;
c2_y = NULL;
c2_b_u = *((real_T *)c2_u);
c2_b_y = NULL;
sf_mex_assign(&c2_b_y, sf_mex_create(&c2_b_u, "y", 0, 0U, 0U, 0));
sf_mex_assign(&c2_y, c2_b_y);
return c2_y;
}
const mxArray *sf_c2_Qam16_get_eml_resolved_functions_info(void)
{
const mxArray *c2_nameCaptureInfo = NULL;
c2_ResolvedFunctionInfo c2_info[2];
c2_ResolvedFunctionInfo (*c2_b_info)[2];
const mxArray *c2_m0 = NULL;
int32_T c2_i0;
c2_ResolvedFunctionInfo *c2_r0;
c2_nameCaptureInfo = NULL;
c2_b_info = &c2_info;
(*c2_b_info)[0].context = "";
(*c2_b_info)[0].name = "uminus";
(*c2_b_info)[0].dominantType = "double";
(*c2_b_info)[0].resolved = "[B]uminus";
(*c2_b_info)[0].fileLength = 0U;
(*c2_b_info)[0].fileTime1 = 0U;
(*c2_b_info)[0].fileTime2 = 0U;
(*c2_b_info)[1].context = "";
(*c2_b_info)[1].name = "gt";
(*c2_b_info)[1].dominantType = "double";
(*c2_b_info)[1].resolved = "[B]gt";
(*c2_b_info)[1].fileLength = 0U;
(*c2_b_info)[1].fileTime1 = 0U;
(*c2_b_info)[1].fileTime2 = 0U;
sf_mex_assign(&c2_m0, sf_mex_createstruct("nameCaptureInfo", 1, 2));
for(c2_i0 = 0; c2_i0 < 2; c2_i0 = c2_i0 + 1) {
c2_r0 = &c2_info[c2_i0];
sf_mex_addfield(c2_m0, sf_mex_create(c2_r0->context, "nameCaptureInfo", 13,
0U, 0U, 2, 1, strlen(c2_r0->context)), "context",
"nameCaptureInfo", c2_i0);
sf_mex_addfield(c2_m0, sf_mex_create(c2_r0->name, "nameCaptureInfo", 13, 0U,
0U, 2, 1, strlen(c2_r0->name)), "name",
"nameCaptureInfo", c2_i0);
sf_mex_addfield(c2_m0, sf_mex_create(c2_r0->dominantType, "nameCaptureInfo",
13, 0U, 0U, 2, 1, strlen(c2_r0->dominantType)),
"dominantType", "nameCaptureInfo", c2_i0);
sf_mex_addfield(c2_m0, sf_mex_create(c2_r0->resolved, "nameCaptureInfo", 13,
0U, 0U, 2, 1, strlen(c2_r0->resolved)), "resolved",
"nameCaptureInfo", c2_i0);
sf_mex_addfield(c2_m0, sf_mex_create(&c2_r0->fileLength, "nameCaptureInfo",
7, 0U, 0U, 0), "fileLength", "nameCaptureInfo", c2_i0);
sf_mex_addfield(c2_m0, sf_mex_create(&c2_r0->fileTime1, "nameCaptureInfo",
7, 0U, 0U, 0), "fileTime1", "nameCaptureInfo", c2_i0);
sf_mex_addfield(c2_m0, sf_mex_create(&c2_r0->fileTime2, "nameCaptureInfo",
7, 0U, 0U, 0), "fileTime2", "nameCaptureInfo", c2_i0);
}
sf_mex_assign(&c2_nameCaptureInfo, c2_m0);
return c2_nameCaptureInfo;
}
static void init_dsm_address_info(void)
{
}
/* SFunction Glue Code */
void sf_c2_Qam16_get_check_sum(mxArray *plhs[])
{
((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(705667019U);
((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(463500521U);
((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1366455003U);
((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1418710388U);
}
mxArray *sf_c2_Qam16_get_autoinheritance_info(void)
{
const char *autoinheritanceFields[] =
{"checksum","inputs","parameters","outputs"};
mxArray *mxAutoinheritanceInfo =
mxCreateStructMatrix(1,1,4,autoinheritanceFields);
{
mxArray *mxChecksum = mxCreateDoubleMatrix(4,1,mxREAL);
double *pr = mxGetPr(mxChecksum);
pr[0] = (double)(2389869724U);
pr[1] = (double)(4221607486U);
pr[2] = (double)(2628677716U);
pr[3] = (double)(3964175257U);
mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
}
{
const char *dataFields[] = {"size","type","complexity"};
mxArray *mxData = mxCreateStructMatrix(1,1,3,dataFields);
{
mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
double *pr = mxGetPr(mxSize);
pr[0] = (double)(1);
pr[1] = (double)(1);
mxSetField(mxData,0,"size",mxSize);
}
{
const char *typeFields[] = {"base","aliasId","fixpt"};
mxArray *mxType = mxCreateStructMatrix(1,1,3,typeFields);
mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
mxSetField(mxType,0,"aliasId",mxCreateDoubleScalar(0));
mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
mxSetField(mxData,0,"type",mxType);
}
mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));
mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
}
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -