コード例 #1
0
ファイル: SDRuTransmitter.c プロジェクト: CalilQ/sdruWiLab
/* Function Definitions */
comm_SDRuTransmitter *SDRuTransmitter_SDRuTransmitter(const emlrtStack *sp,
  comm_SDRuTransmitter *obj)
{
  comm_SDRuTransmitter *b_obj;
  comm_SDRuTransmitter *c_obj;
  int32_T k;
  real_T varargin_1[10];
  int32_T i5;
  static const char_T cv52[5] = { 'S', 'D', 'R', 'u', '_' };

  real_T d0;
  boolean_T flag;
  emlrtStack st;
  emlrtStack b_st;
  emlrtStack c_st;
  emlrtStack d_st;
  emlrtStack e_st;
  emlrtStack f_st;
  emlrtStack g_st;
  emlrtStack h_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  c_st.prev = &b_st;
  c_st.tls = b_st.tls;
  d_st.prev = &c_st;
  d_st.tls = c_st.tls;
  e_st.prev = &d_st;
  e_st.tls = d_st.tls;
  f_st.prev = &e_st;
  f_st.tls = e_st.tls;
  g_st.prev = &f_st;
  g_st.tls = f_st.tls;
  h_st.prev = &g_st;
  h_st.tls = g_st.tls;
  b_obj = obj;
  st.site = &rj_emlrtRSI;
  c_obj = b_obj;
  c_obj->LocalOscillatorOffset = 0.0;
  c_obj->pSubDevice = TxId;
  b_st.site = &sj_emlrtRSI;
  c_st.site = &bb_emlrtRSI;
  c_st.site = &bb_emlrtRSI;
  c_obj->isInitialized = FALSE;
  c_obj->isReleased = FALSE;
  d_st.site = &cb_emlrtRSI;
  e_st.site = &db_emlrtRSI;
  for (k = 0; k < 4; k++) {
    c_obj->tunablePropertyChanged[k] = FALSE;
  }

  f_st.site = &db_emlrtRSI;
  d_st.site = &cb_emlrtRSI;
  e_st.site = &db_emlrtRSI;
  b_st.site = &sj_emlrtRSI;
  b_st.site = &sj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  b_st.site = &sj_emlrtRSI;
  c_st.site = &u_emlrtRSI;
  emlrtRandu(varargin_1, 10);
  for (k = 0; k < 10; k++) {
    c_st.site = &v_emlrtRSI;
    c_st.site = &v_emlrtRSI;
    d_st.site = &p_emlrtRSI;
    varargin_1[k] = 48.0 + muDoubleScalarFloor(varargin_1[k] * 10.0);
  }

  b_st.site = &sj_emlrtRSI;
  for (k = 0; k < 10; k++) {
    i5 = (int32_T)varargin_1[k];
    emlrtDynamicBoundsCheckFastR2012b(i5, 0, 255, &i_emlrtBCI, &b_st);
  }

  b_st.site = &sj_emlrtRSI;
  for (k = 0; k < 5; k++) {
    c_obj->ObjectID[k] = cv52[k];
  }

  for (k = 0; k < 10; k++) {
    d0 = muDoubleScalarFloor(varargin_1[k]);
    if (muDoubleScalarIsNaN(d0) || muDoubleScalarIsInf(d0)) {
      d0 = 0.0;
    } else {
      d0 = muDoubleScalarRem(d0, 256.0);
    }

    if (d0 < 0.0) {
      c_obj->ObjectID[k + 5] = (int8_T)-(int8_T)(uint8_T)-d0;
    } else {
      c_obj->ObjectID[k + 5] = (int8_T)(uint8_T)d0;
    }
  }

  c_st.site = &db_emlrtRSI;
  b_st.site = &sj_emlrtRSI;
  c_st.site = &db_emlrtRSI;
  d_st.site = &db_emlrtRSI;
  e_st.site = &db_emlrtRSI;
  f_st.site = &eg_emlrtRSI;
  g_st.site = &db_emlrtRSI;
  h_st.site = &sj_emlrtRSI;
  checkIPAddressFormat(&h_st);
  g_st.site = &db_emlrtRSI;
  d_st.site = &db_emlrtRSI;
  e_st.site = &ob_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  c_obj->CenterFrequency = 2.24E+9;
  g_st.site = &sj_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  if (c_obj->isInitialized && (!c_obj->isReleased)) {
    flag = TRUE;
  } else {
    flag = FALSE;
  }

  if (flag) {
    c_obj->TunablePropsChanged = TRUE;
    c_obj->tunablePropertyChanged[1] = TRUE;
  }

  e_st.site = &ob_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  c_obj->InterpolationFactor = 20.0;
  g_st.site = &rj_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  if (c_obj->isInitialized && (!c_obj->isReleased)) {
    flag = TRUE;
  } else {
    flag = FALSE;
  }

  if (flag) {
    c_obj->TunablePropsChanged = TRUE;
    c_obj->tunablePropertyChanged[0] = TRUE;
  }

  e_st.site = &ob_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  c_obj->Gain = 25.0;
  g_st.site = &sj_emlrtRSI;
  f_st.site = &db_emlrtRSI;
  if (c_obj->isInitialized && (!c_obj->isReleased)) {
    flag = TRUE;
  } else {
    flag = FALSE;
  }

  if (flag) {
    c_obj->TunablePropsChanged = TRUE;
    c_obj->tunablePropertyChanged[3] = TRUE;
  }

  return b_obj;
}
コード例 #2
0
/* Function Definitions */
comm_SDRuTransmitter *SDRuTransmitter_SDRuTransmitter(const emlrtStack *sp,
  comm_SDRuTransmitter *obj)
{
  comm_SDRuTransmitter *b_obj;
  comm_SDRuTransmitter *c_obj;
  real_T varargin_1[10];
  int32_T k;
  int32_T i0;
  static const char_T cv0[5] = { 'S', 'D', 'R', 'u', '_' };

  real_T d0;
  emlrtStack st;
  emlrtStack b_st;
  emlrtStack c_st;
  emlrtStack d_st;
  emlrtStack e_st;
  emlrtStack f_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  c_st.prev = &b_st;
  c_st.tls = b_st.tls;
  d_st.prev = &c_st;
  d_st.tls = c_st.tls;
  e_st.prev = &d_st;
  e_st.tls = d_st.tls;
  f_st.prev = &e_st;
  f_st.tls = e_st.tls;
  b_obj = obj;
  st.site = &g_emlrtRSI;
  c_obj = b_obj;
  c_obj->pSubDevice = TxId;
  b_st.site = &h_emlrtRSI;
  c_st.site = &i_emlrtRSI;
  d_st.site = &j_emlrtRSI;
  c_st.site = &i_emlrtRSI;
  c_obj->isInitialized = 0;
  d_st.site = &k_emlrtRSI;
  b_st.site = &h_emlrtRSI;
  c_st.site = &l_emlrtRSI;
  b_st.site = &h_emlrtRSI;
  c_st.site = &m_emlrtRSI;
  b_rand(varargin_1);
  for (k = 0; k < 10; k++) {
    varargin_1[k] = 48.0 + muDoubleScalarFloor(varargin_1[k] * 10.0);
  }

  b_st.site = &h_emlrtRSI;
  for (k = 0; k < 10; k++) {
    i0 = (int32_T)varargin_1[k];
    if (!((i0 >= 0) && (i0 <= 255))) {
      emlrtDynamicBoundsCheckR2012b(i0, 0, 255, &emlrtBCI, &b_st);
    }
  }

  for (k = 0; k < 5; k++) {
    c_obj->ObjectID[k] = cv0[k];
  }

  for (k = 0; k < 10; k++) {
    d0 = muDoubleScalarFloor(varargin_1[k]);
    if (muDoubleScalarIsNaN(d0) || muDoubleScalarIsInf(d0)) {
      d0 = 0.0;
    } else {
      d0 = muDoubleScalarRem(d0, 256.0);
    }

    if (d0 < 0.0) {
      c_obj->ObjectID[k + 5] = (int8_T)-(int8_T)(uint8_T)-d0;
    } else {
      c_obj->ObjectID[k + 5] = (int8_T)(uint8_T)d0;
    }
  }

  b_st.site = &h_emlrtRSI;
  c_st.site = &j_emlrtRSI;
  d_st.site = &j_emlrtRSI;
  e_st.site = &n_emlrtRSI;
  c_obj->CenterFrequency = 1.285E+9;
  e_st.site = &n_emlrtRSI;
  c_obj->Gain = 15.0;
  e_st.site = &n_emlrtRSI;
  c_obj->InterpolationFactor = 500.0;
  e_st.site = &n_emlrtRSI;
  f_st.site = &h_emlrtRSI;
  checkIPAddressFormat(&f_st);
  e_st.site = &n_emlrtRSI;
  c_obj->LocalOscillatorOffset = 0.0;
  return b_obj;
}
コード例 #3
0
/* Function Definitions */
comm_SDRuReceiver *SDRuReceiver_SDRuReceiver(const emlrtStack *sp,
  comm_SDRuReceiver *obj)
{
  comm_SDRuReceiver *b_obj;
  comm_SDRuReceiver *c_obj;
  real_T varargin_1[10];
  int32_T k;
  int32_T i9;
  static const char_T cv10[5] = { 'S', 'D', 'R', 'u', '_' };

  real_T d1;
  boolean_T flag;
  emlrtStack st;
  emlrtStack b_st;
  emlrtStack c_st;
  emlrtStack d_st;
  emlrtStack e_st;
  emlrtStack f_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  c_st.prev = &b_st;
  c_st.tls = b_st.tls;
  d_st.prev = &c_st;
  d_st.tls = c_st.tls;
  e_st.prev = &d_st;
  e_st.tls = d_st.tls;
  f_st.prev = &e_st;
  f_st.tls = e_st.tls;
  b_obj = obj;
  st.site = &ab_emlrtRSI;
  c_obj = b_obj;
  c_obj->LocalOscillatorOffset = 0.0;
  c_obj->pSubDevice = RxId;
  b_st.site = &h_emlrtRSI;
  c_st.site = &i_emlrtRSI;
  d_st.site = &j_emlrtRSI;
  c_st.site = &i_emlrtRSI;
  c_obj->isInitialized = false;
  c_obj->isReleased = false;
  d_st.site = &k_emlrtRSI;
  b_st.site = &h_emlrtRSI;
  c_st.site = &l_emlrtRSI;
  b_st.site = &h_emlrtRSI;
  c_st.site = &m_emlrtRSI;
  b_rand(varargin_1);
  for (k = 0; k < 10; k++) {
    varargin_1[k] = 48.0 + muDoubleScalarFloor(varargin_1[k] * 10.0);
  }

  b_st.site = &h_emlrtRSI;
  for (k = 0; k < 10; k++) {
    i9 = (int32_T)varargin_1[k];
    emlrtDynamicBoundsCheckFastR2012b(i9, 0, 255, &emlrtBCI, &b_st);
  }

  for (k = 0; k < 5; k++) {
    c_obj->ObjectID[k] = cv10[k];
  }

  for (k = 0; k < 10; k++) {
    d1 = muDoubleScalarFloor(varargin_1[k]);
    if (muDoubleScalarIsNaN(d1) || muDoubleScalarIsInf(d1)) {
      d1 = 0.0;
    } else {
      d1 = muDoubleScalarRem(d1, 256.0);
    }

    if (d1 < 0.0) {
      c_obj->ObjectID[k + 5] = (int8_T)-(int8_T)(uint8_T)-d1;
    } else {
      c_obj->ObjectID[k + 5] = (int8_T)(uint8_T)d1;
    }
  }

  b_st.site = &h_emlrtRSI;
  c_st.site = &j_emlrtRSI;
  d_st.site = &j_emlrtRSI;
  e_st.site = &o_emlrtRSI;
  if (c_obj->isInitialized && (!c_obj->isReleased)) {
    flag = true;
  } else {
    flag = false;
  }

  if (flag) {
    c_obj->TunablePropsChanged = true;
  }

  e_st.site = &o_emlrtRSI;
  c_obj->CenterFrequency = 9.05E+8;
  e_st.site = &o_emlrtRSI;
  if (c_obj->isInitialized && (!c_obj->isReleased)) {
    flag = true;
  } else {
    flag = false;
  }

  if (flag) {
    c_obj->TunablePropsChanged = true;
  }

  e_st.site = &o_emlrtRSI;
  c_obj->DecimationFactor = 500.0;
  e_st.site = &o_emlrtRSI;
  if (c_obj->isInitialized && (!c_obj->isReleased)) {
    flag = true;
  } else {
    flag = false;
  }

  if (flag) {
    c_obj->TunablePropsChanged = true;
  }

  e_st.site = &o_emlrtRSI;
  c_obj->Gain = 35.0;
  e_st.site = &o_emlrtRSI;
  f_st.site = &h_emlrtRSI;
  checkIPAddressFormat(&f_st);
  return b_obj;
}
コード例 #4
0
ファイル: Deadbeat_CUK_acc.c プロジェクト: Velocar/Bikair_MBD
void ) { } static void mdlOutputs ( SimStruct * S , int_T tid ) { real_T
jzxguy1xyo ; ZCEventType zcEvent ; boolean_T is1galx1wr ; real_T iden3vpls2 ;
real_T kewj0jjgdw ; real_T c3hti1p3uf ; int8_T rtPrevAction ; int8_T rtAction
; nmsgyp54ig * _rtB ; bbqvqz25ov * _rtP ; n2g2llwf21 * _rtX ; aa2ep02qn5 *
_rtZCE ; pklu3vjy1t * _rtDW ; _rtDW = ( ( pklu3vjy1t * ) ssGetRootDWork ( S )
) ; _rtZCE = ( ( aa2ep02qn5 * ) _ssGetPrevZCSigState ( S ) ) ; _rtX = ( (
n2g2llwf21 * ) ssGetContStates ( S ) ) ; _rtP = ( ( bbqvqz25ov * )
ssGetModelRtp ( S ) ) ; _rtB = ( ( nmsgyp54ig * ) _ssGetModelBlockIO ( S ) )
; if ( ssIsSampleHit ( S , 4 , 0 ) ) { _rtB -> jbbkv4upvi = _rtDW ->
idaicj53o4 ; } if ( ssIsSampleHit ( S , 1 , 0 ) ) { is1galx1wr = ( _rtB ->
jbbkv4upvi != c22ngqieus ( S ) -> pactsh03am ) ; } jzxguy1xyo = ssGetT ( S )
; if ( ssIsSampleHit ( S , 1 , 0 ) ) { _rtB -> oojsaunz11 = _rtP -> P_5 ;
_rtB -> fmra2cutsa = _rtP -> P_6 ; } _rtB -> fs1ofsmvy2 = muDoubleScalarRem (
jzxguy1xyo + _rtB -> oojsaunz11 , _rtB -> fmra2cutsa ) * _rtP -> P_7 ; _rtB
-> kdd430tca4 = ( ( 2.0 * _rtB -> fs1ofsmvy2 - 1.0 ) + 1.0 ) * 0.5 ; if (
ssIsSampleHit ( S , 1 , 0 ) ) { if ( ssIsMajorTimeStep ( S ) ) { _rtDW ->
fiaf5yjt4n = ( _rtB -> jbbkv4upvi >= _rtB -> kdd430tca4 ) ; } _rtB ->
bonoh3t2uf = ( is1galx1wr && _rtDW -> fiaf5yjt4n ) ; } _rtB -> puvw0myvhu [ 0
] = _rtB -> bonoh3t2uf ; _rtB -> puvw0myvhu [ 1 ] = 0.0 ; _rtB -> puvw0myvhu
[ 2 ] = 0.0 ; _rtDW -> lhiprm3wjz [ 0 ] = ! ( _rtB -> puvw0myvhu [ 0 ] ==
_rtDW -> lhiprm3wjz [ 1 ] ) ; _rtDW -> lhiprm3wjz [ 1 ] = _rtB -> puvw0myvhu
[ 0 ] ; _rtB -> puvw0myvhu [ 3 ] = _rtDW -> lhiprm3wjz [ 0 ] ; if (
ssIsSampleHit ( S , 2 , 0 ) ) { ssCallAccelRunBlock ( S , 9 , 15 ,
SS_CALL_MDL_OUTPUTS ) ; ssCallAccelRunBlock ( S , 9 , 16 ,
SS_CALL_MDL_OUTPUTS ) ; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { _rtB ->
ni0skqgprw = _rtB -> mgrpxotnda [ 2 ] ; } if ( ssIsSampleHit ( S , 2 , 0 ) )
{ ssCallAccelRunBlock ( S , 9 , 20 , SS_CALL_MDL_OUTPUTS ) ; } if (
ssIsSampleHit ( S , 1 , 0 ) ) { zcEvent = rt_ZCFcn ( ANY_ZERO_CROSSING , &
_rtZCE -> mpe2yble25 , ( _rtB -> fs1ofsmvy2 - _rtP -> P_11 ) ) ; if ( _rtDW
-> oosqu0tl1h == 0 ) { if ( zcEvent != NO_ZCEVENT ) { _rtB -> dgvfzxjzqp = !
( _rtB -> dgvfzxjzqp != 0.0 ) ; _rtDW -> oosqu0tl1h = 1 ; } else if ( _rtB ->
dgvfzxjzqp == 1.0 ) { if ( _rtB -> fs1ofsmvy2 != _rtP -> P_11 ) { _rtB ->
dgvfzxjzqp = 0.0 ; } } else { if ( _rtB -> fs1ofsmvy2 == _rtP -> P_11 ) {
_rtB -> dgvfzxjzqp = 1.0 ; } } } else { if ( _rtB -> fs1ofsmvy2 != _rtP ->
P_11 ) { _rtB -> dgvfzxjzqp = 0.0 ; } _rtDW -> oosqu0tl1h = 0 ; } } if (
ssIsSampleHit ( S , 2 , 0 ) ) { ssCallAccelRunBlock ( S , 9 , 23 ,
SS_CALL_MDL_OUTPUTS ) ; ssCallAccelRunBlock ( S , 9 , 33 ,
SS_CALL_MDL_OUTPUTS ) ; iden3vpls2 = _rtP -> P_13 * _rtB -> mgrpxotnda [ 8 ]
; } if ( ssIsSampleHit ( S , 4 , 0 ) ) { _rtB -> gp5orjzg5t = _rtB ->
mgrpxotnda [ 2 ] ; } if ( ssIsSampleHit ( S , 2 , 0 ) ) { kewj0jjgdw = (
iden3vpls2 - _rtB -> gp5orjzg5t ) * _rtB -> nzunlww04y ; } if ( ssIsSampleHit
( S , 4 , 0 ) ) { _rtB -> jw2hkpsksy = _rtB -> gp5orjzg5t * _rtB ->
dvca5kgoqr ; _rtB -> elobzetbdp = _rtB -> mgrpxotnda [ 8 ] ; } if (
ssIsSampleHit ( S , 2 , 0 ) ) { c3hti1p3uf = ( kewj0jjgdw + _rtB ->
jw2hkpsksy ) - _rtB -> elobzetbdp ; if ( ssIsSampleHit ( S , 4 , 0 ) ) { _rtB
-> bc5lqmbcwx = _rtB -> mgrpxotnda [ 9 ] ; } } if ( ssIsSampleHit ( S , 4 , 0
) ) { _rtB -> bpiny53cki = _rtB -> elobzetbdp + _rtB -> bc5lqmbcwx ; } if (
ssIsSampleHit ( S , 2 , 0 ) ) { iden3vpls2 = c3hti1p3uf / _rtB -> bpiny53cki
+ _rtB -> idha0n310x ; if ( iden3vpls2 > _rtP -> P_16 ) { _rtB -> ccrq35nhp3
= _rtP -> P_16 ; } else if ( iden3vpls2 < _rtP -> P_17 ) { _rtB -> ccrq35nhp3
= _rtP -> P_17 ; } else { _rtB -> ccrq35nhp3 = iden3vpls2 ; } } if (
ssIsSampleHit ( S , 4 , 0 ) ) { _rtB -> pvzuuxenvc = _rtB -> ccrq35nhp3 ; }
if ( ssIsSampleHit ( S , 2 , 0 ) ) { _rtB -> ii04l1a0ic = ( _rtB ->
mgrpxotnda [ 9 ] + _rtB -> mgrpxotnda [ 8 ] ) - _rtB -> mgrpxotnda [ 6 ] ;
ssCallAccelRunBlock ( S , 9 , 51 , SS_CALL_MDL_OUTPUTS ) ; rtPrevAction =
_rtDW -> dcumqbbyun ; if ( ssIsMajorTimeStep ( S ) ) { if ( _rtB ->
mgrpxotnda [ 9 ] < 90.199999999999989 ) { rtAction = 0 ; } else { rtAction =
1 ; } _rtDW -> dcumqbbyun = rtAction ; } else { rtAction = _rtDW ->
dcumqbbyun ; } if ( rtPrevAction != rtAction ) { switch ( rtPrevAction ) {
case 0 : ssSetSolverNeedsReset ( S ) ; break ; case 1 : ssSetSolverNeedsReset
( S ) ; break ; case 2 : ssSetSolverNeedsReset ( S ) ; break ; } } switch (
rtAction ) { case 0 : if ( rtAction != rtPrevAction ) { if ( ssGetTaskTime (
S , 2 ) != ssGetTStart ( S ) ) { ssSetSolverNeedsReset ( S ) ; } } _rtB ->
kx5rgsvmx3 = _rtP -> P_0 * _rtB -> mgrpxotnda [ 8 ] ; if ( ssIsMajorTimeStep
( S ) ) { srUpdateBC ( _rtDW -> o5k0zwtbn4 ) ; } break ; case 1 : if (
rtAction != rtPrevAction ) { if ( ssGetTaskTime ( S , 2 ) != ssGetTStart ( S
) ) { ssSetSolverNeedsReset ( S ) ; } } _rtB -> kx5rgsvmx3 = _rtP -> P_1 ; if
( ssIsMajorTimeStep ( S ) ) { srUpdateBC ( _rtDW -> ihoovge3z4 ) ; } break ;
case 2 : if ( rtAction != rtPrevAction ) { if ( ssGetTaskTime ( S , 2 ) !=
ssGetTStart ( S ) ) { ssSetSolverNeedsReset ( S ) ; } } _rtB -> pvzuuxenvc =
_rtP -> P_2 ; if ( ssIsMajorTimeStep ( S ) ) { srUpdateBC ( _rtDW ->
gunoszsdaf ) ; } break ; } } bemu4fk2sq ( S , _rtB -> kwjevd5eqt , 0.0 , &
_rtB -> bemu4fk2sq4 , & _rtDW -> bemu4fk2sq4 , ( mvw1gbh0c1 * ) & _rtP ->
bemu4fk2sq4 , & ( ( npjij2cecc * ) ssGetContStateDisabled ( S ) ) ->
bemu4fk2sq4 ) ; cqabclhqip ( S , _rtB -> donhz1jhkq , 0.0 , & _rtB ->
cqabclhqip4 , & _rtDW -> cqabclhqip4 , ( nneyi35s1a * ) & _rtP -> cqabclhqip4
, & _rtX -> cqabclhqip4 , & ( ( npjij2cecc * ) ssGetContStateDisabled ( S ) )
-> cqabclhqip4 ) ; bemu4fk2sq ( S , _rtB -> jwapqatga5 , 0.0 , & _rtB ->
n1qdzssqu3 , & _rtDW -> n1qdzssqu3 , ( mvw1gbh0c1 * ) & _rtP -> n1qdzssqu3 ,
& ( ( npjij2cecc * ) ssGetContStateDisabled ( S ) ) -> n1qdzssqu3 ) ;
cqabclhqip ( S , _rtB -> p5ierutvgv , 0.0 , & _rtB -> nfugx5ih43 , & _rtDW ->
nfugx5ih43 , ( nneyi35s1a * ) & _rtP -> nfugx5ih43 , & _rtX -> nfugx5ih43 , &
( ( npjij2cecc * ) ssGetContStateDisabled ( S ) ) -> nfugx5ih43 ) ;
UNUSED_PARAMETER ( tid ) ; } static void mdlOutputsTID5 ( SimStruct * S ,
コード例 #5
0
/* Function Definitions */
comm_SDRuReceiver *SDRuReceiver_SDRuReceiver(const emlrtStack *sp,
  comm_SDRuReceiver *obj, real_T varargin_2, real_T varargin_4, real_T
  varargin_8)
{
  comm_SDRuReceiver *b_obj;
  comm_SDRuReceiver *c_obj;
  real_T varargin_1[10];
  int32_T k;
  int32_T i10;
  static const char_T cv6[5] = { 'S', 'D', 'R', 'u', '_' };

  real_T d1;
  emlrtStack st;
  emlrtStack b_st;
  emlrtStack c_st;
  emlrtStack d_st;
  emlrtStack e_st;
  emlrtStack f_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  c_st.prev = &b_st;
  c_st.tls = b_st.tls;
  d_st.prev = &c_st;
  d_st.tls = c_st.tls;
  e_st.prev = &d_st;
  e_st.tls = d_st.tls;
  f_st.prev = &e_st;
  f_st.tls = e_st.tls;
  b_obj = obj;
  st.site = &w_emlrtRSI;
  c_obj = b_obj;
  c_obj->LocalOscillatorOffset = 0.0;
  c_obj->pSubDevice = RxId;
  b_st.site = &j_emlrtRSI;
  c_st.site = &k_emlrtRSI;
  d_st.site = &l_emlrtRSI;
  c_st.site = &k_emlrtRSI;
  c_obj->isInitialized = 0;
  d_st.site = &m_emlrtRSI;
  b_st.site = &j_emlrtRSI;
  c_st.site = &n_emlrtRSI;
  b_st.site = &j_emlrtRSI;
  c_st.site = &o_emlrtRSI;
  b_rand(varargin_1);
  for (k = 0; k < 10; k++) {
    varargin_1[k] = 48.0 + muDoubleScalarFloor(varargin_1[k] * 10.0);
  }

  b_st.site = &j_emlrtRSI;
  for (k = 0; k < 10; k++) {
    i10 = (int32_T)varargin_1[k];
    if (!((i10 >= 0) && (i10 <= 255))) {
      emlrtDynamicBoundsCheckR2012b(i10, 0, 255, &emlrtBCI, &b_st);
    }
  }

  for (k = 0; k < 5; k++) {
    c_obj->ObjectID[k] = cv6[k];
  }

  for (k = 0; k < 10; k++) {
    d1 = muDoubleScalarFloor(varargin_1[k]);
    if (muDoubleScalarIsNaN(d1) || muDoubleScalarIsInf(d1)) {
      d1 = 0.0;
    } else {
      d1 = muDoubleScalarRem(d1, 256.0);
    }

    if (d1 < 0.0) {
      c_obj->ObjectID[k + 5] = (int8_T)-(int8_T)(uint8_T)-d1;
    } else {
      c_obj->ObjectID[k + 5] = (int8_T)(uint8_T)d1;
    }
  }

  b_st.site = &j_emlrtRSI;
  c_st.site = &l_emlrtRSI;
  d_st.site = &l_emlrtRSI;
  e_st.site = &p_emlrtRSI;
  c_obj->CenterFrequency = varargin_2;
  e_st.site = &p_emlrtRSI;
  if (varargin_4 > 512.0) {
    f_st.site = &w_emlrtRSI;
    b_warning(&f_st);
  }

  c_obj->DecimationFactor = varargin_4;
  e_st.site = &p_emlrtRSI;
  c_obj->Gain = varargin_8;
  e_st.site = &p_emlrtRSI;
  f_st.site = &j_emlrtRSI;
  checkIPAddressFormat(&f_st);
  return b_obj;
}
コード例 #6
0
static void sf_c9_QPSK_Transmit_v12d(SFc9_QPSK_Transmit_v12dInstanceStruct
  *chartInstance)
{
  creal_T c9_d_in;
  uint32_T c9_debug_family_var_map[5];
  const mxArray *c9_fm = NULL;
  real_T c9_nargin = 1.0;
  real_T c9_nargout = 1.0;
  cint16_T c9_d_out;
  creal_T c9_varargin_1;
  real_T c9_d0;
  real_T c9_d1;
  int16_T c9_i0;
  cint16_T c9_b_varargin_1;
  real_T c9_d2;
  real_T c9_d3;
  int16_T c9_i1;
  const mxArray *c9_T = NULL;
  const mxArray *c9_F = NULL;
  const mxArray *c9_ERR = NULL;
  const mxArray *c9_val = NULL;
  const mxArray *c9_isautoscaled = NULL;
  const mxArray *c9_pvpairsetdata = NULL;
  const mxArray *c9_isfimathlocal = NULL;
  cint16_T *c9_b_d_out;
  creal_T *c9_b_d_in;
  c9_b_d_out = (cint16_T *)ssGetOutputPortSignal(chartInstance->S, 1);
  c9_b_d_in = (creal_T *)ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 1U, chartInstance->c9_sfEvent);
  chartInstance->c9_sfEvent = CALL_EVENT;
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 1U, chartInstance->c9_sfEvent);
  c9_d_in.re = c9_b_d_in->re;
  c9_d_in.im = c9_b_d_in->im;
  sf_debug_symbol_scope_push_eml(0U, 5U, 5U, c9_debug_family_names,
    c9_debug_family_var_map);
  sf_debug_symbol_scope_add_eml(&c9_fm, 0U, c9_d_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_nargin, 1U, c9_c_sf_marshallOut,
    c9_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml_importable(&c9_nargout, 2U, c9_c_sf_marshallOut,
    c9_b_sf_marshallIn);
  sf_debug_symbol_scope_add_eml(&c9_d_in, 3U, c9_b_sf_marshallOut);
  sf_debug_symbol_scope_add_eml_importable(&c9_d_out, 4U, c9_sf_marshallOut,
    c9_sf_marshallIn);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 3);
  c9_fm = c9_eml_mx;
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, 5);
  c9_varargin_1 = c9_d_in;
  c9_d0 = muDoubleScalarFloor(c9_varargin_1.re * 2048.0);
  if (muDoubleScalarIsNaN(c9_d0) || muDoubleScalarIsInf(c9_d0)) {
    c9_d1 = 0.0;
  } else {
    c9_d1 = muDoubleScalarRem(c9_d0, 4096.0);
  }

  c9_i0 = (int16_T)muDoubleScalarFloor(c9_d1);
  if ((int16_T)(c9_i0 & 2048) != 0) {
    c9_b_varargin_1.re = (int16_T)(c9_i0 | -2048);
  } else {
    c9_b_varargin_1.re = (int16_T)(c9_i0 & 2047);
  }

  c9_d2 = muDoubleScalarFloor(c9_varargin_1.im * 2048.0);
  if (muDoubleScalarIsNaN(c9_d2) || muDoubleScalarIsInf(c9_d2)) {
    c9_d3 = 0.0;
  } else {
    c9_d3 = muDoubleScalarRem(c9_d2, 4096.0);
  }

  c9_i1 = (int16_T)muDoubleScalarFloor(c9_d3);
  if ((int16_T)(c9_i1 & 2048) != 0) {
    c9_b_varargin_1.im = (int16_T)(c9_i1 | -2048);
  } else {
    c9_b_varargin_1.im = (int16_T)(c9_i1 & 2047);
  }

  c9_d_out = c9_b_varargin_1;
  sf_mex_destroy(&c9_T);
  sf_mex_destroy(&c9_F);
  sf_mex_destroy(&c9_ERR);
  sf_mex_destroy(&c9_val);
  sf_mex_destroy(&c9_isautoscaled);
  sf_mex_destroy(&c9_pvpairsetdata);
  sf_mex_destroy(&c9_isfimathlocal);
  _SFD_EML_CALL(0U, chartInstance->c9_sfEvent, -5);
  sf_debug_symbol_scope_pop();
  c9_b_d_out->re = c9_d_out.re;
  c9_b_d_out->im = c9_d_out.im;
  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 1U, chartInstance->c9_sfEvent);
  sf_debug_check_for_state_inconsistency(_QPSK_Transmit_v12dMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}