You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.3 KiB
C++

/***************************************************************************
* Copyright (C) 2009 by gempa GmbH *
* *
* All Rights Reserved. *
* *
* NOTICE: All information contained herein is, and remains *
* the property of gempa GmbH and its suppliers, if any. The intellectual *
* and technical concepts contained herein are proprietary to gempa GmbH *
* and its suppliers. *
* Dissemination of this information or reproduction of this material *
* is strictly forbidden unless prior written permission is obtained *
* from gempa GmbH. *
***************************************************************************/
#include <gempa/caps/metapacket.h>
#include <gempa/caps/log.h>
#include <gempa/caps/riff.h>
#include <gempa/caps/utils.h>
#include <cstring>
namespace Gempa {
namespace CAPS {
void MetaDataRecord::MetaHeader::setEndTime(const Time &ts) {
int year, yday, hour, min, sec, usec;
ts.get2(&year, &yday, &hour, &min, &sec, &usec);
endTime.year = year;
endTime.yday = yday;
endTime.hour = hour;
endTime.minute = min;
endTime.second = sec;
endTime.usec = usec;
}
MetaDataRecord::MetaDataRecord() {}
MetaDataRecord::Buffer *MetaDataRecord::data() {
return NULL;
}
const char *MetaDataRecord::formatName() const {
return "META";
}
const DataRecord::Header *MetaDataRecord::header() const {
return &_header.dataHeader;
}
Time MetaDataRecord::startTime() const {
return _startTime;
}
Time MetaDataRecord::endTime() const {
return _endTime;
}
size_t MetaDataRecord::dataSize(bool /*withHeader*/) const {
return 0;
}
DataRecord::ReadStatus MetaDataRecord::get(std::streambuf &buf, int size,
const Time &start, const Time &end,
int maxBytes) {
return RS_Error;
}
void MetaDataRecord::setHeader(const MetaHeader &header) {
_header = header;
_startTime = timestampToTime(header.dataHeader.samplingTime);
_endTime = timestampToTime(header.endTime);
}
}
}