support setting detector gain
This commit is contained in:
parent
d6cae80e5e
commit
b3605aa88a
@ -8,6 +8,7 @@ void Grabber::run() {
|
|||||||
if (camera->isOpen()) {
|
if (camera->isOpen()) {
|
||||||
camera->frameRate(static_cast<uint>(framerate));
|
camera->frameRate(static_cast<uint>(framerate));
|
||||||
camera->exposureTime(exposure);
|
camera->exposureTime(exposure);
|
||||||
|
camera->gain(gain);
|
||||||
Pylon::CGrabResultPtr frame;
|
Pylon::CGrabResultPtr frame;
|
||||||
Pylon::CInstantCamera *cam = camera->getCamera();
|
Pylon::CInstantCamera *cam = camera->getCamera();
|
||||||
cam->StartGrabbing();
|
cam->StartGrabbing();
|
||||||
|
10
grabber.h
10
grabber.h
@ -23,12 +23,16 @@ public:
|
|||||||
return exposure;
|
return exposure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double currentGain() {
|
||||||
|
return gain;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool stop_request = false;
|
bool stop_request = false;
|
||||||
PylonWrapper *camera;
|
PylonWrapper *camera;
|
||||||
ImageBuffer *buffer;
|
ImageBuffer *buffer;
|
||||||
int framerate;
|
int framerate;
|
||||||
double exposure;
|
double exposure, gain;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void requestStop() {
|
void requestStop() {
|
||||||
@ -40,7 +44,9 @@ public slots:
|
|||||||
void setExposureTime(double newExposureTime) {
|
void setExposureTime(double newExposureTime) {
|
||||||
exposure = newExposureTime;
|
exposure = newExposureTime;
|
||||||
}
|
}
|
||||||
|
void setGain(double gain_db) {
|
||||||
|
gain = gain_db;
|
||||||
|
}
|
||||||
signals:
|
signals:
|
||||||
void terminated();
|
void terminated();
|
||||||
};
|
};
|
||||||
|
@ -502,11 +502,13 @@ void PylonRecorder::disconnectCamera() {
|
|||||||
void PylonRecorder::startRecording() {
|
void PylonRecorder::startRecording() {
|
||||||
std::string filename = createFilename();
|
std::string filename = createFilename();
|
||||||
fileLabel->setText(QString::fromStdString(filename));
|
fileLabel->setText(QString::fromStdString(filename));
|
||||||
|
ImageSettings settings = pylon->getImageSettings();
|
||||||
|
|
||||||
VideoSpecs specs;
|
VideoSpecs specs;
|
||||||
specs.fps = framerateSpinner->value();
|
specs.fps = framerateSpinner->value();
|
||||||
specs.filename = filename;
|
specs.filename = filename;
|
||||||
specs.exposureTime = static_cast<double>(exposureSpinner->value());
|
specs.exposureTime = static_cast<double>(exposureSpinner->value());
|
||||||
ImageSettings settings = pylon->getImageSettings();
|
specs.detectorGain = static_cast<double>(gainSpinner->value());
|
||||||
specs.width = static_cast<uint32_t>(settings.width);
|
specs.width = static_cast<uint32_t>(settings.width);
|
||||||
specs.height= static_cast<uint32_t>(settings.height);
|
specs.height= static_cast<uint32_t>(settings.height);
|
||||||
specs.pixelType = settings.pixelType;
|
specs.pixelType = settings.pixelType;
|
||||||
@ -520,6 +522,8 @@ void PylonRecorder::startRecording() {
|
|||||||
grabber->setFrameRate(framerateSpinner->value());
|
grabber->setFrameRate(framerateSpinner->value());
|
||||||
if (exposureSpinner->value() != int(grabber->currentExposureTime()))
|
if (exposureSpinner->value() != int(grabber->currentExposureTime()))
|
||||||
grabber->setExposureTime(static_cast<double>(exposureSpinner->value()));
|
grabber->setExposureTime(static_cast<double>(exposureSpinner->value()));
|
||||||
|
if (gainSpinner->value() != int(grabber->currentGain()))
|
||||||
|
grabber->setGain(static_cast<double>(gainSpinner->value()));
|
||||||
writer->setVideoSpecs(specs);
|
writer->setVideoSpecs(specs);
|
||||||
buffer->clear();
|
buffer->clear();
|
||||||
grabber->start();
|
grabber->start();
|
||||||
|
Loading…
Reference in New Issue
Block a user