Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
CHANGELOG update and some more gcc 6 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gempa-jabe committed Jun 6, 2016
1 parent befc25b commit cef1c44
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 78 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -62,6 +62,11 @@ UPDATE Meta SET value='0.8' WHERE name='Schema-Version';

* Enhance documentation of scqc and others

* NonLinLoc

* Fixed bug that caused wrong confidence ellipsoid axis length measures.
Values are expected in meters but the wrapper exported then as kilometers.

* trunk

* Add support for HMB (http messaging bus) messaging protocol
Expand Down
18 changes: 18 additions & 0 deletions CMakeLists.txt
Expand Up @@ -99,6 +99,24 @@ IF (CMAKE_COMPILER_IS_GNUCC)
ELSE ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )
ADD_DEFINITIONS(-Wall)
ENDIF ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )

# Query gcc version. We can't use CMAKE_CXX_COMPILER_VERSION which is
# only supported in cmake >= 2.8.10. SLES 11 still comes with cmake 2.6.
EXECUTE_PROCESS(
COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION
)

STRING(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
LIST(GET GCC_VERSION_COMPONENTS 0 GCC_VERSION_MAJOR)
LIST(GET GCC_VERSION_COMPONENTS 1 GCC_VERSION_MINOR)

MESSAGE(STATUS "Found gcc version ${GCC_VERSION_MAJOR}.${GCC_VERSION_MINOR}")

# gcc 6 defaults to C++14 which might break compilation
IF(GCC_VERSION_MAJOR GREATER 5)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
ENDIF(GCC_VERSION_MAJOR GREATER 5)
ENDIF (CMAKE_COMPILER_IS_GNUCC)

# Set the platform specific suffix for dynamic libraries
Expand Down
2 changes: 1 addition & 1 deletion Modules/CreateLibrary.cmake
Expand Up @@ -424,7 +424,7 @@ ENDMACRO(SC_ADD_EXECUTABLE)


MACRO(SC_ADD_PYTHON_EXECUTABLE _name)
UNSET(MAIN_PY)
SET(MAIN_PY "")
FOREACH(file ${${_name}_FILES})
IF(NOT MAIN_PY)
SET(MAIN_PY ${file})
Expand Down
5 changes: 4 additions & 1 deletion src/seedlink/plugins/q330plugin/CMakeLists.txt
Expand Up @@ -16,7 +16,10 @@ INCLUDE_DIRECTORIES(${Q330_INC})
SET(CONFIG_FILE ${SC3_PACKAGE_INSTALL_PREFIX}/acquisition/config/plugins.ini)

SET(OPTIONS -DSYSLOG_FACILITY=LOG_LOCAL0 -DCONFIG_FILE=\\\"${CONFIG_FILE}\\\")
SET(PLATFORM -DLINUX -D_REENTRANT)
SET(PLATFORM -D_REENTRANT)
IF(LINUX)
SET(PLATFORM ${PLATFORM} -DLINUX -Dlinux)
ENDIF(LINUX)

ADD_DEFINITIONS(${OPTIONS} ${PLATFORM})

Expand Down
2 changes: 1 addition & 1 deletion src/seedlink/plugins/reftek_plugin/CMakeLists.txt
Expand Up @@ -20,7 +20,7 @@ INCLUDE_DIRECTORIES(${RT_INC})
SET(CONFIG_FILE ${SC3_PACKAGE_INSTALL_PREFIX}/acquisition/config/plugins.ini)

SET(OPTIONS -DSYSLOG_FACILITY=LOG_LOCAL0 -DCONFIG_FILE=\\\"${CONFIG_FILE}\\\")
SET(PLATFORM -DLINUX -D_REENTRANT)
SET(PLATFORM -DLINUX -D_REENTRANT -Dunix)

ADD_DEFINITIONS(${OPTIONS} ${PLATFORM})

Expand Down
2 changes: 2 additions & 0 deletions src/trunk/libs/seiscomp3/core/version.h
Expand Up @@ -42,6 +42,8 @@ namespace Core {
- Added class Seiscomp::DataModel::ResponseFAP
- Changed Seiscomp::IO::GFArchive::addRequest from 1D request signature to
3D request signature (distance,depth) -> (source,receiver)
- Made Seiscomp::RecordStream::SDSArchive private members and methods
protected
"7.0.0" 0x070000
- Added support for httpmsgbus messaging protocol
Expand Down
39 changes: 18 additions & 21 deletions src/trunk/libs/seiscomp3/io/recordstream/sdsarchive.cpp
Expand Up @@ -26,24 +26,6 @@ using namespace Seiscomp::Core;
using namespace std;


namespace {

Time getStartTime(const string &file) {
MSRecord *prec = NULL;
MSFileParam *pfp = NULL;

int retcode = ms_readmsr_r(&pfp,&prec,const_cast<char*>(file.c_str()),0,NULL,NULL,1,0,0);
if ( retcode == MS_NOERROR ) {
Time start((hptime_t)prec->starttime/HPTMODULUS,(hptime_t)prec->starttime%HPTMODULUS);
ms_readmsr_r(&pfp,&prec,NULL,-1,NULL,NULL,0,0,0);
return start;
}

ms_readmsr_r(&pfp,&prec,NULL,-1,NULL,NULL,0,0,0);
return Time();
}

}

IMPLEMENT_SC_CLASS_DERIVED(SDSArchive,
Seiscomp::IO::RecordStream,
Expand Down Expand Up @@ -154,6 +136,21 @@ string SDSArchive::archiveRoot() const {
return _arcroot;
}

Time SDSArchive::getStartTime(const string &file) {
MSRecord *prec = NULL;
MSFileParam *pfp = NULL;

int retcode = ms_readmsr_r(&pfp,&prec,const_cast<char*>(file.c_str()),0,NULL,NULL,1,0,0);
if ( retcode == MS_NOERROR ) {
Time start((hptime_t)prec->starttime/HPTMODULUS,(hptime_t)prec->starttime%HPTMODULUS);
ms_readmsr_r(&pfp,&prec,NULL,-1,NULL,NULL,0,0,0);
return start;
}

ms_readmsr_r(&pfp,&prec,NULL,-1,NULL,NULL,0,0,0);
return Time();
}

int SDSArchive::getDoy(const Time &time) {
int year;

Expand All @@ -163,7 +160,7 @@ int SDSArchive::getDoy(const Time &time) {
return (365-((int)(Time(year,12,31,23,59,59)-time)/86400));
}

string SDSArchive::SDSfilename(int doy, int year) {
string SDSArchive::filename(int doy, int year) {
string net = _curidx->network();
string sta = _curidx->station();
string cha = _curidx->channel();
Expand Down Expand Up @@ -194,13 +191,13 @@ void SDSArchive::setFilenames() {
for ( int year = syear; year <= eyear; ++year ) {
tmpdoy = (year == eyear)?edoy:getDoy(Time(year,12,31,23,59,59));
for ( int doy = sdoy; doy <= tmpdoy; ++doy ) {
string file = SDSfilename(doy,year);
string file = filename(doy,year);
if ( first ) {
if ( getStartTime(file) > stime ) {
Time tmptime = stime - TimeSpan(86400,0);
int tmpdoy2;
tmptime.get2(&tmpyear, &tmpdoy2);
_fnames.push(SDSfilename(tmpdoy2+1, tmpyear));
_fnames.push(filename(tmpdoy2+1, tmpyear));
}
}

Expand Down
117 changes: 64 additions & 53 deletions src/trunk/libs/seiscomp3/io/recordstream/sdsarchive.h
Expand Up @@ -20,7 +20,6 @@
#include <seiscomp3/io/recordstream.h>
#include <seiscomp3/io/recordstream/archive.h>
#include <seiscomp3/io/recordstream/streamidx.h>
#include <seiscomp3/core.h>


namespace Seiscomp {
Expand All @@ -35,60 +34,72 @@ DEFINE_SMARTPOINTER(SDSArchive);
archive structure:
<root>/<year>/<net>/<sta>/<cha>.D/<net>.<sta>.<loc>.<cha>.D.<year>.<doy> */
class SC_SYSTEM_CORE_API SDSArchive: public Seiscomp::IO::RecordStream {
DECLARE_SC_CLASS(SDSArchive);

friend class IsoFile;

public:
// ----------------------------------------------------------------------
// Xstruction
// ----------------------------------------------------------------------
SDSArchive();
SDSArchive(const std::string arcroot);
SDSArchive(const SDSArchive &arc);
virtual ~SDSArchive();

// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
SDSArchive& operator=(const SDSArchive &arc);

// ----------------------------------------------------------------------
// Public Interface
// ----------------------------------------------------------------------
bool setSource(std::string src);
bool addStream(std::string net, std::string sta, std::string loc, std::string cha);
bool addStream(std::string net, std::string sta, std::string loc, std::string cha,
const Seiscomp::Core::Time &stime, const Seiscomp::Core::Time &etime);
bool removeStream(std::string net, std::string sta, std::string loc, std::string cha);
bool setStartTime(const Seiscomp::Core::Time &stime);
bool setEndTime(const Seiscomp::Core::Time &etime);
bool setTimeWindow(const Seiscomp::Core::TimeWindow &w);
bool setTimeout(int seconds);
std::istream& stream() throw(ArchiveException);
void close();
std::string archiveRoot() const;

private:
// ----------------------------------------------------------------------
// Implementation
// ----------------------------------------------------------------------
std::string _arcroot;
Seiscomp::Core::Time _stime;
Seiscomp::Core::Time _etime;
std::set<StreamIdx> _streams;
std::set<StreamIdx>::const_iterator _curiter;
StreamIdx const *_curidx;
std::queue<std::string> _fnames;
Seiscomp::IO::RecordStreamPtr _recstream;

int getDoy(const Seiscomp::Core::Time &time);
std::string SDSfilename(int doy, int year);
void setFilenames();
bool setStart(const std::string &fname);
bool isEnd();
DECLARE_SC_CLASS(SDSArchive);

// ----------------------------------------------------------------------
// Xstruction
// ----------------------------------------------------------------------
public:
SDSArchive();
SDSArchive(const std::string arcroot);
SDSArchive(const SDSArchive &arc);
virtual ~SDSArchive();


// ----------------------------------------------------------------------
// Operators
// ----------------------------------------------------------------------
public:
SDSArchive& operator=(const SDSArchive &arc);


// ----------------------------------------------------------------------
// Public Interface
// ----------------------------------------------------------------------
public:
bool setSource(std::string src);
bool addStream(std::string net, std::string sta, std::string loc, std::string cha);
bool addStream(std::string net, std::string sta, std::string loc, std::string cha,
const Seiscomp::Core::Time &stime, const Seiscomp::Core::Time &etime);
bool removeStream(std::string net, std::string sta, std::string loc, std::string cha);
bool setStartTime(const Seiscomp::Core::Time &stime);
bool setEndTime(const Seiscomp::Core::Time &etime);
bool setTimeWindow(const Seiscomp::Core::TimeWindow &w);
bool setTimeout(int seconds);
std::istream& stream() throw(ArchiveException);
void close();
std::string archiveRoot() const;


// ----------------------------------------------------------------------
// Protected interface
// ----------------------------------------------------------------------
protected:
Seiscomp::Core::Time getStartTime(const std::string &file);
int getDoy(const Seiscomp::Core::Time &time);
virtual std::string filename(int doy, int year);
virtual void setFilenames();
bool setStart(const std::string &fname);
bool isEnd();


// ----------------------------------------------------------------------
// Protected members
// ----------------------------------------------------------------------
protected:
std::string _arcroot;
Seiscomp::Core::Time _stime;
Seiscomp::Core::Time _etime;
std::set<StreamIdx> _streams;
std::set<StreamIdx>::const_iterator _curiter;
StreamIdx const *_curidx;
std::queue<std::string> _fnames;
Seiscomp::IO::RecordStreamPtr _recstream;

friend class IsoFile;
};


}
}

Expand Down
3 changes: 2 additions & 1 deletion src/trunk/libs/seiscomp3/processing/secondarypicker/S_l2.cpp
Expand Up @@ -469,7 +469,8 @@ void SL2Picker::process(const Record *rec, const DoubleArray &filteredData) {
// Apply detection filter
if ( _stream.filter )
_stream.filter->apply(1, &fv);
if ( _saveIntermediate ) _detectionTrace.append(1, fv);

if ( _saveIntermediate ) _detectionTrace.append(1, fv);

//std::cout << v << " " << fv << std::endl;

Expand Down

0 comments on commit cef1c44

Please sign in to comment.