Commit dedc5eee3fddb292d7e3dca26925bc0ad497d086

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

프로토콜 변경 반영

- 요리 모드 설정 추가
app/app-prime-modbus/app/app-prime-modbus/rs485_serial.c
... ... @@ -225,6 +225,7 @@ static void set_value( command_t *pcmd){
225 225 case TG_TIME : addr = 0x0b; break;
226 226 case TG_CONV_RPM : addr = 0x0f; break;
227 227 case TG_INNER_TEMP : addr = 0x11; break;
  228 + case TG_COOK_MODE : addr = 0x13; break;
228 229 case TG_CLEAN_TYPE : addr = 0x14; break;
229 230 case TG_BUNNER1_RPM : addr = 0x1a; break;
230 231 case TG_BUNNER2_RPM : addr = 0x1b; break;
... ...
app/app-prime-modbus/include/all_share.h
... ... @@ -37,6 +37,7 @@ enum target_value_t {
37 37 TG_TIME,
38 38 TG_CONV_RPM,
39 39 TG_INNER_TEMP,
  40 + TG_COOK_MODE,
40 41 TG_CLEAN_TYPE,
41 42 TG_BUNNER1_RPM,
42 43 TG_BUNNER2_RPM,
... ... @@ -127,7 +128,7 @@ typedef struct {
127 128 U16 cooldown; // 10
128 129 I16 inner_temp; // 11
129 130 U16 reserved12; // 12
130   - U16 reserved13; // 13
  131 + U16 cook_mode; // 13
131 132 U16 clean_type; // 14
132 133 U16 clean_total; // 15
133 134 U16 clean_step; // 16
... ...
app/gui/oven_control/oven.cpp
... ... @@ -72,6 +72,20 @@ bool Oven::setMode_(Mode mode)
72 72 if (mode != mode_)
73 73 {
74 74 mode_ = mode;
  75 +
  76 + switch (mode)
  77 + {
  78 + case HeatMode:
  79 + interface->setMode(Define::DryMode);
  80 + break;
  81 + case SteamMode:
  82 + interface->setMode(Define::SteamMode);
  83 + break;
  84 + case CombinationMode:
  85 + interface->setMode(Define::CombiMode);
  86 + break;
  87 + }
  88 +
75 89 return true;
76 90 }
77 91  
... ...
app/gui/oven_control/oven.h
... ... @@ -5,6 +5,8 @@
5 5 #include <QTimer>
6 6 #include <QTime>
7 7  
  8 +#include "define.h"
  9 +
8 10 class OvenInterface : public QObject
9 11 {
10 12 Q_OBJECT
... ... @@ -22,7 +24,7 @@ signals:
22 24 void doorClosed();
23 25  
24 26 public slots:
25   -// virtual void setMode(Oven::Mode mode) = 0;
  27 + virtual void setMode(Define::Mode mode) = 0;
26 28 virtual void setHumidity(int percentage) = 0;
27 29 virtual void setTemp(int celsius) = 0;
28 30 virtual void setTime(int secs) = 0;
... ...
app/gui/oven_control/ovencontroller.cpp
... ... @@ -57,6 +57,28 @@ bool OvenController::door()
57 57 return state.door_state != 0;
58 58 }
59 59  
  60 +void OvenController::setMode(Define::Mode mode)
  61 +{
  62 + int m;
  63 + switch (mode)
  64 + {
  65 + case Define::SteamMode:
  66 + m = 2;
  67 + break;
  68 + case Define::DryMode:
  69 + m = 0;
  70 + break;
  71 + case Define::CombiMode:
  72 + m = 1;
  73 + break;
  74 + default:
  75 + return;
  76 + }
  77 +
  78 + qDebug() << "Set Mode" << m;
  79 + udp->set(TG_COOK_MODE, m);
  80 +}
  81 +
60 82 void OvenController::setHumidity(int percentage)
61 83 {
62 84 qDebug() << "Set Humidity" << percentage;
... ...
app/gui/oven_control/ovencontroller.h
... ... @@ -24,6 +24,7 @@ public:
24 24 bool door();
25 25  
26 26 public slots:
  27 + void setMode(Define::Mode mode);
27 28 void setHumidity(int percentage);
28 29 void setTemp(int celsius);
29 30 void setTime(int secs);
... ...