Commit 0cfbdfc4 authored by Laurent Claustre's avatar Laurent Claustre

USB3 try

parent e601c396
......@@ -28,6 +28,7 @@
#endif
#include <pylon/PylonIncludes.h>
#include <pylon/usb/BaslerUsbDeviceInfo.h>
#include <pylon/gige/BaslerGigEDeviceInfo.h>
#include <stdlib.h>
#include <limits>
......@@ -38,19 +39,18 @@
using namespace Pylon;
using namespace std;
#if defined( USE_1394 )
// Settings to use Basler 1394 cameras
#include <pylon/1394/Basler1394Camera.h>
typedef Pylon::CBasler1394Camera Camera_t;
using namespace Basler_IIDC1394CameraParams;
using namespace Basler_IIDC1394StreamParams;
#elif defined ( USE_GIGE )
#if defined ( USE_GIGE )
// settings to use Basler GigE cameras
#include <pylon/gige/BaslerGigECamera.h>
typedef Pylon::CBaslerGigECamera Camera_t;
using namespace Basler_GigECameraParams;
using namespace Basler_GigEStreamParams;
#elif defined ( USE_USB )
// settings to use Basler USB cameras
#include <pylon/usb/BaslerUsbCamera.h>
typedef Pylon::CBaslerUsbCamera Camera_t;
using namespace Basler_UsbCameraParams;
using namespace Basler_UsbStreamParams;
#else
#error Camera type is not specified. For example, define USE_GIGE for using GigE cameras
#endif
......@@ -78,7 +78,8 @@ class LIBBASLER_API Camera
enum Status {
Ready, Exposure, Readout, Latency, Fault
};
#if defined (USE_GIGE)
enum LineSource {
Off, ExposureActive, FrameTriggerWait, LineTriggerWait,
Timer1Active, Timer2Active, Timer3Active, Timer4Active, TimerActive,
......@@ -87,6 +88,13 @@ class LIBBASLER_API Camera
PatternGenerator1, PatternGenerator2, PatternGenerator3, PatternGenerator4,
AcquisitionTriggerReady,
};
#elif defined (USE_USB)
enum LineSource {
Off, ExposureActive, FrameTriggerWait,FrameBurstTriggerWait,
UserOutput0, UserOutput1, UserOutput2, UserOutput3,
FlashWindow,
};
#endif
Camera(const std::string& camera_id,int packet_size = -1,int received_priority = 0);
~Camera();
......@@ -134,6 +142,7 @@ class LIBBASLER_API Camera
void getStatus(Camera::Status& status);
// -- Transport Layer
#if defined (USE_GIGE)
void setPacketSize(int isize);
void getPacketSize(int& isize);
void setInterPacketDelay(int ipd);
......@@ -141,11 +150,11 @@ class LIBBASLER_API Camera
void getMaxThroughput(int& ipd);
void getCurrentThroughput(int& ipd);
void getBandwidthAssigned(int& ipd);
void setSocketBufferSize(int sbs);
void setSocketBufferSize(int sbs);
void setFrameTransmissionDelay(int ftd);
#elif defined (USE_USB)
#endif
// -- basler specific, LIMA don't worry about it !
void getFrameRate(double& frame_rate) const;
bool isBinningAvailable() const;
......
......@@ -12,14 +12,10 @@ namespace Basler
enum Status {
Ready, Exposure, Readout, Latency,
};
enum LineSource {
Off, ExposureActive, FrameTriggerWait, LineTriggerWait,
Timer1Active, Timer2Active, Timer3Active, Timer4Active, TimerActive,
UserOutput1, UserOutput2, UserOutput3, UserOutput4, UserOutput,
TriggerReady, SerialTx, AcquisitionTriggerWait, ShaftEncoderModuleOut, FrequencyConverter,
PatternGenerator1, PatternGenerator2, PatternGenerator3, PatternGenerator4,
AcquisitionTriggerReady,
Off, ExposureActive, FrameTriggerWait,FrameBurstTriggerWait,
UserOutput0, UserOutput1, UserOutput2, UserOutput3,
FlashWindow,
};
Camera(const std::string& camera_ip,int mtu_size = -1,int received_priority = 0);
......@@ -60,12 +56,6 @@ namespace Basler
void setBin(const Bin&);
void getBin(Bin& /Out/);
void setInterPacketDelay(int ipd);
void setSocketBufferSize(int sbs);
void setFrameTransmissionDelay(int ftd);
void getFrameRate(double& frame_rate /Out/) const;
bool isBinningAvailable() const;
bool isRoiAvailable() const;
......
This diff is collapsed.
......@@ -44,7 +44,7 @@ Interface::Interface(Camera& cam,bool force_video_mode) :
if(has_video_capability || force_video_mode)
{
if(!has_video_capability)
m_cam._initColorStreamGrabber();
m_cam._initColorStreamGrabber(true);
m_video = new VideoCtrlObj(cam);
}
else
......
......@@ -79,13 +79,16 @@ void VideoCtrlObj::getVideoMode(VideoMode &mode) const
case PixelFormat_Mono8: mode = Y8; break;
case PixelFormat_Mono10: mode = Y16; break;
case PixelFormat_Mono12: mode = Y16; break;
#if defined (USE_GIGE)
case PixelFormat_Mono16: mode = Y16; break;
#endif
case PixelFormat_BayerRG8: mode = BAYER_RG8; break;
case PixelFormat_BayerBG8: mode = BAYER_BG8; break;
case PixelFormat_BayerRG10: mode = BAYER_RG16; break;
case PixelFormat_BayerBG10: mode = BAYER_BG16; break;
case PixelFormat_BayerRG12: mode = BAYER_RG16; break;
case PixelFormat_BayerBG12: mode = BAYER_BG16; break;
#if defined (USE_GIGE)
case PixelFormat_RGB8Packed: mode = RGB24; break;
case PixelFormat_BGR8Packed: mode = BGR24; break;
case PixelFormat_RGBA8Packed: mode = RGB32; break;
......@@ -95,6 +98,7 @@ void VideoCtrlObj::getVideoMode(VideoMode &mode) const
case PixelFormat_YUV444Packed: mode = YUV444; break;
case PixelFormat_BayerRG16: mode = BAYER_RG16; break;
case PixelFormat_BayerBG16: mode = BAYER_BG16; break;
#endif
default:
THROW_HW_ERROR(NotSupported) << "Pixel type not supported yet";
}
......@@ -110,8 +114,10 @@ void VideoCtrlObj::setVideoMode(VideoMode mode)
case Y8:
pixelformat.push_back(PixelFormat_Mono8);
break;
case Y16:
case Y16:
#if defined (USE_GIGE)
pixelformat.push_back(PixelFormat_Mono16);
#endif
pixelformat.push_back(PixelFormat_Mono12);
pixelformat.push_back(PixelFormat_Mono10);
break;
......@@ -122,15 +128,20 @@ void VideoCtrlObj::setVideoMode(VideoMode mode)
pixelformat.push_back(PixelFormat_BayerBG8);
break;
case BAYER_RG16:
#if defined (USE_GIGE)
pixelformat.push_back(PixelFormat_BayerRG16);
#endif
pixelformat.push_back(PixelFormat_BayerRG12);
pixelformat.push_back(PixelFormat_BayerRG10);
break;
case BAYER_BG16:
#if defined (USE_GIGE)
pixelformat.push_back(PixelFormat_BayerBG16);
#endif
pixelformat.push_back(PixelFormat_BayerBG12);
pixelformat.push_back(PixelFormat_BayerBG10);
break;
#if defined (USE_GIGE)
case RGB24:
pixelformat.push_back(PixelFormat_RGB8Packed);
break;
......@@ -152,6 +163,7 @@ void VideoCtrlObj::setVideoMode(VideoMode mode)
case YUV444:
pixelformat.push_back(PixelFormat_YUV444Packed);
break;
#endif
default:
THROW_HW_ERROR(NotSupported) << "Mode type not supported yet";
}
......
......@@ -10,7 +10,7 @@ endif
PYLON_CONFIG := $(PYLON_ROOT)/bin/pylon-config
CXXFLAGS += -I../include -I../../../hardware/include -I../../../common/include \
-DUSE_GIGE -Wall -pthread -fPIC -g
-DUSE_USB -Wall -pthread -fPIC -g -Wno-unknown-pragmas
ifeq ("$(wildcard $(PYLON_CONFIG))", "")
ifndef GENICAM_ROOT_V2_1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment