...
 
Commits (2)
...@@ -97,6 +97,17 @@ class BASLER_EXPORT Camera ...@@ -97,6 +97,17 @@ class BASLER_EXPORT Camera
LevelLow=Basler_GigECamera::TriggerActivation_LevelLow LevelLow=Basler_GigECamera::TriggerActivation_LevelLow
}; };
enum TestImageSelector {
TestImage_Off=Basler_GigECamera::TestImageSelector_Off,
TestImage_1=Basler_GigECamera::TestImageSelector_Testimage1,
TestImage_2=Basler_GigECamera::TestImageSelector_Testimage2,
TestImage_3=Basler_GigECamera::TestImageSelector_Testimage3,
TestImage_4=Basler_GigECamera::TestImageSelector_Testimage4,
TestImage_5=Basler_GigECamera::TestImageSelector_Testimage5,
TestImage_6=Basler_GigECamera::TestImageSelector_Testimage6,
TestImage_7=Basler_GigECamera::TestImageSelector_Testimage7,
};
Camera(const std::string& camera_id,int packet_size = -1,int received_priority = 0); Camera(const std::string& camera_id,int packet_size = -1,int received_priority = 0);
~Camera(); ~Camera();
...@@ -197,6 +208,10 @@ class BASLER_EXPORT Camera ...@@ -197,6 +208,10 @@ class BASLER_EXPORT Camera
// -- Pylon buffers statistics // -- Pylon buffers statistics
void getStatisticsTotalBufferCount(long& count); void getStatisticsTotalBufferCount(long& count);
void getStatisticsFailedBufferCount(long& count); void getStatisticsFailedBufferCount(long& count);
// -- Pylon test image selectors
void setTestImageSelector(TestImageSelector set);
void getTestImageSelector(TestImageSelector& set) const;
private: private:
class _AcqThread; class _AcqThread;
......
...@@ -29,7 +29,18 @@ namespace Basler ...@@ -29,7 +29,18 @@ namespace Basler
LevelHigh=Basler_GigECamera::TriggerActivation_LevelHigh, LevelHigh=Basler_GigECamera::TriggerActivation_LevelHigh,
LevelLow=Basler_GigECamera::TriggerActivation_LevelLow LevelLow=Basler_GigECamera::TriggerActivation_LevelLow
}; };
enum TestImageSelector {
TestImage_Off=Basler_GigECamera::TestImageSelector_Off,
TestImage_1=Basler_GigECamera::TestImageSelector_TestImage1,
TestImage_2=Basler_GigECamera::TestImageSelector_TestImage2,
TestImage_3=Basler_GigECamera::TestImageSelector_TestImage3,
TestImage_4=Basler_GigECamera::TestImageSelector_TestImage4,
TestImage_5=Basler_GigECamera::TestImageSelector_TestImage5,
TestImage_6=Basler_GigECamera::TestImageSelector_TestImage6,
TestImage_7=Basler_GigECamera::TestImageSelector_TestImage7,
};
Camera(const std::string& camera_ip,int mtu_size = -1,int received_priority = 0); Camera(const std::string& camera_ip,int mtu_size = -1,int received_priority = 0);
~Camera(); ~Camera();
...@@ -118,6 +129,10 @@ namespace Basler ...@@ -118,6 +129,10 @@ namespace Basler
void getStatisticsTotalBufferCount(long& count); void getStatisticsTotalBufferCount(long& count);
void getStatisticsFailedBufferCount(long& count); void getStatisticsFailedBufferCount(long& count);
// -- Pylon test image selectors
void setTestImageSelector(TestImageSelector set);
void getTestImageSelector(TestImageSelector& set /Out/) const;
private: private:
Camera(const Basler::Camera&); Camera(const Basler::Camera&);
}; };
......
...@@ -265,6 +265,12 @@ Camera::Camera(const std::string& camera_id,int packet_size,int receive_priority ...@@ -265,6 +265,12 @@ Camera::Camera(const std::string& camera_id,int packet_size,int receive_priority
DEB_TRACE() << "Set ExposureAuto to Off"; DEB_TRACE() << "Set ExposureAuto to Off";
Camera_->ExposureAuto.SetValue(ExposureAuto_Off); Camera_->ExposureAuto.SetValue(ExposureAuto_Off);
} }
if (GenApi::IsAvailable(Camera_->TestImageSelector ))
{
DEB_TRACE() << "Set TestImage to Off";
Camera_->TestImageSelector.SetValue(TestImageSelector_Off);
}
// Start with internal trigger // Start with internal trigger
// Force cache variable to get trigger really initialized at first call // Force cache variable to get trigger really initialized at first call
m_trigger_mode = ExtTrigSingle; m_trigger_mode = ExtTrigSingle;
...@@ -2058,3 +2064,48 @@ void Camera::getStatisticsFailedBufferCount(long& count) ...@@ -2058,3 +2064,48 @@ void Camera::getStatisticsFailedBufferCount(long& count)
count = -1;//Because Not valid when acquisition is stopped count = -1;//Because Not valid when acquisition is stopped
} }
//--------------------------- //---------------------------
//-----------------------------------------------------
//
//-----------------------------------------------------
void Camera::setTestImageSelector(TestImageSelector set)
{
DEB_MEMBER_FUNCT();
try
{
Basler_GigECamera::TestImageSelectorEnums test =
static_cast<Basler_GigECamera::TestImageSelectorEnums>(set);
// If the parameter TestImage is available for this camera
if (GenApi::IsAvailable(Camera_->TestImageSelector))
Camera_->TestImageSelector.SetValue(test);
}
catch (GenICam::GenericException &e)
{
DEB_WARNING() << e.GetDescription();
}
}
//-----------------------------------------------------
//
//-----------------------------------------------------
void Camera::getTestImageSelector(TestImageSelector& set) const
{
DEB_MEMBER_FUNCT();
try
{
Basler_GigECamera::TestImageSelectorEnums test;
// If the parameter TestImage is available for this camera
if (GenApi::IsAvailable(Camera_->TestImageSelector))
test = Camera_->TestImageSelector.GetValue();
set = static_cast<TestImageSelector>(test);
}
catch (GenICam::GenericException &e)
{
DEB_WARNING() << e.GetDescription();
}
}
...@@ -56,10 +56,20 @@ class Basler(PyTango.Device_4Impl): ...@@ -56,10 +56,20 @@ class Basler(PyTango.Device_4Impl):
def __init__(self,*args) : def __init__(self,*args) :
PyTango.Device_4Impl.__init__(self,*args) PyTango.Device_4Impl.__init__(self,*args)
self.init_device() self.__TestImageSelector = {'TESTIMAGE_OFF': BaslerAcq.Camera.TestImage_Off,
'TESTIMAGE_1': BaslerAcq.Camera.TestImage_1,
'TESTIMAGE_2': BaslerAcq.Camera.TestImage_2,
'TESTIMAGE_3': BaslerAcq.Camera.TestImage_3,
'TESTIMAGE_4': BaslerAcq.Camera.TestImage_4,
'TESTIMAGE_5': BaslerAcq.Camera.TestImage_5,
'TESTIMAGE_6': BaslerAcq.Camera.TestImage_6,
'TESTIMAGE_7': BaslerAcq.Camera.TestImage_7,
}
self.__Attribute2FunctionBase = { self.__Attribute2FunctionBase = {
} }
self.init_device()
#------------------------------------------------------------------ #------------------------------------------------------------------
# Device destructor # Device destructor
...@@ -136,7 +146,34 @@ class BaslerClass(PyTango.DeviceClass): ...@@ -136,7 +146,34 @@ class BaslerClass(PyTango.DeviceClass):
} }
attr_list = { attr_list = {
} 'statistics_total_buffer_count':
[[PyTango.DevLong,
PyTango.SCALAR,
PyTango.READ],
{
'unit': 'N/A',
'format': '',
'description': 'total number of frame requested',
}],
'statistics_failed_buffer_count':
[[PyTango.DevLong,
PyTango.SCALAR,
PyTango.READ],
{
'unit': 'N/A',
'format': '',
'description': 'total number of failed frame',
}],
'test_image_selector':
[[PyTango.DevString,
PyTango.SCALAR,
PyTango.READ_WRITE],
{
'unit': 'N/A',
'format': '',
'description': 'select a test image image_off/image_1/.../image_7',
}],
}
def __init__(self,name) : def __init__(self,name) :
PyTango.DeviceClass.__init__(self,name) PyTango.DeviceClass.__init__(self,name)
......