Skip to content

Commit

Permalink
Merge pull request #11 from spacelab-ufsc/dev
Browse files Browse the repository at this point in the history
Dev: v0.3
  • Loading branch information
mgm8 authored Jan 12, 2021
2 parents 2495636 + 75e07c0 commit d430809
Show file tree
Hide file tree
Showing 43 changed files with 3,300 additions and 500 deletions.
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
LIB_NGHAM_TARGET=libngham.so
LIB_NGHAM_FSAT_TARGET=libngham_fsat.so

ifndef BUILD_DIR
BUILD_DIR=$(CURDIR)/build/
endif

all:
mkdir -p $(BUILD_DIR)
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C libs
cp $(BUILD_DIR)*.so spacelab_decoder/

install:
install -m 0755 $(BUILD_DIR)/$(LIB_NGHAM_TARGET) /usr/lib/$(LIB_NGHAM_TARGET)
install -m 0755 $(BUILD_DIR)/$(LIB_NGHAM_FSAT_TARGET) /usr/lib/$(LIB_NGHAM_FSAT_TARGET)

uninstall:
rm /usr/lib/$(LIB_NGHAM_TARGET)
rm /usr/lib/$(LIB_NGHAM_FSAT_TARGET)

clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/*.so
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<img src="https://img.shields.io/badge/status-development-green?style=for-the-badge">
</a>
<a href="https://github.com/spacelab-ufsc/spacelab-decoder/releases">
<img src="https://img.shields.io/badge/version-0.2-blue?style=for-the-badge">
<img alt="GitHub commits since latest release (by date)" src="https://img.shields.io/github/commits-since/spacelab-ufsc/spacelab-decoder/latest?style=for-the-badge">
</a>
<a href="https://github.com/spacelab-ufsc/spacelab-decoder/blob/master/LICENSE">
<img src="https://img.shields.io/badge/license-GPL3-yellow?style=for-the-badge">
Expand All @@ -35,11 +35,38 @@ SpaceLab Packet Decoder is a software to decode audio records from the satellite

## Dependencies

* python (>= 3)
* gi
* scipy
* python3-zmq
* pyzmq
* gnuradio

### Installation on Ubuntu

```sudo apt install python3 python3-gi python3-scipy python3-zmq gnuradio```

### Installation on Fedora

```sudo dnf install python3 python3-gobject python3-scipy python3-zmq gnuradio```

## Building and Installing

Before installing the main Python application, the NGHam library must be compiled and installed in the system:

* ```make```
* ```make install```
* ```python setup.py install```

## Documentation

### Dependencies

* sphinx-rtd-theme

### Building the Documentation

* ```python setup.py build_sphinx```

## License

This project is licensed under GPLv3 license.
20 changes: 20 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
60 changes: 60 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

import os
import sys

import sphinx_rtd_theme

from spacelab_decoder.version import __version__

sys.path.insert(0, os.path.abspath('../spacelab_decoder'))

# -- Project information -----------------------------------------------------

project = 'spacelab-decoder'
copyright = '2021, Universidade Federal de Santa Catarina'
author = 'Gabriel Mariano Marcelino'

# The full version, including alpha/beta/rc tags
release = __version__


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_rtd_theme',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
20 changes: 20 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.. spacelab-decoder documentation master file, created by
sphinx-quickstart on Tue Jan 12 11:55:44 2021.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to spacelab-decoder's documentation!
============================================

.. toctree::
:maxdepth: 2
:caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
43 changes: 3 additions & 40 deletions libs/Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,7 @@
TARGET=libngham.so

ifndef BUILD_DIR
BUILD_DIR=$(CURDIR)
endif

CC=gcc
CFLAGS=-c -fPIC -I$(CURDIR)/ngham/ -o

$(BUILD_DIR)/$(TARGET): $(BUILD_DIR)/ccsds_scrambler.o $(BUILD_DIR)/crc_ccitt.o $(BUILD_DIR)/decode_rs_char.o $(BUILD_DIR)/encode_rs_char.o $(BUILD_DIR)/init_rs_char.o $(BUILD_DIR)/ngham.o $(BUILD_DIR)/ngham_extension.o $(BUILD_DIR)/ngham_packets.o $(BUILD_DIR)/platform.o
$(CC) -shared -fPIC -Wall -o $(BUILD_DIR)/$(TARGET) *.o -lc

$(BUILD_DIR)/ccsds_scrambler.o: ngham/ccsds_scrambler.c ngham/ccsds_scrambler.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/crc_ccitt.o: ngham/crc_ccitt.c ngham/crc_ccitt.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/fec.o: ngham/fec-3.0.1/fec.c ngham/fec-3.0.1/fec.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/decode_rs_char.o: ngham/fec-3.0.1/decode_rs_char.c
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/encode_rs_char.o: ngham/fec-3.0.1/encode_rs_char.c
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/init_rs_char.o: ngham/fec-3.0.1/init_rs_char.c
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham.o: ngham/ngham.c ngham/ngham.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham_extension.o: ngham/ngham_extension.c ngham/ngham_extension.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham_packets.o: ngham/ngham_packets.c ngham/ngham_packets.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/platform.o: ngham/platform/platform.c ngham/platform/platform.h
$(CC) $(CFLAGS) $@ $<

clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/$(TARGET)
all:
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C ngham
$(MAKE) BUILD_DIR=$(BUILD_DIR) -C ngham_fsat
44 changes: 44 additions & 0 deletions libs/ngham/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
TARGET=libngham.so

ifndef BUILD_DIR
BUILD_DIR=$(CURDIR)
endif

CC=gcc
CFLAGS=-c -fPIC -I$(CURDIR)/ -o

$(BUILD_DIR)/$(TARGET): $(BUILD_DIR)/ccsds_scrambler.o $(BUILD_DIR)/crc_ccitt.o $(BUILD_DIR)/decode_rs_char.o $(BUILD_DIR)/encode_rs_char.o $(BUILD_DIR)/init_rs_char.o $(BUILD_DIR)/ngham.o $(BUILD_DIR)/ngham_extension.o $(BUILD_DIR)/ngham_packets.o $(BUILD_DIR)/platform.o
$(CC) -shared -fPIC -Wall -o $(BUILD_DIR)/$(TARGET) $(BUILD_DIR)/ccsds_scrambler.o $(BUILD_DIR)/crc_ccitt.o $(BUILD_DIR)/decode_rs_char.o $(BUILD_DIR)/encode_rs_char.o $(BUILD_DIR)/init_rs_char.o $(BUILD_DIR)/ngham.o $(BUILD_DIR)/ngham_extension.o $(BUILD_DIR)/ngham_packets.o $(BUILD_DIR)/platform.o -lc

$(BUILD_DIR)/ccsds_scrambler.o: ccsds_scrambler.c ccsds_scrambler.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/crc_ccitt.o: crc_ccitt.c crc_ccitt.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/fec.o: fec-3.0.1/fec.c fec-3.0.1/fec.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/decode_rs_char.o: fec-3.0.1/decode_rs_char.c
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/encode_rs_char.o: fec-3.0.1/encode_rs_char.c
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/init_rs_char.o: fec-3.0.1/init_rs_char.c
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham.o: ngham.c ngham.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham_extension.o: ngham_extension.c ngham_extension.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham_packets.o: ngham_packets.c ngham_packets.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/platform.o: platform/platform.c platform/platform.h
$(CC) $(CFLAGS) $@ $<

clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/$(TARGET)
35 changes: 35 additions & 0 deletions libs/ngham_fsat/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
TARGET=libngham_fsat.so

ifndef BUILD_DIR
BUILD_DIR=.
endif

CC=gcc
CFLAGS=-c -fPIC -o

$(BUILD_DIR)/$(TARGET): $(BUILD_DIR)/ccsds_scrambler_fsat.o $(BUILD_DIR)/crc_ccitt_fsat.o $(BUILD_DIR)/fec_fsat.o $(BUILD_DIR)/ngham_fsat.o $(BUILD_DIR)/ngham_extension_fsat.o $(BUILD_DIR)/ngham_packets_fsat.o $(BUILD_DIR)/platform_fsat.o
$(CC) -shared -fPIC -Wall -o $(BUILD_DIR)/$(TARGET) $(BUILD_DIR)/ccsds_scrambler_fsat.o $(BUILD_DIR)/crc_ccitt_fsat.o $(BUILD_DIR)/fec_fsat.o $(BUILD_DIR)/ngham_fsat.o $(BUILD_DIR)/ngham_extension_fsat.o $(BUILD_DIR)/ngham_packets_fsat.o $(BUILD_DIR)/platform_fsat.o -lc

$(BUILD_DIR)/ccsds_scrambler_fsat.o: ccsds_scrambler.c ccsds_scrambler.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/crc_ccitt_fsat.o: crc_ccitt.c crc_ccitt.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/fec_fsat.o: fec.c fec.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham_fsat.o: ngham.c ngham.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham_extension_fsat.o: ngham_extension.c ngham_extension.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/ngham_packets_fsat.o: ngham_packets.c ngham_packets.h
$(CC) $(CFLAGS) $@ $<

$(BUILD_DIR)/platform_fsat.o: platform/platform.c platform/platform.h
$(CC) $(CFLAGS) $@ $<

clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/$(TARGET)
Loading

0 comments on commit d430809

Please sign in to comment.