/* Include files */
#include "blascompat32.h"
#include "PCC_INVERTER_sfun.h"
#include "c2_PCC_INVERTER.h"
#include "mwmathutil.h"
#define CHARTINSTANCE_CHARTNUMBER (chartInstance->chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER (chartInstance->instanceNumber)
#include "PCC_INVERTER_sfun_debug_macros.h"
/* Type Definitions */
/* Named Constants */
/* Variable Declarations */
/* Variable Definitions */
static const char *c2_debug_family_names[32] = { "Vdc", "v0", "v1", "v2", "v3",
"v4", "v5", "v6", "v7", "g_opt", "x_opt", "ik_ref", "ik", "e", "i", "v_o1",
"ik1", "g", "nargin", "nargout", "I_ref", "I_meas", "Sa", "Sb", "Sc", "Ts",
"R", "L", "v", "states", "x_old", "i_old" };
/* Function Declarations */
static void initialize_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance);
static void initialize_params_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance);
static void enable_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance);
static void disable_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance);
static void c2_update_debugger_state_c2_PCC_INVERTER
(SFc2_PCC_INVERTERInstanceStruct *chartInstance);
static const mxArray *get_sim_state_c2_PCC_INVERTER
(SFc2_PCC_INVERTERInstanceStruct *chartInstance);
static void set_sim_state_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance, const mxArray *c2_st);
static void finalize_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance);
static void sf_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct *chartInstance);
static void c2_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct *chartInstance);
static void compInitSubchartSimstructsFcn_c2_PCC_INVERTER
(SFc2_PCC_INVERTERInstanceStruct *chartInstance);
static void init_script_number_translation(uint32_T c2_machineNumber, uint32_T
c2_chartNumber);
static const mxArray *c2_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_b_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_c_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_d_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_e_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_f_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_g_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_h_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_i_sf_marshall(void *chartInstanceVoid, void *c2_u);
static const mxArray *c2_j_sf_marshall(void *chartInstanceVoid, void *c2_u);
static void c2_info_helper(c2_ResolvedFunctionInfo c2_info[36]);
static const mxArray *c2_k_sf_marshall(void *chartInstanceVoid, void *c2_u);
static real_T c2_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct *chartInstance,
const mxArray *c2_Sa, const char_T *c2_name);
static real_T c2_b_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct
*chartInstance, const mxArray *c2_b_L, const char_T *c2_name);
static real_T c2_c_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct
*chartInstance, const mxArray *c2_b_R, const char_T *c2_name);
static real_T c2_d_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct
*chartInstance, const mxArray *c2_b_Ts, const char_T *c2_name);
static creal_T c2_e_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct
*chartInstance, const mxArray *c2_b_i_old, const char_T *c2_name);
static void c2_f_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct *chartInstance,
const mxArray *c2_b_states, const char_T *c2_name, real_T c2_y[24]);
static void c2_g_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct *chartInstance,
const mxArray *c2_b_v, const char_T *c2_name, creal_T c2_y[8]);
static real_T c2_h_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct
*chartInstance, const mxArray *c2_b_x_old, const char_T *c2_name);
static uint8_T c2_i_emlrt_marshallIn(SFc2_PCC_INVERTERInstanceStruct
*chartInstance, const mxArray *c2_b_is_active_c2_PCC_INVERTER, const char_T
*c2_name);
static void init_dsm_address_info(SFc2_PCC_INVERTERInstanceStruct *chartInstance);
/* Function Definitions */
static void initialize_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance)
{
_sfTime_ = (real_T)ssGetT(chartInstance->S);
chartInstance->c2_Ts_not_empty = FALSE;
chartInstance->c2_R_not_empty = FALSE;
chartInstance->c2_L_not_empty = FALSE;
chartInstance->c2_v_not_empty = FALSE;
chartInstance->c2_states_not_empty = FALSE;
chartInstance->c2_x_old_not_empty = FALSE;
chartInstance->c2_i_old_not_empty = FALSE;
chartInstance->c2_is_active_c2_PCC_INVERTER = 0U;
}
static void initialize_params_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance)
{
}
static void enable_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance)
{
_sfTime_ = (real_T)ssGetT(chartInstance->S);
}
static void disable_c2_PCC_INVERTER(SFc2_PCC_INVERTERInstanceStruct
*chartInstance)
{
_sfTime_ = (real_T)ssGetT(chartInstance->S);
}
static void c2_update_debugger_state_c2_PCC_INVERTER
(SFc2_PCC_INVERTERInstanceStruct *chartInstance)
{
}
static const mxArray *get_sim_state_c2_PCC_INVERTER
(SFc2_PCC_INVERTERInstanceStruct *chartInstance)
{
const mxArray *c2_st = NULL;
const mxArray *c2_y = NULL;
real_T c2_hoistedGlobal;
real_T c2_u;
const mxArray *c2_b_y = NULL;
real_T c2_b_hoistedGlobal;
real_T c2_b_u;
const mxArray *c2_c_y = NULL;
real_T c2_c_hoistedGlobal;
real_T c2_c_u;
const mxArray *c2_d_y = NULL;
real_T c2_d_hoistedGlobal;
real_T c2_d_u;
const mxArray *c2_e_y = NULL;
real_T c2_e_hoistedGlobal;
real_T c2_e_u;
const mxArray *c2_f_y = NULL;
real_T c2_f_hoistedGlobal;
real_T c2_f_u;
const mxArray *c2_g_y = NULL;
creal_T c2_g_hoistedGlobal;
creal_T c2_g_u;
const mxArray *c2_h_y = NULL;
int32_T c2_i0;
real_T c2_h_hoistedGlobal[24];
int32_T c2_i1;
real_T c2_h_u[24];
const mxArray *c2_i_y = NULL;
int32_T c2_i2;
creal_T c2_i_hoistedGlobal[8];
int32_T c2_i3;
creal_T c2_i_u[8];
const mxArray *c2_j_y = NULL;
real_T c2_j_hoistedGlobal;
real_T c2_j_u;
const mxArray *c2_k_y = NULL;
uint8_T c2_k_hoistedGlobal;
uint8_T c2_k_u;
const mxArray *c2_l_y = NULL;
real_T *c2_Sa;
real_T *c2_Sb;
real_T *c2_Sc;
c2_Sc = (real_T *)ssGetOutputPortSignal(chartInstance->S, 3);
c2_Sb = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
c2_Sa = (real_T *)ssGetOutputPortSignal(chartInstance->S, 1);
c2_st = NULL;
c2_y = NULL;
sf_mex_assign(&c2_y, sf_mex_createcellarray(11));
c2_hoistedGlobal = *c2_Sa;
c2_u = c2_hoistedGlobal;
c2_b_y = NULL;
sf_mex_assign(&c2_b_y, sf_mex_create("y", &c2_u, 0, 0U, 0U, 0U, 0));
sf_mex_setcell(c2_y, 0, c2_b_y);
c2_b_hoistedGlobal = *c2_Sb;
c2_b_u = c2_b_hoistedGlobal;
c2_c_y = NULL;
sf_mex_assign(&c2_c_y, sf_mex_create("y", &c2_b_u, 0, 0U, 0U, 0U, 0));
sf_mex_setcell(c2_y, 1, c2_c_y);
c2_c_hoistedGlobal = *c2_Sc;
c2_c_u = c2_c_hoistedGlobal;
c2_d_y = NULL;
sf_mex_assign(&c2_d_y, sf_mex_create("y", &c2_c_u, 0, 0U, 0U, 0U, 0));
sf_mex_setcell(c2_y, 2, c2_d_y);
c2_d_hoistedGlobal = chartInstance->c2_L;
c2_d_u = c2_d_hoistedGlobal;
c2_e_y = NULL;
if (!chartInstance->c2_L_not_empty) {
sf_mex_assign(&c2_e_y, sf_mex_create("y", NULL, 0, 0U, 1U, 0U, 2, 0, 0));
} else {
sf_mex_assign(&c2_e_y, sf_mex_create("y", &c2_d_u, 0, 0U, 0U, 0U, 0));
}
sf_mex_setcell(c2_y, 3, c2_e_y);
c2_e_hoistedGlobal = chartInstance->c2_R;
c2_e_u = c2_e_hoistedGlobal;
c2_f_y = NULL;
if (!chartInstance->c2_R_not_empty) {
sf_mex_assign(&c2_f_y, sf_mex_create("y", NULL, 0, 0U, 1U, 0U, 2, 0, 0));
} else {
sf_mex_assign(&c2_f_y, sf_mex_create("y", &c2_e_u, 0, 0U, 0U, 0U, 0));
}
sf_mex_setcell(c2_y, 4, c2_f_y);
c2_