diff --git a/plugins/adc/src/time/grdevicecomponent.cpp b/plugins/adc/src/time/grdevicecomponent.cpp index 7f67c29e71..ba60e13f02 100644 --- a/plugins/adc/src/time/grdevicecomponent.cpp +++ b/plugins/adc/src/time/grdevicecomponent.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include using namespace scopy; using namespace scopy::adc; @@ -34,11 +34,16 @@ QWidget *GRDeviceComponent::createAttrMenu(QWidget *parent) { MenuSectionCollapseWidget *attr = new MenuSectionCollapseWidget("ATTRIBUTES", MenuCollapseSection::MHCW_NONE, parent); - QList attrWidgets = IIOWidgetFactory::buildAllAttrsForDevice(m_src->iioDev()); + + QList attrWidgets = IIOWidgetBuilder().device(m_src->iioDev()).buildAll(); const struct iio_context *ctx = iio_device_get_context(m_src->iioDev()); - attrWidgets.append(IIOWidgetFactory::buildSingle( - IIOWidgetFactory::ComboUi | IIOWidgetFactory::TriggerData, - {.context = const_cast(ctx), .device = m_src->iioDev(), .data = "Triggers"})); + attrWidgets.append(IIOWidgetBuilder() + .context(const_cast(ctx)) + .device(m_src->iioDev()) + .attribute("Triggers") + .uiStrategy(IIOWidgetBuilder::UIS::ComboUi) + .dataStrategy(IIOWidgetBuilder::DS::TriggerData) + .buildSingle()); auto layout = new QVBoxLayout(); layout->setSpacing(10); diff --git a/plugins/adc/src/time/grtimechannelcomponent.cpp b/plugins/adc/src/time/grtimechannelcomponent.cpp index 5bef2b84a5..917fba68ae 100644 --- a/plugins/adc/src/time/grtimechannelcomponent.cpp +++ b/plugins/adc/src/time/grtimechannelcomponent.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include @@ -66,7 +66,10 @@ QWidget *GRTimeChannelComponent::createYAxisMenu(QWidget *parent) m_scaleWidget = nullptr; if(m_scaleAvailable) { cb->addItem(m_unit, YMODE_SCALE); - m_scaleWidget = IIOWidgetFactory::buildAttrForChannel(m_src->channel(), m_src->scaleAttribute(), this); + m_scaleWidget = IIOWidgetBuilder() + .channel(m_src->channel()) + .attribute(m_src->scaleAttribute()) + .buildSingle(); } m_yCtrl = new MenuPlotAxisRangeControl(m_plotChannelCmpt->m_timePlotYAxis, m_yaxisMenu); @@ -173,7 +176,7 @@ QWidget *GRTimeChannelComponent::createAttrMenu(QWidget *parent) { MenuSectionCollapseWidget *section = new MenuSectionCollapseWidget("ATTRIBUTES", MenuCollapseSection::MHCW_NONE, parent); - QList attrWidgets = IIOWidgetFactory::buildAllAttrsForChannel(m_src->channel()); + QList attrWidgets = IIOWidgetBuilder().channel(m_src->channel()).buildAll(); auto layout = new QVBoxLayout(); layout->setSpacing(10); @@ -264,6 +267,8 @@ void GRTimeChannelComponent::setYModeHelper(YMode mode) ymax = (1 << (fmt->bits)); } + scale = scale / 1000.0; // target value is in mV + ymin = ymin * scale; ymax = ymax * scale;