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


C++ Cameras::byname方法代码示例

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


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

示例1: devicemap_error

void	Filterwheel_internals::assign(const std::string& filterwheelid,
		const std::vector<std::string>& arguments) {
	debug(LOG_DEBUG, DEBUG_LOG, 0, "assigning filterwheel of name %s",
		filterwheelid.c_str());

	// make sure we have enough arguments
	if (arguments.size() < 3) {
		throw devicemap_error("filterwheel assign needs 3 arguments");
	}

	// first locate the camera specified by the arguments
	std::string	cameraid = arguments[2];
	debug(LOG_DEBUG, DEBUG_LOG, 0, "get filterwheel from camera %s",
		cameraid.c_str());

	// first try to get the camera with that id
	Cameras	cameras;
	CameraWrapper	camera = cameras.byname(cameraid);

	// then check whether it has enough ccds
	if (!camera->hasFilterWheel()) {
		debug(LOG_ERR, DEBUG_LOG, 0, "camera %s has no filter wheel",
			camera->getName());
		throw devicemap_error("camera has no filterwheel");
	}

	// get the ccd from the camera
	Astro::FilterWheel_ptr	filterwheel;
	try {
		filterwheel = camera->getFilterWheel();
	} catch (const CORBA::Exception& x) {
		std::string	s = Astro::exception2string(x);
		debug(LOG_ERR, DEBUG_LOG, 0, "getFilterWheel exception: %s",
			s.c_str());
		throw std::runtime_error(s);
	}
	if (CORBA::is_nil(filterwheel)) {
		throw devicemap_error("could not get filterwheel");
	}

	// store it in the device map
	DeviceMap<Astro::FilterWheel>::assign(filterwheelid, filterwheel);
}
开发者ID:felipebetancur,项目名称:AstroPhotography-2,代码行数:43,代码来源:Filterwheels.cpp


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