properly use new ringbuffer methods
This commit is contained in:
parent
cb9867eec0
commit
b99ff19620
@ -751,7 +751,7 @@ void PylonRecorder::startRecording() {
|
|||||||
stopRequest = false;
|
stopRequest = false;
|
||||||
|
|
||||||
pressureTimer->start(50);
|
pressureTimer->start(50);
|
||||||
frameTimer->start(50);
|
frameTimer->start(100);
|
||||||
labelTimer->start(650);
|
labelTimer->start(650);
|
||||||
updateActions();
|
updateActions();
|
||||||
}
|
}
|
||||||
@ -806,12 +806,10 @@ void PylonRecorder::displayActivity() {
|
|||||||
|
|
||||||
void PylonRecorder::displaySingleFrame() {
|
void PylonRecorder::displaySingleFrame() {
|
||||||
MyImage *img;
|
MyImage *img;
|
||||||
// if (dryRunCheckBox->isChecked())
|
size_t fc = 0;
|
||||||
// img = buffer->pop();
|
img = buffer->readLast(fc);
|
||||||
// else {
|
|
||||||
img = buffer->readLast();
|
|
||||||
// }
|
|
||||||
if (img != nullptr){
|
if (img != nullptr){
|
||||||
|
std::cerr << "display, last frame count " << fc << std::endl;
|
||||||
QImage qimg(static_cast<uchar *>(img->data()), img->width(), img->height(), QImage::Format::Format_Grayscale8);
|
QImage qimg(static_cast<uchar *>(img->data()), img->width(), img->height(), QImage::Format::Format_Grayscale8);
|
||||||
setImage(qimg);
|
setImage(qimg);
|
||||||
}else {
|
}else {
|
||||||
|
@ -127,13 +127,14 @@ bool PylonWrapper::gain(double gain_db) {
|
|||||||
ImageSettings PylonWrapper::getImageSettings() {
|
ImageSettings PylonWrapper::getImageSettings() {
|
||||||
ImageSettings settings;
|
ImageSettings settings;
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
Pylon::CEnumParameter pixelFormat( camera->GetNodeMap(), "PixelFormat" );
|
||||||
|
Pylon::CPixelTypeMapper pixelTypeMapper( &pixelFormat );
|
||||||
|
Pylon::EPixelType pixelType = pixelTypeMapper.GetPylonPixelTypeFromNodeValue( pixelFormat.GetIntValue() );
|
||||||
Pylon::CIntegerParameter width( camera->GetNodeMap(), "Width");
|
Pylon::CIntegerParameter width( camera->GetNodeMap(), "Width");
|
||||||
Pylon::CIntegerParameter height( camera->GetNodeMap(), "Height");
|
Pylon::CIntegerParameter height( camera->GetNodeMap(), "Height");
|
||||||
Pylon::CEnumParameter pixelFormat( camera->GetNodeMap(), "PixelFormat");
|
settings.pixelType = pixelType;
|
||||||
Pylon::CPixelTypeMapper pixelTypeMapper(&pixelFormat);
|
settings.width = (uint32_t)width.GetValue();
|
||||||
settings.pixelType = pixelTypeMapper.GetPylonPixelTypeFromNodeValue(pixelFormat.GetIntValue());
|
settings.height = (uint32_t)height.GetValue();
|
||||||
settings.width = width.GetValue();
|
|
||||||
settings.height = height.GetValue();
|
|
||||||
settings.orientation = Pylon::EImageOrientation::ImageOrientation_TopDown;
|
settings.orientation = Pylon::EImageOrientation::ImageOrientation_TopDown;
|
||||||
}
|
}
|
||||||
return settings;
|
return settings;
|
||||||
|
@ -92,10 +92,9 @@ void Writer::run() {
|
|||||||
nix::NDSize chunk_shape(1, chunksize);
|
nix::NDSize chunk_shape(1, chunksize);
|
||||||
while ((!stop_request || buffer->bufferLoad() > 0) && !stopNow) {
|
while ((!stop_request || buffer->bufferLoad() > 0) && !stopNow) {
|
||||||
if (buffer->bufferLoad() > 0 ) {
|
if (buffer->bufferLoad() > 0 ) {
|
||||||
MyImage *img = buffer->pop();
|
size_t framecount = 0;
|
||||||
|
MyImage *img = buffer->read(framecount);
|
||||||
if (img != nullptr) {
|
if (img != nullptr) {
|
||||||
auto start = high_resolution_clock::now();
|
|
||||||
// framecount += 1;
|
|
||||||
if (videoSpecs.format == VideoFormat::raw) {
|
if (videoSpecs.format == VideoFormat::raw) {
|
||||||
myFile.write((char*)img->data(), img->size());
|
myFile.write((char*)img->data(), img->size());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user