Blame view

app/gui/oven_control/flushwaterwindow.cpp 1.63 KB
e1a76d3eb   김태훈   고객 요청 사항 반영
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  #include "flushwaterwindow.h"
  #include "ui_flushwaterwindow.h"
  
  #include "udphandler.h"
  #include "notipopupdlg.h"
  
  FlushWaterWindow::FlushWaterWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::FlushWaterWindow)
  {
      ui->setupUi(this);
  
      ui->animation->load(":/images/animation/wash_01.png");
      ui->animation->load(":/images/animation/wash_02.png");
      ui->animation->load(":/images/animation/wash_03.png");
      ui->animation->load(":/images/animation/wash_04.png");
      ui->animation->show();
      ui->animation->start(300);
  
  
      UdpHandler *udp = UdpHandler::getInstance();
      udp->set(TG_OVEN_MODE, 4);
      udp->turnOn(TG_MANUAL_RELAY);
      udp->turnOn(TG_DV);
      udp->turnOn(TG_DP);
      udp->turnOn(TG_INV);
      udp->turnOff(TG_SSV);
  
      terminator = new QTimer(this);
      connect(terminator, SIGNAL(timeout()), SLOT(waitUser()));
      terminator->start(60 * 1000);
  
      QTimer *updater = new QTimer(this);
      connect(updater, SIGNAL(timeout()), SLOT(updateGauge()));
      updater->start(300);
  
      ui->progressGauge->setMaximum(terminator->interval());
      ui->progressGauge->setValue(0);
  }
  
  FlushWaterWindow::~FlushWaterWindow()
  {
      delete ui;
  }
  
  void FlushWaterWindow::updateGauge()
  {
      ui->progressGauge->setValue(terminator->interval() - terminator->remainingTime());
  }
  
  void FlushWaterWindow::waitUser()
  {
      UdpHandler *udp = UdpHandler::getInstance();
      udp->turnOff(TG_DP);
      udp->turnOff(TG_INV);
  
      NotiPopupDlg* notidlg = new NotiPopupDlg(this, tr("동파 방지 실행이 완료되었습니다. 전원을 OFF 해주십시오"), tr("취소"));
      notidlg->exec();
  
      deleteLater();
  
      udp->turnOff(TG_MANUAL_RELAY);
  }