mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
b client simbase
fix slider/thermo/dial issue with value labels
This commit is contained in:
@@ -179,12 +179,13 @@ void SimulatorBase::process_ui_slider(json &uiItem)
|
|||||||
bool visible = uiItem["visible"];
|
bool visible = uiItem["visible"];
|
||||||
QString unit = QString::fromStdString(uiItem.at("unit"));
|
QString unit = QString::fromStdString(uiItem.at("unit"));
|
||||||
|
|
||||||
if (slider->value() != value)
|
|
||||||
{
|
|
||||||
if (label != nullptr)
|
if (label != nullptr)
|
||||||
{
|
{
|
||||||
label->setText(QString("%0 %1").arg(value).arg(unit));
|
label->setText(QString("%0 %1").arg(value).arg(unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (slider->value() != value)
|
||||||
|
{
|
||||||
slider->setValue(value);
|
slider->setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,12 +223,13 @@ void SimulatorBase::process_ui_dial(json &uiItem)
|
|||||||
bool visible = uiItem["visible"];
|
bool visible = uiItem["visible"];
|
||||||
QString unit = QString::fromStdString(uiItem.at("unit"));
|
QString unit = QString::fromStdString(uiItem.at("unit"));
|
||||||
|
|
||||||
if (dial->value() != value)
|
|
||||||
{
|
|
||||||
if (label != nullptr)
|
if (label != nullptr)
|
||||||
{
|
{
|
||||||
label->setText(QString("%0 %1").arg(value).arg(unit));
|
label->setText(QString("%0 %1").arg(value).arg(unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dial->value() != value)
|
||||||
|
{
|
||||||
dial->setValue(value);
|
dial->setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,12 +261,13 @@ void SimulatorBase::process_ui_thermo(json &uiItem)
|
|||||||
bool visible = uiItem["visible"];
|
bool visible = uiItem["visible"];
|
||||||
QString unit = QString::fromStdString(uiItem.at("unit"));
|
QString unit = QString::fromStdString(uiItem.at("unit"));
|
||||||
|
|
||||||
if (thermo->value() != value)
|
|
||||||
{
|
|
||||||
if (label != nullptr)
|
if (label != nullptr)
|
||||||
{
|
{
|
||||||
label->setText(QString("%0 %1").arg(value).arg(unit));
|
label->setText(QString("%0 %1").arg(value).arg(unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (thermo->value() != value)
|
||||||
|
{
|
||||||
thermo->setValue(value);
|
thermo->setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user