[wrapper] add gain access functions

This commit is contained in:
Jan Grewe 2020-11-20 09:46:29 +01:00
parent 2b913b8133
commit 96d63e0a61
2 changed files with 22 additions and 0 deletions

View File

@ -82,6 +82,26 @@ bool PylonWrapper::exposureTime(double exposure_time) {
return false; return false;
} }
double PylonWrapper::gain() {
double gain = -1.;
if (valid) {
GenApi::INodeMap& nodemap = camera->GetNodeMap();
GenApi::INode* n = nodemap.GetNode( "Gain" );
Pylon::CFloatParameter detector_gain( n );
gain = detector_gain.GetValue();
}
return gain;
}
bool PylonWrapper::gain(double gain_db) {
if (valid) {
GenAPI::INodeMap& nodemap = camera.GetNodeMap();
GenAPI::CFloatPtr(nodemap.GetNode("Gain"))->SetValue(gain_db);
return true;
}
return false;
}
ImageSettings PylonWrapper::getImageSettings() { ImageSettings PylonWrapper::getImageSettings() {
ImageSettings settings; ImageSettings settings;
if (valid) { if (valid) {

View File

@ -29,6 +29,8 @@ public:
double maxFrameRate(); double maxFrameRate();
double exposureTime(); double exposureTime();
bool exposureTime(double exposure_time); bool exposureTime(double exposure_time);
double gain();
bool gain(double gain_db);
Pylon::CInstantCamera *getCamera(); Pylon::CInstantCamera *getCamera();
private: private: