Skip to content

Commit

Permalink
debugger: Merge the 2 debugger plugins into a single plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei-Fabian-Pop <[email protected]>
  • Loading branch information
Andrei-Fabian-Pop authored and adisuciu committed Aug 20, 2024
1 parent 0b28360 commit fdd17c5
Show file tree
Hide file tree
Showing 54 changed files with 213 additions and 564 deletions.
2 changes: 2 additions & 0 deletions core/src/scopymainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ void ScopyMainWindow::handlePreferences(QString str, QVariant val)
Q_EMIT p->restartRequired();
} else if(str == "general_show_status_bar") {
StatusBarManager::GetInstance()->setEnabled(val.toBool());
} else if(str == "plugins_use_debugger_v2") {
Q_EMIT p->restartRequired();
}
}

Expand Down
7 changes: 7 additions & 0 deletions iio-widgets/src/iiowidgetbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ QList<IIOWidget *> IIOWidgetBuilder::buildAll()
}

result.append(buildSingle());

m_attribute = "";
m_optionsAttribute = "";
}
} else if(m_device) {
attrCount = iio_device_get_attrs_count(m_device);
Expand All @@ -137,6 +140,8 @@ QList<IIOWidget *> IIOWidgetBuilder::buildAll()
}

result.append(buildSingle());
m_attribute = "";
m_optionsAttribute = "";
}
} else if(m_context) {
attrCount = iio_context_get_attrs_count(m_context);
Expand All @@ -152,6 +157,8 @@ QList<IIOWidget *> IIOWidgetBuilder::buildAll()

m_attribute = name;
result.append(buildSingle());
m_attribute = "";
m_optionsAttribute = "";
}
} else {
qWarning(CAT_ATTRBUILDER) << "Not enough information to build IIOWidgets";
Expand Down
6 changes: 0 additions & 6 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ option(ENABLE_PLUGIN_ADC "Enable ADC plugin" ON)
option(ENABLE_PLUGIN_SWIOT "Enable SWIOT plugin" ON)
option(ENABLE_PLUGIN_PQM "Enable PQM plugin" ON)
option(ENABLE_PLUGIN_DATALOGGER "Enable DATALOGGER plugin" ON)
option(ENABLE_PLUGIN_IIODEBUGPLUGIN "Enable IIODEBUGPLUGIN plugin" ON)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCOPY_PLUGIN_BUILD_PATH})
Expand Down Expand Up @@ -70,11 +69,6 @@ if(ENABLE_PLUGIN_DEBUGGER)
list(APPEND PLUGINS ${DEBUGGER_TARGET_NAME})
endif()

if(ENABLE_PLUGIN_IIODEBUGPLUGIN)
add_subdirectory(iiodebug)
list(APPEND PLUGINS ${IIODEBUG_TARGET_NAME})
endif()

if(ENABLE_PLUGIN_DATALOGGER)
add_subdirectory(datalogger)
list(APPEND PLUGINS ${DATALOGGER_TARGET_NAME})
Expand Down
58 changes: 33 additions & 25 deletions plugins/debugger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include(GenerateExportHeader)

# TODO: split stylesheet/resources and add here TODO: export header files correctly

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/ui)
Expand All @@ -26,55 +26,63 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)

set(SCOPY_QT_COMPONENTS Widgets Concurrent Svg Xml)

file(GLOB SRC_LIST src/*.cpp model/*)

file(
GLOB
SRC_LIST
src/*.cpp
src/*.cc
src/debugger/*.cpp
src/debugger/*.cc
src/debugger/*.h
src/debugger/*.hpp
src/iioexplorer/*.cpp
src/iioexplorer/*cc
)
file(GLOB HEADER_LIST include/${SCOPY_MODULE}/*.h include/${SCOPY_MODULE}/*.hpp)
file(GLOB UI_LIST ui/*.ui)

set(ENABLE_TESTING ON)
if(ENABLE_TESTING)
add_subdirectory(test)
endif()

set(PROJECT_SOURCES ${SRC_LIST} ${HEADER_LIST} ${UI_LIST})
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets Core)

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ${SCOPY_QT_COMPONENTS} REQUIRED)

qt_add_resources(PROJECT_RESOURCES resources/resources.qrc ../../resources/resources.qrc)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCOPY_PLUGIN_BUILD_PATH})
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Scopy.app/Contents/MacOS/plugins/plugins")
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCOPY_PLUGIN_BUILD_PATH})
endif()

qt_add_resources(PROJECT_RESOURCES res/resources.qrc)
add_library(${PROJECT_NAME} SHARED ${PROJECT_SOURCES} ${PROJECT_RESOURCES})

generate_export_header(
${PROJECT_NAME} EXPORT_FILE_NAME ${CMAKE_CURRENT_SOURCE_DIR}/include/${SCOPY_MODULE}/${PROJECT_NAME}_export.h
)

configure_file(
include/${SCOPY_MODULE}/scopy-${SCOPY_MODULE}_config.h.cmakein
${CMAKE_CURRENT_SOURCE_DIR}/include/${SCOPY_MODULE}/scopy-${SCOPY_MODULE}_config.h @ONLY
)

target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/${SCOPY_MODULE})

include_directories(${Qt${QT_VERSION_MAJOR}Concurrent_INCLUDE_DIRS})

foreach(comp ${SCOPY_QT_COMPONENTS})
set(SCOPY_QT_LIBRARIES ${SCOPY_QT_LIBRARIES} Qt${QT_VERSION_MAJOR}::${comp})
endforeach()

target_include_directories(${PROJECT_NAME} PUBLIC scopy-pluginbase scopy-gui)
target_link_libraries(
${PROJECT_NAME}
PUBLIC ${SCOPY_QT_LIBRARIES}
PUBLIC Qt::Widgets
Qt::Core
scopy-core
scopy-pluginbase
scopy-iioutil
scopy-gui
scopy-core
scopy-iioutil
scopy-iio-widgets
)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(INSTALLER_DESCRIPTION "${PLUGIN_DISPLAY_NAME} ${PLUGIN_DESCRIPTION}")
configureinstallersettings(${SCOPY_MODULE} ${INSTALLER_DESCRIPTION} FALSE)
configureinstallersettings(${SCOPY_MODULE} ${PLUGIN_DESCRIPTION} FALSE)
endif()

set(DEBUGGER_TARGET_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(IIODEBUG_TARGET_NAME ${PROJECT_NAME} PARENT_SCOPE)

install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${SCOPY_PLUGIN_INSTALL_DIR})
Loading

0 comments on commit fdd17c5

Please sign in to comment.