Commit 80ed048d authored by ics's avatar ics

new generic gige cam for d19

parent 71b5c38b
......@@ -273,7 +273,7 @@ bool CCameraControl::ExposureFeatureBGAPI() {
// check if the feature is writeable and write new value
if (exposure_node->IsWriteable()) {
exposure_node->SetDouble(exposure_time_);
std::cout <<"e>>>>>>>>>>>>>>>>exposure_time_ OK "<<camera_pointer_->GetRemoteNode("ExposureTimeRaw")->GetValue() << std::endl;
// std::cout <<"e>>>>>>>>>>>>>>>>exposure_time_ OK "<<camera_pointer_->GetRemoteNode("ExposureTimeRaw")->GetValue() << std::endl;
}
BGAPI2::Node* exposure_gain = camera_pointer_->GetRemoteNode("GainRaw");
......@@ -281,16 +281,16 @@ bool CCameraControl::ExposureFeatureBGAPI() {
if (exposure_gain->IsWriteable()) {
exposure_gain->SetInt(exposure_gain_);
}
std::cout <<"e>>>>>>>>>>>>>>>>GainRaw OK "<<camera_pointer_->GetRemoteNode("GainRaw")->GetValue() << std::endl;
// std::cout <<"e>>>>>>>>>>>>>>>>GainRaw OK "<<camera_pointer_->GetRemoteNode("GainRaw")->GetValue() << std::endl;
BGAPI2::Node* pixel_format = camera_pointer_->GetRemoteNode("PixelFormat");
std::cout <<"e>>>>>>>>>>>>>>>>pixel format OK "<<camera_pointer_->GetRemoteNode("PixelFormat")->GetValue() << std::endl;
// std::cout <<"e>>>>>>>>>>>>>>>>pixel format OK "<<camera_pointer_->GetRemoteNode("PixelFormat")->GetValue() << std::endl;
// check if the feature is writeable and write new value
if (pixel_format->IsWriteable()) {
pixel_format->SetString("YUV422_YUYV_Packed");
}
std::cout <<"e>>>>>>>>>>>>>>>>pixel format OK "<<camera_pointer_->GetRemoteNode("PixelFormat")->GetValue() << std::endl;
// std::cout <<"e>>>>>>>>>>>>>>>>pixel format OK "<<camera_pointer_->GetRemoteNode("PixelFormat")->GetValue() << std::endl;
// write some status information
std::lock_guard<std::mutex> lock(feature_command_message_list_lock_);
feature_command_message_list_.clear();
......@@ -424,7 +424,7 @@ bool CCameraControl::CaptureBGAPIImages(const bool * abort_flag, unsigned int nu
// loop over the number of images to capture
do {
// fetch the buffers
BGAPI2::Buffer* buffer = datastream_pointer->GetFilledBuffer(exposure_time_ + 1000);
BGAPI2::Buffer* buffer = datastream_pointer->GetFilledBuffer(exposure_time_ );
if (buffer) {
std::cout <<"GetFilledBuffer OK "<< number_of_captured_images_<< " of " <<number_of_images_ <<std::endl;
FillBufferInformation(datastream_pointer, buffer);
......@@ -478,8 +478,9 @@ bool CCameraControl::StartStreamingBGAPI() {
datastream_pointer->GetBufferList()->DiscardAllBuffers();
datastream_pointer->GetBufferList()->FlushAllToInputQueue();
// start the acquisition on the host side with the selected number of images
datastream_pointer->StartAcquisition(number_of_images_);
// start the acquisition on the device side
datastream_pointer->StartAcquisitionContinuous();
// datastream_pointer->StartAcquisition(number_of_images_);
// start the acquisition on the device side
// to work with this example the device must be in free running mode
if (camera_pointer_->GetRemoteNode("AcquisitionStart")->IsWriteable()) {
camera_pointer_->GetRemoteNode("AcquisitionStart")->Execute();
......
......@@ -130,6 +130,9 @@ void GenericCamDriver::execute(const std::string& aCommand) {
}
GenericCamState* currentState = dynamic_cast<GenericCamState*>(getCurrentState());
// Check command
cout << "GenericCamDriver::stop() " << aCommand<< endl;
if (aCommand == driver::INIT_COMMAND) {
// Init command
currentState->init();
......
......@@ -4,7 +4,15 @@
<link lib="opencv_core"/>
<link lib="opencv_calib3d"/>
<link lib="opencv_highgui"/>
<link path="/opt/pylon/lib" lib="GenApi_gcc_v3_1_Basler_pylon"/>
<link path="/opt/pylon/lib" lib="pylonbase" />
<link path="/opt/pylon/lib" lib="GCBase_gcc_v3_1_Basler_pylon"/>
<link path="/opt/pylon/lib" lib="pylonutility"/>
<link lib="opencv_core"/>
<link lib="opencv_calib3d"/>
<link lib="opencv_highgui"/>
<include path="/opt/baumer-gapi-sdk/include/bgapi2_genicam"/>
<include path="/opt/pylon/include"/>
<include path="$(NOMAD_HOME)/../NomadModules/src"/>
</module>
......@@ -30,6 +30,7 @@
#include "DoubleBufferHandler.h"
#include "GenericCamDef.h"
#include "GenericCamState.h"
#include </opt/pylon/include/pylon/PylonIncludes.h>
namespace genericcam {
......@@ -116,6 +117,8 @@ public:
// int32 GetAvailableGenericCameras();
// std::string getConfigFile(BGAPI2::Device* device);
private:
......@@ -219,8 +222,8 @@ private:
// perform a mean value calculation used by the calculation thread
void DoCalculation(CCameraControl * camera_control);
void stopLiveAcq();
void startLiveAcq();
// instantiate the camera handler
CCameraHandler m_camera_handler;
......@@ -245,6 +248,13 @@ private:
Counter m_TimeCounter;
Pylon::CInstantCamera *camera = nullptr;
int64 cameraNum_ = 1; //��ǰ������������ܸ���
std::string cameraName_;
};
}
......
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