本文整理汇总了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);
}