Blame view

app/gui/oven_control/config1digitsetandenablesetdlg.cpp 1.24 KB
663943a37   고영탁   설정 기능 마무리 진행 중
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
  #include "config1digitsetandenablesetdlg.h"
  #include "ui_config1digitsetandenablesetdlg.h"
  #include "soundplayer.h"
  
  Config1DigitSetAndEnableSetDlg::Config1DigitSetAndEnableSetDlg(QWidget *parent, uint16_t val) :
      QDialog(parent),
      ui(new Ui::Config1DigitSetAndEnableSetDlg)
  {
      ui->setupUi(this);
      this->setWindowFlags(Qt::FramelessWindowHint);
  
      foreach (QPushButton *button, findChildren<QPushButton *>())
          connect(button, &QPushButton::pressed, SoundPlayer::playClick);
  
      if(val < MIN_MONITORING_VALUE) val = MIN_MONITORING_VALUE;
  
      ui->ctrSpBxValue->setMaximum(MAX_MONITORING_VALUE);
      ui->ctrSpBxValue->setMinimum(MIN_MONITORING_VALUE);
      ui->ctrSpBxValue->setValue(val);
  
      ui->ctrSpBxValue->installEventFilter(this);
  }
  
  Config1DigitSetAndEnableSetDlg::~Config1DigitSetAndEnableSetDlg()
  {
      delete ui;
  }
  
  void Config1DigitSetAndEnableSetDlg::on_ctrBtnOk_clicked()
  {
      m_nResult = result_ok;
      close();
  }
  
  
  
  void Config1DigitSetAndEnableSetDlg::on_ctrBtnOk_2_clicked()
  {
      m_nResult = result_disable;
      close();
  }
  
  void Config1DigitSetAndEnableSetDlg::on_ctrBtnCancel_clicked()
  {
      m_nResult = result_rejected;
      close();
  }
  
  int Config1DigitSetAndEnableSetDlg::getValue(){
      return ui->ctrSpBxValue->value();
  }