Install SeisComP and scanloc ARM64 nightly packages
This commit is contained in:
@ -21,18 +21,21 @@
|
||||
#ifndef SEISCOMP_SERVICES_RECORDSTREAM_COMBINED_H
|
||||
#define SEISCOMP_SERVICES_RECORDSTREAM_COMBINED_H
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <seiscomp/core/datetime.h>
|
||||
#include <seiscomp/core/timewindow.h>
|
||||
#include <seiscomp/io/recordstream.h>
|
||||
#include <seiscomp/io/recordstream/streamidx.h>
|
||||
#include <seiscomp/core.h>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace RecordStream {
|
||||
|
||||
DEFINE_SMARTPOINTER(CombinedConnection);
|
||||
|
||||
DEFINE_SMARTPOINTER(CombinedConnection);
|
||||
class SC_SYSTEM_CORE_API CombinedConnection : public IO::RecordStream {
|
||||
public:
|
||||
//! C'tor
|
||||
@ -42,41 +45,41 @@ class SC_SYSTEM_CORE_API CombinedConnection : public IO::RecordStream {
|
||||
CombinedConnection(std::string serverloc);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CombinedConnection();
|
||||
~CombinedConnection() override;
|
||||
|
||||
virtual bool setRecordType(const char*);
|
||||
bool setRecordType(const char*) override;
|
||||
|
||||
//! Initialize the combined connection.
|
||||
virtual bool setSource(const std::string &serverloc);
|
||||
bool setSource(const std::string &serverloc) override;
|
||||
|
||||
//! Adds the given stream to the server connection description
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode) override;
|
||||
|
||||
//! Adds the given stream to the server connection description
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const OPT(Core::Time) &startTime,
|
||||
const OPT(Core::Time) &endTime) override;
|
||||
|
||||
//! Adds the given start time to the server connection description
|
||||
virtual bool setStartTime(const Core::Time &stime);
|
||||
bool setStartTime(const OPT(Core::Time) &stime) override;
|
||||
|
||||
//! Adds the given end time to the server connection description
|
||||
virtual bool setEndTime(const Core::Time &etime);
|
||||
bool setEndTime(const OPT(Core::Time) &etime) override;
|
||||
|
||||
//! Sets timeout
|
||||
virtual bool setTimeout(int seconds);
|
||||
bool setTimeout(int seconds) override;
|
||||
|
||||
//! Terminates the combined connection.
|
||||
virtual void close();
|
||||
void close() override;
|
||||
|
||||
//! Returns the data stream
|
||||
virtual Record *next();
|
||||
Record *next() override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
@ -88,8 +91,8 @@ class SC_SYSTEM_CORE_API CombinedConnection : public IO::RecordStream {
|
||||
size_t _nArchive;
|
||||
size_t _nRealtime;
|
||||
|
||||
Core::Time _startTime;
|
||||
Core::Time _endTime;
|
||||
OPT(Core::Time) _startTime;
|
||||
OPT(Core::Time) _endTime;
|
||||
Core::Time _archiveEndTime;
|
||||
Core::TimeSpan _realtimeAvailability;
|
||||
|
||||
|
||||
@ -62,14 +62,14 @@ class SC_SYSTEM_CORE_API Concurrent : public IO::RecordStream {
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime) override;
|
||||
const OPT(Seiscomp::Core::Time) &startTime,
|
||||
const OPT(Seiscomp::Core::Time) &endTime) override;
|
||||
|
||||
//! Adds the given start time to the server connection description
|
||||
bool setStartTime(const Core::Time &stime) override;
|
||||
bool setStartTime(const OPT(Core::Time) &stime) override;
|
||||
|
||||
//! Adds the given end time to the server connection description
|
||||
bool setEndTime(const Core::Time &etime) override;
|
||||
bool setEndTime(const OPT(Core::Time) &etime) override;
|
||||
|
||||
//! Adds the given end time window to the server connection description
|
||||
bool setTimeWindow(const Core::TimeWindow &w) override;
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#ifndef SEISCOMP_RECORDSTREAM_DECIMATION_H
|
||||
#define SEISCOMP_RECORDSTREAM_DECIMATION_H
|
||||
|
||||
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
|
||||
@ -28,48 +29,49 @@
|
||||
#include <seiscomp/io/recordstream.h>
|
||||
#include <seiscomp/core.h>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace RecordStream {
|
||||
|
||||
DEFINE_SMARTPOINTER(Decimation);
|
||||
|
||||
DEFINE_SMARTPOINTER(Decimation);
|
||||
class SC_SYSTEM_CORE_API Decimation : public Seiscomp::IO::RecordStream {
|
||||
// ----------------------------------------------------------------------
|
||||
// Xstruction
|
||||
// ----------------------------------------------------------------------
|
||||
public:
|
||||
Decimation();
|
||||
virtual ~Decimation();
|
||||
~Decimation() override;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Public Interface
|
||||
// ----------------------------------------------------------------------
|
||||
public:
|
||||
virtual bool setSource(const std::string &source);
|
||||
virtual bool setRecordType(const char *type);
|
||||
bool setSource(const std::string &source) override;
|
||||
bool setRecordType(const char *type) override;
|
||||
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode) override;
|
||||
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &stime,
|
||||
const Seiscomp::Core::Time &etime);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const OPT(Core::Time) &stime,
|
||||
const OPT(Core::Time) &etime) override;
|
||||
|
||||
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
|
||||
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
|
||||
virtual bool setTimeWindow(const Seiscomp::Core::TimeWindow &w);
|
||||
bool setStartTime(const OPT(Core::Time) &stime) override;
|
||||
bool setEndTime(const OPT(Core::Time) &etime) override;
|
||||
bool setTimeWindow(const Core::TimeWindow &w) override;
|
||||
|
||||
virtual bool setTimeout(int seconds);
|
||||
bool setTimeout(int seconds) override;
|
||||
|
||||
virtual void close();
|
||||
void close() override;
|
||||
|
||||
virtual Record *next();
|
||||
Record *next() override;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@ -124,10 +126,10 @@ class SC_SYSTEM_CORE_API Decimation : public Seiscomp::IO::RecordStream {
|
||||
size_t front;
|
||||
|
||||
// Time of front of ring buffer
|
||||
Core::Time startTime;
|
||||
OPT(Core::Time) startTime;
|
||||
|
||||
// End time of last record
|
||||
Core::Time lastEndTime;
|
||||
OPT(Core::Time) lastEndTime;
|
||||
|
||||
ResampleStage *nextStage;
|
||||
|
||||
@ -135,10 +137,12 @@ class SC_SYSTEM_CORE_API Decimation : public Seiscomp::IO::RecordStream {
|
||||
missingSamples = buffer.size();
|
||||
front = 0;
|
||||
samplesToSkip = 0;
|
||||
startTime = Core::Time();
|
||||
lastEndTime = Core::Time();
|
||||
startTime = Core::None;
|
||||
lastEndTime = Core::None;
|
||||
|
||||
if ( nextStage ) nextStage->reset();
|
||||
if ( nextStage ) {
|
||||
nextStage->reset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -46,40 +46,42 @@ class SC_SYSTEM_CORE_API FDSNWSConnectionBase : public IO::RecordStream {
|
||||
public:
|
||||
//! The recordtype cannot be selected when using an arclink
|
||||
//! connection. It will always create MiniSeed records
|
||||
virtual bool setRecordType(const char *type);
|
||||
bool setRecordType(const char *type) override;
|
||||
|
||||
//! Initialize the arclink connection.
|
||||
virtual bool setSource(const std::string &source);
|
||||
bool setSource(const std::string &source) override;
|
||||
|
||||
//! Supply user credentials
|
||||
//! Adds the given stream to the server connection description
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode) override;
|
||||
|
||||
//! Adds the given stream to the server connection description
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Core::Time &startTime,
|
||||
const Core::Time &endTime);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const OPT(Core::Time) &startTime,
|
||||
const OPT(Core::Time) &endTime) override;
|
||||
|
||||
//! Adds the given start time to the server connection description
|
||||
virtual bool setStartTime(const Core::Time &startTime);
|
||||
bool setStartTime(const OPT(Core::Time) &startTime) override;
|
||||
|
||||
//! Adds the given end time to the server connection description
|
||||
virtual bool setEndTime(const Core::Time &endTime);
|
||||
bool setEndTime(const OPT(Core::Time) &endTime) override;
|
||||
|
||||
//! Sets timeout
|
||||
virtual bool setTimeout(int seconds);
|
||||
bool setTimeout(int seconds) override;
|
||||
|
||||
//! Terminates the arclink connection.
|
||||
virtual void close();
|
||||
void close() override;
|
||||
|
||||
virtual Record *next();
|
||||
Record *next() override;
|
||||
|
||||
|
||||
private:
|
||||
//! Reconnects a terminated arclink connection.
|
||||
bool reconnect();
|
||||
|
||||
@ -103,8 +105,8 @@ class SC_SYSTEM_CORE_API FDSNWSConnectionBase : public IO::RecordStream {
|
||||
std::string _url;
|
||||
int _defaultPort;
|
||||
std::set<StreamIdx> _streams;
|
||||
Core::Time _stime;
|
||||
Core::Time _etime;
|
||||
OPT(Core::Time) _stime;
|
||||
OPT(Core::Time) _etime;
|
||||
std::string _reqID;
|
||||
bool _readingData;
|
||||
bool _chunkMode;
|
||||
|
||||
@ -77,11 +77,11 @@ class SC_SYSTEM_CORE_API File : public Seiscomp::IO::RecordStream {
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime) override;
|
||||
const OPT(Seiscomp::Core::Time) &startTime,
|
||||
const OPT(Seiscomp::Core::Time) &endTime) override;
|
||||
|
||||
bool setStartTime(const Seiscomp::Core::Time &startTime) override;
|
||||
bool setEndTime(const Seiscomp::Core::Time &endTime) override;
|
||||
bool setStartTime(const OPT(Seiscomp::Core::Time) &startTime) override;
|
||||
bool setEndTime(const OPT(Seiscomp::Core::Time) &endTime) override;
|
||||
|
||||
void close() override;
|
||||
|
||||
@ -107,27 +107,28 @@ class SC_SYSTEM_CORE_API File : public Seiscomp::IO::RecordStream {
|
||||
private:
|
||||
struct TimeWindowFilter {
|
||||
TimeWindowFilter() {}
|
||||
TimeWindowFilter(const Core::Time &stime, const Core::Time &etime)
|
||||
TimeWindowFilter(const OPT(Core::Time) &stime,
|
||||
const OPT(Core::Time) &etime)
|
||||
: start(stime), end(etime) {}
|
||||
|
||||
Core::Time start;
|
||||
Core::Time end;
|
||||
OPT(Core::Time) start;
|
||||
OPT(Core::Time) end;
|
||||
};
|
||||
|
||||
using FilterMap = std::map<std::string, TimeWindowFilter>;
|
||||
using ReFilterList = std::vector<std::pair<std::string,TimeWindowFilter> >;
|
||||
|
||||
const TimeWindowFilter* findTimeWindowFilter(Record *rec);
|
||||
const TimeWindowFilter *findTimeWindowFilter(Record *rec);
|
||||
|
||||
RecordFactory *_factory{nullptr};
|
||||
std::string _name;
|
||||
bool _closeRequested;
|
||||
std::fstream _fstream;
|
||||
std::istream *_current{&_fstream};
|
||||
FilterMap _filter;
|
||||
ReFilterList _reFilter;
|
||||
Core::Time _startTime;
|
||||
Core::Time _endTime;
|
||||
RecordFactory *_factory{nullptr};
|
||||
std::string _name;
|
||||
bool _closeRequested;
|
||||
std::fstream _fstream;
|
||||
std::istream *_current{&_fstream};
|
||||
FilterMap _filter;
|
||||
ReFilterList _reFilter;
|
||||
OPT(Core::Time) _startTime;
|
||||
OPT(Core::Time) _endTime;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -32,9 +32,10 @@
|
||||
#include <seiscomp/io/httpsocket.h>
|
||||
#include <seiscomp/io/recordstream/streamidx.h>
|
||||
|
||||
extern "C" {
|
||||
#include "bson/bson.h"
|
||||
}
|
||||
|
||||
struct _bson_t;
|
||||
typedef bson_t _bson_t;
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace RecordStream {
|
||||
@ -50,7 +51,8 @@ class SC_SYSTEM_CORE_API HMBQueue {
|
||||
|
||||
//! Adds the given stream
|
||||
void addStream(std::string loc, std::string cha,
|
||||
const Seiscomp::Core::Time &stime, const Seiscomp::Core::Time &etime);
|
||||
const OPT(Core::Time) &stime,
|
||||
const OPT(Core::Time) &etime);
|
||||
|
||||
//! Sets the sequence number
|
||||
void setSequenceNumber(int64_t seq);
|
||||
@ -62,9 +64,9 @@ class SC_SYSTEM_CORE_API HMBQueue {
|
||||
bson_t* toBSON() const;
|
||||
|
||||
private:
|
||||
Core::Time _stime;
|
||||
Core::Time _etime;
|
||||
int64_t _seq;
|
||||
OPT(Core::Time) _stime;
|
||||
OPT(Core::Time) _etime;
|
||||
int64_t _seq;
|
||||
std::set<std::string> _topics;
|
||||
};
|
||||
|
||||
@ -81,44 +83,46 @@ class SC_SYSTEM_CORE_API HMBConnection : public Seiscomp::IO::RecordStream {
|
||||
HMBConnection(std::string serverloc);
|
||||
|
||||
//! Destructor
|
||||
virtual ~HMBConnection();
|
||||
~HMBConnection() override;
|
||||
|
||||
//! The recordtype cannot be selected when using an HMB
|
||||
//! connection. It will always create MiniSeed records
|
||||
virtual bool setRecordType(const char *type);
|
||||
bool setRecordType(const char *type) override;
|
||||
|
||||
//! Initialize the HMB connection.
|
||||
virtual bool setSource(const std::string &source);
|
||||
bool setSource(const std::string &source) override;
|
||||
|
||||
//! Supply user credentials
|
||||
//! Adds the given stream to the server connection description
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode) override;
|
||||
|
||||
//! Adds the given stream to the server connection description
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const OPT(Core::Time) &startTime,
|
||||
const OPT(Core::Time) &endTime) override;
|
||||
|
||||
//! Adds the given start time to the server connection description
|
||||
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
|
||||
bool setStartTime(const OPT(Core::Time) &stime) override;
|
||||
|
||||
//! Adds the given end time to the server connection description
|
||||
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
|
||||
bool setEndTime(const OPT(Core::Time) &etime) override;
|
||||
|
||||
//! Sets timeout
|
||||
virtual bool setTimeout(int seconds);
|
||||
bool setTimeout(int seconds) override;
|
||||
|
||||
//! Terminates the HMB connection.
|
||||
virtual void close();
|
||||
void close() override;
|
||||
|
||||
virtual Record *next();
|
||||
Record *next() override;
|
||||
|
||||
|
||||
private:
|
||||
//! Removes all stream list, time window, etc. -entries from the connection description object.
|
||||
bool clear();
|
||||
|
||||
@ -127,18 +131,18 @@ class SC_SYSTEM_CORE_API HMBConnection : public Seiscomp::IO::RecordStream {
|
||||
|
||||
|
||||
private:
|
||||
IO::HttpSocket<SocketType> _sock;
|
||||
std::string _serverHost;
|
||||
std::string _serverPath;
|
||||
std::string _user;
|
||||
std::string _password;
|
||||
IO::HttpSocket<SocketType> _sock;
|
||||
std::string _serverHost;
|
||||
std::string _serverPath;
|
||||
std::string _user;
|
||||
std::string _password;
|
||||
std::set<Seiscomp::RecordStream::StreamIdx> _streams;
|
||||
Seiscomp::Core::Time _stime;
|
||||
Seiscomp::Core::Time _etime;
|
||||
std::map<std::string, HMBQueue> _queues;
|
||||
std::string _sid;
|
||||
std::string _cid;
|
||||
bool _readingData;
|
||||
OPT(Core::Time) _stime;
|
||||
OPT(Core::Time) _etime;
|
||||
std::map<std::string, HMBQueue> _queues;
|
||||
std::string _sid;
|
||||
std::string _cid;
|
||||
bool _readingData;
|
||||
|
||||
std::string bsonGetString(const bson_t *bson, const char *key);
|
||||
int64_t bsonGetInt(const bson_t *bson, const char *key);
|
||||
|
||||
@ -52,27 +52,27 @@ class SC_SYSTEM_CORE_API Memory: public Seiscomp::IO::RecordStream {
|
||||
public:
|
||||
Memory &operator=(const Memory &mem);
|
||||
|
||||
virtual bool setSource(const std::string &);
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
bool setSource(const std::string &) override;
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode) override;
|
||||
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const OPT(Seiscomp::Core::Time) &startTime,
|
||||
const OPT(Seiscomp::Core::Time) &endTime) override;
|
||||
|
||||
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
|
||||
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
|
||||
bool setStartTime(const OPT(Seiscomp::Core::Time) &stime) override;
|
||||
bool setEndTime(const OPT(Seiscomp::Core::Time) &etime) override;
|
||||
|
||||
virtual void close();
|
||||
void close() override;
|
||||
|
||||
virtual bool setRecordType(const char *type);
|
||||
bool setRecordType(const char *type) override;
|
||||
|
||||
Record *next();
|
||||
Record *next() override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#ifndef SEISCOMP_RECORDSTREAM_RESAMPLE_H
|
||||
#define SEISCOMP_RECORDSTREAM_RESAMPLE_H
|
||||
|
||||
|
||||
#include <sstream>
|
||||
#include <map>
|
||||
#include <deque>
|
||||
@ -48,30 +49,30 @@ class SC_SYSTEM_CORE_API Resample : public Seiscomp::IO::RecordStream {
|
||||
// Public Interface
|
||||
// ----------------------------------------------------------------------
|
||||
public:
|
||||
virtual bool setSource(const std::string &source);
|
||||
virtual bool setRecordType(const char *type);
|
||||
virtual bool setSource(const std::string &source) override;
|
||||
virtual bool setRecordType(const char *type) override;
|
||||
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
const std::string &channelCode) override;
|
||||
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime);
|
||||
const OPT(Core::Time) &startTime,
|
||||
const OPT(Core::Time) &endTime) override;
|
||||
|
||||
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
|
||||
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
|
||||
virtual bool setTimeWindow(const Seiscomp::Core::TimeWindow &w);
|
||||
virtual bool setStartTime(const OPT(Core::Time) &stime) override;
|
||||
virtual bool setEndTime(const OPT(Core::Time) &etime) override;
|
||||
virtual bool setTimeWindow(const Core::TimeWindow &w) override;
|
||||
|
||||
virtual bool setTimeout(int seconds);
|
||||
virtual bool setTimeout(int seconds) override;
|
||||
|
||||
virtual void close();
|
||||
virtual void close() override;
|
||||
|
||||
virtual Record *next();
|
||||
virtual Record *next() override;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@ -48,36 +48,36 @@ class SDSArchive : public Seiscomp::IO::RecordStream {
|
||||
public:
|
||||
SDSArchive();
|
||||
SDSArchive(const std::string arcroot);
|
||||
virtual ~SDSArchive();
|
||||
~SDSArchive() override;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Public Interface
|
||||
// ----------------------------------------------------------------------
|
||||
public:
|
||||
virtual bool setSource(const std::string &source);
|
||||
bool setSource(const std::string &source) override;
|
||||
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode) override;
|
||||
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const OPT(Core::Time) &startTime,
|
||||
const OPT(Core::Time) &endTime) override;
|
||||
|
||||
virtual bool setStartTime(const Seiscomp::Core::Time &stime);
|
||||
virtual bool setEndTime(const Seiscomp::Core::Time &etime);
|
||||
virtual bool setTimeWindow(const Seiscomp::Core::TimeWindow &tw);
|
||||
bool setStartTime(const OPT(Core::Time) &stime) override;
|
||||
bool setEndTime(const OPT(Core::Time) &etime) override;
|
||||
bool setTimeWindow(const Core::TimeWindow &tw) override;
|
||||
|
||||
virtual bool setTimeout(int seconds);
|
||||
bool setTimeout(int seconds) override;
|
||||
|
||||
virtual void close();
|
||||
void close() override;
|
||||
|
||||
virtual Seiscomp::Record *next();
|
||||
Record *next() override;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@ -90,8 +90,8 @@ class SDSArchive : public Seiscomp::IO::RecordStream {
|
||||
const std::string& loc, const std::string& cha);
|
||||
Index(const std::string& net, const std::string& sta,
|
||||
const std::string& loc, const std::string& cha,
|
||||
const Seiscomp::Core::Time& stime,
|
||||
const Seiscomp::Core::Time& etime);
|
||||
const OPT(Core::Time) &stime,
|
||||
const OPT(Core::Time) &etime);
|
||||
|
||||
Index &operator=(const Index &other);
|
||||
bool operator<(const Index &other) const;
|
||||
@ -102,19 +102,20 @@ class SDSArchive : public Seiscomp::IO::RecordStream {
|
||||
std::string sta;
|
||||
std::string loc;
|
||||
std::string cha;
|
||||
mutable Seiscomp::Core::Time stime;
|
||||
mutable Seiscomp::Core::Time etime;
|
||||
|
||||
mutable OPT(Core::Time) stime;
|
||||
mutable OPT(Core::Time) etime;
|
||||
};
|
||||
|
||||
|
||||
typedef std::set<Index> IndexSet;
|
||||
typedef std::list<Index> IndexList;
|
||||
typedef std::pair<std::string,bool> File;
|
||||
typedef std::queue<File> FileQueue;
|
||||
using IndexSet = std::set<Index>;
|
||||
using IndexList = std::list<Index>;
|
||||
using File = std::pair<std::string,bool>;
|
||||
using FileQueue = std::queue<File>;
|
||||
|
||||
std::vector<std::string> _arcroots;
|
||||
Seiscomp::Core::Time _stime;
|
||||
Seiscomp::Core::Time _etime;
|
||||
OPT(Core::Time) _stime;
|
||||
OPT(Core::Time) _etime;
|
||||
IndexList _orderedRequests;
|
||||
IndexSet _streamSet;
|
||||
IndexList::iterator _curiter;
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#ifndef SEISCOMP_IO_RECORDSTREAM_SLINK_H
|
||||
#define SEISCOMP_IO_RECORDSTREAM_SLINK_H
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
@ -58,14 +59,16 @@ class SC_SYSTEM_CORE_API SLStreamIdx {
|
||||
|
||||
SLStreamIdx(const std::string &net, const std::string &sta,
|
||||
const std::string &loc, const std::string &cha,
|
||||
const Seiscomp::Core::Time &stime,
|
||||
const Seiscomp::Core::Time &etime);
|
||||
const OPT(Core::Time) &stime,
|
||||
const OPT(Core::Time) &etime);
|
||||
|
||||
public:
|
||||
SLStreamIdx& operator=(const SLStreamIdx &other);
|
||||
|
||||
bool operator<(const SLStreamIdx &other) const;
|
||||
bool operator==(const SLStreamIdx &other) const;
|
||||
|
||||
public:
|
||||
//! Returns the network code
|
||||
const std::string &network() const;
|
||||
|
||||
@ -83,30 +86,29 @@ class SC_SYSTEM_CORE_API SLStreamIdx {
|
||||
std::string selector() const;
|
||||
|
||||
//! Returns the start time
|
||||
Core::Time startTime() const;
|
||||
const OPT(Core::Time) &startTime() const;
|
||||
|
||||
//! Returns the end time
|
||||
Core::Time endTime() const;
|
||||
const OPT(Core::Time) &endTime() const;
|
||||
|
||||
//! Returns the most recent record end time
|
||||
Seiscomp::Core::Time timestamp() const;
|
||||
const OPT(Core::Time) ×tamp() const;
|
||||
|
||||
//! Sets the time stamp
|
||||
void setTimestamp(Seiscomp::Core::Time &rectime) const;
|
||||
void setTimestamp(const OPT(Core::Time) &rectime) const;
|
||||
|
||||
private:
|
||||
const std::string _net;
|
||||
const std::string _sta;
|
||||
const std::string _loc;
|
||||
const std::string _cha;
|
||||
const Core::Time _stime;
|
||||
const Core::Time _etime;
|
||||
mutable Core::Time _timestamp;
|
||||
const std::string _net;
|
||||
const std::string _sta;
|
||||
const std::string _loc;
|
||||
const std::string _cha;
|
||||
const OPT(Core::Time) _stime;
|
||||
const OPT(Core::Time) _etime;
|
||||
mutable OPT(Core::Time) _timestamp;
|
||||
};
|
||||
|
||||
|
||||
DEFINE_SMARTPOINTER(SLConnection);
|
||||
|
||||
class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
|
||||
DECLARE_SC_CLASS(SLConnection);
|
||||
|
||||
@ -118,44 +120,46 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
|
||||
SLConnection(std::string serverloc);
|
||||
|
||||
//! Destructor
|
||||
virtual ~SLConnection();
|
||||
~SLConnection() override;
|
||||
|
||||
public:
|
||||
//! The recordtype cannot be selected when using a seedlink
|
||||
//! connection. It will always create MiniSeed records
|
||||
virtual bool setRecordType(const char*);
|
||||
bool setRecordType(const char*) override;
|
||||
|
||||
//! Initialize the seedlink connection.
|
||||
virtual bool setSource(const std::string &source);
|
||||
bool setSource(const std::string &source) override;
|
||||
|
||||
//! Adds the given stream to the server connection description
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode) override;
|
||||
|
||||
//! Adds a seismic stream request to the record stream (not implemented)
|
||||
virtual bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const Seiscomp::Core::Time &startTime,
|
||||
const Seiscomp::Core::Time &endTime);
|
||||
bool addStream(const std::string &networkCode,
|
||||
const std::string &stationCode,
|
||||
const std::string &locationCode,
|
||||
const std::string &channelCode,
|
||||
const OPT(Core::Time) &startTime,
|
||||
const OPT(Core::Time) &endTime) override;
|
||||
|
||||
//! Adds the given start time to the server connection description
|
||||
virtual bool setStartTime(const Seiscomp::Core::Time &startTime);
|
||||
bool setStartTime(const OPT(Core::Time) &startTime) override;
|
||||
|
||||
//! Adds the given end time to the server connection description
|
||||
virtual bool setEndTime(const Seiscomp::Core::Time &endTime);
|
||||
bool setEndTime(const OPT(Core::Time) &endTime) override;
|
||||
|
||||
//! Sets timeout
|
||||
virtual bool setTimeout(int seconds);
|
||||
bool setTimeout(int seconds) override;
|
||||
|
||||
//! Disconnects and terminates (!) the seedlink connection.
|
||||
virtual void close();
|
||||
void close() override;
|
||||
|
||||
|
||||
private:
|
||||
//! Reads the data stream
|
||||
virtual Record *next();
|
||||
virtual Record *next() override;
|
||||
|
||||
//! Removes all stream list, time window, etc. -entries from the connection description object.
|
||||
bool clear();
|
||||
@ -163,8 +167,6 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
|
||||
//! Reconnects a terminated seedlink connection.
|
||||
bool reconnect();
|
||||
|
||||
|
||||
private:
|
||||
void handshake();
|
||||
|
||||
|
||||
@ -172,7 +174,7 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
|
||||
class StreamBuffer : public std::streambuf {
|
||||
public:
|
||||
StreamBuffer();
|
||||
std::streambuf *setbuf(char *s, std::streamsize n);
|
||||
std::streambuf *setbuf(char *s, std::streamsize n) override;
|
||||
};
|
||||
|
||||
StreamBuffer _streambuf;
|
||||
@ -180,8 +182,8 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
|
||||
std::string _slrecord;
|
||||
IO::Socket _sock;
|
||||
std::set<SLStreamIdx> _streams;
|
||||
Core::Time _stime;
|
||||
Core::Time _etime;
|
||||
OPT(Core::Time) _stime;
|
||||
OPT(Core::Time) _etime;
|
||||
bool _readingData;
|
||||
bool _useBatch;
|
||||
int _maxRetries;
|
||||
@ -192,4 +194,5 @@ class SC_SYSTEM_CORE_API SLConnection : public Seiscomp::IO::RecordStream {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -21,38 +21,42 @@
|
||||
#ifndef SEISCOMP_IO_RECORDSTREAM_STREAMIDX_H
|
||||
#define SEISCOMP_IO_RECORDSTREAM_STREAMIDX_H
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <seiscomp/core.h>
|
||||
#include <seiscomp/core/datetime.h>
|
||||
#include <seiscomp/core/optional.h>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace RecordStream {
|
||||
|
||||
|
||||
class SC_SYSTEM_CORE_API StreamIdx {
|
||||
public:
|
||||
StreamIdx();
|
||||
|
||||
StreamIdx(const std::string& net, const std::string& sta,
|
||||
const std::string& loc, const std::string& cha);
|
||||
StreamIdx(const std::string &net, const std::string &sta,
|
||||
const std::string &loc, const std::string &cha);
|
||||
|
||||
StreamIdx(const std::string& net, const std::string& sta,
|
||||
const std::string& loc, const std::string& cha,
|
||||
const Seiscomp::Core::Time& stime,
|
||||
const Seiscomp::Core::Time& etime);
|
||||
StreamIdx(const std::string &net, const std::string &sta,
|
||||
const std::string &loc, const std::string &cha,
|
||||
const OPT(Seiscomp::Core::Time) &stime,
|
||||
const OPT(Seiscomp::Core::Time) &etime);
|
||||
|
||||
|
||||
public:
|
||||
StreamIdx& operator=(const StreamIdx &other);
|
||||
|
||||
bool operator<(const StreamIdx &other) const;
|
||||
|
||||
bool operator!=(const StreamIdx &other) const;
|
||||
|
||||
bool operator==(const StreamIdx &other) const;
|
||||
|
||||
bool operator>=(const StreamIdx &other) const;
|
||||
|
||||
bool operator>(const StreamIdx &other) const;
|
||||
|
||||
bool operator<=(const StreamIdx &other) const;
|
||||
|
||||
|
||||
public:
|
||||
//! Returns the network code
|
||||
const std::string &network() const;
|
||||
|
||||
@ -66,27 +70,29 @@ class SC_SYSTEM_CORE_API StreamIdx {
|
||||
const std::string &location() const;
|
||||
|
||||
//! Returns the start time
|
||||
Core::Time startTime() const;
|
||||
const OPT(Core::Time) &startTime() const;
|
||||
|
||||
//! Returns the end time
|
||||
Core::Time endTime() const;
|
||||
const OPT(Core::Time) &endTime() const;
|
||||
|
||||
//! Returns a string: <sTime> <eTime> <network> <station> <channel> <location>
|
||||
//! <*Time> in format: %Y,%m,%d,%H,%M,%S
|
||||
std::string str(const Seiscomp::Core::Time& stime,
|
||||
const Seiscomp::Core::Time& etime) const;
|
||||
std::string str(const OPT(Seiscomp::Core::Time) &stime,
|
||||
const OPT(Seiscomp::Core::Time) &etime) const;
|
||||
|
||||
|
||||
private:
|
||||
const std::string _net;
|
||||
const std::string _sta;
|
||||
const std::string _loc;
|
||||
const std::string _cha;
|
||||
const Seiscomp::Core::Time _stime;
|
||||
const Seiscomp::Core::Time _etime;
|
||||
const std::string _net;
|
||||
const std::string _sta;
|
||||
const std::string _loc;
|
||||
const std::string _cha;
|
||||
const OPT(Seiscomp::Core::Time) _stime;
|
||||
const OPT(Seiscomp::Core::Time) _etime;
|
||||
};
|
||||
|
||||
|
||||
} // namespace RecordStream
|
||||
} // namespace Seiscomp
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user