Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for selecting the debugger version #1661

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
preferences: Add option for selecting the debugger version
The preferences page now contains a checkbox that when selected
(true) will only load the IIODebug (V2) and when it is unchecked
(false) it will only load the Debugger (V1). The default is V2.

Signed-off-by: Andrei-Fabian-Pop <[email protected]>

# Conflicts:
#	core/src/scopymainwindow.cpp
#	core/src/scopypreferencespage.cpp
  • Loading branch information
Andrei-Fabian-Pop committed Aug 8, 2024
commit b1fda2ff7117e7dbf7023d2067f236ff4bc16490
1 change: 1 addition & 0 deletions core/src/scopymainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ void ScopyMainWindow::initPreferences()
p->init("show_grid", true);
p->init("show_graticule", false);
p->init("iiowidgets_use_lazy_loading", true);
p->init("plugins_use_debugger_v2", true);
p->init("general_plot_target_fps", "60");
p->init("general_show_plot_fps", true);
p->init("general_use_native_dialogs", true);
Expand Down
2 changes: 2 additions & 0 deletions core/src/scopypreferencespage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ QWidget *ScopyPreferencesPage::buildGeneralPreferencesPage()
PreferencesHelper::addPreferenceCheckBox(p, "show_graticule", "Show Graticule", generalSection));
generalSection->contentLayout()->addWidget(PreferencesHelper::addPreferenceCheckBox(
p, "iiowidgets_use_lazy_loading", "Use Lazy Loading", generalSection));
generalSection->contentLayout()->addWidget(PreferencesHelper::addPreferenceCheckBox(
p, "plugins_use_debugger_v2", "Use Debugger V2 plugin", generalSection));
generalSection->contentLayout()->addWidget(PreferencesHelper::addPreferenceCombo(
p, "general_theme", "Theme", {"default", "light"}, generalSection));
generalSection->contentLayout()->addWidget(PreferencesHelper::addPreferenceCombo(
Expand Down
10 changes: 9 additions & 1 deletion plugins/debugger/src/debuggerplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <core/detachedtoolwindow.h>
#include <core/detachedtoolwindowmanager.h>
#include <iioutil/connectionprovider.h>
#include <pluginbase/preferences.h>

using namespace scopy;
using namespace scopy::debugger;
Expand All @@ -22,7 +23,14 @@ Q_LOGGING_CATEGORY(CAT_BENCHMARK, "Benchmark");

bool DebuggerPlugin::compatible(QString m_param, QString category)
{
qDebug(CAT_DEBUGGERPLUGIN) << " compatible";
qDebug(CAT_DEBUGGERPLUGIN) << "Checking if Debugger (V1) is compatible.";

// Check weather this version (V1) should be used, true if V2 should be used
bool useThisDebugger = Preferences::GetInstance()->get("plugins_use_debugger_v2").toBool();
if(useThisDebugger) {
return false;
}

bool ret = true;
ConnectionProvider *c = ConnectionProvider::GetInstance();
Connection *conn = c->open(m_param);
Expand Down
8 changes: 8 additions & 0 deletions plugins/iiodebug/src/iiodebugplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "debuggerloggingcategories.h"
#include <QLabel>
#include <iioutil/connectionprovider.h>
#include <pluginbase/preferences.h>

using namespace scopy::iiodebugplugin;

Expand All @@ -10,6 +11,13 @@ bool IIODebugPlugin::compatible(QString m_param, QString category)
// This function defines the characteristics according to which the
// plugin is compatible with a specific device
qDebug(CAT_IIODEBUGGER) << "Checking if IIODebugPlugin is compatible.";

// Check weather this version (V2) should be used
bool useThisDebugger = Preferences::GetInstance()->get("plugins_use_debugger_v2").toBool();
if(!useThisDebugger) {
return false;
}

bool ret = true;
ConnectionProvider *c = ConnectionProvider::GetInstance();
Connection *conn = c->open(m_param);
Expand Down