Commit 86a6d328 authored by Andreas Persson's avatar Andreas Persson

Camera: refactor property management

- Add frame rate control
- Manage exposure time in milliseconds
- Manage gain in dB
parent 28a7b580
......@@ -46,7 +46,7 @@ namespace PointGrey
{
/*******************************************************************
* \class Camera
* \brief object controlling the Point Grey camera via Pylon driver
* \brief object controlling the Point Grey camera via FlyCapture driver
*******************************************************************/
class VideoCtrlObj;
class Camera : public HwMaxImageSizeCallbackGen
......@@ -90,7 +90,7 @@ public:
void getExpTime(double& exp_time);
void setExpTime(double exp_time);
void getExpTimeRange(double& min_exp_time, double& max_exp_time) const;
void getExpTimeRange(double& min_exp_time, double& max_exp_time);
void getLatTime(double& lat_time);
void setLatTime(double lat_time);
......@@ -111,25 +111,35 @@ public:
void setBin(const Bin& bin);
// camera specific
void getGain(double& gain);
void setGain(double gain);
void getPacketSize(int& packet_size);
void setPacketSize(int packet_size);
void getPacketDelay(int& packet_delay);
void setPacketDelay(int packet_delay);
void getAutoExpTime(bool& auto_frame_rate) const;
void getGain(double& gain);
void setGain(double gain);
void getGainRange(double& min_gain, double& max_gain);
void getFrameRate(double& frame_rate);
void setFrameRate(double frame_rate);
void getFrameRateRange(double& min_frame_rate, double& max_frame_rate);
void getAutoExpTime(bool& auto_frame_rate);
void setAutoExpTime(bool auto_exp_time);
void getAutoGain(bool& auto_gain) const;
void getAutoGain(bool& auto_gain);
void setAutoGain(bool auto_gain);
void getAutoFrameRate(bool& auto_frame_rate);
void setAutoFrameRate(bool auto_frame_rate);
protected:
void _getPropertyInfo(FlyCapture2::PropertyInfo *property_info);
void _getProperty(FlyCapture2::Property *property);
void _setProperty(FlyCapture2::Property *property);
// property management
void _getPropertyValue(FlyCapture2::PropertyType type, double& value);
void _setPropertyValue(FlyCapture2::PropertyType type, double value);
void _getPropertyRange(FlyCapture2::PropertyType type, double& min_value, double& max_value);
void _getPropertyAutoMode(FlyCapture2::PropertyType type, bool& auto_mode);
void _setPropertyAutoMode(FlyCapture2::PropertyType type, bool auto_mode);
void _getImageSettingsInfo();
void _applyImageSettings();
......@@ -155,18 +165,10 @@ private:
Camera_t *m_camera;
FlyCapture2::CameraInfo m_camera_info;
FlyCapture2::Error m_error;
FlyCapture2::Error m_error;
ImageSettingsInfo_t m_image_settings_info;
ImageSettings_t m_image_settings;
FlyCapture2::Property m_frame_rate_property,
m_exp_time_property,
m_gain_property;
FlyCapture2::PropertyInfo m_frame_rate_property_info,
m_exp_time_property_info,
m_gain_property_info;
};
} // namespace PointGrey
} // namespace lima
......
......@@ -33,7 +33,7 @@ namespace PointGrey
void getExpTime(double& exp_time /Out/);
void setExpTime(double exp_time);
void getExpTimeRange(double& min_exp_time /Out/, double& max_exp_time /Out/) const;
void getExpTimeRange(double& min_exp_time /Out/, double& max_exp_time /Out/);
void getLatTime(double& lat_time /Out/);
void setLatTime(double lat_time);
......@@ -52,21 +52,31 @@ namespace PointGrey
void getBin(Bin& /Out/);
void setBin(const Bin&);
// -- video
void getGain(double& gain /Out/);
void setGain(double gain);
// -- camera specific
// packet size control
void getPacketSize(int& packet_size /Out/);
void setPacketSize(int packet_size);
// packet delay control
void getPacketDelay(int& packet_delay /Out/);
void setPacketDelay(int packet_delay);
void getAutoExpTime(bool& auto_exp_time /Out/) const;
// exposure control
void getAutoExpTime(bool& auto_exp_time /Out/);
void setAutoExpTime(bool auto_exp_time);
void getAutoGain(bool& auto_gain /Out/) const;
void setAutoGain(bool auto_gain);
// gain control
void getGain(double& gain /Out/);
void setGain(double gain);
void getAutoGain(bool& auto_gain /Out/);
void setAutoGain(bool auto_gain);
void getGainRange(double& min_gain /Out/, double& max_gain /Out/);
// frame rate control
void getFrameRate(double& frame_rate /Out/);
void setFrameRate(double frame_rate);
void getAutoFrameRate(bool& auto_frame_rate /Out/);
void setAutoFrameRate(bool auto_frame_rate);
void getFrameRateRange(double& min_frame_rate /Out/, double& max_frame_rate /Out/);
};
};
This diff is collapsed.
......@@ -69,9 +69,8 @@ void SyncCtrlObj::getTrigMode(TrigMode& trig_mode)
//-----------------------------------------------------
void SyncCtrlObj::setExpTime(double exp_time)
{
m_cam.setExpTime(exp_time);
ValidRangesType valid_ranges;
getValidRanges(valid_ranges);
double exp_time_ms = 1E3 * exp_time;
m_cam.setExpTime(exp_time_ms);
}
//-----------------------------------------------------
......@@ -79,7 +78,9 @@ void SyncCtrlObj::setExpTime(double exp_time)
//-----------------------------------------------------
void SyncCtrlObj::getExpTime(double& exp_time)
{
m_cam.getExpTime(exp_time);
double exp_time_ms;
m_cam.getExpTime(exp_time_ms);
exp_time = exp_time_ms * 1E-3;
}
//-----------------------------------------------------
......@@ -120,14 +121,14 @@ void SyncCtrlObj::getNbHwFrames(int& nb_frames)
void SyncCtrlObj::getValidRanges(ValidRangesType& valid_ranges)
{
DEB_MEMBER_FUNCT();
double min_time;
double max_time;
double min_time_ms;
double max_time_ms;
m_cam.getExpTimeRange(min_time, max_time);
valid_ranges.min_exp_time = min_time;
valid_ranges.max_exp_time = max_time;
m_cam.getExpTimeRange(min_time_ms, max_time_ms);
valid_ranges.min_exp_time = min_time_ms * 1E-3;
valid_ranges.max_exp_time = max_time_ms * 1E-3;
m_cam.getLatTimeRange(min_time, max_time);
valid_ranges.min_lat_time = min_time;
valid_ranges.max_lat_time = max_time;
m_cam.getLatTimeRange(min_time_ms, max_time_ms);
valid_ranges.min_lat_time = min_time_ms * 1E-3;
valid_ranges.max_lat_time = max_time_ms * 1E-3;
}
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