Skip to content

Commit

Permalink
debugger: Add context attributes in info page
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei-Fabian-Pop <[email protected]>
  • Loading branch information
Andrei-Fabian-Pop committed Sep 20, 2024
1 parent fa0c942 commit accf0e9
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion plugins/debugger/src/debuggerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <core/detachedtoolwindowmanager.h>
#include <iioutil/connectionprovider.h>
#include <pluginbase/preferences.h>
#include <gui/infopage.h>

using namespace scopy;
using namespace scopy::debugger;
Expand Down Expand Up @@ -102,7 +103,27 @@ bool DebuggerPlugin::loadPage()
{
m_page = new QWidget();
QVBoxLayout *lay = new QVBoxLayout(m_page);
lay->addWidget(new QLabel("IIO Debugger plugin", m_page));
// m_page->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

InfoPage *info = new InfoPage(m_page);
info->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
lay->addWidget(info);
lay->addItem(new QSpacerItem(0, 0, QSizePolicy::Preferred, QSizePolicy::Expanding));

ConnectionProvider *c = ConnectionProvider::GetInstance();
Connection *conn = c->open(m_param);

const char *name;
const char *value;
for(int i = 0; i < iio_context_get_attrs_count(conn->context()); ++i) {
int ret = iio_context_get_attr(conn->context(), i, &name, &value);
if(ret != 0)
continue;

info->update(name, value);
}
c->close(m_param);

return true;
}

Expand Down

0 comments on commit accf0e9

Please sign in to comment.