mainny ui improcements
This commit is contained in:
@ -16,6 +16,10 @@
|
||||
<property name="windowTitle">
|
||||
<string>Select Cameras</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../../res/resources.qrc">
|
||||
<normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
@ -46,7 +50,9 @@
|
||||
<header location="global">./src/ui/cameralistwidget.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../res/resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
|
@ -20,7 +20,7 @@ void CameraListWidget::setConfigured(std::vector<bool> configured)
|
||||
setHorizontalHeaderItem(1, new QTableWidgetItem("Configured"));
|
||||
for(size_t i = 0; i < desc_.size() && i < configured.size(); ++i)
|
||||
{
|
||||
setItem(static_cast<int>(i), 1, new QTableWidgetItem("No"));
|
||||
setItem(static_cast<int>(i), 1, new QTableWidgetItem(configured[i] ? "Yes" : "No"));
|
||||
qDebug()<<"Set item "<<i<<1;
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ void CameraListWidget::setCameras(const std::vector<cam::Camera::Description>& d
|
||||
setRowCount(static_cast<int>(desc_.size()));
|
||||
for(size_t i = 0; i < desc_.size(); ++i)
|
||||
{
|
||||
setItem(static_cast<int>(i), 0, new QTableWidgetItem((desc_[i].vendor + " " + desc_[i].model).c_str()));
|
||||
setItem(static_cast<int>(i), 0, new QTableWidgetItem((desc_[i].getVendor() + " " + desc_[i].getModel()).c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,20 +7,26 @@
|
||||
#include <uvosunwrap/charuco.h>
|
||||
#include <uvosunwrap/unwrap.h>
|
||||
#include <opencv2/imgproc.hpp>
|
||||
#include <QDebug>
|
||||
|
||||
ConfigureCameraDialog::ConfigureCameraDialog(const CameraSetup& setup, std::shared_ptr<Camera> camera, double exposureTime, QWidget *parent):
|
||||
QDialog(parent),
|
||||
setup_(setup),
|
||||
camera_(camera),
|
||||
profileExposure_(exposureTime),
|
||||
ui(new Ui::ConfigureCameraDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
qDebug()<<"profileExposure_"<<profileExposure_;
|
||||
ui->doubleSpinBox->setValue(profileExposure_);
|
||||
setExposure(profileExposure_);
|
||||
|
||||
ui->doubleSpinBox->setValue(exposureTime);
|
||||
uint64_t min, max;
|
||||
camera_->cam()->getExposureTimeLimits(min, max);
|
||||
ui->doubleSpinBox->setMaximum(max/1000000.0);
|
||||
ui->doubleSpinBox->setMinimum(min/1000000.0);
|
||||
|
||||
connect(ui->pushButtonBgLoad, &QPushButton::clicked, this, &ConfigureCameraDialog::loadBg);
|
||||
connect(ui->pushButtonRemapLoad, &QPushButton::clicked, this, &ConfigureCameraDialog::loadRemap);
|
||||
connect(ui->pushButtonDarkImageLoad, &QPushButton::clicked, this, &ConfigureCameraDialog::loadDark);
|
||||
connect(ui->doubleSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &ConfigureCameraDialog::setExposure);
|
||||
connect(ui->pushButtonBgClear, &QPushButton::clicked, [this](){setup_.bgmask.release(); checkConfig();});
|
||||
connect(ui->pushButtonRemapClear, &QPushButton::clicked, [this](){setup_.remapMap = RemapMap(); checkConfig();});
|
||||
connect(ui->pushButtonDarkImageClear, &QPushButton::clicked, [this](){setup_.darkmap.release(); checkConfig();});
|
||||
@ -38,45 +44,12 @@ ConfigureCameraDialog::~ConfigureCameraDialog()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ConfigureCameraDialog::loadBg()
|
||||
void ConfigureCameraDialog::setExposure(double value)
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(this, tr("Open Background Mask"), CameraSetup::camerasLocation(), "OpenCV Mat (*.mat)");
|
||||
if(!filename.isEmpty())
|
||||
{
|
||||
setup_.loadBgMask(filename);
|
||||
if(!setup_.bgmask.data)
|
||||
QMessageBox::warning(this, "Warning", "Could not load " + filename);
|
||||
checkConfig();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureCameraDialog::loadRemap()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(this, tr("Open Background Mask"), CameraSetup::camerasLocation(), "OpenCV Mat (*.mat)");
|
||||
if(!filename.isEmpty())
|
||||
{
|
||||
setup_.loadRemapMaps(filename);
|
||||
if(!setup_.remapMap.xMat.data || !setup_.remapMap.yMat.data)
|
||||
{
|
||||
QMessageBox::warning(this, "Warning", "Could not load " + filename);
|
||||
setup_.remapMap = RemapMap();
|
||||
}
|
||||
checkConfig();
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureCameraDialog::loadDark()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(this, tr("Open Background Mask"), CameraSetup::camerasLocation(), "Image (*.png)");
|
||||
if(!filename.isEmpty())
|
||||
{
|
||||
setup_.loadDarkMap(filename);
|
||||
if(!setup_.darkmap.data)
|
||||
QMessageBox::warning(this, "Warning", "Could not load " + filename);
|
||||
checkConfig();
|
||||
}
|
||||
if(!camera_->cam()->setExposureTime(value*1000000.0))
|
||||
QMessageBox::warning(this, "Warning", "Failed to set exposure");
|
||||
else
|
||||
qDebug()<<"set exposure to "<<value*1000000.0;
|
||||
}
|
||||
|
||||
void ConfigureCameraDialog::gotImage(Camera::Image img)
|
||||
@ -109,6 +82,11 @@ void ConfigureCameraDialog::gotImage(Camera::Image img)
|
||||
mode_ = MODE_IDLE;
|
||||
break;
|
||||
case MODE_REMAP_GET:
|
||||
cv::Mat masked;
|
||||
if(setup_.bgmask.data)
|
||||
img.mat.copyTo(masked, setup_.bgmask);
|
||||
else
|
||||
masked = img.mat;
|
||||
std::vector<DetectedPoint> points = detectCharucoPoints(img.mat, false);
|
||||
if(points.size() < 8)
|
||||
{
|
||||
@ -117,13 +95,13 @@ void ConfigureCameraDialog::gotImage(Camera::Image img)
|
||||
break;
|
||||
}
|
||||
RemapMap map;
|
||||
if(createRemapMap(img.mat, map, points))
|
||||
if(createRemapMap(masked, map, points))
|
||||
setup_.remapMap = map;
|
||||
else
|
||||
QMessageBox::warning(this, "Failed", "Error creating map");
|
||||
for(size_t i = 0; i < points.size(); ++i)
|
||||
cv::circle(img.mat, points[i].point, 5, cv::Scalar(0,255,0), 1);
|
||||
ui->widget_4->setImage(Camera::Image(setup_.bgmask, camera_->id()));
|
||||
cv::circle(img.mat, points[i].point, img.mat.cols/50, cv::Scalar(255,255,255), img.mat.cols/200);
|
||||
ui->widget_4->setImage(Camera::Image(img.mat, camera_->id()));
|
||||
mode_ = MODE_IDLE;
|
||||
break;
|
||||
}
|
||||
@ -157,6 +135,8 @@ void ConfigureCameraDialog::captureDark()
|
||||
{
|
||||
QMessageBox::information(this, "Cover lense", "Please cover the lense of the camera.");
|
||||
mode_ = MODE_DARK_GET;
|
||||
ui->doubleSpinBox->setValue(profileExposure_);
|
||||
setExposure(profileExposure_);
|
||||
takeImage();
|
||||
}
|
||||
|
||||
@ -165,7 +145,7 @@ void ConfigureCameraDialog::accept()
|
||||
if(checkConfig())
|
||||
QDialog::accept();
|
||||
else
|
||||
QMessageBox::warning(this, "Unfinished", "Can not accept unfinished camera setup");
|
||||
QMessageBox::information(this, "Unfinished", "Can not accept unfinished camera setup");
|
||||
}
|
||||
|
||||
bool ConfigureCameraDialog::checkConfig()
|
||||
@ -182,5 +162,5 @@ bool ConfigureCameraDialog::checkConfig()
|
||||
ui->ledDark->setLit(darkMapOK);
|
||||
ui->ledRemap->setLit(remapMapOk);
|
||||
|
||||
return bgOk && remapMapOk && darkMapOK;
|
||||
return remapMapOk;
|
||||
}
|
||||
|
@ -22,25 +22,27 @@ class ConfigureCameraDialog : public QDialog
|
||||
std::shared_ptr<Camera> camera_;
|
||||
int mode_ = MODE_IDLE;
|
||||
cv::Mat fgImage;
|
||||
double profileExposure_;
|
||||
|
||||
private:
|
||||
bool checkConfig();
|
||||
void gotImage(Camera::Image img);
|
||||
|
||||
private slots:
|
||||
void loadBg();
|
||||
void loadRemap();
|
||||
void loadDark();
|
||||
void captureBg();
|
||||
void captureRemap();
|
||||
void captureDark();
|
||||
void takeImage();
|
||||
void setExposure(double value);
|
||||
|
||||
public slots:
|
||||
void accept() override;
|
||||
|
||||
public:
|
||||
explicit ConfigureCameraDialog(const CameraSetup& setup, const std::shared_ptr<Camera> camera, double exposureTime = 1.0/60, QWidget *parent = nullptr);
|
||||
~ConfigureCameraDialog();
|
||||
CameraSetup getCameraSetup(){return setup_;}
|
||||
void accept() override;
|
||||
|
||||
|
||||
private:
|
||||
Ui::ConfigureCameraDialog *ui;
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>466</width>
|
||||
<height>438</height>
|
||||
<width>545</width>
|
||||
<height>614</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -31,6 +31,29 @@
|
||||
<property name="horizontalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="3" column="1">
|
||||
<widget class="Led" name="ledBg" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QPushButton" name="pushButtonBgCreate">
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@ -48,13 +71,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Background image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pushButtonDarkImageCreate">
|
||||
<property name="text">
|
||||
@ -62,32 +78,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QPushButton" name="pushButtonBgClear">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Led" name="ledRemap" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QPushButton" name="pushButtonRemapClear">
|
||||
<property name="enabled">
|
||||
@ -98,57 +88,40 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QPushButton" name="pushButtonBgCreate">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Create</string>
|
||||
<string>Background image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Led" name="ledBg" native="true"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pushButtonDarkImageShow">
|
||||
<property name="text">
|
||||
<string>Remap Map</string>
|
||||
<string>Show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButtonRemapLoad">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="pushButtonBgLoad">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Led" name="ledDark" native="true">
|
||||
<item row="1" column="1">
|
||||
<widget class="Led" name="ledRemap" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pushButtonDarkImageLoad">
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="pushButtonBgShow">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
<string>Show</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -159,10 +132,36 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<item row="2" column="1">
|
||||
<widget class="Led" name="ledDark" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string>Remap Map (required)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QPushButton" name="pushButtonBgClear">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -182,11 +181,14 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox">
|
||||
<property name="decimals">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
<double>0.001000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -219,18 +221,18 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Led</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">./src/ui/led.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>CvImageViewer</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">./src/ui/cvimageviewer.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Led</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">./src/ui/led.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
@ -1,21 +1,60 @@
|
||||
#include "cvimageviewer.h"
|
||||
#include <QPicture>
|
||||
#include <QDebug>
|
||||
#include <QMouseEvent>
|
||||
#include <QFileDialog>
|
||||
#include <opencv2/imgcodecs.hpp>
|
||||
|
||||
CvImageViewer::CvImageViewer(QWidget *parent, size_t lastId) :
|
||||
QWidget(parent),
|
||||
lastId_(lastId)
|
||||
lastId_(lastId),
|
||||
saveAction_("Save Image", nullptr)
|
||||
{
|
||||
connect(&saveAction_, &QAction::triggered, this, &CvImageViewer::saveImage);
|
||||
qimage_.load(":/images/noimage.png");
|
||||
|
||||
imageContextMenu_.addAction(&saveAction_);
|
||||
}
|
||||
|
||||
CvImageViewer::~CvImageViewer()
|
||||
{
|
||||
}
|
||||
|
||||
void CvImageViewer::saveImage()
|
||||
{
|
||||
QString fileName;
|
||||
if(origImage_.type() == CV_8UC3 || origImage_.type() == CV_8SC3 || origImage_.type() == CV_8UC1 || origImage_.type() == CV_8SC1)
|
||||
{
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Image", "./", "*.mat *.png" );
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = QFileDialog::getSaveFileName(this, "Save Image", "./", "*.mat" );
|
||||
}
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
QStringList tokens = fileName.split('.');
|
||||
if(tokens.back() != "mat" && tokens.back() != "png")
|
||||
fileName.append(".mat");
|
||||
tokens = fileName.split('.');
|
||||
if(tokens.back() == "png")
|
||||
{
|
||||
imwrite(fileName.toStdString(), origImage_);
|
||||
}
|
||||
else
|
||||
{
|
||||
cv::FileStorage matf(fileName.toStdString(), cv::FileStorage::WRITE);
|
||||
matf<<"image"<<origImage_;
|
||||
matf.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CvImageViewer::setImage(Camera::Image img)
|
||||
{
|
||||
image_ = img.mat;
|
||||
origImage_=img.mat;
|
||||
qDebug()<<"viwer got"<<image_.rows<<'x'<<image_.cols<<" type "<<image_.type()<<"image from camera"<<img.cameraId;
|
||||
if(image_.type() == CV_8UC3 || image_.type() == CV_8SC3)
|
||||
{
|
||||
qimage_ = QImage(image_.data, image_.cols, image_.rows, image_.step, QImage::Format_RGB888);
|
||||
@ -37,19 +76,41 @@ void CvImageViewer::setImage(Camera::Image img)
|
||||
update();
|
||||
}
|
||||
|
||||
void CvImageViewer::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if(event->button() == Qt::RightButton)
|
||||
{
|
||||
saveAction_.setEnabled(origImage_.data);
|
||||
imageContextMenu_.popup(event->globalPos());
|
||||
}
|
||||
else if(origImage_.data && event->x() > imgrect_.x() && event->y() > imgrect_.y() && event->x() < imgrect_.x()+imgrect_.width() && event->y() < imgrect_.y()+imgrect_.height())
|
||||
{
|
||||
int x = (event->x()-imgrect_.x())/static_cast<double>(imgrect_.width())*origImage_.cols;
|
||||
int y = (event->y()-imgrect_.y())/static_cast<double>(imgrect_.height())*origImage_.rows;
|
||||
qDebug()<<x<<y;
|
||||
if(origImage_.type() == CV_32FC1)
|
||||
{
|
||||
if(x >= 0 && y >= 0 && x <= origImage_.cols && y < origImage_.rows)
|
||||
sigValue(x, y, origImage_.at<float>(y,x));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
sigValue(x, y, 0);
|
||||
}
|
||||
}
|
||||
QWidget::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void CvImageViewer::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
QPainter painter(this);
|
||||
|
||||
if(!fixedOnWidth_)
|
||||
{
|
||||
double ratio = qimage_.size().width() / qimage_.size().height();
|
||||
painter.drawImage(QRect((rect().width()-rect().height())/2, rect().y(), rect().height()*ratio, rect().height()), qimage_);
|
||||
}
|
||||
double ratio = qimage_.size().height() / (double)qimage_.size().width();
|
||||
if(rect().width()*ratio <= rect().height())
|
||||
imgrect_.setRect(0, (rect().height()-rect().width()*ratio)/2, rect().width(), rect().width()*ratio);
|
||||
else
|
||||
{
|
||||
double ratio = qimage_.size().height() / qimage_.size().width();
|
||||
painter.drawImage(QRect(rect().x(), (rect().height()-rect().width())/2, rect().width(), rect().width()*ratio), qimage_);
|
||||
}
|
||||
imgrect_.setRect((rect().width()-rect().height()/ratio)/2, 0, rect().height()/ratio, rect().height());
|
||||
painter.drawImage(imgrect_, qimage_);
|
||||
}
|
||||
|
@ -3,19 +3,32 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include <QMenu>
|
||||
#include "../cameras.h"
|
||||
|
||||
class CvImageViewer : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
cv::Mat origImage_;
|
||||
cv::Mat image_;
|
||||
QImage qimage_;
|
||||
bool fixedOnWidth_ = false;
|
||||
size_t lastId_;
|
||||
QMenu imageContextMenu_;
|
||||
QAction saveAction_;
|
||||
QRect imgrect_;
|
||||
|
||||
private slots:
|
||||
void saveImage();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent* event) override;
|
||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||
|
||||
signals:
|
||||
void sigValue(size_t x, size_t y, double value);
|
||||
|
||||
public slots:
|
||||
void setImage(Camera::Image img);
|
||||
@ -23,6 +36,8 @@ public slots:
|
||||
public:
|
||||
explicit CvImageViewer(QWidget *parent = nullptr, size_t lastId = 0);
|
||||
void setFixedOnWidth(bool in){fixedOnWidth_ = in;}
|
||||
cv::Mat getImage(){return origImage_;}
|
||||
|
||||
size_t lastId(){return lastId_;}
|
||||
~CvImageViewer();
|
||||
};
|
||||
|
@ -2,6 +2,8 @@
|
||||
#include "ui_editprofiledialog.h"
|
||||
#include <uvosled.h>
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "configurecameradialog.h"
|
||||
|
||||
@ -24,26 +26,91 @@ EditProfileDialog::EditProfileDialog(Cameras* cameras, const Profile profile, QW
|
||||
ui->checkBoxCh3->setChecked(profile_.lighting.mask & CHANNEL_C);
|
||||
ui->checkBoxCh4->setChecked(profile_.lighting.mask & CHANNEL_D);
|
||||
|
||||
if(profile_.cameras.size() == 0)
|
||||
profile_.setCamerasSetupsFromDescription(cameras_->getCameras());
|
||||
ui->checkBoxNodistort->setChecked(profile_.nodistort);
|
||||
|
||||
std::vector<cam::Camera::Description> descs = cameras_->getCameras();
|
||||
profile_.setCamerasSetupsFromDescription(descs);
|
||||
|
||||
if(profile_.cameras.size() > 0)
|
||||
{
|
||||
uint64_t min, max;
|
||||
std::shared_ptr<Camera> cam = cameras_->getCamera(profile_.cameras[0].id);
|
||||
if(cam)
|
||||
{
|
||||
cam->cam()->getExposureTimeLimits(min, max);
|
||||
ui->doubleSpinBoxExposure->setMaximum(max/1000000.0);
|
||||
ui->doubleSpinBoxExposure->setMinimum(min/1000000.0);
|
||||
}
|
||||
}
|
||||
|
||||
ui->calLed->setLit(profile_.calcurve.data);
|
||||
|
||||
connect(ui->doubleSpinBoxBrightness, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [this](double in){profile_.lighting.brightness = in/100.0;});
|
||||
connect(ui->doubleSpinBoxExposure, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [this](double in){profile_.exposureTime = in;});
|
||||
connect(ui->doubleSpinBoxExposure, QOverload<double>::of(&QDoubleSpinBox::valueChanged), [this](double in){profile_.exposureTime = in; invalidateCameras();});
|
||||
connect(ui->lineEditName, &QLineEdit::textChanged, [this](QString in){profile_.setName(in);});
|
||||
connect(ui->checkBoxCh1, &QCheckBox::clicked, this, &EditProfileDialog::setMask);
|
||||
connect(ui->checkBoxCh2, &QCheckBox::clicked, this, &EditProfileDialog::setMask);
|
||||
connect(ui->checkBoxCh3, &QCheckBox::clicked, this, &EditProfileDialog::setMask);
|
||||
connect(ui->checkBoxCh4, &QCheckBox::clicked, this, &EditProfileDialog::setMask);
|
||||
connect(ui->pushButton, &QPushButton::clicked, this, &EditProfileDialog::configureCamera);
|
||||
connect(ui->checkBoxNodistort, &QCheckBox::stateChanged, [this](int state){profile_.nodistort = state == Qt::Checked ?: false; setConfigured();});
|
||||
connect(ui->pushButtonCalLoad, &QPushButton::clicked, this, &EditProfileDialog::loadCalcurve);
|
||||
connect(ui->pushButtonLightmapLoad, &QPushButton::clicked, this, &EditProfileDialog::loadCalcurve);
|
||||
ui->listView->setCameras(cameras_->getCameras());
|
||||
ui->listView->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
setConfigured();
|
||||
}
|
||||
|
||||
void EditProfileDialog::setConfigured()
|
||||
void EditProfileDialog::loadLightmap()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, "Open Lightmap", "./", "*.mat");
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
profile_.calcurve.release();
|
||||
cv::FileStorage matf(fileName.toStdString(), cv::FileStorage::READ);
|
||||
matf["image"]>>profile_.lightmap;
|
||||
|
||||
if(matf.isOpened() && (!profile_.calcurve.data || profile_.calcurve.type() != CV_32FC1))
|
||||
{
|
||||
profile_.lightmap.release();
|
||||
QMessageBox::warning(this, "Invalid file", "File selected dose not contain a valid lightmap");
|
||||
}
|
||||
else if(!profile_.calcurve.data)
|
||||
{
|
||||
QMessageBox::warning(this, "Can no open", "Can not open file selected");
|
||||
}
|
||||
matf.release();
|
||||
ui->ledLightmap->setLit(profile_.lightmap.data);
|
||||
}
|
||||
}
|
||||
|
||||
void EditProfileDialog::loadCalcurve()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, "Open Cal Curve", "./", "*.mat");
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
profile_.calcurve.release();
|
||||
cv::FileStorage matf(fileName.toStdString(), cv::FileStorage::READ);
|
||||
matf["cal"]>>profile_.calcurve;
|
||||
|
||||
if(matf.isOpened() && (!profile_.calcurve.data || profile_.calcurve.type() != CV_32FC1 || profile_.calcurve.rows != 2))
|
||||
{
|
||||
profile_.calcurve.release();
|
||||
QMessageBox::warning(this, "Invalid file", "File selected dose not contain a valid cal curve");
|
||||
}
|
||||
else if(!profile_.calcurve.data)
|
||||
{
|
||||
QMessageBox::warning(this, "Can no open", "Can not open file selected");
|
||||
}
|
||||
matf.release();
|
||||
ui->calLed->setLit(profile_.calcurve.data);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditProfileDialog::setConfigured()
|
||||
{
|
||||
std::vector<cam::Camera::Description> descs = cameras_->getCameras();
|
||||
std::vector<bool> configured(descs.size(), false);
|
||||
std::vector<bool> configured(descs.size(), profile_.nodistort);
|
||||
|
||||
for(size_t i = 0; i< profile_.cameras.size(); ++i)
|
||||
{
|
||||
@ -52,12 +119,19 @@ void EditProfileDialog::setConfigured()
|
||||
{
|
||||
for(auto& camera : descs)
|
||||
{
|
||||
if(camera.getHash() == profileCamera.id)
|
||||
if(camera.getId() == profileCamera.id)
|
||||
configured[i] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
ui->listView->setConfigured(configured);
|
||||
bool fullyConfigured = true;
|
||||
for(bool config : configured)
|
||||
{
|
||||
if(!config)
|
||||
fullyConfigured = false;
|
||||
}
|
||||
return fullyConfigured;
|
||||
}
|
||||
|
||||
void EditProfileDialog::invalidateCameras()
|
||||
@ -78,10 +152,12 @@ void EditProfileDialog::configureCamera()
|
||||
qDebug()<<"descs"<<descs.size();
|
||||
if(!descs.empty())
|
||||
{
|
||||
qDebug()<<"want to edit id"<<descs[0].getId();
|
||||
size_t i = 0;
|
||||
for(; i < profile_.cameras.size(); ++i)
|
||||
{
|
||||
if(profile_.cameras[i].id == descs[0].getHash())
|
||||
qDebug()<<"test"<<profile_.cameras[i].id ;
|
||||
if(profile_.cameras[i].id == descs[0].getId())
|
||||
{
|
||||
std::shared_ptr<Camera> camera = cameras_->getCamera(profile_.cameras[i].id);
|
||||
if(camera)
|
||||
@ -94,9 +170,18 @@ void EditProfileDialog::configureCamera()
|
||||
}
|
||||
}
|
||||
}
|
||||
setConfigured();
|
||||
}
|
||||
}
|
||||
|
||||
void EditProfileDialog::accept()
|
||||
{
|
||||
if(!setConfigured())
|
||||
QMessageBox::information(this, "Unfinished", "Can not accept with unconfigured cameras");
|
||||
else
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void EditProfileDialog::setMask()
|
||||
{
|
||||
uint8_t mask = (ui->checkBoxCh1->isChecked() ? CHANNEL_A : 0) |
|
||||
|
@ -15,13 +15,17 @@ class EditProfileDialog : public QDialog
|
||||
Profile profile_;
|
||||
Cameras* cameras_;
|
||||
|
||||
void setConfigured();
|
||||
bool setConfigured();
|
||||
void invalidateCameras();
|
||||
|
||||
private slots:
|
||||
|
||||
void setMask();
|
||||
void configureCamera();
|
||||
void loadCalcurve();
|
||||
void loadLightmap();
|
||||
|
||||
public slots:
|
||||
virtual void accept() override;
|
||||
|
||||
public:
|
||||
explicit EditProfileDialog(Cameras* cameras, const Profile profile = Profile(), QWidget *parent = nullptr);
|
||||
|
@ -7,11 +7,11 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>539</width>
|
||||
<height>485</height>
|
||||
<height>652</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Profile</string>
|
||||
<string>Edit Profile</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
@ -153,6 +153,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxExposure">
|
||||
<property name="decimals">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
@ -176,9 +179,89 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxNodistort">
|
||||
<property name="text">
|
||||
<string>Don't undisort camera image </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Calibration curve:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Led" name="calLed" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pushButtonCalLoad">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Lightmap:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Led" name="ledLightmap" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButtonLightmapLoad">
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
@ -192,6 +275,12 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Led</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">./src/ui/led.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>CameraListWidget</class>
|
||||
<extends>QListView</extends>
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <uvosled.h>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "../profile.h"
|
||||
|
||||
@ -17,9 +18,62 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
connect(ui->actionProfile, &QAction::triggered, [this](bool checked){(void)checked; sigEditProfiles();});
|
||||
connect(ui->comboBox, &QComboBox::currentTextChanged, this, &MainWindow::sigProfile);
|
||||
connect(ui->pushButtonCapture, &QPushButton::clicked, this, &MainWindow::sigCapture);
|
||||
connect(ui->mainViewer, &CvImageViewer::sigValue, this, &MainWindow::setImageValue);
|
||||
connect(ui->actionOpen, &QAction::triggered, [this](bool checked){(void)checked; openImage();});
|
||||
connect(ui->actionSave_2, &QAction::triggered, [this](bool checked){(void)checked; saveImage();});
|
||||
refreshProfiles();
|
||||
}
|
||||
|
||||
void MainWindow::setImageValue(size_t x, size_t y, double value)
|
||||
{
|
||||
ui->lcdNumber_3->display((double)x);
|
||||
ui->lcdNumber_2->display((double)y);
|
||||
ui->lcdNumber->display(value);
|
||||
}
|
||||
|
||||
void MainWindow::saveImage()
|
||||
{
|
||||
if(!ui->mainViewer->getImage().data)
|
||||
{
|
||||
QMessageBox::warning(this, "No image", "There is no image to save");
|
||||
return;
|
||||
}
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName(this, "Save Image", "./", "*.mat");
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
QStringList tokens = fileName.split('.');
|
||||
if(tokens.back() != "mat")
|
||||
fileName.append(".mat");
|
||||
cv::FileStorage matf(fileName.toStdString(), cv::FileStorage::WRITE);
|
||||
matf<<"image"<<ui->mainViewer->getImage();
|
||||
matf.release();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::openImage()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this, "Open Image", "./", "*.mat");
|
||||
if(!fileName.isEmpty())
|
||||
{
|
||||
cv::Mat image;
|
||||
cv::FileStorage matf(fileName.toStdString(), cv::FileStorage::READ);
|
||||
matf["image"]>>image;
|
||||
|
||||
if(matf.isOpened() && (!image.data || image.type() != CV_32FC1))
|
||||
{
|
||||
image.release();
|
||||
QMessageBox::warning(this, "Invalid file", "File selected dose not contain a valid lightmap");
|
||||
}
|
||||
else if(!image.data)
|
||||
{
|
||||
QMessageBox::warning(this, "Can no open", "Can not open file selected");
|
||||
}
|
||||
matf.release();
|
||||
ui->mainViewer->setImage(Camera::Image(image, 0));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::addCamera(std::shared_ptr<Camera> camera)
|
||||
{
|
||||
viewers_.push_back(new CvImageViewer(this, camera->id()));
|
||||
@ -28,6 +82,11 @@ void MainWindow::addCamera(std::shared_ptr<Camera> camera)
|
||||
ui->viewerLayout->addWidget(viewers_.back());
|
||||
}
|
||||
|
||||
void MainWindow::statusMsg(QString msg)
|
||||
{
|
||||
ui->statusbar->showMessage(msg);
|
||||
}
|
||||
|
||||
void MainWindow::removeCamera(std::shared_ptr<Camera> camera)
|
||||
{
|
||||
for(size_t i = 0; i < viewers_.size(); ++i)
|
||||
@ -93,4 +152,3 @@ MainWindow::~MainWindow()
|
||||
delete viewer;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,11 @@ class MainWindow : public QMainWindow
|
||||
private:
|
||||
std::vector<CvImageViewer*> viewers_;
|
||||
|
||||
private slots:
|
||||
void setImageValue(size_t x, size_t y, double value);
|
||||
void saveImage();
|
||||
void openImage();
|
||||
|
||||
signals:
|
||||
void sigCapture();
|
||||
void sigProfile(QString profileName);
|
||||
@ -30,6 +35,7 @@ public slots:
|
||||
void removeCamera(std::shared_ptr<Camera> camera);
|
||||
bool setProfile(const QString& profileName);
|
||||
QString getProfileName();
|
||||
void statusMsg(QString msg);
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
|
@ -11,7 +11,11 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
<string>Lubricant Detector</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../../res/resources.qrc">
|
||||
<normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
@ -27,6 +31,9 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -68,7 +75,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>467</width>
|
||||
<height>353</height>
|
||||
<height>313</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||
@ -79,6 +86,55 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>X</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLCDNumber" name="lcdNumber_3"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Y</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLCDNumber" name="lcdNumber_2"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Value</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLCDNumber" name="lcdNumber"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -146,7 +202,8 @@
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionSave_2"/>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuSetup">
|
||||
@ -164,6 +221,9 @@
|
||||
<property name="text">
|
||||
<string>Quit</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCameras">
|
||||
<property name="text">
|
||||
@ -180,6 +240,22 @@
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSave_2">
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+S</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionOpen">
|
||||
<property name="text">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+O</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
@ -189,6 +265,8 @@
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../res/resources.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -34,7 +34,7 @@ void ProfileDialog::editProfile()
|
||||
QMessageBox::critical(this, "Profile Incompatible", "Not all cameras need for this profile are available");
|
||||
return;
|
||||
}
|
||||
EditProfileDialog dialog(cameras_, profile);
|
||||
EditProfileDialog dialog(cameras_, profile, this);
|
||||
dialog.show();
|
||||
int ret = dialog.exec();
|
||||
if(ret == QDialog::Accepted)
|
||||
|
@ -13,6 +13,10 @@
|
||||
<property name="windowTitle">
|
||||
<string>Profiles</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../../res/resources.qrc">
|
||||
<normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
@ -61,7 +65,9 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../res/resources.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
|
Reference in New Issue
Block a user