Skip to content

Imu plugin #2043

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

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
99 changes: 99 additions & 0 deletions gui/res/icons/scopy-default/icons/tool_imuanalyzer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 99 additions & 0 deletions gui/res/icons/scopy-light/icons/tool_imuanalyzer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions gui/res/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
<file>icons/device-shapes/square.svg</file>
<file>icons/device-shapes/rounded_square.svg</file>
<file>icons/info.svg</file>
<file>icons/scopy-light/icons/tool_imuanalyzer.svg</file>
<file>icons/scopy-default/icons/tool_imuanalyzer.svg</file>
</qresource>
<qresource prefix="/">
<file>icons/scopy-default/icons/search.svg</file>
Expand Down
6 changes: 6 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ option(ENABLE_PLUGIN_DAC "Enable DAC plugin" ON)
option(ENABLE_PLUGIN_AD9084 "Enable AD9084 plugin" ON)
option(ENABLE_PLUGIN_JESDSTATUS "Enable JESDSTATUS plugin" ON)
option(ENABLE_PLUGIN_PLUTO "Enable PLUTO plugin" ON)
option(ENABLE_PLUGIN_IMUANALYZER "Enable IMUANALYZER plugin" ON)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCOPY_PLUGIN_BUILD_PATH})
Expand Down Expand Up @@ -143,6 +144,11 @@ if(ENABLE_PLUGIN_PLUTO)
list(APPEND PLUGINS ${PLUGIN_NAME})
endif()

if(ENABLE_PLUGIN_IMUANALYZER)
add_subdirectory(imu)
list(APPEND PLUGINS ${IMUANALYZER_TARGET_NAME})
endif()

install(TARGETS ${PLUGINS} LIBRARY DESTINATION ${SCOPY_PLUGIN_INSTALL_PATH})

set(PLUGINS ${PLUGINS} PARENT_SCOPE)
Expand Down
1 change: 1 addition & 0 deletions plugins/imu/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include/imuanalyzer/scopy-imuanalyzer_export.h
124 changes: 124 additions & 0 deletions plugins/imu/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#
# Copyright (c) 2025 Analog Devices Inc.
#
# This file is part of Scopy
# (see https://www.github.com/analogdevicesinc/scopy).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

cmake_minimum_required(VERSION 3.9)

set(SCOPY_MODULE imuanalyzer)

message(STATUS "building plugin: " ${SCOPY_MODULE})

project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)

include(GenerateExportHeader)

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

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/ui)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)

set(SCOPY_QT_COMPONENTS Core Widgets)

file(GLOB SRC_LIST src/*.cpp src/*.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 ${SCOPY_QT_COMPONENTS}
REQUIRED
Core
Gui
Widgets
3DCore
3DExtras
3DRender
3DInput
)

add_library(
${PROJECT_NAME} SHARED
${PROJECT_SOURCES}
include/imuanalyzer/imuanalyzerinterface.hpp
include/imuanalyzer/scenerenderer.hpp
include/imuanalyzer/bubblelevelrenderer.hpp
include/imuanalyzer/imuanalyzerutils.hpp
include/imuanalyzer/imuanalyzersettings.hpp
src/datavisualizer.cpp
include/imuanalyzer/datavisualizer.hpp
# ${PROJECT_RESOURCES}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comented code

)

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

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

target_include_directories(${PROJECT_NAME} PUBLIC scopy-pluginbase scopy-gui)
target_include_directories(
${PROJECT_NAME}
PRIVATE ${IIO_INCLUDE_DIRS}
scopy-gui
scopy-iio-widgets
scopy-iioutil
${OPENGL_INCLUDE_DIRS}
${GLUT_INCLUDE_DIRS}
)

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

target_link_libraries(
${PROJECT_NAME}
PUBLIC Qt::Widgets
Qt::Core
scopy-pluginbase
scopy-gui
scopy-iioutil
scopy-iio-widgets
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::3DCore
Qt5::3DExtras
Qt5::3DRender
Qt5::3DInput
)

set(PLUGIN_NAME ${PROJECT_NAME} PARENT_SCOPE)
Loading
Loading