Compare View
Commits (3)
Showing
5 changed files
Show diff stats
app/gui/oven_control/define.h
app/gui/oven_control/ovenstatics.cpp
@@ -51,6 +51,7 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) | @@ -51,6 +51,7 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) | ||
51 | m_nLastPopupidx = MAX_ERROR_TYPE_CNT; | 51 | m_nLastPopupidx = MAX_ERROR_TYPE_CNT; |
52 | m_wndSrvpassdlg = NULL; | 52 | m_wndSrvpassdlg = NULL; |
53 | state.firmware_version = 150; | 53 | state.firmware_version = 150; |
54 | + m_bPrevteamTempErr = false; | ||
54 | 55 | ||
55 | for(i=0;i<MAX_LOG_SENSOR;i++){ | 56 | for(i=0;i<MAX_LOG_SENSOR;i++){ |
56 | curSensorValue[i].utemp = 0; | 57 | curSensorValue[i].utemp = 0; |
@@ -59,7 +60,10 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) | @@ -59,7 +60,10 @@ OvenStatistics::OvenStatistics(QObject* parent) :QObject(parent) | ||
59 | curSensorValue[12].itemp = 100; | 60 | curSensorValue[12].itemp = 100; |
60 | 61 | ||
61 | srvdata = new ServiceData(); | 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 | OvenStatistics::~OvenStatistics(){ | 69 | OvenStatistics::~OvenStatistics(){ |
@@ -73,6 +77,7 @@ void OvenStatistics::onDataChanged() | @@ -73,6 +77,7 @@ void OvenStatistics::onDataChanged() | ||
73 | time_t ltime=0; | 77 | time_t ltime=0; |
74 | uint16_t errstatetemp; | 78 | uint16_t errstatetemp; |
75 | uint8_t cookingstate=0; | 79 | uint8_t cookingstate=0; |
80 | + bool curSteamTempErr = false; | ||
76 | udp->fillControl(control); | 81 | udp->fillControl(control); |
77 | udp->fillData(state); | 82 | udp->fillData(state); |
78 | bDataRefreshed = true; | 83 | bDataRefreshed = true; |
@@ -86,6 +91,15 @@ void OvenStatistics::onDataChanged() | @@ -86,6 +91,15 @@ void OvenStatistics::onDataChanged() | ||
86 | qDebug() << " Upper RPM : " << m_nUpperRpm << ", Lower Rpm : " << m_nLowerRpm << ", Steam Rpm : " << m_nSteamRpm; | 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 | if((control.cooking || oven->cooking() || oven->preheating() || oven->cooldown())) cookingstate = 1; | 103 | if((control.cooking || oven->cooking() || oven->preheating() || oven->cooldown())) cookingstate = 1; |
90 | else if(state.cleaning_sate != 0 ) cookingstate = 2; | 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,7 +150,7 @@ void OvenStatistics::processSensorError(uint16_t errflag, time_t ltime){ | ||
136 | if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; | 150 | if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; |
137 | else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH; | 151 | else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH; |
138 | else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF; | 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 | else state = SYS_ON_COOK_OFF; | 154 | else state = SYS_ON_COOK_OFF; |
141 | 155 | ||
142 | if(errflag & MAKE_MASK(SENSOR_ERR_SENSOR_1)){ | 156 | if(errflag & MAKE_MASK(SENSOR_ERR_SENSOR_1)){ |
@@ -213,7 +227,7 @@ void OvenStatistics::processCommError(uint16_t errflag, time_t ltime){ | @@ -213,7 +227,7 @@ void OvenStatistics::processCommError(uint16_t errflag, time_t ltime){ | ||
213 | if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; | 227 | if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; |
214 | else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH; | 228 | else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH; |
215 | else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF; | 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 | else state = SYS_ON_COOK_OFF; | 231 | else state = SYS_ON_COOK_OFF; |
218 | 232 | ||
219 | if(errflag & MAKE_MASK(COMM_ERR_BUNNER1)){ | 233 | if(errflag & MAKE_MASK(COMM_ERR_BUNNER1)){ |
@@ -299,7 +313,7 @@ void OvenStatistics::processSystemError(uint16_t errflag,time_t ltime){ | @@ -299,7 +313,7 @@ void OvenStatistics::processSystemError(uint16_t errflag,time_t ltime){ | ||
299 | if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; | 313 | if( control.system==0 && !bCookingState ) state = SYS_OFF_COOK_OFF; |
300 | else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH; | 314 | else if(control.system !=0 && this->state.cleaning_sate !=0 ) state = SYS_ON_WASH; |
301 | else if(control.system != 0 && !bCookingState) state = SYS_ON_COOK_OFF; | 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 | else state = SYS_ON_COOK_OFF; | 317 | else state = SYS_ON_COOK_OFF; |
304 | 318 | ||
305 | if( errflag & MAKE_MASK(SYS_ERR_FIRE_TRIGGER1)){ | 319 | if( errflag & MAKE_MASK(SYS_ERR_FIRE_TRIGGER1)){ |
@@ -771,3 +785,8 @@ void OvenStatistics::onCommTimeoutFired() | @@ -771,3 +785,8 @@ void OvenStatistics::onCommTimeoutFired() | ||
771 | dlg->showFullScreen(); | 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,6 +499,8 @@ private: | ||
499 | uint32_t m_nUpperRpm; | 499 | uint32_t m_nUpperRpm; |
500 | uint32_t m_nLowerRpm; | 500 | uint32_t m_nLowerRpm; |
501 | uint32_t m_nSteamRpm; | 501 | uint32_t m_nSteamRpm; |
502 | + bool m_bPrevteamTempErr; | ||
503 | + QTimer *m_tmrSvoff; | ||
502 | 504 | ||
503 | explicit OvenStatistics(QObject* parent); | 505 | explicit OvenStatistics(QObject* parent); |
504 | ~OvenStatistics(); | 506 | ~OvenStatistics(); |
@@ -525,6 +527,7 @@ public slots: | @@ -525,6 +527,7 @@ public slots: | ||
525 | void onErrorPopupClosed(int erridx); | 527 | void onErrorPopupClosed(int erridx); |
526 | void setWndPassInputNull(void){m_wndSrvpassdlg = NULL;} | 528 | void setWndPassInputNull(void){m_wndSrvpassdlg = NULL;} |
527 | void onCommTimeoutFired(); | 529 | void onCommTimeoutFired(); |
530 | + void onSvOffTimeoutFired(); | ||
528 | 531 | ||
529 | signals: | 532 | signals: |
530 | void onErrorFired(int erridx); | 533 | void onErrorFired(int erridx); |
app/gui/oven_control/udphandler.cpp
@@ -21,6 +21,7 @@ UdpHandler::UdpHandler(QObject *parent) : QObject(parent) | @@ -21,6 +21,7 @@ UdpHandler::UdpHandler(QObject *parent) : QObject(parent) | ||
21 | bzero(&control, sizeof(control)); | 21 | bzero(&control, sizeof(control)); |
22 | bzero(&state, sizeof(state)); | 22 | bzero(&state, sizeof(state)); |
23 | 23 | ||
24 | + m_steamhighctr_enabled = false; | ||
24 | emitted = false; | 25 | emitted = false; |
25 | emitTimeoutTimer.setSingleShot(true); | 26 | emitTimeoutTimer.setSingleShot(true); |
26 | emitTimeoutTimer.setInterval(COMM_TIMEOUT_SEC * 1000); | 27 | emitTimeoutTimer.setInterval(COMM_TIMEOUT_SEC * 1000); |
@@ -40,6 +41,20 @@ bool UdpHandler::init() | @@ -40,6 +41,20 @@ bool UdpHandler::init() | ||
40 | return true; | 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 | void UdpHandler::readPendingDatagrams() | 58 | void UdpHandler::readPendingDatagrams() |
44 | { | 59 | { |
45 | while (sock->hasPendingDatagrams()) { | 60 | while (sock->hasPendingDatagrams()) { |
@@ -103,16 +118,28 @@ void UdpHandler::processState(oven_state_t *state) | @@ -103,16 +118,28 @@ void UdpHandler::processState(oven_state_t *state) | ||
103 | 118 | ||
104 | void UdpHandler::turnOn(int target) | 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 | sendCommand(CMD_ONOFF, target, SWITCH_ON); | 125 | sendCommand(CMD_ONOFF, target, SWITCH_ON); |
107 | } | 126 | } |
108 | 127 | ||
109 | void UdpHandler::turnOff(int target) | 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 | sendCommand(CMD_ONOFF, target, SWITCH_OFF); | 134 | sendCommand(CMD_ONOFF, target, SWITCH_OFF); |
112 | } | 135 | } |
113 | 136 | ||
114 | void UdpHandler::set(int target, int value) | 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 | sendCommand(CMD_VALUE, target, value); | 143 | sendCommand(CMD_VALUE, target, value); |
117 | } | 144 | } |
118 | 145 |
app/gui/oven_control/udphandler.h
@@ -30,6 +30,7 @@ public: | @@ -30,6 +30,7 @@ public: | ||
30 | } | 30 | } |
31 | 31 | ||
32 | bool init(); | 32 | bool init(); |
33 | + void set_steam_high_sv_onoff(bool onoff); | ||
33 | 34 | ||
34 | const oven_control_t &getControl() { return control; } | 35 | const oven_control_t &getControl() { return control; } |
35 | const oven_state_t &getData() { return state; } | 36 | const oven_state_t &getData() { return state; } |
@@ -101,6 +102,7 @@ private: | @@ -101,6 +102,7 @@ private: | ||
101 | QUdpSocket *sock; | 102 | QUdpSocket *sock; |
102 | QTimer emitTimeoutTimer; | 103 | QTimer emitTimeoutTimer; |
103 | bool emitted; | 104 | bool emitted; |
105 | + bool m_steamhighctr_enabled; | ||
104 | 106 | ||
105 | private slots: | 107 | private slots: |
106 | void readPendingDatagrams(); | 108 | void readPendingDatagrams(); |