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


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

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


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

示例1: check

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
bool Check::check() {
	if ( _inv == NULL ) return false;

	EpochMap networkEpochs;

	for ( size_t n = 0; n < _inv->networkCount(); ++n ) {
		Network *net = _inv->network(n);
		checkEpoch(net);
		checkOverlap(networkEpochs[net->code()], net);

		EpochMap stationEpochs;

		for ( size_t s = 0; s < net->stationCount(); ++s ) {
			Station *sta = net->station(s);
			checkEpoch(sta);
			checkOverlap(stationEpochs[sta->code()], sta);
			checkOutside(net, sta);

			EpochMap locationEpochs;
			double lat = sta->latitude();
			double lon = sta->longitude();

			if ( lat == 0.0 && lon == 0.0 ) {
				log(LogHandler::Warning,
				    (string(sta->className()) + " " + id(sta) + "\n  "
				     "coordinates are 0.0/0.0").c_str(),
				     NULL, NULL);
			}

			for ( size_t l = 0; l < sta->sensorLocationCount(); ++l ) {
				SensorLocation *loc = sta->sensorLocation(l);
				checkEpoch(loc);
				checkOverlap(locationEpochs[loc->code()], loc);
				checkOutside(sta, loc);

				double llat = loc->latitude();
				double llon = loc->longitude();

				if ( llat == 0.0 && llon == 0.0 ) {
					log(LogHandler::Warning,
					    (string(loc->className()) + " " + id(loc) + "\n  "
					     "coordinates are 0.0/0.0").c_str(),
					     NULL, NULL);
				}

				double dist,a1,a2;

				Math::Geo::delazi(lat,lon,llat,llon, &dist, &a1, &a2);
				dist = Math::Geo::deg2km(dist);

				if ( dist > 10 ) {
					log(LogHandler::Warning,
					    (string(loc->className()) + " " + id(loc) + "\n  "
					     "location is " + Core::toString(dist) + "km away from parent Station").c_str(),
					     NULL, NULL);
				}

				EpochMap channelEpochs;

				for ( size_t c = 0; c < loc->streamCount(); ++c ) {
					Stream *cha = loc->stream(c);
					checkEpoch(cha);
					checkOverlap(channelEpochs[cha->code()], cha);
					checkOutside(loc, cha);
					try {
						if ( cha->gain() == 0.0 ) {
							log(LogHandler::Warning,
							    (string(cha->className()) + " " + id(cha) + "\n  "
							     "invalid gain of 0").c_str(), NULL, NULL);
						}
					}
					catch ( ... ) {
						log(LogHandler::Warning,
						    (string(cha->className()) + " " + id(cha) + "\n  "
						     "no gain set").c_str(), NULL, NULL);
					}

					if ( cha->gainUnit().empty() ) {
						log(LogHandler::Warning,
						    (string(cha->className()) + " " + id(cha) + "\n  "
						     "no gain unit set").c_str(), NULL, NULL);
					}

					if ( !cha->sensor().empty() ) {
						// Done already in merge
						/*
						Sensor *sensor = findSensor(cha->sensor());
						if ( sensor == NULL ) {
							log(LogHandler::Unresolved,
							    (string(cha->className()) + " " + id(cha) + "\n  "
							     "referenced sensor is not available").c_str(), NULL, NULL);
						}
						*/
					}
					else
						log(LogHandler::Information,
						    (string(cha->className()) + " " + id(cha) + "\n  "
						     "no sensor and thus no response information available").c_str(), NULL, NULL);
				}
//.........这里部分代码省略.........
开发者ID:koukou73gr,项目名称:seiscomp3,代码行数:101,代码来源:check.cpp


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