MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / getToolsForPlugin

Method getToolsForPlugin

core/src/scopymainwindow_api.cpp:338–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338QStringList ScopyMainWindow_API::getToolsForPlugin(QString plugin)
339{
340 Q_ASSERT(m_w->dm != nullptr);
341 QString devID = "";
342 QStringList resultList;
343 if(!m_w->dm->connectedDev.isEmpty()) {
344 devID = m_w->dm->connectedDev.back();
345 } else {
346 qWarning(CAT_SCOPY_API) << "No device connected";
347 return resultList;
348 }
349 Device *dev = m_w->dm->getDevice(devID);
350 if(dev) {
351 QList<ToolMenuEntry *> toolList = dev->toolList();
352 for(int i = 0; i < toolList.size(); i++) {
353 if(toolList[i]->pluginName() == plugin) {
354 resultList.append(toolList[i]->name());
355 }
356 }
357 } else {
358 qWarning(CAT_SCOPY_API) << "Device with id " << devID << " is not available!";
359 }
360 return resultList;
361}
362
363QPair<QString, QVariant> ScopyMainWindow_API::getPreference(QString prefName)
364{

Callers 2

switchToolsPluginTestFunction · 0.80
runAllPluginToolsTestFunction · 0.80

Calls 4

appendMethod · 0.80
getDeviceMethod · 0.45
toolListMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected