Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
NomadSpecialModules
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Instrument Control
NomadSpecialModules
Commits
80ed048d
Commit
80ed048d
authored
Apr 08, 2020
by
ics
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new generic gige cam for d19
parent
71b5c38b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
573 additions
and
369 deletions
+573
-369
src/drivers/gigecam/genericcam/CameraHandler.cpp
src/drivers/gigecam/genericcam/CameraHandler.cpp
+8
-7
src/drivers/gigecam/genericcam/GenericCamDriver.cpp
src/drivers/gigecam/genericcam/GenericCamDriver.cpp
+3
-0
src/drivers/gigecam/genericcam/Module.xml
src/drivers/gigecam/genericcam/Module.xml
+8
-0
src/drivers/gigecam/genericcam/RealGenericCamDriver.cpp
src/drivers/gigecam/genericcam/RealGenericCamDriver.cpp
+542
-360
src/drivers/gigecam/genericcam/RealGenericCamDriver.h
src/drivers/gigecam/genericcam/RealGenericCamDriver.h
+12
-2
No files found.
src/drivers/gigecam/genericcam/CameraHandler.cpp
View file @
80ed048d
...
...
@@ -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
();
...
...
src/drivers/gigecam/genericcam/GenericCamDriver.cpp
View file @
80ed048d
...
...
@@ -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
();
...
...
src/drivers/gigecam/genericcam/Module.xml
View file @
80ed048d
...
...
@@ -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>
src/drivers/gigecam/genericcam/RealGenericCamDriver.cpp
View file @
80ed048d
This diff is collapsed.
Click to expand it.
src/drivers/gigecam/genericcam/RealGenericCamDriver.h
View file @
80ed048d
...
...
@@ -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_
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment