/***************************************************************************** * mseed.h * * Mini-SEED format implementation * * (c) 2000 Andres Heinloo, GFZ Potsdam * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any later * version. For more information, see http://www.gnu.org/ * * ================ * Change log * =============== * * 01.01.2013 Adapted code to CAPS client library requirements (gempa GmbH) *****************************************************************************/ #ifndef CAPS_MSEED_MSEED_H #define CAPS_MSEED_MSEED_H #include "packet.h" #include "spclock.h" #include #include namespace Gempa { namespace CAPS { /* SEED data encoding types */ enum SEEDDataEncodingType { DE_ASCII = 0, DE_INT16 = 1, DE_INT32 = 3, DE_FLOAT32 = 4, DE_FLOAT64 = 5, DE_STEIM1 = 10, DE_STEIM2 = 11, DE_GEOSCOPE24 = 12, DE_GEOSCOPE163 = 13, DE_GEOSCOPE164 = 14, DE_CDSN = 16, DE_SRO = 30, DE_DWWSSN = 32 }; struct MSEEDFormat { MSEEDFormat(const std::string &networkCode, const std::string &stationCode, const std::string &locationCode, const std::string &channelCode, unsigned short freqn, unsigned short freqd, unsigned short packtype_init, uint8_t recLen); template MSEEDEncoderPacket get_packet(const SPClock::INT_TIME &it, int usec_correction, int timing_quality) { void *dataptr = NULL; int datalen = 0; unsigned int size = 0; MSEEDDataRecord *rec = get_buffer(it, usec_correction, timing_quality, dataptr, datalen); return MSEEDEncoderPacket(rec, size, dataptr, datalen); } MSEEDDataRecord *get_buffer(const SPClock::INT_TIME &it, int usec_correction, int timing_quality, void *&dataptr, int &datalen); void updateBuffer(MSEEDDataRecord *rec, int samples, int frames); std::string networkCode; std::string stationCode; std::string locationCode; std::string channelCode; int sample_rate_factor; int sample_rate_multiplier; unsigned short packType; int timingQuality; uint8_t recordLength; }; } } #endif