diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/Makefile b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/Makefile index a5115dcedd23e4cc229a563a54e3bd2877c179b8..a7694eb74acfc7e6af77958ef00c27b8b31baa4b 100644 --- a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/Makefile +++ b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/Makefile @@ -17,7 +17,7 @@ all: $(BIN_PATH) include $(MAKE_INCLUDE_DIR)/VimbaCPP.mk include $(MAKE_INCLUDE_DIR)/VimbaImageTransform.mk -include $(MAKE_INCLUDE_DIR)/Qt5.mk +include $(MAKE_INCLUDE_DIR)/Qt6.mk SOURCE_DIR = $(PROJECT_DIR)/Source diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/binary/x86_64bit/AsynchronousOpenCVRecorder b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/binary/x86_64bit/AsynchronousOpenCVRecorder index fec3cc88bb39d041955643633d853085e1c672e3..dfa3e9df22861ec741c5ba53ae8112ef6701a1f0 100755 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/binary/x86_64bit/AsynchronousOpenCVRecorder and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/binary/x86_64bit/AsynchronousOpenCVRecorder differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/ApiController.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/ApiController.o index 0513014e6736a6748578d0de8bb6ce05fbb5a208..dcc47ba2b35ceb83aad395bc98f4b046fc8c2989 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/ApiController.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/ApiController.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/AsynchronousOpenCVRecorder.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/AsynchronousOpenCVRecorder.o index 20b75ad7993e5ce9216ed97df51899c9062fa100..d1129011baa2f9826116d75a10da9353a1f94e66 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/AsynchronousOpenCVRecorder.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/AsynchronousOpenCVRecorder.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/CameraObserver.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/CameraObserver.o index 604af9cdde9101d7703a16ec939677aab68249cd..28cbc96d701f6c8a0dd209bf25c3e6c098dad913 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/CameraObserver.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/CameraObserver.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/FrameObserver.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/FrameObserver.o index 391fe2e9fd0e47c343020b3eececd8fec919ecd9..149298e35f6d8180dfdeebe7fc43031b2eb2d6eb 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/FrameObserver.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/FrameObserver.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/main.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/main.o index c2c2dfc8e3d7954992f99fdf88bb94a77b08b169..566850f8538eb57edf68462176c5e837cfcbdb5a 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/main.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/main.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_AsynchronousOpenCVRecorder.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_AsynchronousOpenCVRecorder.o index ad126988eb67996fbb71882109227c815ba08add..82d4e4be4a2557ed7972617f7e224024f2212e42 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_AsynchronousOpenCVRecorder.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_AsynchronousOpenCVRecorder.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_CameraObserver.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_CameraObserver.o index e42a4d284344869b279cf4f6c377a338d0419e9c..0c5f4dd951a989419c334ed39ae82d54c08a14e1 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_CameraObserver.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_CameraObserver.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_FrameObserver.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_FrameObserver.o index ac3726e9583738b3497d9782108bd47576b060db..1f3014f89db9308bc8b93ce93be33874b4dcb165 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_FrameObserver.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_FrameObserver.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_OpenCVVideoRecorder.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_OpenCVVideoRecorder.o index 919a2335f4d248b0eede13cc27999ff94ce8819e..cc4f4729f7ed0a02804e59c670c1f80ee1a4fa2f 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_OpenCVVideoRecorder.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/moc_OpenCVVideoRecorder.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/qrc_AsynchronousOpenCVRecorder.o b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/qrc_AsynchronousOpenCVRecorder.o index 6a8192e5fc28be1a23565813f79aabd19b40359e..3075a5f09e7fd3eead22cfaec93ac6c927a31d5c 100644 Binary files a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/qrc_AsynchronousOpenCVRecorder.o and b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Build/Make/object/x86_64bit/qrc_AsynchronousOpenCVRecorder.o differ diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Source/AsynchronousOpenCVRecorder.h b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Source/AsynchronousOpenCVRecorder.h index 7414ba2682228141e6c8bd2d7f728cd769e92453..b25d751bc9f2a1747202197eb2b0286ab40da134 100644 --- a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Source/AsynchronousOpenCVRecorder.h +++ b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/Qt/Source/AsynchronousOpenCVRecorder.h @@ -41,7 +41,7 @@ class AsynchronousOpenCVRecorder : public QMainWindow Q_OBJECT public: - AsynchronousOpenCVRecorder( QWidget *parent = 0, Qt::WindowFlags flags = 0 ); + AsynchronousOpenCVRecorder( QWidget *parent = 0, Qt::WindowFlags flags = (Qt::WindowFlags)0 ); ~AsynchronousOpenCVRecorder(); private: diff --git a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/notes b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/notes index b03b2d93345893af1ada265e6be7584ab22206e8..a171dfce8c349801d29ec5359cb61e2d3619bf77 100644 --- a/VimbaCPP/Examples/AsynchronousOpenCVRecorder/notes +++ b/VimbaCPP/Examples/AsynchronousOpenCVRecorder/notes @@ -1,9 +1,12 @@ +## use QT6 +replace Qt.mk with Qt6.mk in Makefile +add INCLUDE and LIB flags manually to Makefile + ## use QT5 replace Qt.mk with Qt5.mk in Makefile > add qt5widgets? > see async grab notes! - ## use openCV4 apt install opencv-dev pkg-config --cflags --libs opencv4 # test it! diff --git a/VimbaCPP/Examples/Build/Make/Qt6.mk b/VimbaCPP/Examples/Build/Make/Qt6.mk new file mode 100644 index 0000000000000000000000000000000000000000..c8a4f421a6b821b3c6ceef43ff661f20ec806359 --- /dev/null +++ b/VimbaCPP/Examples/Build/Make/Qt6.mk @@ -0,0 +1,34 @@ +include $(MAKE_INCLUDE_DIR)/Common.mk + +# Qt bin dir in Path! + +QT_INC=/usr/include/x86_64-linux-gnu/qt6 +# QT_LIBS=/usr/lib/x86_64-linux-gnu +QT_BIN=/usr/lib/qt6/libexec +MOC = $(QT_BIN)/moc +UIC = $(QT_BIN)/uic +RCC = $(QT_BIN)/rcc + + +ifeq ($(MOC),) +$(error Didn't find Moc. Add Qt-Bin-Dir to Path!) +endif + +#Compile options needed for QtCore +# !! WARNING !! +# Qt6 doesn't use pkg-config or qmake anymore but uses CMAKE instead... +# so try to insert flags manually +# before: pkg-config --cflags --libs Qt5Core + +QTCORE_CFLAGS = -I$(QT_INC) -I$(QT_INC)/QtCore +QTCORE_LIBS = -lQt6Core +QTGUI_CFLAGS = -I$(QT_INC) -I$(QT_INC)/QtGui -I$(QT_INC) -I$(QT_INC)/QtCore +QTGUI_LIBS = -lQt6Gui -lQt6Core +QTWIDGETS_CFLAGS = -I$(QT_INC) -I$(QT_INC)/QtWidgets -I$(QT_INC) -I$(QT_INC)/QtCore +QTWIDGETS_LIBS = -lQt6Gui -lQt6Widgets + +#Operations we have to do in order to prepare QtXZ +QtCore: +QtGui: +QtWidgets: + diff --git a/VimbaCPP/Examples/CameraFactory/Build/Make/binary/x86_64bit/CameraFactory b/VimbaCPP/Examples/CameraFactory/Build/Make/binary/x86_64bit/CameraFactory index 8d43ae7768569c9819917331117fad0bd8c4caa3..1a009d9c4f6020749c762d64048f56053b463526 100755 Binary files a/VimbaCPP/Examples/CameraFactory/Build/Make/binary/x86_64bit/CameraFactory and b/VimbaCPP/Examples/CameraFactory/Build/Make/binary/x86_64bit/CameraFactory differ diff --git a/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/CameraFactory.o b/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/CameraFactory.o index 62d2cbeaed203309d053aeefa0d6abc8ecda8238..3b04823359b90c096325f71407e7463fdc1563db 100644 Binary files a/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/CameraFactory.o and b/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/CameraFactory.o differ diff --git a/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/program.o b/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/program.o index 9cd4abd175dce28d25a1ebb259122dd5aa17064b..c018ee06da763eb1bab09f1010452add11abb589 100644 Binary files a/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/program.o and b/VimbaCPP/Examples/CameraFactory/Build/Make/object/x86_64bit/program.o differ diff --git a/VimbaCPP/Examples/ListCameras/Build/Make/binary/x86_64bit/ListCameras b/VimbaCPP/Examples/ListCameras/Build/Make/binary/x86_64bit/ListCameras index 9f8ad30d8d3bf6638e4be1a3c07d4ec4d2f94bd4..0f26501b835f8c7d7fdcb2dfbc127d8d7c2bdf9c 100755 Binary files a/VimbaCPP/Examples/ListCameras/Build/Make/binary/x86_64bit/ListCameras and b/VimbaCPP/Examples/ListCameras/Build/Make/binary/x86_64bit/ListCameras differ diff --git a/VimbaCPP/Examples/ListCameras/Build/Make/object/x86_64bit/ListCameras.o b/VimbaCPP/Examples/ListCameras/Build/Make/object/x86_64bit/ListCameras.o index cac025ea7a312999498bc5fd12bc822b08ae3ecb..2b41a24ef8528fde47bcae08e16bc5925ded715b 100644 Binary files a/VimbaCPP/Examples/ListCameras/Build/Make/object/x86_64bit/ListCameras.o and b/VimbaCPP/Examples/ListCameras/Build/Make/object/x86_64bit/ListCameras.o differ diff --git a/recorder/obj/moc_mainwindow.cpp b/recorder/obj/moc_mainwindow.cpp index 11a1798abb1cac1fe4c73efc9cbef03fb722d0cf..db7db12a53a9133719ba5b4db016801ace1a9653 100644 --- a/recorder/obj/moc_mainwindow.cpp +++ b/recorder/obj/moc_mainwindow.cpp @@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_MainWindow_t { - const uint offsetsAndSize[10]; - char stringdata0[48]; + const uint offsetsAndSize[8]; + char stringdata0[43]; }; #define QT_MOC_LITERAL(ofs, len) \ uint(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs), len @@ -32,12 +32,10 @@ static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = { QT_MOC_LITERAL(0, 10), // "MainWindow" QT_MOC_LITERAL(11, 3), // "log" QT_MOC_LITERAL(15, 0), // "" -QT_MOC_LITERAL(16, 21), // "on_pushButton_clicked" -QT_MOC_LITERAL(38, 9) // "list_cams" +QT_MOC_LITERAL(16, 26) // "on_button_listcams_clicked" }, - "MainWindow\0log\0\0on_pushButton_clicked\0" - "list_cams" + "MainWindow\0log\0\0on_button_listcams_clicked" }; #undef QT_MOC_LITERAL @@ -47,7 +45,7 @@ static const uint qt_meta_data_MainWindow[] = { 10, // revision 0, // classname 0, 0, // classinfo - 3, 14, // methods + 2, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors @@ -55,13 +53,11 @@ static const uint qt_meta_data_MainWindow[] = { 0, // signalCount // slots: name, argc, parameters, tag, flags, initial metatype offsets - 1, 1, 32, 2, 0x0a, 1 /* Public */, - 3, 0, 35, 2, 0x08, 3 /* Private */, - 4, 0, 36, 2, 0x08, 4 /* Private */, + 1, 1, 26, 2, 0x0a, 1 /* Public */, + 3, 0, 29, 2, 0x08, 3 /* Private */, // slots: parameters QMetaType::Void, QMetaType::QString, 2, - QMetaType::Void, QMetaType::Void, 0 // eod @@ -74,8 +70,7 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, (void)_t; switch (_id) { case 0: _t->log((*reinterpret_cast< std::add_pointer_t<QString>>(_a[1]))); break; - case 1: _t->on_pushButton_clicked(); break; - case 2: _t->list_cams(); break; + case 1: _t->on_button_listcams_clicked(); break; default: ; } } @@ -89,7 +84,7 @@ const QMetaObject MainWindow::staticMetaObject = { { nullptr, qt_incomplete_metaTypeArray<qt_meta_stringdata_MainWindow_t , QtPrivate::TypeAndForceComplete<MainWindow, std::true_type> -, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<const QString &, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> +, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<const QString &, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> >, @@ -116,13 +111,13 @@ int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { - if (_id < 3) + if (_id < 2) qt_static_metacall(this, _c, _id, _a); - _id -= 3; + _id -= 2; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { - if (_id < 3) + if (_id < 2) *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType(); - _id -= 3; + _id -= 2; } return _id; } diff --git a/recorder/recorder.sublime-project b/recorder/recorder.sublime-project index 5a915b83e2f4967c062e394d6241964c892ddb76..799a6bde348d082b366dd0ed20a7fe0f6ea2233e 100644 --- a/recorder/recorder.sublime-project +++ b/recorder/recorder.sublime-project @@ -20,25 +20,21 @@ "working_dir": "$project_path/obj", "shell_cmd": "qmake6 && make -j8 && cd ../bin && recorder", + // COLORS in output - HOW?? + // "env": {"GCC_COLORS": "error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01"}, //force color for some CLI programs + // "env": {"CLICOLOR_FORCE": "1"}, //force color for some CLI programs + // "syntax": "/home/sugu/.config/sublime-text/Packages/User/make-output.sublime-syntax", - // COLORS in output? - "env": {"GCC_COLORS": "error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01"}, //force color for some CLI programs - "env": {"CLICOLOR_FORCE": "1"}, //force color for some CLI programs - "syntax": "/home/sugu/.config/sublime-text/Packages/User/make-output.sublime-syntax", - // "syntax": "/home/sugu/.config/sublime-text/Packages/User/C++.sublime-syntax", - - //### RESULTS // -> toggle with shortcuts + //### RESULTS // -> toggle with shortcuts ctr+alt+left/right // capture up to four fields of error information from a results view, namely: filename, line number, column number and error message. // Use groups in the pattern to capture this information. The filename field and the line number field are required. // test in: https://regex101.com/r/yN4tJ6/1 "file_regex": "([a-zA-Z0-9\\.\\/_-]+):([0-9]*):([0-9]*): ((note|warning|error|fatal error): ([^\\n]*))", - // (\w+\.\w+)*:([0-9]*):([0-9]*): ((note|warning|error): ([^\n]*)) - // "line_regex": "...", // If file_regex doesn’t match but result_line_regex exists and does match on the current line, + // "line_regex": "...", + // If file_regex doesn’t match but result_line_regex exists and does match on the current line, // walk backwards through the buffer until a line matching result_file_regex is found, // and use the two matches to determine the file and line to go to. - // result_base_dir - "variants": [ diff --git a/recorder/src/main.cpp b/recorder/src/main.cpp index 64d07bcac2d9e7df8e166035b050071d6c3cff2d..c8807d81c3886906afae1a743ba858ee0d758c80 100644 --- a/recorder/src/main.cpp +++ b/recorder/src/main.cpp @@ -1,12 +1,6 @@ -#include <iostream> #include "mainwindow.h" - #include <QApplication> -#include "VimbaCPP/Include/VimbaCPP.h" - -using namespace AVT::VmbAPI; - int main(int argc, char *argv[]) { QApplication a(argc, argv); @@ -16,10 +10,3 @@ int main(int argc, char *argv[]) return a.exec(); } - -// #include "opencv2/opencv.hpp" -// cv::VideoWriter m_VideoWriter; // OpenCV VideoWriter -// cv::Mat m_ConvertImage; - -// #include "VimbaC/Include/VimbaC.h" -// #include "VimbaCPP/Include/Frame.h" diff --git a/recorder/src/mainwindow.cpp b/recorder/src/mainwindow.cpp index d3474b2733868f8bb306fe118e355021caf60199..e90ce2248eea9ee0c67cef100cd2f80c7f476f26 100644 --- a/recorder/src/mainwindow.cpp +++ b/recorder/src/mainwindow.cpp @@ -3,6 +3,7 @@ #include "../obj/ui_mainwindow.h" #include <QDebug> +#include <QPushButton> #include <unistd.h> #include <iostream> @@ -16,6 +17,8 @@ MainWindow::MainWindow(QWidget *parent) , sys(VimbaSystem::GetInstance()) // Create and get Vimba singleton { ui->setupUi(this); + // QMetaObject::connectSlotsByName(this); //sseems to be done automagically + // QObject::connect(&ui->button_listcams, &QPushButton::clicked(), list_cams); log(getVersionString()); @@ -42,13 +45,12 @@ MainWindow::~MainWindow() delete ui; } +// void MainWindow::foo() +// { +// VimbaSystem::RegisterCameraListObserver +// } -void MainWindow::on_pushButton_clicked() -{ - list_cams(); -} - -void MainWindow::list_cams() +void MainWindow::on_button_listcams_clicked() { CameraPtrVector cameras; // A vector of std::shared_ptr<AVT::VmbAPI::Camera> objects VmbErrorType err = sys.GetCameras( cameras ); // Fetch all cameras known to Vimba @@ -57,7 +59,8 @@ void MainWindow::list_cams() std::cout << "Cameras found: " << cameras.size() <<"\n\n"; // query and print all _static_ details of all known cams [without opening cams] - auto mf = std::bind(&MainWindow::printCamInfo, this, std::placeholders::_1); //weird syntax for calling non-static memberfunction... + log( QString("Found %1 Cameras!").arg(cameras.size())); + auto mf = std::bind(&MainWindow::printCamInfo, this, std::placeholders::_1); //weird syntax for calling non-static memberfunction in for_each... std::for_each( cameras.begin(), cameras.end(), mf ); } else @@ -99,9 +102,10 @@ void MainWindow::printCamInfo( const CameraPtr &camera ) log( QString::fromStdString(caminfo)); } + void MainWindow::log(const QString& msg) { - // QString::fromStdString( ) + //for std::string, use: log(QString::fromStdString(msg)) ui->logWidget->insertItem( 0, msg ); qDebug() << msg; } diff --git a/recorder/src/mainwindow.h b/recorder/src/mainwindow.h index 34cfa30a64a832e2695a67d5489afe1cb350e578..f684e7590918594484ec7c78f2ffcc061156d899 100644 --- a/recorder/src/mainwindow.h +++ b/recorder/src/mainwindow.h @@ -22,8 +22,7 @@ public slots: void log(const QString&); private slots: - void on_pushButton_clicked(); - void list_cams(); + void on_button_listcams_clicked(); private: void printCamInfo( const AVT::VmbAPI::CameraPtr &camera ); diff --git a/recorder/src/mainwindow.ui b/recorder/src/mainwindow.ui index d2e5b6508e2c1e4078da02fa9de51187bb52ef49..8789cfd9830a39101a5be4bdc07e23179e57edfa 100644 --- a/recorder/src/mainwindow.ui +++ b/recorder/src/mainwindow.ui @@ -14,27 +14,17 @@ <string>MainWindow</string> </property> <widget class="QWidget" name="centralwidget"> - <widget class="QPushButton" name="pushButton"> + <widget class="QPushButton" name="button_listcams"> <property name="geometry"> <rect> - <x>340</x> - <y>270</y> + <x>61</x> + <y>260</y> <width>89</width> <height>25</height> </rect> </property> <property name="text"> - <string>PushButton</string> - </property> - </widget> - <widget class="QListWidget" name="logWidget"> - <property name="geometry"> - <rect> - <x>120</x> - <y>310</y> - <width>561</width> - <height>241</height> - </rect> + <string>list cams</string> </property> </widget> </widget> @@ -49,6 +39,18 @@ </property> </widget> <widget class="QStatusBar" name="statusbar"/> + <widget class="QDockWidget" name="dockWidget"> + <attribute name="dockWidgetArea"> + <number>8</number> + </attribute> + <widget class="QWidget" name="dockWidgetContents"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QListWidget" name="logWidget"/> + </item> + </layout> + </widget> + </widget> </widget> <resources/> <connections/> diff --git a/recorder/src/utils.h b/recorder/src/utils.h index 30c154c8cb85d28f832fb4c227279f5634d592f5..5df483302929bbc66fff9b89d8dbbded9e329179 100644 --- a/recorder/src/utils.h +++ b/recorder/src/utils.h @@ -3,7 +3,7 @@ #include <QString> -#include "VimbaC/Include/VmbCommonTypes.h" //VmbError_t -> how to fwd decl?? +#include "VimbaC/Include/VmbCommonTypes.h" //VmbError_t -> cant really fwd-decl typedef...?? const QString getVersionString(); const QString errorCodeToMessage( VmbError_t );