当前位置: 首页>>代码示例>>C++>>正文


C++ Station::end方法代码示例

本文整理汇总了C++中Station::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Station::end方法的具体用法?C++ Station::end怎么用?C++ Station::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Station的用法示例。


在下文中一共展示了Station::end方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Envelope::init() {
	if ( !Application::init() ) return false;

	// Construct stream firewall
	for ( size_t i = 0; i < _config.streamsWhiteList.size(); ++i ) {
		Core::trim(_config.streamsWhiteList[i]);
		if ( !_config.streamsWhiteList[i].empty() ) {
			SEISCOMP_DEBUG("Adding pattern to stream whitelist: %s",
			               _config.streamsWhiteList[i].c_str());
			_streamFirewall.allow.insert(_config.streamsWhiteList[i]);
		}
	}

	for ( size_t i = 0; i < _config.streamsBlackList.size(); ++i ) {
		Core::trim(_config.streamsBlackList[i]);
		if ( !_config.streamsBlackList[i].empty() ) {
			SEISCOMP_DEBUG("Adding pattern to stream blacklist: %s",
			               _config.streamsBlackList[i].c_str());
			_streamFirewall.deny.insert(_config.streamsBlackList[i]);
		}
	}

	Inventory *inv = Client::Inventory::Instance()->inventory();
	if ( inv == NULL ) {
		SEISCOMP_ERROR("Inventory not available");
		return false;
	}

	Core::Time now = Core::Time::GMT();

	for ( size_t n = 0; n < inv->networkCount(); ++n ) {
		Network *net = inv->network(n);
		try { if ( net->end() < now ) continue; }
		catch ( ... ) {}

		for ( size_t s = 0; s < net->stationCount(); ++s ) {
			Station *sta = net->station(s);
			try { if ( sta->end() < now ) continue; }
			catch ( ... ) {}

			// Find velocity and strong-motion streams
			DataModel::WaveformStreamID tmp(net->code(), sta->code(), "", "", "");

			Stream *maxVel, *maxAcc;
			maxVel = Private::findStreamMaxSR(sta, now,
			                                  Processing::WaveformProcessor::MeterPerSecond,
			                                  &_streamFirewall);
			maxAcc = Private::findStreamMaxSR(sta, now,
			                                  Processing::WaveformProcessor::MeterPerSecondSquared,
			                                  &_streamFirewall);

			if ( !maxAcc && !maxVel ) {
				SEISCOMP_WARNING("%s.%s: no usable velocity and acceleration channel found",
				                 net->code().c_str(), sta->code().c_str());
				continue;
			}

			// Add velocity data if available
			if ( maxVel ) {
				tmp.setLocationCode(maxVel->sensorLocation()->code());
				tmp.setChannelCode(maxVel->code().substr(0,2));
				addProcessor(maxVel->sensorLocation(), tmp, now, "velocity", "vel");
			}

			// Add velocity data if available
			if ( maxAcc ) {
				tmp.setLocationCode(maxAcc->sensorLocation()->code());
				tmp.setChannelCode(maxAcc->code().substr(0,2));
				addProcessor(maxAcc->sensorLocation(), tmp, now, "accelerometric", "acc");
			}
		}
	}

	if ( _config.ts.valid() ) recordStream()->setStartTime(_config.ts);
	if ( _config.te.valid() ) recordStream()->setEndTime(_config.te);

	_creationInfo.setAgencyID(agencyID());
	_creationInfo.setAuthor(author());

	// We do not need lookup objects by publicID
	PublicObject::SetRegistrationEnabled(false);

	_sentMessages = 0;
	_sentMessagesTotal = 0;

#ifndef SC3_SYNC_VERSION
	_mpsReset.setCallback(boost::bind(&Envelope::resetMPSCount, this));
	_mpsReset.setTimeout(1);
	_mpsReset.start();
#endif

	return true;
}
开发者ID:Fran89,项目名称:seiscomp3,代码行数:94,代码来源:envelope.cpp


注:本文中的Station::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。