⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c1_netcon.c

📁 RFID读卡器与标签之间在AWGN和加入其它读写器干扰下的BER仿真
💻 C
📖 第 1 页 / 共 4 页
字号:
                transitionList[numTransitions] = 10;
                numTransitions++;
              }
              sf_debug_transition_conflict_check_end();
              if(numTransitions>1) {
                _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
              }
            }
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,7);
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,6);
            chartInstance.c1_count = c1__u16_s32_(chartInstance.c1_count + 1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_count, 3U);
            output(chartInstance.c1_convec);
            chartInstance.c1_i = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            *c1_outdp1() = chartInstance.c1_convec[1];
            _SFD_DATA_RANGE_CHECK((real_T)*c1_outdp1(), 6U);
            *c1_outdp2() = chartInstance.c1_convec[0];
            _SFD_DATA_RANGE_CHECK((real_T)*c1_outdp2(), 4U);
            c1_exit_internal_Road();
            chartInstance.c1_tp_Road = 0;
            chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
            chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_STATE;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,4);
            chartInstance.c1_tp_STATE = 1;
          } else if(CV_TRANSITION_EVAL(10U,
            (_SFD_CCP_CALL(10,0,(chartInstance.c1_code == 1)) != 0) &&
            (_SFD_CCP_CALL(10,1,(chartInstance.c1_i
               == 0)) != 0)) != 0) {
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,10);
            chartInstance.c1_convec[1] = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
            chartInstance.c1_convec[0] = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
            chartInstance.c1_i = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            chartInstance.c1_tp_S1 = 0;
            chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
            chartInstance.c1_is_Road = (uint8_T)c1_IN_S3;
            chartInstance.c1_was_Road = (uint8_T)c1_IN_S3;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
            chartInstance.c1_tp_S3 = 1;
          }
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,2);
          break;
         case c1_IN_S2:
          CV_STATE_EVAL(5,0,3);
          _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,0);
          if(CV_TRANSITION_EVAL(3U,
            (int32_T)_SFD_CCP_CALL(3,0,(chartInstance.c1_i == 1))) != 0) {
            if(sf_debug_transition_conflict_check_enabled()) {
              unsigned int transitionList[3];
              unsigned int numTransitions=1;
              transitionList[0] = 3;
              sf_debug_transition_conflict_check_begin();
              if((chartInstance.c1_code == 1) && (chartInstance.c1_i == 0)) {
                transitionList[numTransitions] = 4;
                numTransitions++;
              }
              if((chartInstance.c1_code == 0) && (chartInstance.c1_i == 0)) {
                transitionList[numTransitions] = 17;
                numTransitions++;
              }
              sf_debug_transition_conflict_check_end();
              if(numTransitions>1) {
                _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
              }
            }
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,3);
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,6);
            chartInstance.c1_count = c1__u16_s32_(chartInstance.c1_count + 1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_count, 3U);
            output(chartInstance.c1_convec);
            chartInstance.c1_i = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            *c1_outdp1() = chartInstance.c1_convec[1];
            _SFD_DATA_RANGE_CHECK((real_T)*c1_outdp1(), 6U);
            *c1_outdp2() = chartInstance.c1_convec[0];
            _SFD_DATA_RANGE_CHECK((real_T)*c1_outdp2(), 4U);
            c1_exit_internal_Road();
            chartInstance.c1_tp_Road = 0;
            chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
            chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_STATE;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,4);
            chartInstance.c1_tp_STATE = 1;
          } else if(CV_TRANSITION_EVAL(4U,
            (_SFD_CCP_CALL(4,0,(chartInstance.c1_code == 1)) != 0) &&
            (_SFD_CCP_CALL(4,1,(chartInstance.c1_i
               == 0)) != 0)) != 0) {
            if(sf_debug_transition_conflict_check_enabled()) {
              unsigned int transitionList[2];
              unsigned int numTransitions=1;
              transitionList[0] = 4;
              sf_debug_transition_conflict_check_begin();
              if((chartInstance.c1_code == 0) && (chartInstance.c1_i == 0)) {
                transitionList[numTransitions] = 17;
                numTransitions++;
              }
              sf_debug_transition_conflict_check_end();
              if(numTransitions>1) {
                _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
              }
            }
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,4);
            chartInstance.c1_convec[1] = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
            chartInstance.c1_convec[0] = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
            chartInstance.c1_i = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            chartInstance.c1_tp_S2 = 0;
            chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
            chartInstance.c1_is_Road = (uint8_T)c1_IN_S1;
            chartInstance.c1_was_Road = (uint8_T)c1_IN_S1;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,2);
            chartInstance.c1_tp_S1 = 1;
          } else if(CV_TRANSITION_EVAL(17U,
            (_SFD_CCP_CALL(17,0,(chartInstance.c1_code == 0)) != 0) &&
            (_SFD_CCP_CALL(17,1,(chartInstance.c1_i
               == 0)) != 0)) != 0) {
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,17);
            chartInstance.c1_convec[1] = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
            chartInstance.c1_convec[0] = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
            chartInstance.c1_i = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            chartInstance.c1_tp_S2 = 0;
            chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
            chartInstance.c1_is_Road = (uint8_T)c1_IN_S0;
            chartInstance.c1_was_Road = (uint8_T)c1_IN_S0;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,6);
            chartInstance.c1_tp_S0 = 1;
          }
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
          break;
         case c1_IN_S3:
          CV_STATE_EVAL(5,0,4);
          _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,3);
          if(CV_TRANSITION_EVAL(2U, (_SFD_CCP_CALL(2,0,(chartInstance.c1_code ==
               0)) != 0) && (_SFD_CCP_CALL(2,1,(chartInstance.c1_i == 0))
             != 0)) != 0) {
            if(sf_debug_transition_conflict_check_enabled()) {
              unsigned int transitionList[3];
              unsigned int numTransitions=1;
              transitionList[0] = 2;
              sf_debug_transition_conflict_check_begin();
              if((chartInstance.c1_code == 1) && (chartInstance.c1_i == 0)) {
                transitionList[numTransitions] = 5;
                numTransitions++;
              }
              if(chartInstance.c1_i == 1) {
                transitionList[numTransitions] = 12;
                numTransitions++;
              }
              sf_debug_transition_conflict_check_end();
              if(numTransitions>1) {
                _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
              }
            }
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,2);
            chartInstance.c1_convec[1] = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
            chartInstance.c1_convec[0] = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
            chartInstance.c1_i = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            chartInstance.c1_tp_S3 = 0;
            chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,3);
            chartInstance.c1_is_Road = (uint8_T)c1_IN_S2;
            chartInstance.c1_was_Road = (uint8_T)c1_IN_S2;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,0);
            chartInstance.c1_tp_S2 = 1;
          } else if(CV_TRANSITION_EVAL(5U,
            (_SFD_CCP_CALL(5,0,(chartInstance.c1_code == 1)) != 0) &&
            (_SFD_CCP_CALL(5,1,(chartInstance.c1_i
               == 0)) != 0)) != 0) {
            if(sf_debug_transition_conflict_check_enabled()) {
              unsigned int transitionList[2];
              unsigned int numTransitions=1;
              transitionList[0] = 5;
              sf_debug_transition_conflict_check_begin();
              if(chartInstance.c1_i == 1) {
                transitionList[numTransitions] = 12;
                numTransitions++;
              }
              sf_debug_transition_conflict_check_end();
              if(numTransitions>1) {
                _SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
              }
            }
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,5);
            chartInstance.c1_convec[1] = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[1], 2U);
            chartInstance.c1_convec[0] = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_convec[0], 2U);
            chartInstance.c1_i = c1__u8_s8_(1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            chartInstance.c1_tp_S3 = 0;
            chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,3);
            chartInstance.c1_is_Road = (uint8_T)c1_IN_S3;
            chartInstance.c1_was_Road = (uint8_T)c1_IN_S3;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,3);
            chartInstance.c1_tp_S3 = 1;
          } else if(CV_TRANSITION_EVAL(12U,
            (int32_T)_SFD_CCP_CALL(12,0,(chartInstance.c1_i == 1))) != 0) {
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,12);
            _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,6);
            chartInstance.c1_count = c1__u16_s32_(chartInstance.c1_count + 1);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_count, 3U);
            output(chartInstance.c1_convec);
            chartInstance.c1_i = c1__u8_s8_(0);
            _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_i, 0U);
            *c1_outdp1() = chartInstance.c1_convec[1];
            _SFD_DATA_RANGE_CHECK((real_T)*c1_outdp1(), 6U);
            *c1_outdp2() = chartInstance.c1_convec[0];
            _SFD_DATA_RANGE_CHECK((real_T)*c1_outdp2(), 4U);
            c1_exit_internal_Road();
            chartInstance.c1_tp_Road = 0;
            chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
            _SFD_CS_CALL(STATE_INACTIVE_TAG,5);
            chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_STATE;
            _SFD_CS_CALL(STATE_ACTIVE_TAG,4);
            chartInstance.c1_tp_STATE = 1;
          }
          _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,3);
          break;
         default:
          CV_STATE_EVAL(5,0,0);
          break;
        }
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
        break;
       case c1_IN_STATE:
        CV_CHART_EVAL(0,0,3);
        _SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,4);
        _SFD_CT_CALL(TRANSITION_ACTIVE_TAG,11);
        chartInstance.c1_code = (uint8_T)In1(chartInstance.c1_count);
        _SFD_DATA_RANGE_CHECK((real_T)chartInstance.c1_code, 1U);
        *c1_indp() = chartInstance.c1_code;
        _SFD_DATA_RANGE_CHECK((real_T)*c1_indp(), 5U);
        chartInstance.c1_tp_STATE = 0;
        chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
        _SFD_CS_CALL(STATE_INACTIVE_TAG,4);
        chartInstance.c1_is_c1_netcon = (uint8_T)c1_IN_IN;
        _SFD_CS_CALL(STATE_ACTIVE_TAG,1);
        chartInstance.c1_tp_IN = 1;
        _SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,4);
        break;
       case c1_IN_STOP:
        CV_CHART_EVAL(0,0,4);
        break;
       default:
        CV_CHART_EVAL(0,0,0);
        break;
      }
    }
    _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG,0);
    _SFD_CE_CALL(EVENT_AFTER_BROADCAST_TAG,c1_event_event);
    _sfEvent_ = c1_previousEvent;
  }
}

static void c1_exit_internal_Road(void)
{
  switch(chartInstance.c1_is_Road) {
   case c1_IN_S0:
    CV_STATE_EVAL(5,1,1);
    chartInstance.c1_tp_S0 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,6);
    break;
   case c1_IN_S1:
    CV_STATE_EVAL(5,1,2);
    chartInstance.c1_tp_S1 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,2);
    break;
   case c1_IN_S2:
    CV_STATE_EVAL(5,1,3);
    chartInstance.c1_tp_S2 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,0);
    break;
   case c1_IN_S3:
    CV_STATE_EVAL(5,1,4);
    chartInstance.c1_tp_S3 = 0;
    chartInstance.c1_is_Road = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
    _SFD_CS_CALL(STATE_INACTIVE_TAG,3);
    break;
   default:
    CV_STATE_EVAL(5,1,0);
    break;
  }
}

static uint8_T c1__u8_s8_(int8_T c1_b)
{
  uint8_T c1_a;
  c1_a = (uint8_T)c1_b;
  if(c1_b < 0) {
    sf_debug_overflow_detection(0);
  }
  return c1_a;
}

static uint16_T c1__u16_s32_(int32_T c1_b)
{
  uint16_T c1_a;
  c1_a = (uint16_T)c1_b;
  if(c1_a != c1_b) {
    sf_debug_overflow_detection(0);
  }
  return c1_a;
}

static uint16_T c1__u16_s8_(int8_T c1_b)
{
  uint16_T c1_a;
  c1_a = (uint16_T)c1_b;
  if(c1_b < 0) {
    sf_debug_overflow_detection(0);
  }
  return c1_a;
}

static uint8_T *c1_indp(void)
{
  return (uint8_T *)ssGetOutputPortSignal(chartInstance.S, 1);
}

static uint8_T *c1_outdp1(void)
{
  return (uint8_T *)ssGetOutputPortSignal(chartInstance.S, 2);
}

static uint8_T *c1_outdp2(void)
{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -