Blame view

app/gui/oven_control/ignitionicon.cpp 559 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
  #include "ignitionicon.h"
  
  #include "udphandler.h"
  
  QPixmap *IgnitionIcon::icon = Q_NULLPTR;
  
  IgnitionIcon::IgnitionIcon(QWidget *parent) : QLabel(parent)
  {
      if (icon == Q_NULLPTR)
          icon = new QPixmap(":/images/symbol/inigited.png");
  
      connect(&timer, SIGNAL(timeout()), SLOT(check()));
      timer.start(1000);
  
      setPixmap(*icon);
  
      check();
  }
  
  void IgnitionIcon::check()
  {
      UdpHandler *udp = UdpHandler::getInstance();
      if (udp->burnerState(1) || udp->burnerState(2) || udp->burnerState(3))
          show();
      else
          hide();
  }