Skip to content

Commit 1f9c197

Browse files
Qt: TCP: limit selectable probes to certified ones
Solum requires the correct probe to be set via solumLoadApplication() for image acquisition to work.
1 parent 1fb2672 commit 1f9c197

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

examples/solum_qt/solumqt.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Solum::Solum(QWidget *parent) : QMainWindow(parent), connected_(false), imaging_
7272
}
7373

7474
certified_.clear();
75+
QStringList probeModels;
7576
auto json = doc.object();
7677
if (json.contains("results") && json["results"].isArray())
7778
{
@@ -88,12 +89,19 @@ Solum::Solum(QWidget *parent) : QMainWindow(parent), connected_(false), imaging_
8889
if (!serial.isEmpty())
8990
certified_[serial] = probe["crt"].toString();
9091
}
92+
if (device.contains("model"))
93+
{
94+
auto model = device["model"].toString();
95+
if (!model.isEmpty() && probesSupported_.contains(model))
96+
probeModels.push_back(model);
97+
}
9198
}
9299
}
93100

94101
addStatus(QStringLiteral("(Cloud) Found %1 valid OEM probes").arg(certified_.size()));
95102
ui_.retrieve->ready();
96103
ui_.tcp->setEnabled(true);
104+
loadProbes(probeModels);
97105
}
98106
});
99107

@@ -365,7 +373,7 @@ bool Solum::event(QEvent *event)
365373
{
366374
auto evt = static_cast<event::List*>(event);
367375
if (evt->probes_)
368-
loadProbes(evt->list_);
376+
probesSupported_ = evt->list_;
369377
else
370378
loadApplications(evt->list_);
371379
return true;

examples/solum_qt/solumqt.h

+1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ public slots:
276276
QTimer timer_; ///< timer for updating probe status
277277
QNetworkAccessManager cloud_; ///< for accessing clarius cloud
278278
Ble ble_; ///< bluetooth module
279+
QStringList probesSupported_; ///< result of solumProbes() API call
279280
Probes certified_; ///< list of certified probes
280281
std::unique_ptr<QSettings> settings_; ///< persistent settings
281282
};

examples/solum_qt/solumqt.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ Required for direct connections from proprietary Clarius applications (i.e., not
381381
<item row="3" column="0">
382382
<widget class="QLabel" name="_probeslist">
383383
<property name="text">
384-
<string>Probes</string>
384+
<string>Probe model</string>
385385
</property>
386386
</widget>
387387
</item>

0 commit comments

Comments
 (0)