#include "ne_ds.h"
#include "MotorController_FOC_466a9c02_1_ds_mode.h"
#include "MotorController_FOC_466a9c02_1_ds_sys_struct.h"
#include "MotorController_FOC_466a9c02_1_ds_externals.h"
#include "MotorController_FOC_466a9c02_1_ds_external_struct.h"
#include "ssc_ml_fun.h"
int32_T MotorController_FOC_466a9c02_1_ds_mode ( const NeDynamicSystem * sys
, const NeDynamicSystemInput * t2 , NeDsMethodOutput * t3 ) { PmIntVector out
; real_T U_idx_0 ; real_T U_idx_1 ; real_T U_idx_2 ; real_T U_idx_3 ; real_T
U_idx_4 ; real_T U_idx_5 ; real_T X_idx_10 ; real_T X_idx_3 ; real_T X_idx_7
; real_T X_idx_8 ; real_T X_idx_9 ; real_T
plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v ; real_T
plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v ; int32_T t0_idx_0 ;
int32_T t0_idx_1 ; U_idx_0 = t2 -> mU . mX [ 0 ] ; U_idx_1 = t2 -> mU . mX [
1 ] ; U_idx_2 = t2 -> mU . mX [ 2 ] ; U_idx_3 = t2 -> mU . mX [ 3 ] ; U_idx_4
= t2 -> mU . mX [ 4 ] ; U_idx_5 = t2 -> mU . mX [ 5 ] ; X_idx_3 = t2 -> mX .
mX [ 3 ] ; X_idx_7 = t2 -> mX . mX [ 7 ] ; X_idx_8 = t2 -> mX . mX [ 8 ] ;
X_idx_9 = t2 -> mX . mX [ 9 ] ; X_idx_10 = t2 -> mX . mX [ 10 ] ; out = t3 ->
mMODE ; plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v = ( X_idx_10 * -
0.001 + X_idx_9 ) + - 48.0 ;
plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v = ( X_idx_10 * - 0.001 +
X_idx_7 ) + - 48.0 ; X_idx_10 = ( X_idx_10 * - 0.001 + X_idx_8 ) + - 48.0 ;
t0_idx_0 = ( int32_T ) floor ( X_idx_3 / 6.2831853071795862 ) ; t0_idx_1 = (
int32_T ) ( fabs ( X_idx_3 / 6.2831853071795862 ) > 2.147483647E+9 ) ; out .
mX [ 0 ] = t0_idx_0 ; out . mX [ 1 ] = t0_idx_1 ; out . mX [ 2 ] = ( int32_T
) ( U_idx_0 > 0.5 ) ; out . mX [ 3 ] = ( int32_T ) ( - X_idx_8 > 0.8 ) ; out
. mX [ 4 ] = ( int32_T ) ( - X_idx_8 < - pmf_get_inf ( ) ) ; out . mX [ 5 ] =
( int32_T ) ( U_idx_1 > 0.5 ) ; out . mX [ 6 ] = ( int32_T ) (
plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v > 0.8 ) ; out . mX [ 7 ]
= ( int32_T ) ( plant_pmsm_inverter_MOSFET_Ideal_Switching4_diode_v < -
pmf_get_inf ( ) ) ; out . mX [ 8 ] = ( int32_T ) ( U_idx_2 > 0.5 ) ; out . mX
[ 9 ] = ( int32_T ) ( - X_idx_9 > 0.8 ) ; out . mX [ 10 ] = ( int32_T ) ( -
X_idx_9 < - pmf_get_inf ( ) ) ; out . mX [ 11 ] = ( int32_T ) ( U_idx_3 > 0.5
) ; out . mX [ 12 ] = ( int32_T ) (
plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v > 0.8 ) ; out . mX [ 13 ]
= ( int32_T ) ( plant_pmsm_inverter_MOSFET_Ideal_Switching_diode_v < -
pmf_get_inf ( ) ) ; out . mX [ 14 ] = ( int32_T ) ( U_idx_4 > 0.5 ) ; out .
mX [ 15 ] = ( int32_T ) ( - X_idx_7 > 0.8 ) ; out . mX [ 16 ] = ( int32_T ) (
- X_idx_7 < - pmf_get_inf ( ) ) ; out . mX [ 17 ] = ( int32_T ) ( U_idx_5 >
0.5 ) ; out . mX [ 18 ] = ( int32_T ) ( X_idx_10 > 0.8 ) ; out . mX [ 19 ] =
( int32_T ) ( X_idx_10 < - pmf_get_inf ( ) ) ; ( void ) sys ; ( void ) t3 ;
return 0 ; }
