Blame view

app/gui/oven_control/waterlevelicon.cpp 612 Bytes
5f017a9d7   김태훈   요청 사항 반영
1
2
3
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
  #include "waterlevelicon.h"
  
  #include "udphandler.h"
  
  WaterLevelIcon::WaterLevelIcon(QWidget *parent) : QLabel(parent)
  {
      connect(&timer, SIGNAL(timeout()), SLOT(check()));
      timer.start(1000);
  
      check();
  }
  
  void WaterLevelIcon::check()
  {
      switch (UdpHandler::getInstance()->waterLevel())
      {
      case 3:
      case 2:
          setPixmap(QPixmap(":/images/symbol/water_level_high.png"));
          break;
      case 1:
          setPixmap(QPixmap(":/images/symbol/water_level_middle.png"));
          break;
      case 0:
          setPixmap(QPixmap(":/images/symbol/water_level_low.png"));
          break;
      }
  }