📄 c8_mysin4.c
字号:
/* Include files */
#include "mysin4_sfun.h"
#include "c8_mysin4.h"
#define CHARTINSTANCE_CHARTNUMBER (chartInstance.chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER (chartInstance.instanceNumber)
#include "mysin4_sfun_debug_macros.h"
/* Type Definitions */
/* Named Constants */
#define c8_IN_NO_ACTIVE_CHILD (0)
/* Variable Declarations */
/* Variable Definitions */
static SFc8_mysin4InstanceStruct chartInstance;
/* Function Declarations */
static void initialize_c8_mysin4(void);
static void initialize_params_c8_mysin4(void);
static void enable_c8_mysin4(void);
static void disable_c8_mysin4(void);
static void finalize_c8_mysin4(void);
static void sf_c8_mysin4(void);
static const mxArray *c8_sf_marshall(void *c8_chartInstance, void *c8_u);
static const mxArray *c8_b_sf_marshall(void *c8_chartInstance, void *c8_u);
static const mxArray *c8_c_sf_marshall(void *c8_chartInstance, void *c8_u);
static const mxArray *c8_d_sf_marshall(void *c8_chartInstance, void *c8_u);
static boolean_T *c8_preset(void);
static uint8_T *c8_counter(void);
static void init_dsm_address_info(void);
/* Function Definitions */
static void initialize_c8_mysin4(void)
{
_sfTime_ = (real_T)ssGetT(chartInstance.S);
chartInstance.c8_count_not_empty = false;
chartInstance.c8_m0 = NULL;
chartInstance.c8_m1 = NULL;
chartInstance.c8_m2 = NULL;
chartInstance.c8_is_active_c8_mysin4 = 0U;
sf_mex_assign(&chartInstance.c8_m2, sf_mex_call("numerictype", 1U, 12U, 15,
"Signed", 12, 0, 15, "WordLength", 6, 6.0, 15,
"FractionLength", 6, 0.0, 15, "BinaryPoint", 6, 0.0, 15, "FixedExponent", 6,
0.0, 15, "Slope", 6, 1.0));
sf_mex_assign(&chartInstance.c8_m1, sf_mex_call("numerictype", 1U, 12U, 15,
"Signed", 12, 0, 15, "WordLength", 6, 5.0, 15,
"FractionLength", 6, 0.0, 15, "BinaryPoint", 6, 0.0, 15, "FixedExponent", 6,
0.0, 15, "Slope", 6, 1.0));
sf_mex_assign(&chartInstance.c8_m0, sf_mex_call("fimath", 1U, 2U, 15,
"RoundMode", 15, "floor"));
}
static void initialize_params_c8_mysin4(void)
{
}
static void enable_c8_mysin4(void)
{
}
static void disable_c8_mysin4(void)
{
}
static void finalize_c8_mysin4(void)
{
sf_mex_destroy(&chartInstance.c8_m0);
sf_mex_destroy(&chartInstance.c8_m1);
sf_mex_destroy(&chartInstance.c8_m2);
}
static void sf_c8_mysin4(void)
{
uint8_T c8_previousEvent;
boolean_T c8_b_preset;
uint8_T c8_inc;
uint8_T c8_init_val;
const mxArray *c8_result_fm = NULL;
const mxArray *c8_result_nt = NULL;
uint8_T c8_b_counter;
const mxArray *c8_T = NULL;
const mxArray *c8_F = NULL;
const mxArray *c8_ERR = NULL;
const mxArray *c8_val = NULL;
uint8_T c8_a0;
uint8_T c8_a;
uint8_T c8_ain;
uint32_T c8_u0;
uint8_T c8_u1;
const mxArray *c8_b_ERR = NULL;
const mxArray *c8_a2SD = NULL;
const mxArray *c8_b2SD = NULL;
const mxArray *c8_Tsd = NULL;
const mxArray *c8_tc = NULL;
const mxArray *c8_errmsg = NULL;
uint8_T c8_var1;
uint8_T c8_b_var1;
uint8_T c8_u2;
uint8_T c8_u3;
uint8_T c8_hfi;
const mxArray *c8_b_T = NULL;
const mxArray *c8_b_F = NULL;
const mxArray *c8_c_ERR = NULL;
const mxArray *c8_b_val = NULL;
const mxArray *c8_isautoscaled = NULL;
_sfTime_ = (real_T)ssGetT(chartInstance.S);
_SFD_DATA_RANGE_CHECK((real_T)*c8_preset(), 0U);
_SFD_DATA_RANGE_CHECK((real_T)*c8_counter(), 1U);
c8_previousEvent = _sfEvent_;
_sfEvent_ = CALL_EVENT;
_SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG,0);
c8_b_preset = *c8_preset();
sf_debug_symbol_scope_push(7U, 0U);
sf_debug_symbol_scope_add_verbose("count", 3, 0U, 0U, 0U, 1U, 1.0, 0, 0.0, 0U,
5, 0U, 0, 0, &chartInstance.c8_count);
sf_debug_symbol_scope_add("inc", &c8_inc, c8_d_sf_marshall);
sf_debug_symbol_scope_add("init_val", &c8_init_val, c8_c_sf_marshall);
sf_debug_symbol_scope_add_verbose("result_fm", 10, 0U, 0U, 0U, 0U, 1.0, 0,
0.0, 0U, 0, 0U, 0, 0, &c8_result_fm);
sf_debug_symbol_scope_add_verbose("result_nt", 10, 0U, 0U, 0U, 0U, 1.0, 0,
0.0, 0U, 0, 0U, 0, 0, &c8_result_nt);
sf_debug_symbol_scope_add("counter", &c8_b_counter, c8_b_sf_marshall);
sf_debug_symbol_scope_add("preset", &c8_b_preset, c8_sf_marshall);
CV_EML_FCN(0, 0);
/* a preset counter, that counts how many times this block is called */
/* result 'counter' saturates if claled more than 15 times. */
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,6);
sf_mex_assign(&c8_result_nt, sf_mex_dup(chartInstance.c8_m1));
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,7);
sf_mex_assign(&c8_result_fm, sf_mex_dup(chartInstance.c8_m0));
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,9);
c8_init_val = 0U;
sf_mex_destroy(&c8_T);
sf_mex_destroy(&c8_F);
sf_mex_destroy(&c8_ERR);
sf_mex_destroy(&c8_val);
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,12);
if(CV_EML_IF(0, 0, !chartInstance.c8_count_not_empty)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,13);
chartInstance.c8_count = c8_init_val;
chartInstance.c8_count_not_empty = true;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,16);
if(CV_EML_IF(0, 1, c8_b_preset)) {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,17);
chartInstance.c8_count = c8_init_val;
} else {
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,19);
c8_a0 = chartInstance.c8_count;
c8_a = c8_a0;
c8_ain = (uint8_T)(c8_a & 63U);
c8_u0 = (uint32_T)c8_ain + 1U;
if(c8_u0 > 63U) {
c8_u1 = 63U;
} else {
c8_u1 = (uint8_T)c8_u0;
}
c8_inc = c8_u1;
sf_mex_destroy(&c8_b_ERR);
sf_mex_destroy(&c8_a2SD);
sf_mex_destroy(&c8_b2SD);
sf_mex_destroy(&c8_Tsd);
sf_mex_destroy(&c8_tc);
sf_mex_destroy(&c8_errmsg);
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,20);
c8_var1 = c8_inc;
c8_b_var1 = c8_var1;
c8_u2 = c8_b_var1;
if(c8_u2 > 31) {
c8_u3 = 31U;
} else {
c8_u3 = c8_u2;
}
c8_hfi = c8_u3;
sf_mex_destroy(&c8_b_T);
sf_mex_destroy(&c8_b_F);
sf_mex_destroy(&c8_c_ERR);
sf_mex_destroy(&c8_b_val);
sf_mex_destroy(&c8_isautoscaled);
chartInstance.c8_count = c8_hfi;
}
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,23);
c8_b_counter = chartInstance.c8_count;
_SFD_EML_CALL(STATE_DURING_DURING_ACTION_TAG,0,-23);
sf_debug_symbol_scope_pop();
sf_mex_destroy(&c8_result_nt);
sf_mex_destroy(&c8_result_fm);
*c8_counter() = c8_b_counter;
_SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
_sfEvent_ = c8_previousEvent;
sf_debug_check_for_state_inconsistency(_mysin4MachineNumber_,
chartInstance.chartNumber, chartInstance.instanceNumber);
}
static const mxArray *c8_sf_marshall(void *c8_chartInstance, void *c8_u)
{
const mxArray *c8_y = NULL;
boolean_T c8_b_u;
const mxArray *c8_b_y = NULL;
c8_y = NULL;
c8_b_u = *(boolean_T *)c8_u;
c8_b_y = NULL;
sf_mex_assign(&c8_b_y, sf_mex_create(&c8_b_u, "y", 9, 0U, 0U, 0));
sf_mex_assign(&c8_y, c8_b_y);
return c8_y;
}
static const mxArray *c8_b_sf_marshall(void *c8_chartInstance, void *c8_u)
{
const mxArray *c8_y = NULL;
uint8_T c8_b_u;
const mxArray *c8_b_y = NULL;
uint8_T c8_c_u;
const mxArray *c8_c_y = NULL;
c8_y = NULL;
c8_b_u = *(uint8_T *)c8_u;
c8_b_y = NULL;
c8_c_u = c8_b_u;
c8_c_y = NULL;
sf_mex_assign(&c8_c_y, sf_mex_create(&c8_c_u, "y", 3, 0U, 0U, 0));
sf_mex_assign(&c8_b_y, sf_mex_call("embedded.fi", 1U, 6U, 15, "fimath", 14,
sf_mex_dup(chartInstance.c8_m0), 15, "numerictype", 14,
sf_mex_dup(chartInstance.c8_m1), 15, "int", 14, c8_c_y));
sf_mex_assign(&c8_y, c8_b_y);
return c8_y;
}
static const mxArray *c8_c_sf_marshall(void *c8_chartInstance, void *c8_u)
{
const mxArray *c8_y = NULL;
uint8_T c8_b_u;
const mxArray *c8_b_y = NULL;
uint8_T c8_c_u;
const mxArray *c8_c_y = NULL;
c8_y = NULL;
c8_b_u = *(uint8_T *)c8_u;
c8_b_y = NULL;
c8_c_u = c8_b_u;
c8_c_y = NULL;
sf_mex_assign(&c8_c_y, sf_mex_create(&c8_c_u, "y", 3, 0U, 0U, 0));
sf_mex_assign(&c8_b_y, sf_mex_call("embedded.fi", 1U, 6U, 15, "fimath", 14,
sf_mex_dup(chartInstance.c8_m0), 15, "numerictype", 14,
sf_mex_dup(chartInstance.c8_m1), 15, "int", 14, c8_c_y));
sf_mex_assign(&c8_y, c8_b_y);
return c8_y;
}
static const mxArray *c8_d_sf_marshall(void *c8_chartInstance, void *c8_u)
{
const mxArray *c8_y = NULL;
uint8_T c8_b_u;
const mxArray *c8_b_y = NULL;
uint8_T c8_c_u;
const mxArray *c8_c_y = NULL;
c8_y = NULL;
c8_b_u = *(uint8_T *)c8_u;
c8_b_y = NULL;
c8_c_u = c8_b_u;
c8_c_y = NULL;
sf_mex_assign(&c8_c_y, sf_mex_create(&c8_c_u, "y", 3, 0U, 0U, 0));
sf_mex_assign(&c8_b_y, sf_mex_call("embedded.fi", 1U, 6U, 15, "fimath", 14,
sf_mex_dup(chartInstance.c8_m0), 15, "numerictype", 14,
sf_mex_dup(chartInstance.c8_m2), 15, "int", 14, c8_c_y));
sf_mex_assign(&c8_y, c8_b_y);
return c8_y;
}
const mxArray *sf_c8_mysin4_get_eml_resolved_functions_info(void)
{
const mxArray *c8_nameCaptureInfo = NULL;
c8_nameCaptureInfo = NULL;
sf_mex_assign(&c8_nameCaptureInfo, sf_mex_create(NULL, "nameCaptureInfo", 0,
0U, 1U, 2, 0, 1));
return c8_nameCaptureInfo;
}
static boolean_T *c8_preset(void)
{
return (boolean_T *)ssGetInputPortSignal(chartInstance.S, 0);
}
static uint8_T *c8_counter(void)
{
return (uint8_T *)ssGetOutputPortSignal(chartInstance.S, 1);
}
static void init_dsm_address_info(void)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -