diff --git a/camids.cpp b/camids.cpp new file mode 100644 index 0000000..368e0da --- /dev/null +++ b/camids.cpp @@ -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(); +} \ No newline at end of file diff --git a/camids.h b/camids.h new file mode 100644 index 0000000..754fd45 --- /dev/null +++ b/camids.h @@ -0,0 +1,45 @@ +#ifndef CAMIDS_H +#define CAMIDS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#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 +