Skip to content

Commit 46e25c8

Browse files
committed
iioExplorer: Build attribute tree eagerly; query libiio in CliDetailsView.
Create all device/channel attribute items at connection time without constructing IIOWidgets, so the tree is fully populated for search immediately. Rewrite CliDetailsView to query libiio directly on a background thread instead of reading from IIOWidget data strategies. Signed-off-by: andreidanila1 <andrei.danila@analog.com>
1 parent fc1511d commit 46e25c8

File tree

5 files changed

+332
-288
lines changed

5 files changed

+332
-288
lines changed

packages/generic-plugins/plugins/debugger/include/debugger/clidetailsview.h

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
#include <QWidget>
2626
#include <QTextBrowser>
27+
#include <QFutureWatcher>
28+
#include <iio.h>
2729
#include "iiostandarditem.h"
2830

2931
namespace scopy::debugger {
@@ -35,38 +37,24 @@ class CliDetailsView : public QWidget
3537
void setIIOStandardItem(IIOStandardItem *item);
3638
void refreshView();
3739

38-
Q_SIGNALS:
39-
void addToWatchlist(IIOStandardItem *item);
40-
void removeFromWatchlist(IIOStandardItem *item);
41-
4240
private:
4341
void setupUi();
44-
void setupChannelAttr();
45-
void setupChannel();
46-
void setupDeviceAttr();
47-
void setupDevice();
48-
void setupContextAttr();
49-
void setupContext();
50-
51-
QString tabs(int level);
42+
QString buildText(IIOStandardItem *item);
5243

53-
IIOStandardItem *m_currentItem;
54-
QTextBrowser *m_textBrowser;
44+
void appendContextInfo(struct iio_context *ctx, QString &text, int globalLevel);
45+
void appendDeviceInfo(struct iio_device *dev, QString &text, int globalLevel);
46+
void appendChannelInfo(struct iio_channel *ch, QString &text, int globalLevel);
5547

56-
// used for creating the iio info view
57-
IIOStandardItem *m_channelIIOItem;
58-
IIOStandardItem *m_deviceIIOItem;
59-
IIOStandardItem *m_contextIIOItem;
48+
QString readDeviceAttr(struct iio_device *dev, const char *attr, bool isDebug);
49+
QString readChannelAttr(struct iio_channel *ch, const char *attr);
50+
QString channelFormatString(struct iio_channel *ch);
51+
QString triggerStatusString(struct iio_device *dev);
6052

61-
QString m_currentText;
62-
QString m_deviceAttrsString;
53+
static QString tabs(int level, int globalLevel);
6354

64-
int m_noCtxAttributes;
65-
int m_noDevices;
66-
int m_noDevAttributes;
67-
int m_noChannels;
68-
int m_noChnlAttributes;
69-
int m_globalLevel;
55+
IIOStandardItem *m_currentItem;
56+
QTextBrowser *m_textBrowser;
57+
bool m_includeDebugAttrs;
7058
};
7159
} // namespace scopy::debugger
7260

packages/generic-plugins/plugins/debugger/include/debugger/iiomodel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ class IIOModel : public QObject
5151
void setupCtx();
5252
void generateCtxAttributes();
5353
void setupCurrentDevice();
54+
void generateDeviceAttributes();
5455
void setupCurrentChannel();
56+
void generateChannelAttributes();
5557
void populateDeviceChildren(IIOStandardItem *item);
5658
void populateChannelChildren(IIOStandardItem *item);
57-
void buildEntries();
58-
QStandardItem *createPlaceholderItem();
5959

6060
/**
6161
* @brief Creates a new IIOStandardItem and connects it to the emitLog signal.

0 commit comments

Comments
 (0)