[camids] add dialog to set camera User specified ids, disabled at the
moment
This commit is contained in:
parent
a3418bc25e
commit
18f088c4fd
48
camids.cpp
Normal file
48
camids.cpp
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#include "camids.h"
|
||||||
|
#include "mylogger.h"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CameraID::CameraID(Pylon::DeviceInfoList &deviceList, QWidget *parent) :
|
||||||
|
deviceList(deviceList), QDialog(parent) {
|
||||||
|
device_combo = new QComboBox(this);
|
||||||
|
for (auto d : deviceList) {
|
||||||
|
device_combo->addItem(QString(d.GetFullName()) + " - " + QString(d.GetUserDefinedName()));
|
||||||
|
}
|
||||||
|
connect(device_combo, SIGNAL(currentIndexChanged(int)), SLOT(primaryDeviceChanged(int)));
|
||||||
|
|
||||||
|
QWidget *header = new QWidget(this);
|
||||||
|
QGridLayout *grid = new QGridLayout(header);
|
||||||
|
grid->addWidget(new QLabel("Camera device:", this), 1, 0);
|
||||||
|
grid->addWidget(device_combo, 1, 1);
|
||||||
|
|
||||||
|
edit = new QLineEdit(this);
|
||||||
|
grid->addWidget(new QLabel("Camera Id", this), 2, 0);
|
||||||
|
grid->addWidget(edit, 2, 1);
|
||||||
|
header->setLayout(grid);
|
||||||
|
|
||||||
|
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||||
|
vbox->addWidget(header);
|
||||||
|
|
||||||
|
buttonbox = new QDialogButtonBox(QDialogButtonBox::Ok
|
||||||
|
| QDialogButtonBox::Cancel);
|
||||||
|
connect(buttonbox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
|
connect(buttonbox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
|
vbox->addWidget(buttonbox);
|
||||||
|
std::cerr <<"ping\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void CameraID::setID() {
|
||||||
|
std::cerr << "Set ID!" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CameraID::newID() {
|
||||||
|
std::cerr <<"ping\n";
|
||||||
|
return edit->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
int CameraID::cameraIndex() {
|
||||||
|
std::cerr <<"ping\n";
|
||||||
|
return device_combo->currentIndex();
|
||||||
|
}
|
45
camids.h
Normal file
45
camids.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#ifndef CAMIDS_H
|
||||||
|
#define CAMIDS_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QComboBox>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <pylon/PylonIncludes.h>
|
||||||
|
|
||||||
|
#include "mylogger.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class CameraID;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CameraID : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit CameraID(Pylon::DeviceInfoList_t &deviceList, QWidget *parent = 0);
|
||||||
|
// ~CameraID(){};
|
||||||
|
QString newID();
|
||||||
|
int cameraIndex();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setID();
|
||||||
|
|
||||||
|
// signals:
|
||||||
|
// void column_visibility_changed(QString who, QString column, bool state);
|
||||||
|
// void recent_file_changed(QStringList);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Pylon::DeviceInfoList_t deviceList;
|
||||||
|
QComboBox *device_combo;
|
||||||
|
QLineEdit *edit;
|
||||||
|
QDialogButtonBox *buttonbox;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CAMIDS_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user