I need creating a program en QT for view cameras SAPERA++

253 views Asked by At

i have this program that i copy the other post: Sapera++ API with Qt undefined reference to '_imp__ZN11SapLocation My Program is:

SapCamara1.pro

#-------------------------------------------------
#
# Project created by QtCreator 2021-07-06T09:36:29
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = SapCamara1
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

#CONFIG += c++11 #puede comentarse

SOURCES += \
        main.cpp \
        mainwindow.cpp

HEADERS += \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapAcqDevice.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapAcqToBufThruCab.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapAcquisition.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapBayer.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapBuffer.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapBufferRemote.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapBufferRoi.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapBufferWithTrash.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapBufferWithTrashAndRoi.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapCab.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapClassBasic.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapClassBasicDef.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapClassBasicObsolete.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapClassBasicRes.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapColorConversion.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapCounter.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapData.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapDisplay.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapDynamicLut.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapFeature.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapFlatField.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapGio.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapGraphic.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapLut.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapManager.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapMetadata.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapMultiAcqToBufThruCab.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapPerformance.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapPixPro.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapProcessing.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapRTPro.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapRTProDesign.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapRTProDesignOnBrdBuffers.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapTransfer.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapTransferEx.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapView.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapXferMultiNode.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/SapXferNode.h \
#        ../../../../../../../Program Files/Teledyne DALSA/Sapera/Classes/Basic/corenv.h \
        mainwindow.h

FORMS += \
        mainwindow.ui

INCLUDEPATH += 'C:\Program Files\Teledyne DALSA\Sapera\Classes\Basic'
INCLUDEPATH += 'C:\Program Files\Teledyne DALSA\Sapera\Include'
INCLUDEPATH += 'C:\Program Files\Teledyne DALSA\Sapera\Lib'

LIBS += 'C:\Program Files\Teledyne DALSA\Sapera\Lib\Win64\SapClassBasic.lib'



# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H

main.cpp

#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}

And I am not sure if I am placing correctly the index and resourcefile of the arguments requested by SapAcquisition. mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "SapClassBasic.h"
#include "SapAcquisition.h"

HWND disp;
//bool success;


MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //disp=(HWND)ui->graphicsView->winId();
    disp=(HWND)ui->graphicsView->winId();
    SapAcquisition *pAcq=new SapAcquisition(SapLocation("Nano-M1450_1",1),"T_Nano-M1450_IAB_1.ccf");
    //Nano-M1450
    //T_Nano-M1450_IAB_1.ccf

    SapBuffer *pBuffer=new SapBuffer(1,pAcq);
    //SapView *pView=new SapView(pBuffer,disp);
}

MainWindow::~MainWindow()
{
    delete ui;
}

But i can't see the image of the camera:

09:35:29: Starting C:\Users\MSA\Desktop\Adrian Pilataxi\tutorial open cv camara\SapCamara1\build-SapCamara1-Desktop_Qt_5_11_1_MSVC2015_64bit-Debug\debug\SapCamara1.exe ...
=>LOG :  : Loading logger parameter file 'C:\Program Files\GenICam_v2_4\log\config\DebugLogging.properties'
09:35:33: C:/Users/MSA/Desktop/Adrian Pilataxi/tutorial open cv camara/SapCamara1/build-SapCamara1-Desktop_Qt_5_11_1_MSVC2015_64bit-Debug/debug/SapCamara1.exe exited with code 0

The cameras I am using are: Nano-M1450 of the GenieNano series from Teledyne DALSA, I don't know if anyone can help me with any suggestions to be able to observe the image obtained from the camera through the GUI.

0

There are 0 answers