Blame view

app/gui/oven_control/ovencontroller.cpp 1.9 KB
8c2952457   김태훈   응용 프로그램 추가
1
  #include "ovencontroller.h"
c598b01b2   김태훈   GUI 업데이트
2
  OvenController::OvenController(QObject *parent) : OvenInterface(parent)
8c2952457   김태훈   응용 프로그램 추가
3
  {
8c2952457   김태훈   응용 프로그램 추가
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  }
  
  void OvenController::setUdpHandler(UdpHandler *udp)
  {
      this->udp = udp;
      connect(udp, SIGNAL(changed()), this, SLOT(onDataChanged()));
  }
  
  void OvenController::onDataChanged()
  {
      udp->fillControl(control);
      udp->fillData(state);
  }
  
  int OvenController::currentTemp()
  {
      return state.curr_heat;
  }
  
  
  int OvenController::currentHumidity()
  {
      return state.curr_humidity;
  }
  
  int OvenController::currentInterTemp()
  {
      return 0;
  }
  
  bool OvenController::door()
  {
      return state.door_state;
  }
  
  void OvenController::setHumidity(int percentage)
  {
      udp->set(TG_HUMIDITY, percentage);
  }
  
  void OvenController::setTemp(int celsius)
  {
      udp->set(TG_HEAT, celsius);
  }
43d009fb5   김태훈   오븐 제어 인터페이스에 시간 설...
48
49
50
51
  void OvenController::setTime(int secs)
  {
      udp->set(TG_TIME, secs);
  }
8c2952457   김태훈   응용 프로그램 추가
52
53
54
55
56
57
58
59
60
61
62
63
64
  void OvenController::setInterTemp(int celsius)
  {
      udp->set(TG_INNER_TEMP, celsius);
  }
  
  void OvenController::setFan(int rpm)
  {
      udp->set(TG_CONV_RPM, rpm);
  }
  
  void OvenController::startCooking()
  {
      udp->set(TG_OVEN_MODE, 1);
366850165   김태훈   연동 시험 결과 반영
65
      udp->set(TG_TIME, 1440);
8c2952457   김태훈   응용 프로그램 추가
66
67
68
69
70
71
72
73
74
75
76
77
      udp->turnOn(TG_SYSTEM);
      udp->turnOn(TG_COOKING);
  }
  
  void OvenController::stopCooking()
  {
      udp->turnOff(TG_COOKING);
  }
  
  void OvenController::startPreheating()
  {
      udp->set(TG_OVEN_MODE, 0);
99b8066f4   김태훈   V0.1.1
78
      udp->set(TG_TIME, 1440);
8c2952457   김태훈   응용 프로그램 추가
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
      udp->turnOn(TG_SYSTEM);
      udp->turnOn(TG_PREHEAT);
  }
  
  void OvenController::stopPreheating()
  {
      udp->turnOff(TG_PREHEAT);
  }
  
  void OvenController::startCooldown()
  {
      udp->turnOn(TG_COOLDOWN);
  }
  
  void OvenController::stopCooldown()
  {
      udp->turnOff(TG_COOLDOWN);
  }
  
  void OvenController::startHumidification()
  {
      udp->turnOn(TG_INNERWATER);
  }
  
  void OvenController::stopHumidification()
  {
      udp->turnOff(TG_INNERWATER);
  }
  
  void OvenController::startWashing()
  {
  
  }
  
  void OvenController::stopWashing()
  {
  
  }
  
  void OvenController::openDamper()
  {
  
  }
  
  void OvenController::closeDamper()
  {
  
  }