📄 c1_stateflow_heating_controller.c
字号:
c1_event_next)!=0)) != 0) && (_SFD_CCP_CALL(5,1,((*c1_Enter ==
1.0)!=0))
!= 0)) != 0U != 0) {
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,5);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,19);
chartInstance.c1_tp_Minutes1 = 0U;
_SFD_CS_CALL(STATE_INACTIVE_TAG,19);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,19);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_Output_Time;
_SFD_CS_CALL(STATE_ACTIVE_TAG,16);
chartInstance.c1_tp_Output_Time = 1U;
*c1_Time = (10.0 * chartInstance.c1_h2 + chartInstance.c1_h1) + (10.0
* chartInstance.c1_m2 + chartInstance.c1_m1) / 100.0;
_SFD_DATA_RANGE_CHECK(*c1_Time, 2U);
*c1_SetClock = 1.0;
_SFD_DATA_RANGE_CHECK(*c1_SetClock, 0U);
}
}
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,19);
break;
case c1_IN_Minutes2:
CV_STATE_EVAL(5,0,5);
_SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,15);
if(chartInstance.c1_is_Process_Buttons == 5) {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,8);
if(CV_TRANSITION_EVAL(8U, (_SFD_CCP_CALL(8,0,((_sfEvent_ ==
c1_event_next)!=0)) != 0) && (_SFD_CCP_CALL(8,1,((*c1_PushButton
== -1.0)!=0))
!= 0)) != 0U != 0) {
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,8);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,15);
chartInstance.c1_tp_Minutes2 = 0U;
_SFD_CS_CALL(STATE_INACTIVE_TAG,15);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,15);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_Wait4;
_SFD_CS_CALL(STATE_ACTIVE_TAG,2);
chartInstance.c1_temporalCounter_i1 = 0U;
chartInstance.c1_tp_Wait4 = 1U;
} else {
*c1_Reset = 1.0;
_SFD_DATA_RANGE_CHECK(*c1_Reset, 14U);
}
}
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,15);
break;
case c1_IN_Output_Time:
CV_STATE_EVAL(5,0,6);
_SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,16);
if(chartInstance.c1_is_Process_Buttons == 6) {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,10);
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,10);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,16);
chartInstance.c1_tp_Output_Time = 0U;
_SFD_CS_CALL(STATE_INACTIVE_TAG,16);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,16);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_AMPM;
_SFD_CS_CALL(STATE_ACTIVE_TAG,7);
chartInstance.c1_temporalCounter_i1 = 0U;
chartInstance.c1_tp_AMPM = 1U;
*c1_Reset = 1.0;
_SFD_DATA_RANGE_CHECK(*c1_Reset, 14U);
}
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,16);
break;
case c1_IN_SetTemp:
CV_STATE_EVAL(5,0,7);
_SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,6);
if(chartInstance.c1_is_Process_Buttons == 7) {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,23);
if(CV_TRANSITION_EVAL(23U,
(int32_T)_SFD_CCP_CALL(23,0,((chartInstance.c1_Zone == 2.0)!=0))) !=
0U != 0) {
if(sf_debug_transition_conflict_check_enabled()) {
unsigned int transitionList[2];
unsigned int numTransitions=1;
transitionList[0] = 23;
sf_debug_transition_conflict_check_begin();
if(chartInstance.c1_Zone == 1.0) {
transitionList[numTransitions] = 6;
numTransitions++;
}
sf_debug_transition_conflict_check_end();
if(numTransitions>1) {
_SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
}
}
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,23);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,6);
chartInstance.c1_tp_SetTemp = 0U;
_SFD_CS_CALL(STATE_INACTIVE_TAG,6);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,6);
(*c1_SetTemps)[1] = 10.0 * chartInstance.c1_m2 + chartInstance.c1_m1;
_SFD_DATA_RANGE_CHECK((*c1_SetTemps)[1], 13U);
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,25);
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,25);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_b_IN_Start;
_SFD_CS_CALL(STATE_ACTIVE_TAG,18);
chartInstance.c1_b_tp_Start = 1U;
*c1_SetClock = 0.0;
_SFD_DATA_RANGE_CHECK(*c1_SetClock, 0U);
} else {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,6);
if(CV_TRANSITION_EVAL(6U,
(int32_T)_SFD_CCP_CALL(6,0,((chartInstance.c1_Zone == 1.0)!=0))) !=
0U != 0) {
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,6);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,6);
chartInstance.c1_tp_SetTemp = 0U;
_SFD_CS_CALL(STATE_INACTIVE_TAG,6);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,6);
(*c1_SetTemps)[0] = 10.0 * chartInstance.c1_m2 + chartInstance.c1_m1;
_SFD_DATA_RANGE_CHECK((*c1_SetTemps)[0], 13U);
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,25);
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,25);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_b_IN_Start;
_SFD_CS_CALL(STATE_ACTIVE_TAG,18);
chartInstance.c1_b_tp_Start = 1U;
*c1_SetClock = 0.0;
_SFD_DATA_RANGE_CHECK(*c1_SetClock, 0U);
}
}
}
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,6);
break;
case c1_IN_SetTime:
CV_STATE_EVAL(5,0,8);
c1_SetTime();
break;
case c1_b_IN_Start:
CV_STATE_EVAL(5,0,9);
c1_Start();
break;
case c1_IN_Temperature:
CV_STATE_EVAL(5,0,10);
c1_Temperature();
break;
case c1_IN_Tens1:
CV_STATE_EVAL(5,0,11);
c1_Tens1();
break;
case c1_IN_Tens2:
CV_STATE_EVAL(5,0,12);
c1_Tens2();
break;
case c1_IN_Wait1:
CV_STATE_EVAL(5,0,13);
c1_Wait1();
break;
case c1_IN_Wait2:
CV_STATE_EVAL(5,0,14);
c1_Wait2();
break;
case c1_IN_Wait3:
CV_STATE_EVAL(5,0,15);
c1_Wait3();
break;
case c1_IN_Wait4:
CV_STATE_EVAL(5,0,16);
c1_Wait4();
break;
default:
CV_STATE_EVAL(5,0,0);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
_SFD_CS_CALL(STATE_INACTIVE_TAG,7);
break;
}
}
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,5);
}
static void c1_Tens1(void)
{
real_T *c1_PushButton;
real_T *c1_Reset;
c1_PushButton = (real_T *)ssGetInputPortSignal(chartInstance.S, 1);
c1_Reset = (real_T *)ssGetOutputPortSignal(chartInstance.S, 3);
_SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,14);
if(chartInstance.c1_is_Process_Buttons == 11) {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,1);
if(CV_TRANSITION_EVAL(1U, (_SFD_CCP_CALL(1,0,((_sfEvent_ ==
c1_event_next)!=0)) != 0) && (_SFD_CCP_CALL(1,1,((*c1_PushButton ==
-1.0)!=0))
!= 0)) != 0U != 0) {
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,1);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,14);
chartInstance.c1_tp_Tens1 = 0U;
_SFD_CS_CALL(STATE_INACTIVE_TAG,14);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,14);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_Wait1;
_SFD_CS_CALL(STATE_ACTIVE_TAG,12);
chartInstance.c1_temporalCounter_i1 = 0U;
chartInstance.c1_tp_Wait1 = 1U;
} else {
*c1_Reset = 1.0;
_SFD_DATA_RANGE_CHECK(*c1_Reset, 14U);
}
}
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,14);
}
static void c1_Tens2(void)
{
real_T *c1_Enter;
real_T *c1_Reset;
c1_Enter = (real_T *)ssGetInputPortSignal(chartInstance.S, 2);
c1_Reset = (real_T *)ssGetOutputPortSignal(chartInstance.S, 3);
_SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,10);
if(chartInstance.c1_is_Process_Buttons == 12) {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,12);
if(CV_TRANSITION_EVAL(12U, (_SFD_CCP_CALL(12,0,((_sfEvent_ ==
c1_event_next)!=0)) != 0) && (_SFD_CCP_CALL(12,1,((*c1_Enter ==
1.0)!=0))
!= 0)) != 0U != 0) {
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,12);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,10);
chartInstance.c1_tp_Tens2 = 0U;
_SFD_CS_CALL(STATE_INACTIVE_TAG,10);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,10);
*c1_Reset = 1.0;
_SFD_DATA_RANGE_CHECK(*c1_Reset, 14U);
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_SetTemp;
_SFD_CS_CALL(STATE_ACTIVE_TAG,6);
chartInstance.c1_tp_SetTemp = 1U;
}
}
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,10);
}
static void c1_Temperature(void)
{
real_T *c1_Enter;
real_T *c1_Reset;
real_T *c1_PushButton;
real_T *c1_SetClock;
c1_PushButton = (real_T *)ssGetInputPortSignal(chartInstance.S, 1);
c1_Enter = (real_T *)ssGetInputPortSignal(chartInstance.S, 2);
c1_SetClock = (real_T *)ssGetOutputPortSignal(chartInstance.S, 1);
c1_Reset = (real_T *)ssGetOutputPortSignal(chartInstance.S, 3);
_SFD_CS_CALL(STATE_ENTER_DURING_FUNCTION_TAG,11);
if(chartInstance.c1_is_Process_Buttons == 10) {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,28);
if(CV_TRANSITION_EVAL(28U, (_SFD_CCP_CALL(28,0,((_sfEvent_ ==
c1_event_next)!=0)) != 0) && (_SFD_CCP_CALL(28,1,((*c1_Enter ==
1.0)!=0))
!= 0)) != 0U != 0) {
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,28);
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,9);
if(CV_TRANSITION_EVAL(9U,
(int32_T)_SFD_CCP_CALL(9,0,((chartInstance.c1_Zone == 1.0)!=0))) != 0U
!= 0) {
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,9);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,11);
chartInstance.c1_tp_Temperature = 0U;
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
_SFD_CS_CALL(STATE_INACTIVE_TAG,11);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,11);
chartInstance.c1_Zone = 2.0;
_SFD_DATA_RANGE_CHECK(chartInstance.c1_Zone, 8U);
*c1_Reset = 1.0;
_SFD_DATA_RANGE_CHECK(*c1_Reset, 14U);
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,25);
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,25);
if(chartInstance.c1_is_Process_Buttons != 9) {
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_b_IN_Start;
_SFD_CS_CALL(STATE_ACTIVE_TAG,18);
chartInstance.c1_b_tp_Start = 1U;
*c1_SetClock = 0.0;
_SFD_DATA_RANGE_CHECK(*c1_SetClock, 0U);
}
} else {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,24);
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,24);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,11);
chartInstance.c1_tp_Temperature = 0U;
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
_SFD_CS_CALL(STATE_INACTIVE_TAG,11);
_SFD_CS_CALL(EXIT_OUT_OF_FUNCTION_TAG,11);
chartInstance.c1_Zone = 1.0;
_SFD_DATA_RANGE_CHECK(chartInstance.c1_Zone, 8U);
*c1_Reset = 1.0;
_SFD_DATA_RANGE_CHECK(*c1_Reset, 14U);
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,25);
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,25);
if(chartInstance.c1_is_Process_Buttons != 9) {
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_b_IN_Start;
_SFD_CS_CALL(STATE_ACTIVE_TAG,18);
chartInstance.c1_b_tp_Start = 1U;
*c1_SetClock = 0.0;
_SFD_DATA_RANGE_CHECK(*c1_SetClock, 0U);
}
}
} else {
_SFD_CT_CALL(TRANSITION_BEFORE_PROCESSING_TAG,7);
if(CV_TRANSITION_EVAL(7U, (int32_T)_SFD_CCP_CALL(7,0,((_sfEvent_ ==
c1_event_run)!=0))) != 0U != 0) {
if(sf_debug_transition_conflict_check_enabled()) {
unsigned int transitionList[2];
unsigned int numTransitions=1;
transitionList[0] = 7;
sf_debug_transition_conflict_check_begin();
if(_sfEvent_ == c1_event_time) {
transitionList[numTransitions] = 34;
numTransitions++;
}
sf_debug_transition_conflict_check_end();
if(numTransitions>1) {
_SFD_TRANSITION_CONFLICT(&(transitionList[0]),numTransitions);
}
}
_SFD_CT_CALL(TRANSITION_ACTIVE_TAG,7);
_SFD_CS_CALL(STATE_ENTER_EXIT_FUNCTION_TAG,11);
chartInstance.c1_tp_Temperature = 0U;
chartInstance.c1_is_Process_Buttons = (uint8_T)c1_IN_NO_ACTIVE_CHILD;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -