From 3bbdd584445ed9511a54c09cdd1b156878c97b57 Mon Sep 17 00:00:00 2001 From: "simon.fanetti" <simon.fanetti@etu.hesge.ch> Date: Fri, 5 Jun 2020 12:54:08 +0200 Subject: [PATCH] add black screen for the camera profil + instructions for the beamer location routine --- app/SandboxSetup/beamerlocationgui.ui | 45 +++++++++++++++++++++------ app/SandboxSetup/camerafocus.cpp | 9 +++++- app/SandboxSetup/camerafocus.h | 7 +++-- app/SandboxSetup/croppingmask.ui | 17 ---------- app/SandboxSetup/mainwindow.cpp | 2 +- app/SandboxSetup/projectiongui.ui | 12 +++---- 6 files changed, 55 insertions(+), 37 deletions(-) diff --git a/app/SandboxSetup/beamerlocationgui.ui b/app/SandboxSetup/beamerlocationgui.ui index 027254b..f1633ff 100644 --- a/app/SandboxSetup/beamerlocationgui.ui +++ b/app/SandboxSetup/beamerlocationgui.ui @@ -13,30 +13,55 @@ <property name="windowTitle"> <string>Dialog</string> </property> - <widget class="QLabel" name="lblInstructions"> + <widget class="QPushButton" name="btnLock"> + <property name="geometry"> + <rect> + <x>220</x> + <y>300</y> + <width>89</width> + <height>25</height> + </rect> + </property> + <property name="text"> + <string>Lock</string> + </property> + </widget> + <widget class="QLabel" name="label"> <property name="geometry"> <rect> <x>40</x> <y>40</y> - <width>121</width> + <width>201</width> <height>17</height> </rect> </property> <property name="text"> - <string>Consignes :</string> + <string>Instructions :</string> </property> </widget> - <widget class="QPushButton" name="btnLock"> + <widget class="QTextEdit" name="txtInstructions"> <property name="geometry"> <rect> - <x>220</x> - <y>260</y> - <width>89</width> - <height>25</height> + <x>60</x> + <y>70</y> + <width>421</width> + <height>181</height> </rect> </property> - <property name="text"> - <string>Lock</string> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="html"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- A red corss is displayed from the selected output at step 2<br />- Match the position of the cross with your white target</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- When you are ready, press the button to validate a point</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- Repeat this process 3 times for each cross you see (there will be 3 different crosses)</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Note :</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">For each point you validate, change the height of your target to not save the same position twice in the process.</p></body></html></string> </property> </widget> </widget> diff --git a/app/SandboxSetup/camerafocus.cpp b/app/SandboxSetup/camerafocus.cpp index 48978fb..1373039 100644 --- a/app/SandboxSetup/camerafocus.cpp +++ b/app/SandboxSetup/camerafocus.cpp @@ -1,12 +1,14 @@ #include "camerafocus.h" #include "ui_camerafocus.h" -CameraFocus::CameraFocus(SandboxSetup *sandbox, QWidget *parent) : +CameraFocus::CameraFocus(SandboxSetup *sandbox, MonitorGui *_mg, QWidget *parent) : SubApp("Camera focus", "Error", parent), ui(new Ui::CameraFocus) { ui->setupUi(this); setup = sandbox; + mg = _mg; + blackScreen = new QtFullScreen(mg->getResolution(), true, this); setup->loadFrameProcessProfil(); initCameraParams(); @@ -17,17 +19,22 @@ CameraFocus::CameraFocus(SandboxSetup *sandbox, QWidget *parent) : CameraFocus::~CameraFocus() { delete frameTimer; + delete blackScreen; delete ui; } void CameraFocus::showEvent(QShowEvent *event){ QWidget::showEvent(event); + cv::Mat black = cv::Mat(1, 1, CV_8UC3, cv::Scalar(0, 0, 0)); + blackScreen->setGeometry(mg->getResolution()); + blackScreen->imShow(black); frameTimer->start(100); } void CameraFocus::closeEvent(QCloseEvent *event){ frameTimer->stop(); + blackScreen->close(); QWidget::closeEvent(event); } diff --git a/app/SandboxSetup/camerafocus.h b/app/SandboxSetup/camerafocus.h index e893776..e7effd2 100644 --- a/app/SandboxSetup/camerafocus.h +++ b/app/SandboxSetup/camerafocus.h @@ -5,7 +5,8 @@ #include <QTimer> #include <QAbstractButton> #include <sandboxSetup.h> - +#include "monitorgui.h" +#include "qtfullscreen.h" #include "subapp.h" namespace Ui { @@ -17,7 +18,7 @@ class CameraFocus : public SubApp Q_OBJECT public: - explicit CameraFocus(SandboxSetup *sandbox, QWidget *parent = 0); + explicit CameraFocus(SandboxSetup *sandbox, MonitorGui *_mg, QWidget *parent = 0); ~CameraFocus(); void valideRoutine(); @@ -50,7 +51,9 @@ protected: private: Ui::CameraFocus *ui; SandboxSetup *setup; + MonitorGui *mg; QTimer *frameTimer; + QtFullScreen *blackScreen; FrameProcessProfil defaultProfil; bool displayConstrasts = false; diff --git a/app/SandboxSetup/croppingmask.ui b/app/SandboxSetup/croppingmask.ui index 5143339..6ebc1cf 100644 --- a/app/SandboxSetup/croppingmask.ui +++ b/app/SandboxSetup/croppingmask.ui @@ -57,25 +57,8 @@ </layout> </widget> </widget> - <widget class="QLabel" name="label"> - <property name="geometry"> - <rect> - <x>40</x> - <y>350</y> - <width>441</width> - <height>20</height> - </rect> - </property> - <property name="text"> - <string>Note : Set your screens in mirror mode</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> - </property> - </widget> <zorder>frame</zorder> <zorder>btnTakePicture</zorder> - <zorder>label</zorder> </widget> <resources/> <connections/> diff --git a/app/SandboxSetup/mainwindow.cpp b/app/SandboxSetup/mainwindow.cpp index ba08066..408cfa7 100644 --- a/app/SandboxSetup/mainwindow.cpp +++ b/app/SandboxSetup/mainwindow.cpp @@ -15,7 +15,7 @@ MainWindow::MainWindow(QWidget *parent) : init = new InitCamera(setup); mg = new MonitorGui(setup); pg = new ProjectionGui(setup, mg); - cf = new CameraFocus(setup); + cf = new CameraFocus(setup, mg); cm = new CroppingMask(setup, mg); bl = new BeamerLocationGui(setup, mg); scfg = new SaveConfigGui(setup); diff --git a/app/SandboxSetup/projectiongui.ui b/app/SandboxSetup/projectiongui.ui index d1b18a1..0deee7b 100644 --- a/app/SandboxSetup/projectiongui.ui +++ b/app/SandboxSetup/projectiongui.ui @@ -49,7 +49,7 @@ <property name="geometry"> <rect> <x>40</x> - <y>340</y> + <y>440</y> <width>331</width> <height>21</height> </rect> @@ -83,17 +83,17 @@ <widget class="QLabel" name="label"> <property name="geometry"> <rect> - <x>80</x> - <y>420</y> - <width>361</width> + <x>40</x> + <y>360</y> + <width>441</width> <height>61</height> </rect> </property> <property name="text"> - <string>Project a blue screen on the previously selected output to setup your beamer</string> + <string>Project a blue screen on the previously selected output to help you setup your beamer manually</string> </property> <property name="alignment"> - <set>Qt::AlignCenter</set> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> </property> <property name="wordWrap"> <bool>true</bool> -- GitLab