Commit 38bd9e271739aea7b0ab6881ae53f7c20fe6e267

Authored by 김태훈
1 parent 9ecdf0853c
Exists in master

점화 아이콘 표시 여부를 전기식/가스식에 따라 다르게 판별

Showing 1 changed file with 27 additions and 1 deletions   Show diff stats
app/gui/oven_control/ignitionicon.cpp
1 #include "ignitionicon.h" 1 #include "ignitionicon.h"
2 2
3 #include "udphandler.h" 3 #include "udphandler.h"
  4 +#include "config.h"
4 5
5 QPixmap *IgnitionIcon::icon = Q_NULLPTR; 6 QPixmap *IgnitionIcon::icon = Q_NULLPTR;
6 7
@@ -16,8 +17,33 @@ IgnitionIcon::IgnitionIcon(QWidget *parent) : QLabel(parent) @@ -16,8 +17,33 @@ IgnitionIcon::IgnitionIcon(QWidget *parent) : QLabel(parent)
16 17
17 void IgnitionIcon::check() 18 void IgnitionIcon::check()
18 { 19 {
  20 + bool ignition = false;
  21 +
19 UdpHandler *udp = UdpHandler::getInstance(); 22 UdpHandler *udp = UdpHandler::getInstance();
20 - if (udp->burnerState(1) || udp->burnerState(2) || udp->burnerState(3) || udp->heater()) 23 +
  24 + switch (Config::getInstance()->getConfigValue(Define::config_model).d32)
  25 + {
  26 + case Define::model_electric_10:
  27 + case Define::model_electric_20:
  28 + case Define::model_electric_24:
  29 + case Define::model_electric_40:
  30 + ignition = udp->heater();
  31 + break;
  32 +
  33 + case Define::model_gas_lpg_10:
  34 + case Define::model_gas_lpg_20:
  35 + case Define::model_gas_lpg_24:
  36 + case Define::model_gas_lpg_40:
  37 +
  38 + case Define::model_gas_lng_10:
  39 + case Define::model_gas_lng_20:
  40 + case Define::model_gas_lng_24:
  41 + case Define::model_gas_lng_40:
  42 + ignition = udp->burnerState(1) || udp->burnerState(2) || udp->burnerState(3);
  43 + break;
  44 + }
  45 +
  46 + if (ignition)
21 show(); 47 show();
22 else 48 else
23 hide(); 49 hide();