Subversion Repositories seema-scanner

Rev

Rev 23 | Rev 27 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23 Rev 26
Line 1... Line 1...
1
#include "CameraPointGrey.h"
1
#include "CameraPointGrey.h"
2
#include <cstring>
2
#include <cstring>
3
 
3
 
-
 
4
//#include <sys/ioctl.h>
-
 
5
//#include <linux/usbdevice_fs.h>
-
 
6
 
4
void PrintError(FlyCapture2::Error error){
7
void PrintError(FlyCapture2::Error error){
5
    error.PrintErrorTrace();
8
    error.PrintErrorTrace();
6
}
9
}
7
 
10
 
8
vector<CameraInfo> CameraPointGrey::getCameraList(){
11
vector<CameraInfo> CameraPointGrey::getCameraList(){
Line 49... Line 52...
49
    return ret;
52
    return ret;
50
}
53
}
51
 
54
 
52
CameraPointGrey::CameraPointGrey(unsigned int camNum, CameraTriggerMode triggerMode) : Camera(triggerMode){
55
CameraPointGrey::CameraPointGrey(unsigned int camNum, CameraTriggerMode triggerMode) : Camera(triggerMode){
53
 
56
 
-
 
57
//    // Reset USB bus
-
 
58
//    std::cout << "Resetting USB device %s\n";
-
 
59
//    int rc = ioctl(fd, USBDEVFS_RESET, 0);
-
 
60
//    if (rc < 0)
-
 
61
//        perror("Error in ioctl");
-
 
62
//    else
-
 
63
//        printf("Reset successful\n");
-
 
64
 
-
 
65
 
54
    FlyCapture2::Error error;
66
    FlyCapture2::Error error;
55
 
67
 
56
    // Connect to camera
68
    // Connect to camera
57
    FlyCapture2::BusManager busManager;
69
    FlyCapture2::BusManager busManager;
-
 
70
    busManager.RescanBus();
-
 
71
 
58
    FlyCapture2::PGRGuid camGuid;
72
    FlyCapture2::PGRGuid camGuid;
59
 
73
 
60
    busManager.GetCameraFromIndex(camNum, &camGuid);
74
    busManager.GetCameraFromIndex(camNum, &camGuid);
61
    error = cam.Connect(&camGuid);
75
    error = cam.Connect(&camGuid);
62
    if (error != FlyCapture2::PGRERROR_OK)
76
    if (error != FlyCapture2::PGRERROR_OK)