Skip to content

Commit 2678dcb

Browse files
committed
iioExplorer: Rewrite CliDetailsView to query libiio directly.
Replace tree-model walking with direct libiio API calls for the IIO View tab. This decouples the view from IIOWidget state — attribute values are always read live from the device regardless of whether widgets have been created. Run text generation on a background thread via QtConcurrent to avoid blocking the UI on device-heavy contexts. All append methods use local variables for thread safety. Signed-off-by: andreidanila1 <andrei.danila@analog.com>
1 parent 29055f3 commit 2678dcb

File tree

2 files changed

+250
-192
lines changed

2 files changed

+250
-192
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

0 commit comments

Comments
 (0)