Skip to content

Commit

Permalink
Split spectrograph into receiver and spectrograph classes (indilib#1463)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Platone authored May 24, 2021
1 parent 7f318d3 commit 13274d6
Show file tree
Hide file tree
Showing 19 changed files with 1,175 additions and 165 deletions.
39 changes: 29 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ else(WIN32 OR ANDROID)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(CFITSIO REQUIRED)
find_package(RTLSDR REQUIRED)
find_package(Nova REQUIRED)
find_package(USB1 REQUIRED)
find_package(CURL REQUIRED)
Expand All @@ -333,10 +334,11 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/dsp)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/stream)
include_directories( ${CFITSIO_INCLUDE_DIR})
include_directories( ${RTLSDR_INCLUDE_DIR})
include_directories( ${NOVA_INCLUDE_DIR})
include_directories( ${USB1_INCLUDE_DIRS})
include_directories( ${GSL_INCLUDE_DIRS})
include_directories( ${JPEG_INCLUDE_DIR} )
include_directories( ${JPEG_INCLUDE_DIR})
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/libs/webcam)
ENDIF (${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
Expand Down Expand Up @@ -448,6 +450,7 @@ SET(indidriver_CXX_SRC
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indicorrelator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indidetector.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indispectrograph.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indireceiver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/inditelescope.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifilterwheel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifocuserinterface.cpp
Expand Down Expand Up @@ -874,15 +877,6 @@ add_executable(indi_script_telescope ${telescopescript_SRC})
target_link_libraries(indi_script_telescope indidriver)
install(TARGETS indi_script_telescope RUNTIME DESTINATION bin)

################ Detector Simulator ################

SET(spectrographsimulator_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/spectrograph/spectrograph_simulator.cpp)

add_executable(indi_simulator_spectrograph ${spectrographsimulator_SRC})
target_link_libraries(indi_simulator_spectrograph indidriver)
install(TARGETS indi_simulator_spectrograph RUNTIME DESTINATION bin)

########### CCD Simulator ##############
SET(ccdsimulator_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/ccd/ccd_simulator.cpp)
Expand Down Expand Up @@ -1388,6 +1382,30 @@ install(TARGETS indi_qhycfw3_wheel RUNTIME DESTINATION bin)

#################################################################################

#####################################
########## SENSORS GROUP ############
#####################################

################ Receiver Simulator ################

SET(receiversimulator_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/receiver/receiver_simulator.cpp)

add_executable(indi_simulator_receiver ${receiversimulator_SRC})
target_link_libraries(indi_simulator_receiver indidriver)
install(TARGETS indi_simulator_receiver RUNTIME DESTINATION bin)

################# RTL-SDR Receiver #################

SET(rtlsdr_SRC
${CMAKE_CURRENT_SOURCE_DIR}/drivers/receiver/indi_rtlsdr.cpp)

add_executable(indi_rtlsdr ${rtlsdr_SRC})
target_link_libraries(indi_rtlsdr indidriver ${RTLSDR_LIBRARIES})
install(TARGETS indi_rtlsdr RUNTIME DESTINATION bin)

#################################################################################

#####################################
########## DOME GROUP ############
#####################################
Expand Down Expand Up @@ -1997,6 +2015,7 @@ if (INDI_BUILD_DRIVERS OR INDI_BUILD_CLIENT OR INDI_BUILD_QT5_CLIENT)
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indicorrelator.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indidetector.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indispectrograph.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indireceiver.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifilterwheel.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indifocuserinterface.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/indibase/indiweatherinterface.h
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Learn more about INDI:
On Debian/Ubuntu:

```
sudo apt-get install -y libnova-dev libcfitsio-dev libusb-1.0-0-dev zlib1g-dev libgsl-dev build-essential cmake git libjpeg-dev libcurl4-gnutls-dev libtiff-dev libfftw3-dev
sudo apt-get install -y libnova-dev libcfitsio-dev libusb-1.0-0-dev zlib1g-dev libgsl-dev build-essential cmake git libjpeg-dev libcurl4-gnutls-dev libtiff-dev libfftw3-dev librtlsdr-dev
```

## Create Project Directory
Expand Down
52 changes: 52 additions & 0 deletions cmake_modules/FindRTLSDR.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# - Try to find RTLSDR
# Once done this will define
#
# RTLSDR_FOUND - system has RTLSDR
# RTLSDR_INCLUDE_DIR - the RTLSDR include directory
# RTLSDR_LIBRARIES - Link these to use RTLSDR
# RTLSDR_VERSION_STRING - Human readable version number of rtlsdr
# RTLSDR_VERSION_MAJOR - Major version number of rtlsdr
# RTLSDR_VERSION_MINOR - Minor version number of rtlsdr

# Copyright (c) 2017, Ilia Platone, <[email protected]>
# Based on FindLibfacile by Carsten Niehaus, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if (RTLSDR_LIBRARIES)

# in cache already
set(RTLSDR_FOUND TRUE)
message(STATUS "Found RTLSDR: ${RTLSDR_LIBRARIES}")


else (RTLSDR_LIBRARIES)

find_library(RTLSDR_LIBRARIES NAMES rtlsdr rtlsdr0
PATHS
${_obLinkDir}
${GNUWIN32_DIR}/lib
/usr/local/lib
)

if(RTLSDR_LIBRARIES)
set(RTLSDR_FOUND TRUE)
else (RTLSDR_LIBRARIES)
set(RTLSDR_FOUND FALSE)
endif(RTLSDR_LIBRARIES)


if (RTLSDR_FOUND)
if (NOT RTLSDR_FIND_QUIETLY)
message(STATUS "Found RTLSDR: ${RTLSDR_LIBRARIES}")
endif (NOT RTLSDR_FIND_QUIETLY)
else (RTLSDR_FOUND)
if (RTLSDR_FIND_REQUIRED)
message(FATAL_ERROR "RTLSDR not found. Please install librtlsdr-dev")
endif (RTLSDR_FIND_REQUIRED)
endif (RTLSDR_FOUND)

mark_as_advanced(RTLSDR_LIBRARIES)

endif (RTLSDR_LIBRARIES)
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Build-Depends: debhelper (>= 8.1.3~),
libcurl4-gnutls-dev,
libtheora-dev,
libogg-dev,
libfftw3-dev
libfftw3-dev,
rtl-sdr
Standards-Version: 3.9.5
Homepage: http://www.indilib.org/
Vcs-Git: git://github.com/indilib/indi.git
Expand Down
Loading

0 comments on commit 13274d6

Please sign in to comment.