Compare View

switch
from
...
to
 
Commits (3)
app/gui/oven_control/define.h
... ... @@ -5,7 +5,7 @@
5 5  
6 6 #define MAJOR_VER 1
7 7 #define MINOR_VER 6
8   -#define HOTFIX_VER 7
  8 +#define HOTFIX_VER 9
9 9  
10 10 // 0 for normal
11 11 // 1 for premium
... ...
app/gui/oven_control/ovenstatics.cpp
... ... @@ -51,6 +51,7 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent)
51 51 m_nLastPopupidx = MAX_ERROR_TYPE_CNT;
52 52 m_wndSrvpassdlg = NULL;
53 53 state.firmware_version = 150;
  54 + m_bPrevteamTempErr = false;
54 55  
55 56 for(i=0;i<MAX_LOG_SENSOR;i++){
56 57 curSensorValue[i].utemp = 0;
... ... @@ -59,7 +60,10 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent)
59 60 curSensorValue[12].itemp = 100;
60 61  
61 62 srvdata = new ServiceData();
62   -
  63 + m_tmrSvoff = new QTimer(this);
  64 + m_tmrSvoff->setInterval(30000);
  65 + m_tmrSvoff->setSingleShot(true);
  66 + connect(m_tmrSvoff, SIGNAL(timeout()), this, SLOT(onSvOffTimeoutFired()));
63 67 }
64 68  
65 69 OvenStatistics::~OvenStatistics(){
... ... @@ -73,6 +77,7 @@ void OvenStatistics::onDataChanged()
73 77 time_t ltime=0;
74 78 uint16_t errstatetemp;
75 79 uint8_t cookingstate=0;
  80 + bool curSteamTempErr = false;
76 81 udp->fillControl(control);
77 82 udp->fillData(state);
78 83 bDataRefreshed = true;
... ... @@ -86,6 +91,15 @@ void OvenStatistics::onDataChanged()
86 91 qDebug() << " Upper RPM : " << m_nUpperRpm << ", Lower Rpm : " << m_nLowerRpm << ", Steam Rpm : " << m_nSteamRpm;
87 92 }
88 93  
  94 + curSteamTempErr = (state.system_error & MAKE_MASK(SYS_ERR_STAM_TEMP_ALARM)) != 0;
  95 + if(curSteamTempErr != m_bPrevteamTempErr){
  96 + m_bPrevteamTempErr = curSteamTempErr;
  97 + if(m_bPrevteamTempErr){
  98 + udp->set_steam_high_sv_onoff(true);
  99 + if(!m_tmrSvoff->isActive()) m_tmrSvoff->start();
  100 + }
  101 + }
  102 +
89 103 if((control.cooking || oven->cooking() || oven->preheating() || oven->cooldown())) cookingstate = 1;
90 104 else if(state.cleaning_sate != 0 ) cookingstate = 2;
91 105  
... ... @@ -136,7 +150,7 @@ void OvenStatistics::processSensorError(uint16_t errflag, time_t ltime){
136 150 if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF;
137 151 else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH;
138 152 else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF;
139   - else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON;
  153 + else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON;
140 154 else state = SYS_ON_COOK_OFF;
141 155  
142 156 if(errflag & MAKE_MASK(SENSOR_ERR_SENSOR_1)){
... ... @@ -213,7 +227,7 @@ void OvenStatistics::processCommError(uint16_t errflag, time_t ltime){
213 227 if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF;
214 228 else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH;
215 229 else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF;
216   - else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON;
  230 + else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON;
217 231 else state = SYS_ON_COOK_OFF;
218 232  
219 233 if(errflag & MAKE_MASK(COMM_ERR_BUNNER1)){
... ... @@ -299,7 +313,7 @@ void OvenStatistics::processSystemError(uint16_t errflag,time_t ltime){
299 313 if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF;
300 314 else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH;
301 315 else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF;
302   - else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON;
  316 + else if(control.system !=0 && bCookingState) state = SYS_ON_COOK_ON;
303 317 else state = SYS_ON_COOK_OFF;
304 318  
305 319 if( errflag & MAKE_MASK(SYS_ERR_FIRE_TRIGGER1)){
... ... @@ -771,3 +785,8 @@ void OvenStatistics::onCommTimeoutFired()
771 785 dlg->showFullScreen();
772 786 }
773 787 }
  788 +
  789 +void OvenStatistics::onSvOffTimeoutFired()
  790 +{
  791 + udp->set_steam_high_sv_onoff(false);
  792 +}
... ...
app/gui/oven_control/ovenstatics.h
... ... @@ -499,6 +499,8 @@ private:
499 499 uint32_t m_nUpperRpm;
500 500 uint32_t m_nLowerRpm;
501 501 uint32_t m_nSteamRpm;
  502 + bool m_bPrevteamTempErr;
  503 + QTimer *m_tmrSvoff;
502 504  
503 505 explicit OvenStatistics(QObject* parent);
504 506 ~OvenStatistics();
... ... @@ -525,6 +527,7 @@ public slots:
525 527 void onErrorPopupClosed(int erridx);
526 528 void setWndPassInputNull(void){m_wndSrvpassdlg = NULL;}
527 529 void onCommTimeoutFired();
  530 + void onSvOffTimeoutFired();
528 531  
529 532 signals:
530 533 void onErrorFired(int erridx);
... ...
app/gui/oven_control/udphandler.cpp
... ... @@ -21,6 +21,7 @@ UdpHandler::UdpHandler(QObject *parent) : QObject(parent)
21 21 bzero(&control, sizeof(control));
22 22 bzero(&state, sizeof(state));
23 23  
  24 + m_steamhighctr_enabled = false;
24 25 emitted = false;
25 26 emitTimeoutTimer.setSingleShot(true);
26 27 emitTimeoutTimer.setInterval(COMM_TIMEOUT_SEC * 1000);
... ... @@ -40,6 +41,20 @@ bool UdpHandler::init()
40 41 return true;
41 42 }
42 43  
  44 +void UdpHandler::set_steam_high_sv_onoff(bool onoff)
  45 +{
  46 + if(onoff){
  47 + sendCommand(CMD_ONOFF, TG_MANUAL_RELAY, SWITCH_ON);
  48 + sendCommand(CMD_ONOFF, TG_SSV, SWITCH_ON);
  49 + m_steamhighctr_enabled = true;
  50 + }
  51 + else{
  52 + sendCommand(CMD_ONOFF, TG_SSV, SWITCH_OFF);
  53 + sendCommand(CMD_ONOFF, TG_MANUAL_RELAY, SWITCH_OFF);
  54 + m_steamhighctr_enabled = false;
  55 + }
  56 +}
  57 +
43 58 void UdpHandler::readPendingDatagrams()
44 59 {
45 60 while (sock->hasPendingDatagrams()) {
... ... @@ -103,16 +118,28 @@ void UdpHandler::processState(oven_state_t *state)
103 118  
104 119 void UdpHandler::turnOn(int target)
105 120 {
  121 + if(m_steamhighctr_enabled){
  122 + sendCommand(CMD_ONOFF, TG_MANUAL_RELAY, SWITCH_OFF);
  123 + m_steamhighctr_enabled = false;
  124 + }
106 125 sendCommand(CMD_ONOFF, target, SWITCH_ON);
107 126 }
108 127  
109 128 void UdpHandler::turnOff(int target)
110 129 {
  130 + if(m_steamhighctr_enabled){
  131 + sendCommand(CMD_ONOFF, TG_MANUAL_RELAY, SWITCH_OFF);
  132 + m_steamhighctr_enabled = false;
  133 + }
111 134 sendCommand(CMD_ONOFF, target, SWITCH_OFF);
112 135 }
113 136  
114 137 void UdpHandler::set(int target, int value)
115 138 {
  139 + if(m_steamhighctr_enabled && target != TG_ERROR_CLEAR){
  140 + sendCommand(CMD_ONOFF, TG_MANUAL_RELAY, SWITCH_OFF);
  141 + m_steamhighctr_enabled = false;
  142 + }
116 143 sendCommand(CMD_VALUE, target, value);
117 144 }
118 145  
... ...
app/gui/oven_control/udphandler.h
... ... @@ -30,6 +30,7 @@ public:
30 30 }
31 31  
32 32 bool init();
  33 + void set_steam_high_sv_onoff(bool onoff);
33 34  
34 35 const oven_control_t &getControl() { return control; }
35 36 const oven_state_t &getData() { return state; }
... ... @@ -101,6 +102,7 @@ private:
101 102 QUdpSocket *sock;
102 103 QTimer emitTimeoutTimer;
103 104 bool emitted;
  105 + bool m_steamhighctr_enabled;
104 106  
105 107 private slots:
106 108 void readPendingDatagrams();
... ...