savety net for gain settings, add readme, licence and ignore

This commit is contained in:
2026-03-12 10:29:23 +01:00
parent 4a8602bb42
commit e1f1f773af
4 changed files with 726 additions and 3 deletions

View File

@@ -54,10 +54,12 @@ void exposureTime(CInstantCamera &camera, double exposure_time) {
void detectorGain(CInstantCamera &camera, double gain) {
double g = gain >= 0.0 ? gain : 0.0;
g = g < 12.0 ? g : 11.9;
GenApi::INodeMap& nodemap = camera.GetNodeMap();
CEnumParameter(nodemap, "GainAuto").SetValue("Off");
CEnumParameter(nodemap, "GainSelector").SetValue("All");
CFloatParameter(nodemap, "Gain").SetValue(gain);
CEnumParameter( nodemap, "GainAuto" ).SetValue( "Off" );
CEnumParameter( nodemap, "GainSelector" ).SetValue( "All" );
CFloatParameter( nodemap, "Gain" ).SetValue( g );
}