Commit 39fec1254e007f607eb12a4d9378e821ed43cc54

Authored by 김태훈
1 parent 596b06d692
Exists in master and in 2 other branches fhd, fhd-demo

요청 사항 반영

- HACCP 기록 항목 추가
  - 설정 습도, 설정 온도, 설정 시간
  - 수위 상태, 급수 밸브, 히터 상태
app/app-prime-modbus/app/app-prime-modbus/rs485_serial.c
... ... @@ -502,7 +502,6 @@ static void on_rcv_status( void){
502 502  
503 503 printf( "onoff_state1 = 0x%04x\n", oven.state.onoff_state1);
504 504 printf( "onoff_state2 = 0x%04x\n", oven.state.onoff_state2);
505   - printf( "onoff_realy_load = 0x%04x\n", oven.state.onoff_relay_load);
506 505  
507 506 // GUI로 전송
508 507 gui_send_data_to_gui( ( char *)&oven, sizeof( gui_oven_state_t));
... ...
app/app-prime-modbus/include/all_share.h
... ... @@ -186,7 +186,7 @@ typedef struct {
186 186 U16 cleaning_sec; // 0E
187 187 U16 cleaning_min; // 0F
188 188 U16 door_state; // 10
189   - U16 reserved11; // 11
  189 + U16 water_level; // 11
190 190 U16 burner1_rpm; // 12
191 191 U16 burner2_rpm; // 13
192 192 U16 burner3_rpm; // 14
... ... @@ -212,9 +212,9 @@ typedef struct {
212 212 I16 sensor14; // 28
213 213 U16 sensor15; // 29
214 214 U16 sensor16; // 2A
215   - U16 onoff_relay_load; // 2B
216   - U16 reserved2c; // 2C
217   - U16 reserved2d; // 2D
  215 + U16 onoff_relay_load1; // 2B
  216 + U16 onoff_relay_load2; // 2C
  217 + U16 onoff_relay_load3; // 2D
218 218 U16 system_error; // 2E
219 219 U16 communication_error; // 2F
220 220 U16 sensor_error; // 30
... ...
app/gui/oven_control/haccp.cpp
... ... @@ -10,6 +10,7 @@
10 10 #include "stringer.h"
11 11 #include "oven.h"
12 12 #include "config.h"
  13 +#include "udphandler.h"
13 14  
14 15 namespace
15 16 {
... ... @@ -19,11 +20,23 @@ enum Type { Invalid, Manual, Auto, Multi, Wash, Engineering };
19 20 struct Stamp
20 21 {
21 22 QDateTime time;
22   - int temp;
  23 + int remainingTime;
  24 +
  25 + int targetTemp;
  26 + int curTemp;
  27 +
23 28 int targetCoreTemp;
24 29 int curCoreTemp;
25   - bool door;
  30 +
  31 + int targetHumidity;
  32 +
  33 + int waterLevel;
  34 + int heater;
  35 +
26 36 QString caption;
  37 +
  38 + bool door;
  39 + bool ssv;
27 40 };
28 41  
29 42 struct AutoCookConfig
... ... @@ -386,10 +399,14 @@ void stamp(QString caption)
386 399 return;
387 400  
388 401 Oven *oven = Oven::getInstance();
  402 + UdpHandler *udp = UdpHandler::getInstance();
389 403  
390 404 Stamp s;
391 405 s.time = QDateTime::currentDateTime();
392   - s.temp = oven->currentTemp();
  406 + s.remainingTime = oven->time();
  407 +
  408 + s.targetTemp = oven->temp();
  409 + s.curTemp = oven->currentTemp();
393 410  
394 411 if (oven->interTempEnabled())
395 412 {
... ... @@ -402,9 +419,15 @@ void stamp(QString caption)
402 419 s.curCoreTemp = 0;
403 420 }
404 421  
  422 + s.targetHumidity = oven->humidity();
  423 +
405 424 s.door = oven->door();
406 425 s.caption = caption;
407 426  
  427 + s.waterLevel = udp->waterLevel();
  428 + s.ssv = udp->ssv();
  429 + s.heater = udp->heater();
  430 +
408 431 data.records.append(s);
409 432  
410 433 lastDoor = oven->door();
... ... @@ -519,11 +542,17 @@ void saveData()
519 542 << "#2,Inner Tank Temp\n"
520 543 << "#3,Food Temp (Target)\n"
521 544 << "#4,Food Temp\n"
522   - << "#5,Door Open / Closed\n";
  545 + << "#5,Door Open / Closed\n"
  546 + << "#6,Humidity (Target)\n"
  547 + << "#7,Temp (Target)\n"
  548 + << "#8,Time (Target)\n"
  549 + << "#9,Water Level\n"
  550 + << "#10,Valve\n"
  551 + << "#11,Heater\n";
523 552  
524 553 stream << "\n";
525 554  
526   - stream << "#1,#2,#3,#4,#5\n";
  555 + stream << "#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11\n";
527 556 for (int i = 0; i < data.records.size(); i++)
528 557 {
529 558 const Stamp &s = data.records.at(i);
... ... @@ -534,7 +563,7 @@ void saveData()
534 563 int secs = data.startedAt.secsTo(s.time);
535 564 int nextSecs = data.startedAt.secsTo(n.time);
536 565 if (secs == nextSecs
537   - && s.temp == n.temp
  566 + && s.curTemp == n.curTemp
538 567 && s.targetCoreTemp == n.targetCoreTemp
539 568 && s.curCoreTemp == n.curCoreTemp
540 569 && s.door == n.door)
... ... @@ -552,10 +581,21 @@ void saveData()
552 581 stream << s.caption << "\n";
553 582  
554 583 stream << Stringer::timeSecs(data.startedAt.secsTo(s.time)) << ","
555   - << s.temp << ","
  584 + << s.curTemp << ","
556 585 << s.targetCoreTemp << ","
557 586 << s.curCoreTemp << ","
558   - << (s.door ? "O\n" : "C\n");
  587 + << (s.door ? "O," : "C,")
  588 + << s.targetHumidity << ","
  589 + << s.targetTemp << ","
  590 + << Stringer::timeSecs(s.remainingTime) << ","
  591 + << (s.waterLevel == 3 ? "H," :
  592 + s.waterLevel == 1 ? "C," :
  593 + s.waterLevel == 0 ? "L," : "E,")
  594 + << (s.ssv ? "O," : "C,")
  595 + << (s.heater & 0x01 ? "1" : "0")
  596 + << (s.heater & 0x02 ? "1" : "0")
  597 + << (s.heater & 0x04 ? "1" : "0")
  598 + << (s.heater & 0x08 ? "1" : "0") << "\n";
559 599 }
560 600  
561 601 if (!data.autoConfig.isEmpty())
... ... @@ -620,7 +660,7 @@ void check()
620 660 if (oven->door() != lastDoor)
621 661 stamp();
622 662  
623   - if (lastStampedTime.elapsed() > 60 * 1000 - 100)
  663 + if (lastStampedTime.elapsed() > 30 * 1000 - 100)
624 664 stamp();
625 665 }
626 666  
... ...
app/gui/oven_control/ovenstatics.cpp
... ... @@ -542,8 +542,8 @@ void OvenStatistics::oneSecTimerFired(void){
542 542 realdata.b.wsv_open = (state.onoff_state2&LOAD_STATE2_WSV)==0?0:1;
543 543 realdata.b.ssv_open = (state.onoff_state2&LOAD_STATE2_SSV)==0?0:1;
544 544  
545   - if( (state.reserved11&0x0018) == 0x0018) realdata.b.water_level = water_level_high;
546   - else if( (state.reserved11&0x0018) == 0x0000) realdata.b.water_level = water_level_low;
  545 + if( (state.water_level&0x0018) == 0x0018) realdata.b.water_level = water_level_high;
  546 + else if( (state.water_level&0x0018) == 0x0000) realdata.b.water_level = water_level_low;
547 547 else realdata.b.water_level = water_level_normal;
548 548  
549 549 if(srvdata->sensor_log.items.B1.high_temp.itemp < state.sensor1 ){
... ...
app/gui/oven_control/udphandler.h
... ... @@ -55,7 +55,15 @@ public:
55 55 bool unp() { return (state.onoff_state2 & 0x0200) != 0; }
56 56 bool hdm() { return (state.onoff_state2 & 0x0400) != 0; }
57 57 bool sgnv() { return (state.onoff_state2 & 0x0800) != 0; }
58   - bool inv() {return (state.onoff_state2 & 0x1000) !=0; }
  58 + bool inv() { return (state.onoff_state2 & 0x1000) !=0; }
  59 +
  60 + // 3: H, 2: Error, 1: C, 0: L
  61 + int waterLevel() {
  62 + return ((state.water_level & 0x08) >> 2)
  63 + | ((state.water_level & 0x10) >> 4);
  64 + }
  65 +
  66 + int heater() { return (state.onoff_relay_load2 & 0x0F); }
59 67  
60 68 signals:
61 69 void changed();
... ...