Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
1 change: 1 addition & 0 deletions src/seedlink/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ IF ( NOT MACOSX )
sockplugin
wave24_plugin
win_plugin
seismicpi_plugin
)
ENDIF ( NOT MACOSX )

Expand Down
79 changes: 79 additions & 0 deletions src/seedlink/plugins/descriptions/seedlink_seismicpi.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<seiscomp>
<binding module="seedlink" name="seismicpi" category="sources">
<description>SeismicPI HAT Interface</description>
<configuration>
<parameter name="port_path_hint" type="string" default="/dev/ttyS0">
<description>
Device path and name of port for USB Seismometer Interface.
If the specified port cannot be opened or is not a USB Seismometer
Interface device, all available ports will be scanned.
</description>
</parameter>
<parameter name="allow_set_interface_attribs" type="int" default="1">
<description>
Allow low-level setting of port interface attributes when available
ports are scanned to find a USB Seismometer Interface device, 0=NO, 1=Yes.
Setting 1 (=Yes) may help successful detection and correct reading of the
USB Seismometer Interface device, particularly for the RasberryPi, but can
have adverse effects on other devices, terminals, etc. open on the system.
</description>
</parameter>
<parameter name="mswrite_header_sample_rate" type="double" default="32">
<description>
Sets a fixed sample rate to report in the miniseed file header.
The default (32) sets the sample rate to 32 samples per second.
See also: nominal_sample_rate
</description>
</parameter>
<parameter name="mswrite_data_encoding_type" type="string" default="STEIM2">
<description>
SEED data encoding type for writing miniseed files.
Supported values are: INT16, INT32, STEIM1, STEIM2
</description>
</parameter>
<parameter name="channel_prefix" type="string" default="BH">
<description>
The initial letters to set for the miniseed header 'channel', will be
prepended to the component.
</description>
</parameter>
<parameter name="locationcode_prefix" type="string" default="00">
<description>
The initial code to set for the miniseed header 'location', will be
prepended to the component. If empty JamaSeis software will not be able to acquire data.
</description>
</parameter>
<parameter name="component" type="string" default="Z">
<description>
Component of seismogram, one of Z, N or E.
</description>
</parameter>
<parameter name="do_settings_sep064" type="int" default="1">
<description>
Set sample rate and gain on SeismicPi HAT device, 0=NO, 1=Yes.
</description>
</parameter>
<parameter name="nominal_sample_rate" type="int" default="32">
<description>
Nominal sample rate per second, one of 32, 64 or 128.
</description>
</parameter>
<parameter name="nominal_gain" type="int" default="4">
<description>
Nominal gain, one of 1, 2, 4 or 8.
</description>
</parameter>
<parameter name="single_multi" type="int" default="2">
<description>
Single (1) or Multi Channel (2) acquisition.
</description>
</parameter>
<parameter name="source_select" type="int" default="1">
<description>
Select as source the internal accelerometer (1) or an external devicce (2).
</description>
</parameter>
</configuration>
</binding>
</seiscomp>
16 changes: 16 additions & 0 deletions src/seedlink/plugins/seismicpi_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SET(SEISMICPI_PLUGIN_SOURCES
seismicpi_writer.c
seismicpi_writer.h
seismicpidevice.c
seismicpidevice.h
settings/settings.c
settings/settings.h
settings/strmap.c
settings/strmap.h
)

INCLUDE_DIRECTORIES(../../libs/plugin ${LIBMSEED_INCLUDE_DIR})
ADD_EXECUTABLE(seismicpi_plugin ${SEISMICPI_PLUGIN_SOURCES})
TARGET_LINK_LIBRARIES(seismicpi_plugin rt slplugin ${LIBMSEED_LIBRARY})
INSTALL(TARGETS seismicpi_plugin RUNTIME DESTINATION ${SEEDLINK_PLUGIN_OUTPUT_DIR})

86 changes: 86 additions & 0 deletions src/seedlink/plugins/seismicpi_plugin/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@

# Build environment can be configured the following
# environment variables:
# CC : Specify the C compiler to use
# CFLAGS : Specify compiler options to use

# IMPORTANT: change here to set the directory for binary executable files
ifdef MYBIN
export BINDIR=${MYBIN}
else
# with the following, binary executables will be placed in bin subdirectory of your home directory
#BINDIR=~/bin/
# if in doubt, use the following - binary executables will be placed in the current directory
export BINDIR=.
endif

# Options specific for GCC
ifndef CC
export CC = gcc
endif
#
ifndef CCFLAGS
#
export CCFLAGS_BASIC = -Wall -fPIC -I..
#
# optimized
export CCFLAGS = -O3 $(CCFLAGS_BASIC)
#
# profile
#CCFLAGS=-O3 -pg $(CCFLAGS_BASIC)
#
# debug - gdb, valgrind, ...
#CCFLAGS = $(CCFLAGS_BASIC) -g
# valgrind --leak-check=yes exe_name <args>
# valgrind --leak-check=full --show-reachable=yes exe_name exe_name <args>
endif

#LDFLAGS = -L..
#LDLIBS = -lm

# variables to support compiling in different configurations (called by higher level Makefile in distribution)
ifndef LIB_MSEED
export LIB_MSEED = -lmseed
endif
ifndef LIB_RT
export LIB_RT =
endif

OBJ=seismicpidevice.o settings/settings.o settings/strmap.o


all: $(BINDIR)/seismicpi_writer

$(BINDIR)/seismicpi_writer: seismicpi_writer.o modules $(OBJ)
$(CC) $(CCFLAGS) -o $(BINDIR)/seismicpi_writer seismicpi_writer.o $(OBJ) $(LIB_MSEED) $(LIB_RT) -lm


MODULES = \
settings

modules:
@for x in $(MODULES); \
do \
(echo ------; cd $$x; echo Making $@ in:; pwd; \
make -f Makefile); \
done

clean:
@for x in $(MODULES); \
do \
(cd $$x; echo Cleaning in:; pwd; \
make -f Makefile clean); \
done
rm -f $(BINDIR)/seismicpi_writer
rm -f *.o
rm -f *.a


# Implicit rule for building object files
%.o: %.c
$(CC) $(CCFLAGS) -c $<

install:
@echo
@echo "No install target, copy the executable(s) yourself"
@echo
Loading