本文整理汇总了C++中Error::PrintErrorTrace方法的典型用法代码示例。如果您正苦于以下问题:C++ Error::PrintErrorTrace方法的具体用法?C++ Error::PrintErrorTrace怎么用?C++ Error::PrintErrorTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error::PrintErrorTrace方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFrame
RawImage CaptureFlycap::getFrame() {
mutex.lock();
Error error;
Image image;
RawImage result;
result.setColorFormat(capture_format);
result.setWidth(0);
result.setHeight(0);
result.setTime(0.0);
result.setData(0);
error = camera->RetrieveBuffer(&image);
if (error != PGRERROR_OK) {
error.PrintErrorTrace();
mutex.unlock();
return result;
}
stored_image = new Image;
stored_image->DeepCopy(&image);
result.setData(stored_image->GetData());
struct timeval tv;
gettimeofday(&tv,NULL);
result.setTime((double)tv.tv_sec + tv.tv_usec*(1.0E-6));
result.setHeight(stored_image->GetRows());
result.setWidth(stored_image->GetCols());
result.setColorFormat(pixelFormatToColorFormat(stored_image->GetPixelFormat()));
mutex.unlock();
return result;
}
示例2: PrintError
void ofApp::PrintError (Error error){
error.PrintErrorTrace();
}
示例3: PrintError
void PrintError( Error error )
{
error.PrintErrorTrace();
}
示例4: PrintErrorAndExit
static void PrintErrorAndExit(Error error)
{
error.PrintErrorTrace();
exit(0);
}
示例5: PrintError
void CameraPointGrey::PrintError(Error error)
{
error.PrintErrorTrace();
}
示例6: startCapture
bool CaptureFlycap::startCapture() {
mutex.lock();
cam_id_mutex.lock();
BusManager busMgr;
Error error;
unsigned int numCameras;
int current_id = v_cam_bus->getInt();
if (current_id >= 0) {
cam_id = (unsigned int)current_id;
} else {
fprintf(stderr, "Flycapture: Invalid cam_id: %d\n", current_id);
mutex.unlock();
cam_id_mutex.unlock();
return false;
}
error = busMgr.GetNumOfCameras(&numCameras);
if (error != PGRERROR_OK)
{
error.PrintErrorTrace();
mutex.unlock();
cam_id_mutex.unlock();
return false;
}
if(cam_id >= numCameras)
{
fprintf(stderr, "Flycapture: Invalid cam_id: %u\n", cam_id);
mutex.unlock();
cam_id_mutex.unlock();
return false;
}
bool id_active = false;
for (size_t i = 0; i < active_cam_ids.size(); i++) {
if (active_cam_ids[i] == cam_id) {
id_active = true;
break;
}
}
if (id_active) {
fprintf(stderr, "Flycapture: cam_id %u is already in use \n", cam_id);
mutex.unlock();
cam_id_mutex.unlock();
return false;
}
camera = new GigECamera();
error = busMgr.GetCameraFromIndex(v_cam_bus->getInt(), &guid);
if (error != PGRERROR_OK) {
error.PrintErrorTrace();
delete camera;
mutex.unlock();
cam_id_mutex.unlock();
return false;
}
error = camera->Connect(&guid);
if (error != PGRERROR_OK) {
error.PrintErrorTrace();
delete camera;
mutex.unlock();
cam_id_mutex.unlock();
return false;
}
fprintf(stderr,"Connected");
is_connected = true;
CameraInfo camInfo;
error = camera->GetCameraInfo(&camInfo);
if (error != PGRERROR_OK) {
error.PrintErrorTrace();
delete camera;
mutex.unlock();
cam_id_mutex.unlock();
return false;
}
fprintf(stderr," to %s, Serial Number: %u\n",
camInfo.modelName,
camInfo.serialNumber);
Property auto_exposure;
auto_exposure.onOff = false;
auto_exposure.onePush = false;
auto_exposure.type = FlyCapture2::AUTO_EXPOSURE;
error = camera->SetProperty(&auto_exposure);
if (error != PGRERROR_OK) {
mutex.unlock();
cam_id_mutex.unlock();
delete camera;
error.PrintErrorTrace();
//.........这里部分代码省略.........
示例7: writeParameterValues
void CaptureFlycap::writeParameterValues(VarList * item) {
if (!is_connected) {
mutex.lock();
}
Error error;
string item_name = item->getName();
if (item_name == "Camera Parameters") {
vector<VarType *> children = item->getChildren();
for (unsigned int i=0;i<children.size();i++) {
bool is_property=false;
Property prop;
string param_name = children[i]->getName();
if (param_name == "Video Mode") {
if (is_connected && !is_capturing) {
Mode mode = videoModeFromString(v_videomode->getString());
error = camera->SetGigEImagingMode(mode);
if (error != PGRERROR_OK) {
error.PrintErrorTrace();
mutex.unlock();
return;
}
}
} else if (param_name == "Brightness") {
is_property = true;
prop.type = FlyCapture2::BRIGHTNESS;
} else if (param_name == "Shutter") {
is_property = true;
prop.type = FlyCapture2::SHUTTER;
}
else if (param_name == "Gain") {
is_property = true;
prop.type = FlyCapture2::GAIN;
}
else if (param_name == "Gamma") {
is_property = true;
prop.type = FlyCapture2::GAMMA;
}
else if (param_name == "Frame Rate") {
is_property = true;
prop.type = FlyCapture2::FRAME_RATE;
}
else if (param_name == "White Balance") {
is_property = true;
prop.type = FlyCapture2::WHITE_BALANCE;
}
if (is_property) {
prop.onePush = false;
prop.onOff = true;
prop.autoManualMode = false;
prop.absControl = true;
if (is_connected) {
if (param_name == "White Balance") {
vector<VarType *> grandchildren = children[i]->getChildren();
VarBool* vOnOff = (VarBool*)grandchildren[0];
VarInt* vRed = (VarInt*)grandchildren[1];
VarInt* vBlue = (VarInt*)grandchildren[2];
prop.onOff = vOnOff->getBool();
prop.valueA = vRed->getInt();
prop.valueB = vBlue->getInt();
}
else {
VarDouble* current_double = (VarDouble *)children[i];
double absvalue = current_double->getDouble();
prop.absValue = (float)absvalue;
}
error = camera->SetProperty(&prop);
if (error != PGRERROR_OK) {
mutex.unlock();
error.PrintErrorTrace();
return;
}
}
}
}
}
if (settings_changed) {
if (is_connected) {
GigEImageSettings imageSettings;
imageSettings.offsetX = v_xoffset->getInt();
imageSettings.offsetY = v_yoffset->getInt();
imageSettings.height = v_height->getInt();
imageSettings.width = v_width->getInt();
imageSettings.pixelFormat = colorFormatToPixelFormat(Colors::stringToColorFormat(v_colormode->getString().c_str()));
error = camera->SetGigEImageSettings(&imageSettings);
if (error != PGRERROR_OK) {
error.PrintErrorTrace();
mutex.unlock();
return;
}
settings_changed = false;
}
}
//.........这里部分代码省略.........
示例8: PrintError
void PGRCamera::PrintError( Error error )
{
error.PrintErrorTrace();
}