...
 
Commits (10)
......@@ -142,6 +142,11 @@ class LIBBASLER_API Camera
void getTemperature(double& temperature);
void isColor(bool& color_flag) const;
// -- Pylon buffers statistics
void getStatisticsTotalBufferCount(long& count);
void getStatisticsFailedBufferCount(long& count);
private:
class _AcqThread;
friend class _AcqThread;
......
......@@ -2,32 +2,48 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.soleil.lib.Lima</groupId>
<artifactId>Camera</artifactId>
<version>1.3.0-SNAPSHOT</version>
<groupId>fr.soleil</groupId>
<artifactId>super-pom-C-CPP</artifactId>
<version>RELEASE</version>
</parent>
<groupId>fr.soleil.lib.Lima.Camera</groupId>
<artifactId>LimaBasler-${aol}-shared-${mode}</artifactId>
<version>1.3.4</version>
<packaging>nar</packaging>
<name>LimaBasler</name> <!-- use for the name of executable -->
<name>LimaBasler</name>
<description>This module controls the Basler Camera</description>
<scm>
<connection>scm:git:git://github.com/soleil-ica/Lima-camera-basler.git</connection>
<developerConnection>scm:git:git://github.com/soleil-ica/Lima-camera-basler.git</developerConnection>
<url>https://github.com/soleil-ica/Lima-camera-basler</url>
</scm>
<dependencies>
<dependency>
<groupId>com.basler</groupId>
<artifactId>Genicam-${aol}-shared-${mode}</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.basler</groupId>
<artifactId>Pylon-${aol}-shared-${mode}</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>fr.soleil.lib</groupId>
<artifactId>LimaCore-${aol}-shared-${mode}</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>com.basler</groupId>
<artifactId>Genicam-${aol}-shared-${mode}</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.basler</groupId>
<artifactId>Pylon-${aol}-shared-${mode}</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>ncsa.uiuc.edu</groupId>
<artifactId>HDF5-${aol}-shared-release</artifactId>
<version>1.8.13</version>
</dependency>
</dependencies>
<build>
<plugins>
......@@ -35,9 +51,11 @@
<groupId>org.freehep</groupId>
<artifactId>freehep-nar-plugin</artifactId>
<configuration>
<cpp>
<sourceDirectory>src</sourceDirectory>
<includePaths>
<includePath>include</includePath>
</includePaths>
<defines>
<define>USE_GIGE</define>
</defines>
......@@ -46,9 +64,39 @@
<option>-w</option>
</options>
</cpp>
<libraries>
<library>
<type>shared</type>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
<developers>
<developer>
<id>langlois</id>
<name>langlois</name>
<url>http://controle/</url>
<organization>Synchrotron Soleil</organization>
<organizationUrl>http://www.synchrotron-soleil.fr</organizationUrl>
<roles>
<role>manager</role>
</roles>
<timezone>1</timezone>
</developer>
<developer>
<id>noureddine</id>
<name>noureddine</name>
<url>http://controle/</url>
<organization>Synchrotron Soleil</organization>
<organizationUrl>http://www.synchrotron-soleil.fr</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>1</timezone>
</developer>
</developers>
</project>
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -641,18 +641,18 @@ void Camera::getImageType(ImageType& type)
DEB_MEMBER_FUNCT();
try
{
PixelSizeEnums ps = Camera_->PixelSize.GetValue();
PixelFormatEnums ps = Camera_->PixelFormat.GetValue();
switch( ps )
{
case PixelSize_Bpp8:
case PixelFormat_Mono8:
type= Bpp8;
break;
case PixelSize_Bpp12:
case PixelFormat_Mono12:
type= Bpp12;
break;
case PixelSize_Bpp16: //- this is in fact 12 bpp inside a 16bpp image
case PixelFormat_Mono16: //- this is in fact 12 bpp inside a 16bpp image
type= Bpp16;
break;
......@@ -665,8 +665,7 @@ void Camera::getImageType(ImageType& type)
{
// Error handling
THROW_HW_ERROR(Error) << e.GetDescription();
}
}
}
//-----------------------------------------------------
......@@ -682,8 +681,9 @@ void Camera::setImageType(ImageType type)
case Bpp8:
this->Camera_->PixelFormat.SetValue(PixelFormat_Mono8);
break;
case Bpp12:
this->Camera_->PixelFormat.SetValue(PixelFormat_Mono12);
break;
case Bpp16:
this->Camera_->PixelFormat.SetValue(PixelFormat_Mono16);
break;
......@@ -736,14 +736,17 @@ void Camera::setTrigMode(TrigMode mode)
DEB_PARAM() << DEB_VAR1(mode);
try
{
{
if ( mode == IntTrig )
{
//- INTERNAL
this->Camera_->TriggerSelector.SetValue( TriggerSelector_AcquisitionStart );
this->Camera_->TriggerMode.SetValue( TriggerMode_Off );
if ( GenApi::IsAvailable(Camera_->TriggerSelector.GetEntryByName("FrameStart")))
GenApi::IEnumEntry *enumEntryFrameStart = Camera_->TriggerSelector.GetEntryByName("FrameStart");
if(enumEntryFrameStart && GenApi::IsAvailable(enumEntryFrameStart))
this->Camera_->TriggerSelector.SetValue( TriggerSelector_FrameStart );
this->Camera_->TriggerMode.SetValue( TriggerMode_Off );
this->Camera_->ExposureMode.SetValue(ExposureMode_Timed);
}
......@@ -752,8 +755,11 @@ void Camera::setTrigMode(TrigMode mode)
//- EXTERNAL - TRIGGER WIDTH
this->Camera_->TriggerSelector.SetValue( TriggerSelector_AcquisitionStart );
this->Camera_->TriggerMode.SetValue( TriggerMode_On );
if ( GenApi::IsAvailable(Camera_->TriggerSelector.GetEntryByName("FrameStart")))
GenApi::IEnumEntry *enumEntryFrameStart = Camera_->TriggerSelector.GetEntryByName("FrameStart");
if(enumEntryFrameStart && GenApi::IsAvailable(enumEntryFrameStart))
this->Camera_->TriggerSelector.SetValue( TriggerSelector_FrameStart );
this->Camera_->TriggerMode.SetValue( TriggerMode_On );
this->Camera_->AcquisitionFrameRateEnable.SetValue( false );
this->Camera_->ExposureMode.SetValue( ExposureMode_TriggerWidth );
......@@ -764,8 +770,11 @@ void Camera::setTrigMode(TrigMode mode)
this->Camera_->TriggerSelector.SetValue( TriggerSelector_AcquisitionStart );
this->Camera_->TriggerMode.SetValue( TriggerMode_On );
if ( GenApi::IsAvailable(Camera_->TriggerSelector.GetEntryByName("FrameStart")))
GenApi::IEnumEntry *enumEntryFrameStart = Camera_->TriggerSelector.GetEntryByName("FrameStart");
if(enumEntryFrameStart && GenApi::IsAvailable(enumEntryFrameStart))
this->Camera_->TriggerSelector.SetValue( TriggerSelector_FrameStart );
this->Camera_->TriggerMode.SetValue( TriggerMode_Off );
this->Camera_->AcquisitionFrameRateEnable.SetValue( false );
this->Camera_->ExposureMode.SetValue( ExposureMode_Timed );
......@@ -794,7 +803,8 @@ void Camera::getTrigMode(TrigMode& mode)
this->Camera_->TriggerSelector.SetValue( TriggerSelector_AcquisitionStart );
acqStart = this->Camera_->TriggerMode.GetValue();
if ( GenApi::IsAvailable(Camera_->TriggerSelector.GetEntryByName("FrameStart")))
GenApi::IEnumEntry *enumEntryFrameStart = Camera_->TriggerSelector.GetEntryByName("FrameStart");
if(enumEntryFrameStart && GenApi::IsAvailable(enumEntryFrameStart))
{
this->Camera_->TriggerSelector.SetValue( TriggerSelector_FrameStart );
frameStart = this->Camera_->TriggerMode.GetValue();
......@@ -814,10 +824,10 @@ void Camera::getTrigMode(TrigMode& mode)
// Error handling
THROW_HW_ERROR(Error) << e.GetDescription();
}
DEB_RETURN() << DEB_VAR4(mode,acqStart, frameStart, expMode);
DEB_RETURN() << DEB_VAR4(mode,acqStart, frameStart, expMode);
}
//-----------------------------------------------------
//
//-----------------------------------------------------
......@@ -843,6 +853,8 @@ void Camera::setExpTime(double exp_time)
Camera_->ExposureTimeRaw.SetValue(static_cast<int> (raw));
raw = static_cast<double> (Camera_->ExposureTimeRaw.GetValue());
Camera_->ExposureTimeBaseAbs.SetValue(1E6 * (exp_time / raw));
DEB_TRACE() << "raw = " << raw;
DEB_TRACE() << "ExposureTimeBaseAbs = " << (1E6 * (exp_time / raw));
}
else
{
......@@ -1352,6 +1364,7 @@ void Camera::getAutoGain(bool& auto_gain) const
else
{
auto_gain = false;
// THROW_HW_ERROR(Error)<<"GainAuto Parameter is not Available !";
}
}
catch (GenICam::GenericException &e)
......@@ -1373,7 +1386,11 @@ void Camera::setGain(double gain)
try
{
// you want to set the gain, remove autogain
setAutoGain(false);
if (GenApi::IsAvailable(Camera_->GainAuto))
{
setAutoGain(false);
}
if (GenApi::IsWritable(Camera_->GainRaw) && GenApi::IsAvailable(Camera_->GainRaw))
{
......@@ -1396,11 +1413,15 @@ void Camera::setGain(double gain)
Camera_->GainRaw.SetValue(gain_raw);
DEB_TRACE() << "gain_raw = " << gain_raw;
}
else
{
THROW_HW_ERROR(Error)<<"GainRaw Parameter is not Available !";
}
}
catch (GenICam::GenericException &e)
{
// Error handling
THROW_HW_ERROR(Error) << e.GetDescription();
THROW_HW_ERROR(Error) << e.GetDescription();
}
}
......@@ -1472,4 +1493,31 @@ void Camera::isColor(bool& color_flag) const
{
color_flag = m_color_flag;
}
//---------------------------
// The Total Buffer Count will count the number of all buffers with "status == succeeded" and "status == failed".
// That means, all successfully and all incompletely grabbed (error code: 0xE1000014) buffers.
// That means, the Failed Buffer Count will also be included into this number.
//---------------------------
void Camera::getStatisticsTotalBufferCount(long& count)
{
DEB_MEMBER_FUNCT();
if(StreamGrabber_ != NULL)
count = StreamGrabber_->Statistic_Total_Buffer_Count.GetValue();
else
count = -1;//Because Not valid when acquisition is stopped
}
//---------------------------
// The Failed Buffer Count will count only buffers, which were received with "status == failed".
// That means, buffers that were incompletely grabbed (error code: 0xE1000014).
//---------------------------
void Camera::getStatisticsFailedBufferCount(long& count)
{
DEB_MEMBER_FUNCT();
if(StreamGrabber_ != NULL)
count = StreamGrabber_->Statistic_Failed_Buffer_Count.GetValue();
else
count = -1;//Because Not valid when acquisition is stopped
}
//---------------------------