mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
simbase
remove t and d for determining slider or dial
This commit is contained in:
@@ -121,8 +121,6 @@ void SimulatorBase::process_ui_label(json& uiItem)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SimulatorBase::process_ui_slider(json& uiItem)
|
void SimulatorBase::process_ui_slider(json& uiItem)
|
||||||
{
|
|
||||||
if (QString::fromStdString(uiItem["id"]).startsWith('t'))
|
|
||||||
{
|
{
|
||||||
QwtSlider* slider = id_to_slider(QString::fromStdString(uiItem["id"]));
|
QwtSlider* slider = id_to_slider(QString::fromStdString(uiItem["id"]));
|
||||||
QLabel* label = id_to_slider_label(QString::fromStdString(uiItem["id"]));
|
QLabel* label = id_to_slider_label(QString::fromStdString(uiItem["id"]));
|
||||||
@@ -158,36 +156,6 @@ void SimulatorBase::process_ui_slider(json& uiItem)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QString::fromStdString(uiItem["id"]).startsWith('d'))
|
|
||||||
{
|
|
||||||
QwtDial* dial = id_to_dial(QString::fromStdString(uiItem["id"]));
|
|
||||||
QLabel* label = id_to_dial_label(QString::fromStdString(uiItem["id"]));
|
|
||||||
if (dial == nullptr)
|
|
||||||
{
|
|
||||||
QD << "id_to_dial returned null on " << QString::fromStdString(uiItem["id"]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
double value = uiItem["value"];
|
|
||||||
bool visible = uiItem["visible"];
|
|
||||||
|
|
||||||
if (dial->value() != value)
|
|
||||||
{
|
|
||||||
if (label != nullptr)
|
|
||||||
{
|
|
||||||
label->setText(format_dial_value(QString::fromStdString(uiItem["id"]), value));
|
|
||||||
}
|
|
||||||
dial->setValue(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dial->isVisible() != visible)
|
|
||||||
{
|
|
||||||
dial->setVisible(visible);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SimulatorBase::process_ui_textbox(json& uiItem)
|
void SimulatorBase::process_ui_textbox(json& uiItem)
|
||||||
{
|
{
|
||||||
QD << "Not implemented";
|
QD << "Not implemented";
|
||||||
|
|||||||
Reference in New Issue
Block a user