コード例 #1
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void StreamApplication::readRecords(bool sendEndNotification) {
	SEISCOMP_INFO("Starting record acquisition");

	IO::RecordInput recInput(_recordStream.get(), Array::FLOAT, _recordInputHint);
	try {
		for ( IO::RecordIterator it = recInput.begin(); it != recInput.end(); ++it ) {
			Record* rec = *it;
			if ( rec ) {
				try {
					rec->endTime();
					if ( !storeRecord(rec) ) {
						delete rec;
						return;
					}
					++_receivedRecords;
				}
				catch ( ... ) {
					delete rec;
					SEISCOMP_ERROR("Skipping invalid record for %s.%s.%s.%s (fsamp: %0.2f, nsamp: %d)",
					               rec->networkCode().c_str(), rec->stationCode().c_str(), rec->locationCode().c_str(),
					               rec->channelCode().c_str(), rec->samplingFrequency(), rec->sampleCount());
				}
			}
		}
	}
	catch ( Core::OperationInterrupted& e ) {
		SEISCOMP_INFO("Interrupted acquisition, msg: '%s'", e.what());
	}
	catch ( std::exception& e ) {
		SEISCOMP_ERROR("Exception in acquisition: '%s'", e.what());
	}

	if ( sendEndNotification )
		sendNotification(Notification::AcquisitionFinished);

	SEISCOMP_INFO("Finished acquisition");
	acquisitionFinished();
}
コード例 #2
0
ファイル: record.cpp プロジェクト: aemanov/seiscomp3
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Record::Record(const Record &rec)
 : Core::BaseObject(), 
   _net(rec.networkCode()), _sta(rec.stationCode()), _loc(rec.locationCode()),
   _cha(rec.channelCode()), _stime(rec.startTime()), _datatype(rec.dataType()),
   _hint(rec._hint), _nsamp(rec.sampleCount()),
   _fsamp(rec.samplingFrequency()), _timequal(rec.timingQuality()) {}