diff --git a/gui/widgets/loopCtrl/loopCtrl.hpp b/gui/widgets/loopCtrl/loopCtrl.hpp index 61d89a0dc..c0d9ea36c 100644 --- a/gui/widgets/loopCtrl/loopCtrl.hpp +++ b/gui/widgets/loopCtrl/loopCtrl.hpp @@ -109,8 +109,8 @@ loopCtrl::loopCtrl( std::string & procName, ui.slider_loop->setup(m_procName, "loop_state", "toggle", ""); ui.slider_loop->setStretch(0,0,10, true, true); - ui.gainCtrl->setup(m_procName, "loop_gain", "Global Gain", -1, -1); - ui.mcCtrl->setup(m_procName, "loop_multcoeff", "Global Mult. Coef.", -1, -1); + ui.gainCtrl->setup(m_procName, "loop_gain", "Gain", -1, -1); + ui.mcCtrl->setup(m_procName, "loop_multcoeff", "Mult. Coef.", -1, -1); ui.mcCtrl->makeMultCoeffCtrl(); if(m_procName == "loloop") m_gainCtrl = "logainctrl"; @@ -415,7 +415,7 @@ void loopCtrl::setupBlocks(int nB) char str[16]; snprintf(str, sizeof(str), "%02d", n); modeTot += m_modes[n]; - m_blockCtrls[n] = new gainCtrl(m_gainCtrl, std::string("block") + str + "_gain", std::string("Block") + str + " Gain", m_modes[n], modeTot); + m_blockCtrls[n] = new gainCtrl(m_gainCtrl, std::string("block") + str + "_gain", "", m_modes[n], modeTot); ui.horizontalLayout_2->addWidget(m_blockCtrls[n]); if(m_parent) m_parent->addSubscriber(m_blockCtrls[n]); } diff --git a/gui/widgets/xWidgets/gainCtrl.hpp b/gui/widgets/xWidgets/gainCtrl.hpp index 71b51ab06..ccc3cd498 100644 --- a/gui/widgets/xWidgets/gainCtrl.hpp +++ b/gui/widgets/xWidgets/gainCtrl.hpp @@ -184,11 +184,16 @@ void gainCtrl::makeMultCoeffCtrl() void gainCtrl::subscribe() { - if(!m_parent) return; + if(!m_parent) return; - if(m_property != "") m_parent->addSubscriberProperty(this, m_device, m_property); + if(m_property != "") + { + m_parent->addSubscriberProperty(this, m_device, m_property); - m_parent->addSubscriber(ui.status); + //m_parent->addSubscriberProperty(this, m_device, m_property + "_name"); + } + + m_parent->addSubscriber(ui.status); return; } @@ -234,9 +239,42 @@ void gainCtrl::handleSetProperty( const pcf::IndiProperty & ipRecv) { m_target = ipRecv["target"].get(); } + + if(m_label == "") + { + m_label = ipRecv.getLabel(); + + size_t ssp = m_label.find(" Gain"); + if(ssp == std::string::npos) + { + ssp = m_label.find(" Mult"); + } + if(ssp == std::string::npos) + { + ssp = m_label.find(" Limit"); + } + + if(ssp == std::string::npos) + { + ui.label->setText(m_label.c_str()); + } + else + { + ui.label->setText(m_label.substr(0,ssp).c_str()); + } + } } } + /*if(ipRecv.getName() == m_property + "_name") + { + if(ipRecv.find("value")) + { + std::cerr << ipRecv["value"].get() << "\n"; + ui.label->setText(ipRecv["value"].get().c_str()); + } + }*/ + updateGUI(); ui.status->handleSetProperty(ipRecv);