Commit 2189b57d9aab28ac708bd0ad6c2168a91badc6c8
1 parent
14d1b0775f
Exists in
master
and in
2 other branches
GUI V0.3.15
- 0.3.15 버전 변경 - 통신에러 30초간 감지 후 발생
Showing
2 changed files
with
63 additions
and
11 deletions
Show diff stats
app/gui/oven_control/define.h
app/gui/oven_control/ovenstatics.cpp
@@ -93,11 +93,11 @@ void OvenStatistics::onDataChanged() | @@ -93,11 +93,11 @@ void OvenStatistics::onDataChanged() | ||
93 | } | 93 | } |
94 | curSysErrorState = state.system_error; | 94 | curSysErrorState = state.system_error; |
95 | 95 | ||
96 | - errstatetemp = state.communication_error; | ||
97 | - if(errstatetemp!=0 && errstatetemp != curCommErrorState ){ | ||
98 | - processCommError( (errstatetemp & comm_err_mask[cookingstate][cfg->getConfigValue(Define::config_model).d32]),ltime ); | ||
99 | - } | ||
100 | - curCommErrorState = errstatetemp; | 96 | +// errstatetemp = state.communication_error; |
97 | +// if(errstatetemp!=0 && errstatetemp != curCommErrorState ){ | ||
98 | +// processCommError( (errstatetemp & comm_err_mask[cookingstate][cfg->getConfigValue(Define::config_model).d32]),ltime ); | ||
99 | +// } | ||
100 | +// curCommErrorState = errstatetemp; | ||
101 | 101 | ||
102 | errstatetemp = state.sensor_error; | 102 | errstatetemp = state.sensor_error; |
103 | if(errstatetemp!=0 && errstatetemp != curSensorErrorState ){ | 103 | if(errstatetemp!=0 && errstatetemp != curSensorErrorState ){ |
@@ -105,11 +105,11 @@ void OvenStatistics::onDataChanged() | @@ -105,11 +105,11 @@ void OvenStatistics::onDataChanged() | ||
105 | } | 105 | } |
106 | curSensorErrorState = errstatetemp; | 106 | curSensorErrorState = errstatetemp; |
107 | 107 | ||
108 | - errstatetemp = state.controller_error; | ||
109 | - if(errstatetemp != 0 && errstatetemp != curControlErrorState){ | ||
110 | - processStateError((errstatetemp&state_err_mask[cookingstate][cfg->getConfigValue(Define::config_model).d32]),ltime); | ||
111 | - } | ||
112 | - curControlErrorState = errstatetemp; | 108 | +// errstatetemp = state.controller_error; |
109 | +// if(errstatetemp != 0 && errstatetemp != curControlErrorState){ | ||
110 | +// processStateError((errstatetemp&state_err_mask[cookingstate][cfg->getConfigValue(Define::config_model).d32]),ltime); | ||
111 | +// } | ||
112 | +// curControlErrorState = errstatetemp; | ||
113 | 113 | ||
114 | } | 114 | } |
115 | 115 | ||
@@ -367,6 +367,14 @@ void OvenStatistics::oneSecTimerFired(void){ | @@ -367,6 +367,14 @@ void OvenStatistics::oneSecTimerFired(void){ | ||
367 | static int nOneSecCnt=1; | 367 | static int nOneSecCnt=1; |
368 | time_t ltime; | 368 | time_t ltime; |
369 | 369 | ||
370 | + static int nStateErrValStableCnt = 0; | ||
371 | + static int nCommErrValStableCnt = 0; | ||
372 | + static uint16_t nCommErrVal = 0; | ||
373 | + static uint16_t nStateErrVal = 0; | ||
374 | + uint16_t errstatetemp=0; | ||
375 | + int cookingstate=0; | ||
376 | + if((control.cooking || oven->cooking() || oven->preheating() || oven->cooldown())) cookingstate =1; | ||
377 | + | ||
370 | ltime = time(NULL); | 378 | ltime = time(NULL); |
371 | 379 | ||
372 | nOneSecCnt++; | 380 | nOneSecCnt++; |
@@ -374,11 +382,55 @@ void OvenStatistics::oneSecTimerFired(void){ | @@ -374,11 +382,55 @@ void OvenStatistics::oneSecTimerFired(void){ | ||
374 | srvdata->saveServiceData(); | 382 | srvdata->saveServiceData(); |
375 | } | 383 | } |
376 | 384 | ||
385 | + | ||
377 | if(bDataRefreshed) bDataRefreshed= false; | 386 | if(bDataRefreshed) bDataRefreshed= false; |
378 | else{ | 387 | else{ |
379 | udp->fillControl(control); | 388 | udp->fillControl(control); |
380 | udp->fillData(state); | 389 | udp->fillData(state); |
381 | } | 390 | } |
391 | + | ||
392 | + if(nCommErrVal != state.communication_error){ | ||
393 | + nCommErrVal = state.communication_error; | ||
394 | + if(nCommErrVal ==0) { | ||
395 | + curCommErrorState = nCommErrVal; | ||
396 | + nCommErrValStableCnt = 60; | ||
397 | + } | ||
398 | + else { | ||
399 | + nCommErrValStableCnt=0; | ||
400 | + } | ||
401 | + } | ||
402 | + else{ | ||
403 | + if(nCommErrValStableCnt >=60){ | ||
404 | + errstatetemp = state.communication_error; | ||
405 | + if(errstatetemp!=0 && errstatetemp != curCommErrorState ){ | ||
406 | + processCommError( (errstatetemp & comm_err_mask[cookingstate][cfg->getConfigValue(Define::config_model).d32]),ltime ); | ||
407 | + } | ||
408 | + curCommErrorState = errstatetemp; | ||
409 | + } | ||
410 | + else nCommErrValStableCnt++; | ||
411 | + } | ||
412 | + | ||
413 | + if(nStateErrVal != state.controller_error){ | ||
414 | + nStateErrVal = state.controller_error; | ||
415 | + if(nStateErrVal == 0 ) { | ||
416 | + curControlErrorState = nStateErrVal; | ||
417 | + nStateErrValStableCnt=60; | ||
418 | + } | ||
419 | + else{ | ||
420 | + nStateErrValStableCnt=0; | ||
421 | + } | ||
422 | + } | ||
423 | + else{ | ||
424 | + if(nStateErrValStableCnt>=60){ | ||
425 | + errstatetemp = state.controller_error; | ||
426 | + if(errstatetemp != 0 && errstatetemp != curControlErrorState){ | ||
427 | + processStateError((errstatetemp&state_err_mask[cookingstate][cfg->getConfigValue(Define::config_model).d32]),ltime); | ||
428 | + } | ||
429 | + curControlErrorState = errstatetemp; | ||
430 | + } | ||
431 | + else nStateErrValStableCnt++; | ||
432 | + } | ||
433 | + | ||
382 | //가열부 시간 측정 | 434 | //가열부 시간 측정 |
383 | if( (state.onoff_state1 & LOAD_STATE1_STEAM_BUNNER) !=0){ | 435 | if( (state.onoff_state1 & LOAD_STATE1_STEAM_BUNNER) !=0){ |
384 | srvdata->use_log.items.steam_heat +=1; | 436 | srvdata->use_log.items.steam_heat +=1; |