Update to version 2

This commit is contained in:
2022-11-18 13:42:30 +01:00
parent 284fef3ec2
commit 8934eeac6b
23 changed files with 5109 additions and 5695 deletions

View File

@@ -12,28 +12,29 @@
* from gempa GmbH. *
***************************************************************************/
#ifndef CAPS_MSEED_UNCOMPRESSED_H
#define CAPS_MSEED_UNCOMPRESSED_H
#include "encoder.h"
#include "mseed.h"
#include <gempa/caps/endianess.h>
#include <iostream>
#include <netinet/in.h>
namespace Gempa {
namespace CAPS {
template<typename T> class UncompressedMSEED : public Encoder {
MSEEDEncoderPacket<T> get_packet() {
return _format->get_packet<T>(_clk.get_time(-_bp),
_clk.correction(), _timingQuality);
return _format->getPacket<T>(_clk.getTime(-_bp),
_clk.correction(), _timingQuality);
}
void queue_packet(MSEEDEncoderPacket<T> &pckt) {
void queuePacket(MSEEDEncoderPacket<T> &pckt) {
_format->updateBuffer(pckt.record, _sampleCount, 1);
Packet *packet = new Packet(DataRecordPtr(pckt.record), _format->networkCode, _format->stationCode,
@@ -51,7 +52,7 @@ template<typename T> class UncompressedMSEED : public Encoder {
virtual ~UncompressedMSEED() { if ( _format ) delete _format; }
virtual void flush() {
if ( _current_packet.valid() ) {
queue_packet(_current_packet);
queuePacket(_current_packet);
}
}
@@ -72,13 +73,15 @@ template<typename T> class UncompressedMSEED : public Encoder {
virtual int type() const { return _format->packType; }
private:
MSEEDFormat *_format;
MSEEDEncoderPacket<T> _current_packet;
int _bp;
MSEEDFormat *_format;
MSEEDEncoderPacket<T> _current_packet;
int _bp;
};
}
}
#endif // __STEIM1_H__