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,7 +502,6 @@ static void on_rcv_status( void){
502 502
503 printf( "onoff_state1 = 0x%04x\n", oven.state.onoff_state1); 503 printf( "onoff_state1 = 0x%04x\n", oven.state.onoff_state1);
504 printf( "onoff_state2 = 0x%04x\n", oven.state.onoff_state2); 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 // GUI로 전송 506 // GUI로 전송
508 gui_send_data_to_gui( ( char *)&oven, sizeof( gui_oven_state_t)); 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,7 +186,7 @@ typedef struct {
186 U16 cleaning_sec; // 0E 186 U16 cleaning_sec; // 0E
187 U16 cleaning_min; // 0F 187 U16 cleaning_min; // 0F
188 U16 door_state; // 10 188 U16 door_state; // 10
189 - U16 reserved11; // 11 189 + U16 water_level; // 11
190 U16 burner1_rpm; // 12 190 U16 burner1_rpm; // 12
191 U16 burner2_rpm; // 13 191 U16 burner2_rpm; // 13
192 U16 burner3_rpm; // 14 192 U16 burner3_rpm; // 14
@@ -212,9 +212,9 @@ typedef struct { @@ -212,9 +212,9 @@ typedef struct {
212 I16 sensor14; // 28 212 I16 sensor14; // 28
213 U16 sensor15; // 29 213 U16 sensor15; // 29
214 U16 sensor16; // 2A 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 U16 system_error; // 2E 218 U16 system_error; // 2E
219 U16 communication_error; // 2F 219 U16 communication_error; // 2F
220 U16 sensor_error; // 30 220 U16 sensor_error; // 30
app/gui/oven_control/haccp.cpp
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 #include "stringer.h" 10 #include "stringer.h"
11 #include "oven.h" 11 #include "oven.h"
12 #include "config.h" 12 #include "config.h"
  13 +#include "udphandler.h"
13 14
14 namespace 15 namespace
15 { 16 {
@@ -19,11 +20,23 @@ enum Type { Invalid, Manual, Auto, Multi, Wash, Engineering }; @@ -19,11 +20,23 @@ enum Type { Invalid, Manual, Auto, Multi, Wash, Engineering };
19 struct Stamp 20 struct Stamp
20 { 21 {
21 QDateTime time; 22 QDateTime time;
22 - int temp; 23 + int remainingTime;
  24 +
  25 + int targetTemp;
  26 + int curTemp;
  27 +
23 int targetCoreTemp; 28 int targetCoreTemp;
24 int curCoreTemp; 29 int curCoreTemp;
25 - bool door; 30 +
  31 + int targetHumidity;
  32 +
  33 + int waterLevel;
  34 + int heater;
  35 +
26 QString caption; 36 QString caption;
  37 +
  38 + bool door;
  39 + bool ssv;
27 }; 40 };
28 41
29 struct AutoCookConfig 42 struct AutoCookConfig
@@ -386,10 +399,14 @@ void stamp(QString caption) @@ -386,10 +399,14 @@ void stamp(QString caption)
386 return; 399 return;
387 400
388 Oven *oven = Oven::getInstance(); 401 Oven *oven = Oven::getInstance();
  402 + UdpHandler *udp = UdpHandler::getInstance();
389 403
390 Stamp s; 404 Stamp s;
391 s.time = QDateTime::currentDateTime(); 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 if (oven->interTempEnabled()) 411 if (oven->interTempEnabled())
395 { 412 {
@@ -402,9 +419,15 @@ void stamp(QString caption) @@ -402,9 +419,15 @@ void stamp(QString caption)
402 s.curCoreTemp = 0; 419 s.curCoreTemp = 0;
403 } 420 }
404 421
  422 + s.targetHumidity = oven->humidity();
  423 +
405 s.door = oven->door(); 424 s.door = oven->door();
406 s.caption = caption; 425 s.caption = caption;
407 426
  427 + s.waterLevel = udp->waterLevel();
  428 + s.ssv = udp->ssv();
  429 + s.heater = udp->heater();
  430 +
408 data.records.append(s); 431 data.records.append(s);
409 432
410 lastDoor = oven->door(); 433 lastDoor = oven->door();
@@ -519,11 +542,17 @@ void saveData() @@ -519,11 +542,17 @@ void saveData()
519 << "#2,Inner Tank Temp\n" 542 << "#2,Inner Tank Temp\n"
520 << "#3,Food Temp (Target)\n" 543 << "#3,Food Temp (Target)\n"
521 << "#4,Food Temp\n" 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 stream << "\n"; 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 for (int i = 0; i < data.records.size(); i++) 556 for (int i = 0; i < data.records.size(); i++)
528 { 557 {
529 const Stamp &s = data.records.at(i); 558 const Stamp &s = data.records.at(i);
@@ -534,7 +563,7 @@ void saveData() @@ -534,7 +563,7 @@ void saveData()
534 int secs = data.startedAt.secsTo(s.time); 563 int secs = data.startedAt.secsTo(s.time);
535 int nextSecs = data.startedAt.secsTo(n.time); 564 int nextSecs = data.startedAt.secsTo(n.time);
536 if (secs == nextSecs 565 if (secs == nextSecs
537 - && s.temp == n.temp 566 + && s.curTemp == n.curTemp
538 && s.targetCoreTemp == n.targetCoreTemp 567 && s.targetCoreTemp == n.targetCoreTemp
539 && s.curCoreTemp == n.curCoreTemp 568 && s.curCoreTemp == n.curCoreTemp
540 && s.door == n.door) 569 && s.door == n.door)
@@ -552,10 +581,21 @@ void saveData() @@ -552,10 +581,21 @@ void saveData()
552 stream << s.caption << "\n"; 581 stream << s.caption << "\n";
553 582
554 stream << Stringer::timeSecs(data.startedAt.secsTo(s.time)) << "," 583 stream << Stringer::timeSecs(data.startedAt.secsTo(s.time)) << ","
555 - << s.temp << "," 584 + << s.curTemp << ","
556 << s.targetCoreTemp << "," 585 << s.targetCoreTemp << ","
557 << s.curCoreTemp << "," 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 if (!data.autoConfig.isEmpty()) 601 if (!data.autoConfig.isEmpty())
@@ -620,7 +660,7 @@ void check() @@ -620,7 +660,7 @@ void check()
620 if (oven->door() != lastDoor) 660 if (oven->door() != lastDoor)
621 stamp(); 661 stamp();
622 662
623 - if (lastStampedTime.elapsed() > 60 * 1000 - 100) 663 + if (lastStampedTime.elapsed() > 30 * 1000 - 100)
624 stamp(); 664 stamp();
625 } 665 }
626 666
app/gui/oven_control/ovenstatics.cpp
@@ -542,8 +542,8 @@ void OvenStatistics::oneSecTimerFired(void){ @@ -542,8 +542,8 @@ void OvenStatistics::oneSecTimerFired(void){
542 realdata.b.wsv_open = (state.onoff_state2&LOAD_STATE2_WSV)==0?0:1; 542 realdata.b.wsv_open = (state.onoff_state2&LOAD_STATE2_WSV)==0?0:1;
543 realdata.b.ssv_open = (state.onoff_state2&LOAD_STATE2_SSV)==0?0:1; 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 else realdata.b.water_level = water_level_normal; 547 else realdata.b.water_level = water_level_normal;
548 548
549 if(srvdata->sensor_log.items.B1.high_temp.itemp < state.sensor1 ){ 549 if(srvdata->sensor_log.items.B1.high_temp.itemp < state.sensor1 ){
app/gui/oven_control/udphandler.h
@@ -55,7 +55,15 @@ public: @@ -55,7 +55,15 @@ public:
55 bool unp() { return (state.onoff_state2 & 0x0200) != 0; } 55 bool unp() { return (state.onoff_state2 & 0x0200) != 0; }
56 bool hdm() { return (state.onoff_state2 & 0x0400) != 0; } 56 bool hdm() { return (state.onoff_state2 & 0x0400) != 0; }
57 bool sgnv() { return (state.onoff_state2 & 0x0800) != 0; } 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 signals: 68 signals:
61 void changed(); 69 void changed();