|
|
@@ -6,7 +6,7 @@
|
|
|
|
|
|
#include "Globals.h"
|
|
|
#include "LanguageManager.h"
|
|
|
-#include "FunctionTimer.h"
|
|
|
+#include "ConfigManager.h"
|
|
|
|
|
|
FormStandby::FormStandby(QWidget *parent)
|
|
|
: QWidget(parent)
|
|
|
@@ -33,6 +33,16 @@ void FormStandby::initWidget()
|
|
|
m_price->setParent(this);
|
|
|
m_price->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
|
|
m_price->setWindowModality(Qt::WindowModal);
|
|
|
+
|
|
|
+ m_ccu_cfg = ConfigManager::instance()->ccu_cfg();
|
|
|
+ refreshDisplay();
|
|
|
+
|
|
|
+ connect(GLOBALS, &Globals::ccuConfigValueChanged, this, [this](const CCU_CFG& ccu_cfg) {
|
|
|
+ if (m_ccu_cfg.GUN_Numb != ccu_cfg.GUN_Numb) {
|
|
|
+ m_ccu_cfg = ccu_cfg;
|
|
|
+ refreshDisplay();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
void FormStandby::initConnect()
|
|
|
@@ -40,10 +50,6 @@ void FormStandby::initConnect()
|
|
|
connect(ui->gun_widget_1, &FormGunDetail::signalControlAuth, ui->gun_widget_1, &FormGunDetail::slotParseControlAuth);
|
|
|
connect(ui->gun_widget_2, &FormGunDetail::signalControlAuth, ui->gun_widget_2, &FormGunDetail::slotParseControlAuth);
|
|
|
|
|
|
- connect(GLOBALS, &Globals::ccuConfigValueChanged, this, [this](const CCU_CFG& value) {
|
|
|
- ui->gun_widget_2->setVisible(value.GUN_Numb == CHARGE_GUN_DEFAULT_2);
|
|
|
- });
|
|
|
-
|
|
|
connect(ui->gun_widget_1, &FormGunDetail::showPrice, this, [this]() {
|
|
|
if (m_price) m_price->show();
|
|
|
});
|
|
|
@@ -54,3 +60,19 @@ void FormStandby::initConnect()
|
|
|
connect(LanguageManager::instance(), &LanguageManager::languageChanged, this, [this]() { ui->retranslateUi(this); });
|
|
|
}
|
|
|
|
|
|
+void FormStandby::refreshDisplay()
|
|
|
+{
|
|
|
+ switch (m_ccu_cfg.GUN_Numb) {
|
|
|
+ case CHARGE_GUN_DEFAULT_1:
|
|
|
+ ui->gun_widget_1->setVisible(true);
|
|
|
+ ui->gun_widget_2->setVisible(false);
|
|
|
+ break;
|
|
|
+ case CHARGE_GUN_DEFAULT_2:
|
|
|
+ ui->gun_widget_1->setVisible(true);
|
|
|
+ ui->gun_widget_2->setVisible(true);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|