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

Thorlabs deformable mirror #40

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
fdf6767
build project structure and add ThorlabsDMH
ChrisLee333 Apr 18, 2024
84cd8dd
Merge branch 'itom-project:master' into Thorlabs-Deformable-Mirror
ChrisLee333 Apr 19, 2024
f95d82e
adapt to right names for classes and interfaces
ChrisLee333 Apr 19, 2024
95d6cdc
Merge branch 'Thorlabs-Deformable-Mirror' of https://github.com/Chris…
ChrisLee333 Apr 19, 2024
16d3b16
change rest of old names to ThorlabsDMH (in .ui files)
ChrisLee333 Apr 19, 2024
a953867
adapt template to thorlabs actuator
ChrisLee333 Apr 30, 2024
f34144d
added Thorlabs DFM SDK in cmake
photoniker Apr 30, 2024
bd4a53c
Merge branch 'Thorlabs-Deformable-Mirror' of https://github.com/Chris…
photoniker Apr 30, 2024
0a10f8d
add librarier to cMakeList, start communication with mirror
ChrisLee333 May 6, 2024
fadaa83
added VISA x86 folder to cmake for vpptype.h
photoniker May 6, 2024
d230cfc
change error msg in cmakelist, implement relax mirror and start with …
ChrisLee333 May 7, 2024
d0ee0f3
implement new parameter, add functionallity to setposrel and setposab…
ChrisLee333 May 8, 2024
8f1165a
Merge branch 'master' into pr/40
photoniker May 10, 2024
11bd50a
Update .gitignore
photoniker May 10, 2024
278899e
Merge branch 'Thorlabs-Deformable-Mirror' of https://github.com/Chris…
photoniker May 10, 2024
4105536
implement error handling, device recognition with serial numbers
ChrisLee333 May 13, 2024
a71a561
remove store Zernike
ChrisLee333 May 28, 2024
7aef5af
fix bug in setzernike and remove relaxmirror from init
ChrisLee333 Jun 10, 2024
e74e34a
Merge branch 'master' into pr/40
photoniker Jun 21, 2024
5cd8ce8
ThorlabsDMH: adapt Plugin to itom 4.3.0 cmake structure
photoniker Jun 21, 2024
d6baff7
Merge branch 'Thorlabs-Deformable-Mirror' of https://github.com/Chris…
photoniker Jun 21, 2024
2af9052
Update ThorlabsDMH.cpp
photoniker Jun 21, 2024
2f39b1a
added min, max itom version
photoniker Jun 21, 2024
3e9544f
:lipstick: sorry for typo
photoniker Jun 21, 2024
16d1e7c
added itom min max version macros
photoniker Jun 21, 2024
5333d77
some beauty review
photoniker Aug 8, 2024
9f411c0
Merge branch 'master' into pr/40
photoniker Oct 21, 2024
a12c672
adapt ui for ThorlabsDMH and test it
Oct 21, 2024
3e372e0
update docu and implement functionality to gui
Oct 30, 2024
a054bd3
update docu and implement functionality to dock widget motoraxiscontr…
Nov 4, 2024
35bd4e3
ThorlabsDMH: some minor beauty changes
photoniker Nov 5, 2024
9639dd9
ThorlabsDMH: review of docu
photoniker Nov 5, 2024
e50f76f
Merge branch 'master' into pr/40
photoniker Nov 5, 2024
006ebf4
ThorlabsDMH: update
photoniker Nov 5, 2024
84312f7
Merge branch 'master' into pr/40
photoniker Nov 12, 2024
3858db0
add installation instruction
ChrisLee333 Nov 18, 2024
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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,14 @@ if(PLUGIN_ThorlabsBDCServo)
add_subdirectory(ThorlabsBDCServo)
endif(PLUGIN_ThorlabsBDCServo)

# ThorlabsFF High-Stroke Deformable Mirrors
if(WIN32)
option(PLUGIN_ThorlabsDMH "Build the Thorlabs High-Stroke Deformable Mirrors plugin." ${ITOM_BUILD_SHIPMENT})
if(PLUGIN_ThorlabsDMH)
add_subdirectory(ThorlabsDMH)
endif(PLUGIN_ThorlabsDMH)
endif()

# ThorlabsFF filter flipper
itom_plugin_option(PLUGIN_ThorlabsFF)
if(PLUGIN_ThorlabsFF)
Expand Down
137 changes: 137 additions & 0 deletions ThorlabsDMH/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
cmake_minimum_required(VERSION 3.12...3.29)

set(target_name ThorlabsDMH)

if(NOT EXISTS ${ITOM_SDK_DIR})
find_path(ITOM_SDK_DIR "cmake/itom_sdk.cmake"
HINTS "$ENV{ITOM_SDK_ROOT}"
"${CMAKE_CURRENT_BINARY_DIR}/../itom/SDK"
DOC "Path of SDK subfolder of itom root (build) directory")
endif(NOT EXISTS ${ITOM_SDK_DIR})

if(NOT EXISTS ${ITOM_SDK_DIR})
message(FATAL_ERROR "ITOM_SDK_DIR is invalid. Provide itom SDK directory path first")
endif(NOT EXISTS ${ITOM_SDK_DIR})

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${ITOM_SDK_DIR}/cmake)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(THORLABS_DFM_VISA_DIRECTORY "" CACHE PATH "Path to the install directory of Thorlabs Deformable Mirror VISA (e.g. C:/Program Files/IVI Foundation/VISA")
set(THORLABS_DFM_VISA_x86_DIRECTORY "" CACHE PATH "Path to the install directory of Thorlabs Deformable Mirror VISA x86 (e.g. C:/Program Files (x86)/IVI Foundation/VISA")

if(NOT THORLABS_DFM_VISA_DIRECTORY AND THORLABS_DFM_VISA_x86_DIRECTORY)
set(THORLABS_DFM_VISA_DIRECTORY $ENV{NI_VISA_ROOT})
endif(NOT THORLABS_DFM_VISA_DIRECTORY AND THORLABS_DFM_VISA_x86_DIRECTORY)

if(THORLABS_DFM_VISA_DIRECTORY AND THORLABS_DFM_VISA_x86_DIRECTORY)
if(WIN32)
find_path(THORLABS_DFMX_INCLUDE_DIR "TLDFMX_def.h" PATHS ${THORLABS_DFM_VISA_DIRECTORY} PATH_SUFFIXES "Win64/Include")
find_path(THORLABS_DFM_x86_INCLUDE_DIR "vpptype.h" PATHS ${THORLABS_DFM_VISA_x86_DIRECTORY} PATH_SUFFIXES "WinNT/Include")
find_library(THORLABS_DFM_LIBRARY "TLDFM_64" PATHS ${THORLABS_DFM_VISA_DIRECTORY} PATH_SUFFIXES "Win64/Lib_x64/msc")
find_library(THORLABS_DFMX_LIBRARY "TLDFMX_64" PATHS ${THORLABS_DFM_VISA_DIRECTORY} PATH_SUFFIXES "Win64/Lib_x64/msc")
endif(WIN32)
endif(THORLABS_DFM_VISA_DIRECTORY)

option(BUILD_TARGET64 "Build for 64 bit target if set to ON or 32 bit if set to OFF." ON)

if(THORLABS_DFMX_INCLUDE_DIR AND THORLABS_DFM_x86_INCLUDE_DIR)
find_package(ITOM_SDK COMPONENTS dataobject itomCommonLib itomCommonQtLib itomWidgets REQUIRED)

include(ItomBuildMacros)

itom_init_cmake_policy(3.12)
itom_find_package_qt(ON Core Widgets LinguistTools)
itom_init_plugin_library(${target_name})

include_directories(
${CMAKE_CURRENT_BINARY_DIR} #build directory of this plugin (recommended)
${CMAKE_CURRENT_SOURCE_DIR} #source directory of this plugin (recommended)
${ITOM_SDK_INCLUDE_DIRS} #include directory of the itom SDK (recommended) as well as necessary 3rd party directories (e.g. from OpenCV)
#add further include directories here
${THORLABS_DFMX_INCLUDE_DIR}
${THORLABS_DFM_INCLUDE_DIR}
${THORLABS_DFM_x86_INCLUDE_DIR}
)

link_directories(
#add all linker directories
)

set(PLUGIN_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/ThorlabsDMH.h
${CMAKE_CURRENT_SOURCE_DIR}/dialogThorlabsDMH.h
${CMAKE_CURRENT_SOURCE_DIR}/dockWidgetThorlabsDMH.h
${CMAKE_CURRENT_BINARY_DIR}/pluginVersion.h
${CMAKE_CURRENT_BINARY_DIR}/gitVersion.h #provided by the init script, contains currently checked out git tag
#add further header files (absolute paths e.g. using CMAKE_CURRENT_SOURCE_DIR)
)

set(PLUGIN_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/dialogThorlabsDMH.cpp
${CMAKE_CURRENT_SOURCE_DIR}/dockWidgetThorlabsDMH.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ThorlabsDMH.cpp
#add further source files here
)

if(MSVC)
list(APPEND PLUGIN_SOURCES ${ITOM_SDK_INCLUDE_DIR}/../pluginLibraryVersion.rc)
endif()

set(PLUGIN_UI
${CMAKE_CURRENT_SOURCE_DIR}/dialogThorlabsDMH.ui
${CMAKE_CURRENT_SOURCE_DIR}/dockWidgetThorlabsDMH.ui
)

set(PLUGIN_RCC
#add absolute paths to any *.qrc resource files here
)

#Define Version in pluginVersion.h
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/pluginVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/pluginVersion.h)

add_library(${target_name} SHARED
${PLUGIN_SOURCES}
${PLUGIN_HEADERS}
${PLUGIN_UI}
${PLUGIN_RCC}
)

set_target_properties(${target_name} PROPERTIES AUTOMOC ON AUTORCC ON AUTOUIC ON)

target_link_libraries(${target_name}
${ITOM_SDK_LIBRARIES}
${QT5_LIBRARIES}
${VISUALLEAKDETECTOR_LIBRARIES}
${THORLABS_DFM_LIBRARY}
${THORLABS_DFMX_LIBRARY}
)

set(FILES_TO_TRANSLATE ${PLUGIN_SOURCES} ${PLUGIN_HEADERS} ${PLUGIN_UI} ${PLUGIN_RCC})
itom_library_translation(
QM_FILES
TARGET ${target_name}
FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE}
)

itom_configure_plugin_documentation(${target_name} ThorlabsDMH)

set(COPY_SOURCES "")
set(COPY_DESTINATIONS "")

itom_add_pluginlibrary_to_copy_list(${target_name} COPY_SOURCES COPY_DESTINATIONS)
itom_add_plugin_qm_files_to_copy_list(${target_name} QM_FILES COPY_SOURCES COPY_DESTINATIONS)

itom_post_build_copy_files(${target_name} COPY_SOURCES COPY_DESTINATIONS)

itom_post_build_copy_files_to_lib_folder(${target_name} THORLABS_DFMX_BINARY)

set(BINARY_FILES
"${THORLABS_DFM_VISA_DIRECTORY}/Win64/Bin/TLDFM_64.dll"
"${THORLABS_DFM_VISA_DIRECTORY}/Win64/Bin/TLDFMX_64.dll"
)

itom_post_build_copy_files_to_lib_folder(${target_name} BINARY_FILES)

else(THORLABS_DFMX_INCLUDE_DIR AND THORLABS_DFM_x86_INCLUDE_DIR)
message(SEND_ERROR "${THORLABS_DFMX_INCLUDE_DIR} or ${THORLABS_DFM_x86_INCLUDE_DIR} for plugin ${target_name} could not be found. ${target_name} will not be build. Please properly indicate THORLABS_DFM_VISA_DIRECTORY and THORLABS_DFM_VISA_x86_DIRECTORY.")
ENDIF(THORLABS_DFMX_INCLUDE_DIR AND THORLABS_DFM_x86_INCLUDE_DIR)
Loading