Compare commits
5 Commits
fd5571712a
...
36ad438608
| Author | SHA1 | Date | |
|---|---|---|---|
| 36ad438608 | |||
| bb1a01f402 | |||
| 797ff77f5f | |||
| 83ef26a1e2 | |||
| e7a73430d0 |
238
HPPA/Carousel.cpp
Normal file
238
HPPA/Carousel.cpp
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
#include "Carousel.h"
|
||||||
|
#include <QContextMenuEvent>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
MyCarousel::MyCarousel(QWidget* parent)
|
||||||
|
: QWidget(parent),
|
||||||
|
m_stackedWidget(new QStackedWidget(this)),
|
||||||
|
m_bottomButtonOverlay(nullptr),
|
||||||
|
m_bottomButtonLayout(nullptr),
|
||||||
|
m_bottomButtonGroup(nullptr),
|
||||||
|
m_currentIndex(0),
|
||||||
|
m_isPlaying(false),
|
||||||
|
m_isLocked(false),
|
||||||
|
m_lockedIndex(-1),
|
||||||
|
m_playInterval(1000),
|
||||||
|
m_intervalButtonSize(40)
|
||||||
|
{
|
||||||
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
|
layout->addWidget(m_stackedWidget);
|
||||||
|
|
||||||
|
m_autoPlayerTimer = new QTimer(this);
|
||||||
|
connect(m_autoPlayerTimer, &QTimer::timeout,
|
||||||
|
this, &MyCarousel::slideRight);
|
||||||
|
|
||||||
|
m_nomalQSS= R"(
|
||||||
|
QPushButton {
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid white;
|
||||||
|
}
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
QPushButton:checked {
|
||||||
|
background-color: blue;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid blue;
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
|
||||||
|
m_lockedQSS = R"(
|
||||||
|
QPushButton {
|
||||||
|
background-color: red;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid red;
|
||||||
|
}
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: yellow;
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::addWidget(QWidget* w)
|
||||||
|
{
|
||||||
|
m_widgets.append(w);
|
||||||
|
m_stackedWidget->addWidget(w);
|
||||||
|
updateStackedWidgetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::play()
|
||||||
|
{
|
||||||
|
if (m_widgets.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_isPlaying = true;
|
||||||
|
|
||||||
|
// 创建底部按钮
|
||||||
|
m_bottomButtonLayout = new QHBoxLayout();
|
||||||
|
m_bottomButtonGroup = new QButtonGroup(this);
|
||||||
|
m_bottomButtons.clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < m_widgets.size(); ++i) {
|
||||||
|
QPushButton* btn = new QPushButton(this);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
btn->setFixedSize(m_intervalButtonSize, 3);
|
||||||
|
btn->setStyleSheet(m_nomalQSS);
|
||||||
|
btn->setFixedHeight(10);
|
||||||
|
btn->setFixedWidth(10);
|
||||||
|
|
||||||
|
m_bottomButtonLayout->addWidget(btn);
|
||||||
|
m_bottomButtonGroup->addButton(btn, i);
|
||||||
|
m_bottomButtons.append(btn);
|
||||||
|
|
||||||
|
connect(btn, &QPushButton::clicked, this, [this, i]() {
|
||||||
|
onButtonClicked(i);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
m_bottomButtonOverlay = new QWidget(this);
|
||||||
|
m_bottomButtonOverlay->setLayout(m_bottomButtonLayout);
|
||||||
|
m_bottomButtonOverlay->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
|
m_bottomButtonOverlay->show();
|
||||||
|
|
||||||
|
m_autoPlayerTimer->setInterval(m_playInterval);
|
||||||
|
m_autoPlayerTimer->start();
|
||||||
|
|
||||||
|
updateStackedWidgetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::contextMenuEvent(QContextMenuEvent* event)
|
||||||
|
{
|
||||||
|
showContextMenu(event->globalPos());
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::showContextMenu(const QPoint& pos)
|
||||||
|
{
|
||||||
|
QMenu menu(this);
|
||||||
|
|
||||||
|
QAction* startAct = menu.addAction(QString::fromLocal8Bit("开始轮播"));
|
||||||
|
QAction* stopAct = menu.addAction(QString::fromLocal8Bit("停止轮播"));
|
||||||
|
|
||||||
|
if (!m_isLocked)
|
||||||
|
startAct->setEnabled(false);
|
||||||
|
|
||||||
|
if (m_isLocked)
|
||||||
|
stopAct->setEnabled(false);
|
||||||
|
|
||||||
|
QAction* act = menu.exec(pos);
|
||||||
|
|
||||||
|
if (act == startAct)
|
||||||
|
startAutoPlay();
|
||||||
|
else if (act == stopAct)
|
||||||
|
stopAutoPlay();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::startAutoPlay()
|
||||||
|
{
|
||||||
|
updateButtonState(m_currentIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::stopAutoPlay()
|
||||||
|
{
|
||||||
|
updateButtonState(m_currentIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::onButtonClicked(int index)
|
||||||
|
{
|
||||||
|
updateButtonState(index);
|
||||||
|
gotoWidget(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::updateButtonState(int index)
|
||||||
|
{
|
||||||
|
if (m_isLocked)
|
||||||
|
{
|
||||||
|
if (index == m_lockedIndex) {
|
||||||
|
// 解锁
|
||||||
|
m_isLocked = false;
|
||||||
|
m_lockedIndex = -1;
|
||||||
|
|
||||||
|
if (m_isPlaying)
|
||||||
|
m_autoPlayerTimer->start();
|
||||||
|
|
||||||
|
restoreButtonStyle(index);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 切换锁定
|
||||||
|
restoreButtonStyle(m_lockedIndex);
|
||||||
|
setButtonLocked(index);
|
||||||
|
m_lockedIndex = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 初次锁定
|
||||||
|
m_isLocked = true;
|
||||||
|
m_lockedIndex = index;
|
||||||
|
m_autoPlayerTimer->stop();
|
||||||
|
setButtonLocked(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::setButtonLocked(int index)
|
||||||
|
{
|
||||||
|
QPushButton* btn = m_bottomButtons[index];
|
||||||
|
btn->setText("");
|
||||||
|
btn->setStyleSheet(m_lockedQSS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::restoreButtonStyle(int index)
|
||||||
|
{
|
||||||
|
if (index < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QPushButton* btn = m_bottomButtons[index];
|
||||||
|
btn->setText("");
|
||||||
|
btn->setStyleSheet(m_nomalQSS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::slideLeft()
|
||||||
|
{
|
||||||
|
if (m_widgets.isEmpty() || m_isLocked || !m_isPlaying)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_currentIndex = (m_currentIndex - 1 + m_widgets.size()) % m_widgets.size();
|
||||||
|
updateStackedWidgetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::slideRight()
|
||||||
|
{
|
||||||
|
if (m_widgets.isEmpty() || m_isLocked || !m_isPlaying)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_currentIndex = (m_currentIndex + 1) % m_widgets.size();
|
||||||
|
updateStackedWidgetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::gotoWidget(int index)
|
||||||
|
{
|
||||||
|
m_currentIndex = index;
|
||||||
|
updateStackedWidgetVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::updateStackedWidgetVisibility()
|
||||||
|
{
|
||||||
|
if (m_widgets.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_stackedWidget->setCurrentIndex(m_currentIndex);
|
||||||
|
|
||||||
|
if (!m_isLocked) {
|
||||||
|
for (int i = 0; i < m_bottomButtons.size(); ++i)
|
||||||
|
m_bottomButtons[i]->setChecked(i == m_currentIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyCarousel::resizeEvent(QResizeEvent*)
|
||||||
|
{
|
||||||
|
if (!m_bottomButtonOverlay)
|
||||||
|
return;
|
||||||
|
|
||||||
|
int count = m_widgets.size();
|
||||||
|
int totalWidth = m_intervalButtonSize * count + 10 * (count - 1);
|
||||||
|
|
||||||
|
int x = (width() - totalWidth) / 2;
|
||||||
|
int y = height() - m_intervalButtonSize;
|
||||||
|
|
||||||
|
m_bottomButtonOverlay->setGeometry(x, y, totalWidth, m_intervalButtonSize);
|
||||||
|
}
|
||||||
66
HPPA/Carousel.h
Normal file
66
HPPA/Carousel.h
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QButtonGroup>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QMenu>
|
||||||
|
|
||||||
|
class MyCarousel : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit MyCarousel(QWidget* parent = nullptr);
|
||||||
|
|
||||||
|
void addWidget(QWidget* w);
|
||||||
|
void play();
|
||||||
|
void gotoWidget(int index);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void contextMenuEvent(QContextMenuEvent* event) override;
|
||||||
|
void resizeEvent(QResizeEvent* event) override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void slideLeft();
|
||||||
|
void slideRight();
|
||||||
|
void onButtonClicked(int index);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// UI
|
||||||
|
QStackedWidget* m_stackedWidget;
|
||||||
|
QWidget* m_bottomButtonOverlay;
|
||||||
|
QHBoxLayout* m_bottomButtonLayout;
|
||||||
|
QButtonGroup* m_bottomButtonGroup;
|
||||||
|
|
||||||
|
QVector<QWidget*> m_widgets;
|
||||||
|
QVector<QPushButton*> m_bottomButtons;
|
||||||
|
QString m_nomalQSS;
|
||||||
|
QString m_lockedQSS;
|
||||||
|
|
||||||
|
// ״ֵ̬
|
||||||
|
int m_currentIndex;
|
||||||
|
bool m_isPlaying;
|
||||||
|
bool m_isLocked;
|
||||||
|
int m_lockedIndex;
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD>
|
||||||
|
int m_playInterval;
|
||||||
|
int m_intervalButtonSize;
|
||||||
|
|
||||||
|
QTimer* m_autoPlayerTimer;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateStackedWidgetVisibility();
|
||||||
|
void updateButtonState(int index);
|
||||||
|
|
||||||
|
void setButtonLocked(int index);
|
||||||
|
void restoreButtonStyle(int index);
|
||||||
|
|
||||||
|
void showContextMenu(const QPoint& pos);
|
||||||
|
|
||||||
|
void startAutoPlay();
|
||||||
|
void stopAutoPlay();
|
||||||
|
};
|
||||||
204
HPPA/CustomDockWidgetBase.cpp
Normal file
204
HPPA/CustomDockWidgetBase.cpp
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
#include "CustomDockWidgetBase.h"
|
||||||
|
|
||||||
|
CustomDockWidgetBase::CustomDockWidgetBase(QMainWindow* parent)
|
||||||
|
: QDockWidget(parent),
|
||||||
|
m_mainWindow(parent),
|
||||||
|
m_isMaximized(false)
|
||||||
|
{
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomDockWidgetBase::CustomDockWidgetBase(QString title, QMainWindow* parent)
|
||||||
|
: QDockWidget(title, parent),
|
||||||
|
m_mainWindow(parent),
|
||||||
|
m_isMaximized(false)
|
||||||
|
{
|
||||||
|
initialize();
|
||||||
|
setTile(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CustomDockWidgetBase::initialize()
|
||||||
|
{
|
||||||
|
QWidget* titleBar_Background = new QWidget(this);
|
||||||
|
titleBar_Background->setObjectName("titleBar_Background");
|
||||||
|
QGridLayout* layout_titleBar_Background = new QGridLayout(titleBar_Background);
|
||||||
|
layout_titleBar_Background->setContentsMargins(0, 0, 0, 0);
|
||||||
|
titleBar_Background->setStyleSheet(R"(
|
||||||
|
QWidget #titleBar_Background{
|
||||||
|
background: #040125;
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
|
||||||
|
QWidget* titleBar = new QWidget(titleBar_Background);
|
||||||
|
titleBar->setObjectName("titleBar");
|
||||||
|
QHBoxLayout* layout = new QHBoxLayout(titleBar);
|
||||||
|
titleBar->setFixedHeight(30);
|
||||||
|
|
||||||
|
title_label = new QLabel(titleBar);
|
||||||
|
|
||||||
|
layout->setContentsMargins(10, 0, 10, 0);
|
||||||
|
layout->addWidget(title_label);
|
||||||
|
layout->addStretch();
|
||||||
|
|
||||||
|
m_maxButton = new QToolButton(titleBar);
|
||||||
|
m_maxButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton));
|
||||||
|
|
||||||
|
layout->addWidget(m_maxButton);
|
||||||
|
|
||||||
|
titleBar->setStyleSheet(R"(
|
||||||
|
QWidget #titleBar{
|
||||||
|
background: #0E1C4C;
|
||||||
|
/*border: 4px solid #2c586b;*/
|
||||||
|
/*padding-top: 10px;
|
||||||
|
padding-bottom: 10px;*/
|
||||||
|
|
||||||
|
border-top: 1px solid #2c586b;
|
||||||
|
border-left: 1px solid #2c586b;
|
||||||
|
border-right: 1px solid #2c586b;
|
||||||
|
border-bottom: none; /* ȡ<><C8A1><EFBFBD>ײ<EFBFBD><D7B2>߿<EFBFBD> */
|
||||||
|
|
||||||
|
border-top-left-radius: 5px;
|
||||||
|
border-top-right-radius: 5px;
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
title_label->setStyleSheet("color: white;");
|
||||||
|
m_maxButton->setStyleSheet("");
|
||||||
|
|
||||||
|
layout_titleBar_Background->addWidget(titleBar);
|
||||||
|
|
||||||
|
setTitleBarWidget(titleBar_Background);
|
||||||
|
setFeatures(QDockWidget::DockWidgetClosable);
|
||||||
|
connect(m_maxButton, &QToolButton::clicked, this, &CustomDockWidgetBase::toggleMaximize);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CustomDockWidgetBase::setTile(QString title)
|
||||||
|
{
|
||||||
|
title_label->setText(title);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CustomDockWidgetBase::hideMaxButton()
|
||||||
|
{
|
||||||
|
m_maxButton->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CustomDockWidgetBase::toggleMaximize()
|
||||||
|
{
|
||||||
|
if (!m_isMaximized)
|
||||||
|
{
|
||||||
|
m_hiddenDocks.clear();
|
||||||
|
m_originalSizes.clear();
|
||||||
|
|
||||||
|
m_savedState = m_mainWindow->saveState();
|
||||||
|
|
||||||
|
const QList<QDockWidget*> docks = m_mainWindow->findChildren<QDockWidget*>();
|
||||||
|
for (QDockWidget* dock : docks)
|
||||||
|
{
|
||||||
|
m_originalSizes[dock] = dock->size();
|
||||||
|
if (dock != this && dock->isVisible())
|
||||||
|
{
|
||||||
|
dock->hide();
|
||||||
|
m_hiddenDocks.append(dock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_isMaximized = true;
|
||||||
|
emit maximizeStateChanged(m_isMaximized);
|
||||||
|
m_maxButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarNormalButton));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (QDockWidget* dock : m_hiddenDocks)
|
||||||
|
{
|
||||||
|
dock->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_savedState.isEmpty())
|
||||||
|
{
|
||||||
|
m_mainWindow->restoreState(m_savedState);
|
||||||
|
m_savedState.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QDockWidget*> docks;
|
||||||
|
QList<int> widths, heights;
|
||||||
|
for (auto it = m_originalSizes.begin(); it != m_originalSizes.end(); ++it)
|
||||||
|
{
|
||||||
|
docks.append(it.key());
|
||||||
|
widths.append(it.value().width());
|
||||||
|
heights.append(it.value().height());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_mainWindow->resizeDocks(docks, widths, Qt::Horizontal);
|
||||||
|
m_mainWindow->resizeDocks(docks, heights, Qt::Vertical);
|
||||||
|
|
||||||
|
m_isMaximized = false;
|
||||||
|
emit maximizeStateChanged(m_isMaximized);
|
||||||
|
m_maxButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CustomDockWidgetHideAbove::CustomDockWidgetHideAbove(QString title, QMainWindow* parent)
|
||||||
|
:CustomDockWidgetBase(title, parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
CustomDockWidgetHideAbove::CustomDockWidgetHideAbove(QMainWindow* parent)
|
||||||
|
:CustomDockWidgetBase(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CustomDockWidgetHideAbove::toggleMaximize()
|
||||||
|
{
|
||||||
|
if (!m_isMaximized)
|
||||||
|
{
|
||||||
|
m_hiddenDocks.clear();
|
||||||
|
m_originalSizes.clear();
|
||||||
|
|
||||||
|
m_savedState = m_mainWindow->saveState();
|
||||||
|
|
||||||
|
const QList<QDockWidget*> docks = m_mainWindow->findChildren<QDockWidget*>();
|
||||||
|
for (QDockWidget* dock : docks)
|
||||||
|
{
|
||||||
|
m_originalSizes[dock] = dock->size();
|
||||||
|
if (dock->objectName().contains("mDockCarousel") && dock->isVisible())
|
||||||
|
{
|
||||||
|
dock->hide();
|
||||||
|
m_hiddenDocks.append(dock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_isMaximized = true;
|
||||||
|
emit maximizeStateChanged(m_isMaximized);
|
||||||
|
m_maxButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarNormalButton));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (QDockWidget* dock : m_hiddenDocks)
|
||||||
|
{
|
||||||
|
dock->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_savedState.isEmpty())
|
||||||
|
{
|
||||||
|
m_mainWindow->restoreState(m_savedState);
|
||||||
|
m_savedState.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
//QList<QDockWidget*> docks;
|
||||||
|
//QList<int> widths, heights;
|
||||||
|
//for (auto it = m_originalSizes.begin(); it != m_originalSizes.end(); ++it)
|
||||||
|
//{
|
||||||
|
// docks.append(it.key());
|
||||||
|
// widths.append(it.value().width());
|
||||||
|
// heights.append(it.value().height());
|
||||||
|
//}
|
||||||
|
|
||||||
|
//m_mainWindow->resizeDocks(docks, widths, Qt::Horizontal);
|
||||||
|
//m_mainWindow->resizeDocks(docks, heights, Qt::Vertical);
|
||||||
|
|
||||||
|
m_isMaximized = false;
|
||||||
|
emit maximizeStateChanged(m_isMaximized);
|
||||||
|
m_maxButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton));
|
||||||
|
}
|
||||||
|
}
|
||||||
53
HPPA/CustomDockWidgetBase.h
Normal file
53
HPPA/CustomDockWidgetBase.h
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QDockWidget>
|
||||||
|
#include <QToolButton>
|
||||||
|
#include <QStyle>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QMainWindow>
|
||||||
|
#include <QMap>
|
||||||
|
#include <QSize>
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
|
class CustomDockWidgetBase :
|
||||||
|
public QDockWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit CustomDockWidgetBase(QString title, QMainWindow* parent = nullptr);
|
||||||
|
explicit CustomDockWidgetBase(QMainWindow* parent = nullptr);
|
||||||
|
void setTile(QString title);
|
||||||
|
void hideMaxButton();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
virtual void toggleMaximize();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void maximizeStateChanged(bool isMaximized);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QMainWindow* m_mainWindow = nullptr;
|
||||||
|
QToolButton* m_maxButton = nullptr;
|
||||||
|
bool m_isMaximized = false;
|
||||||
|
|
||||||
|
QList<QDockWidget*> m_hiddenDocks;
|
||||||
|
QByteArray m_savedState;
|
||||||
|
QMap<QDockWidget*, QSize> m_originalSizes;
|
||||||
|
|
||||||
|
QLabel* title_label;
|
||||||
|
void initialize();
|
||||||
|
};
|
||||||
|
|
||||||
|
class CustomDockWidgetHideAbove :
|
||||||
|
public CustomDockWidgetBase
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit CustomDockWidgetHideAbove(QString title, QMainWindow* parent = nullptr);
|
||||||
|
explicit CustomDockWidgetHideAbove(QMainWindow* parent = nullptr);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void toggleMaximize();
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
||||||
720
HPPA/HPPA.cpp
720
HPPA/HPPA.cpp
@ -65,6 +65,346 @@ HPPA::HPPA(QWidget* parent)
|
|||||||
ui.splitter->setStretchFactor(1, 1);
|
ui.splitter->setStretchFactor(1, 1);
|
||||||
ui.splitter->setStretchFactor(2, 3);*/
|
ui.splitter->setStretchFactor(2, 3);*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
initMenubarToolbar();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD>
|
||||||
|
m_Imager = nullptr;
|
||||||
|
m_RecordState = 0;
|
||||||
|
connect(this->ui.action_connect_imager, SIGNAL(triggered()), this, SLOT(onconnect()));//<2F>ź<EFBFBD><C5BA><EFBFBD><EFBFBD>ۣ<EFBFBD><DBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD><EFBFBD>۰<DBB0><F3B6A8B7>ں<EFBFBD><DABA><EFBFBD>onconnect<63><74>
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD>ʷ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD>Щ<EFBFBD><D0A9><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD>slider<65><72><EFBFBD>źźͲ<C5BA><CDB2><EFBFBD><EFBFBD><EFBFBD>connectǰ<74><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>setMinimum<75><6D><EFBFBD>ı<EFBFBD>slider<65><72>ֵ
|
||||||
|
ui.FramerateSlider->setMinimum(1);
|
||||||
|
ui.FramerateSlider->setMaximum(250);
|
||||||
|
ui.GainSlider->setMinimum(0);
|
||||||
|
ui.GainSlider->setMaximum(24);
|
||||||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
frame_number->setEnabled(false);
|
||||||
|
|
||||||
|
ui.framerate_lineEdit->setEnabled(false);
|
||||||
|
ui.integratioin_time_lineEdit->setEnabled(false);
|
||||||
|
ui.gain_lineEdit->setEnabled(false);
|
||||||
|
|
||||||
|
ui.FramerateSlider->setEnabled(false);
|
||||||
|
ui.IntegratioinTimeSlider->setEnabled(false);
|
||||||
|
ui.GainSlider->setEnabled(false);
|
||||||
|
|
||||||
|
startTimer(1000);
|
||||||
|
|
||||||
|
widthScale = 1;
|
||||||
|
heightScale = 1;
|
||||||
|
|
||||||
|
//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ģ<EFBFBD><C4A3>
|
||||||
|
connect(ui.graphicsView->imager, SIGNAL(leftMouseButtonPressed(int, int)), this, SLOT(onimagerSimulatorMove(int, int)));
|
||||||
|
|
||||||
|
initPanelToolbar();
|
||||||
|
setDockNestingEnabled(true);
|
||||||
|
connect(this->ui.action_about, SIGNAL(triggered()), this, SLOT(onAbout()));
|
||||||
|
connect(this->ui.mActionOneMotorScenario, SIGNAL(triggered()), this, SLOT(createOneMotorScenario()));
|
||||||
|
|
||||||
|
delete ui.centralWidget;
|
||||||
|
|
||||||
|
QString qss_DockWidget_contentWidget = R"(
|
||||||
|
background: #0D1233;
|
||||||
|
/*border: 1px solid #2c586b;*/
|
||||||
|
|
||||||
|
border-top: 1px solid #2c586b;
|
||||||
|
border-left: 1px solid #2c586b;
|
||||||
|
border-right: 1px solid #2c586b;
|
||||||
|
border-bottom: 1px solid #2c586b;
|
||||||
|
|
||||||
|
border-bottom-left-radius: 10px;
|
||||||
|
border-bottom-right-radius: 10px;
|
||||||
|
)";
|
||||||
|
|
||||||
|
|
||||||
|
ui.mDockWidgetSimulator->setTile(QString::fromLocal8Bit("3Dģ<EFBFBD><EFBFBD>"));
|
||||||
|
ui.mDockWidgetSpectrometer->setTile(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
|
|
||||||
|
//TOC
|
||||||
|
CustomDockWidgetBase* dock_layers = new CustomDockWidgetBase(QString::fromLocal8Bit("layers"), this);
|
||||||
|
dock_layers->setObjectName("mDockLayers");
|
||||||
|
dock_layers->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
|
mPanelMenu->addAction(dock_layers->toggleViewAction());
|
||||||
|
addDockWidget(Qt::LeftDockWidgetArea, dock_layers);
|
||||||
|
dock_layers->hideMaxButton();
|
||||||
|
|
||||||
|
QWidget* dock_layersWidgetContents = new QWidget();
|
||||||
|
dock_layersWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents_2"));
|
||||||
|
QGridLayout* gridLayout_toc = new QGridLayout(dock_layersWidgetContents);
|
||||||
|
gridLayout_toc->setSpacing(6);
|
||||||
|
gridLayout_toc->setContentsMargins(11, 11, 11, 11);
|
||||||
|
gridLayout_toc->setObjectName(QString::fromUtf8("gridLayout_toc"));
|
||||||
|
gridLayout_toc->setVerticalSpacing(0);
|
||||||
|
gridLayout_toc->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
ImagerPositionSimulation* graphicsView_delete = new ImagerPositionSimulation(dock_layersWidgetContents);
|
||||||
|
graphicsView_delete->setObjectName(QString::fromUtf8("graphicsView_delete"));
|
||||||
|
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||||
|
sizePolicy1.setHorizontalStretch(0);
|
||||||
|
sizePolicy1.setVerticalStretch(0);
|
||||||
|
sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidth());
|
||||||
|
graphicsView_delete->setSizePolicy(sizePolicy1);
|
||||||
|
graphicsView_delete->setFrameShape(QFrame::NoFrame);
|
||||||
|
graphicsView_delete->setFrameShadow(QFrame::Raised);
|
||||||
|
|
||||||
|
gridLayout_toc->addWidget(graphicsView_delete, 0, 0, 1, 1);
|
||||||
|
dock_layers->setWidget(dock_layersWidgetContents);
|
||||||
|
dock_layersWidgetContents->setStyleSheet(qss_DockWidget_contentWidget);
|
||||||
|
|
||||||
|
//dock_layers->setMinimumWidth(449);
|
||||||
|
//dock_layers->setMaximumWidth(450);
|
||||||
|
//dock_layers->setMinimumHeight(497);
|
||||||
|
//dock_layers->setMaximumHeight(498);
|
||||||
|
|
||||||
|
|
||||||
|
//<2F>߹<EFBFBD><DFB9>ײ鿴
|
||||||
|
QDockWidget* dock_hyperimgViewer = new CustomDockWidgetBase(QString::fromLocal8Bit("hyimgViewer"), this);
|
||||||
|
dock_hyperimgViewer->setObjectName("hyimgViewer");
|
||||||
|
|
||||||
|
QWidget* dock_hyperimgViewerWidgetContents = new QWidget();
|
||||||
|
dock_hyperimgViewerWidgetContents->setObjectName(QString::fromUtf8("dock_hyperimgViewerWidgetContents"));
|
||||||
|
QGridLayout* gridLayout_hyperimgViewer = new QGridLayout(dock_hyperimgViewerWidgetContents);
|
||||||
|
gridLayout_hyperimgViewer->setSpacing(6);
|
||||||
|
gridLayout_hyperimgViewer->setObjectName(QString::fromUtf8("gridLayout_hyperimgViewer"));
|
||||||
|
gridLayout_hyperimgViewer->setVerticalSpacing(6);
|
||||||
|
gridLayout_hyperimgViewer->setContentsMargins(1, 2, 1, 2);
|
||||||
|
|
||||||
|
m_imageViewerTabWidget = new QTabWidget();
|
||||||
|
//m_imageViewerTabWidget->tabBar()->setFixedHeight(40);//û<><C3BB>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>qss<73><73><EFBFBD><EFBFBD><EFBFBD>ø߶Ȳ<DFB6><C8B2><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>Ϊɶ<CEAA><C9B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
m_imageViewerTabWidget->clear();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD>棬<EFBFBD><E6A3AC><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>tab
|
||||||
|
QToolButton* maxButton = new QToolButton();
|
||||||
|
maxButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton));
|
||||||
|
connect(maxButton, SIGNAL(clicked()), dock_hyperimgViewer, SLOT(toggleMaximize()));
|
||||||
|
m_imageViewerTabWidget->setCornerWidget(maxButton, Qt::TopRightCorner);
|
||||||
|
//onCreateTab(0);
|
||||||
|
//m_imageViewerTabWidget->setTabsClosable(true);//<2F><><EFBFBD><EFBFBD>ÿҳ<C3BF><D2B3><EFBFBD><EFBFBD><EFBFBD>йرհ<D8B1>ť
|
||||||
|
connect(m_imageViewerTabWidget, SIGNAL(currentChanged(int)), this, SLOT(onTabWidgetCurrentChanged(int)));
|
||||||
|
m_imageViewerTabWidget->setStyleSheet(R"(
|
||||||
|
QTabBar::tab {
|
||||||
|
background: #0E1C4C;
|
||||||
|
color: white;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #27376C;
|
||||||
|
height: 18;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar::tab:selected {
|
||||||
|
background: #0D1233;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*QTabBar::tab:hover {
|
||||||
|
background: #141A45;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
QTabWidget::pane {
|
||||||
|
border: none;
|
||||||
|
border-top: 1px solid #27376C;
|
||||||
|
background: #0D1233;
|
||||||
|
top: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget QWidget {
|
||||||
|
background: #0D1233;
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
QWidget* imageViewerTabWidgetContainer = new QWidget();
|
||||||
|
QGridLayout* gridLayout_imageViewerTabWidgetContainer = new QGridLayout(imageViewerTabWidgetContainer);
|
||||||
|
gridLayout_imageViewerTabWidgetContainer->setSpacing(6);
|
||||||
|
gridLayout_imageViewerTabWidgetContainer->setObjectName(QString::fromUtf8("gridLayout_imageViewerTabWidgetContainer"));
|
||||||
|
gridLayout_imageViewerTabWidgetContainer->setVerticalSpacing(6);
|
||||||
|
gridLayout_imageViewerTabWidgetContainer->setContentsMargins(0, 0, 0, 0);
|
||||||
|
gridLayout_imageViewerTabWidgetContainer->addWidget(m_imageViewerTabWidget, 0, 0, 1, 1);
|
||||||
|
imageViewerTabWidgetContainer->setStyleSheet(R"(
|
||||||
|
background: #0E1C4C;
|
||||||
|
)");
|
||||||
|
|
||||||
|
QFrame* line = new QFrame();
|
||||||
|
line->setFrameShape(QFrame::HLine);
|
||||||
|
line->setFrameShadow(QFrame::Plain);
|
||||||
|
line->setStyleSheet(R"(
|
||||||
|
QWidget {
|
||||||
|
color: #2c586b;
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
|
||||||
|
m_chartView = new QChartView();
|
||||||
|
m_chartView->setRenderHint(QPainter::Antialiasing);
|
||||||
|
m_chartView->setStyleSheet(R"(
|
||||||
|
background: #0D1233;
|
||||||
|
)");
|
||||||
|
//m_chartView->setBackgroundBrush(QColor("#0D1233"));
|
||||||
|
|
||||||
|
m_chart = new QChart();
|
||||||
|
m_chart->setBackgroundBrush(QColor("#0D1233"));
|
||||||
|
m_chart->legend()->hide();
|
||||||
|
//m_chart->setTitle("Simple line chart example");
|
||||||
|
|
||||||
|
QValueAxis* axisX = new QValueAxis();
|
||||||
|
QValueAxis* axisY = new QValueAxis();
|
||||||
|
setAxis(axisX, axisY);
|
||||||
|
m_chart->addAxis(axisX, Qt::AlignBottom);
|
||||||
|
m_chart->addAxis(axisY, Qt::AlignLeft);
|
||||||
|
m_chartView->setChart(m_chart);
|
||||||
|
|
||||||
|
gridLayout_hyperimgViewer->addWidget(imageViewerTabWidgetContainer, 0, 0, 1, 1);
|
||||||
|
gridLayout_hyperimgViewer->addWidget(line, 1, 0, 1, 1);
|
||||||
|
gridLayout_hyperimgViewer->addWidget(m_chartView, 2, 0, 1, 1);
|
||||||
|
|
||||||
|
gridLayout_hyperimgViewer->setRowStretch(0, 3);
|
||||||
|
gridLayout_hyperimgViewer->setRowStretch(1, 1);
|
||||||
|
gridLayout_hyperimgViewer->setRowStretch(2, 2);
|
||||||
|
|
||||||
|
|
||||||
|
dock_hyperimgViewerWidgetContents->setStyleSheet(R"(
|
||||||
|
QWidget #dock_hyperimgViewerWidgetContents{
|
||||||
|
background: #0D1233;
|
||||||
|
/*border: 1px solid #2c586b;*/
|
||||||
|
|
||||||
|
border-top: 2px solid #2c586b;
|
||||||
|
border-left: 1px solid #2c586b;
|
||||||
|
border-right: 1px solid #2c586b;
|
||||||
|
border-bottom: 2px solid #2c586b;
|
||||||
|
|
||||||
|
border-top-left-radius: 10px;
|
||||||
|
border-top-right-radius: 10px;
|
||||||
|
border-bottom-left-radius: 10px;
|
||||||
|
border-bottom-right-radius: 10px;
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
|
||||||
|
dock_hyperimgViewer->setWidget(dock_hyperimgViewerWidgetContents);
|
||||||
|
mPanelMenu->addAction(dock_hyperimgViewer->toggleViewAction());
|
||||||
|
QWidget* tmp6 = new QWidget();
|
||||||
|
dock_hyperimgViewer->setTitleBarWidget(tmp6);
|
||||||
|
|
||||||
|
//<2F>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
m_dock_carousel = new CustomDockWidgetBase(QString::fromLocal8Bit("<EFBFBD>ֲ<EFBFBD>"), this);
|
||||||
|
m_dock_carousel->setObjectName("mDockCarousel");
|
||||||
|
m_dock_carousel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
|
mPanelMenu->addAction(m_dock_carousel->toggleViewAction());
|
||||||
|
//addDockWidget(Qt::LeftDockWidgetArea, m_dock_carousel);
|
||||||
|
|
||||||
|
m_carousel = new MyCarousel();
|
||||||
|
m_carousel->setObjectName(QString::fromUtf8("carousel"));
|
||||||
|
|
||||||
|
QScrollArea* sa = new QScrollArea();
|
||||||
|
sa->setStyleSheet(R"(
|
||||||
|
border: none;
|
||||||
|
)");
|
||||||
|
QGridLayout* gridLayout_sa = new QGridLayout(sa);
|
||||||
|
gridLayout_sa->setSpacing(6);
|
||||||
|
gridLayout_sa->setObjectName(QString::fromUtf8("gridLayout_sa"));
|
||||||
|
gridLayout_sa->setVerticalSpacing(0);
|
||||||
|
gridLayout_sa->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
m_cam_label = new QLabel();
|
||||||
|
gridLayout_sa->addWidget(m_cam_label);
|
||||||
|
|
||||||
|
m_carousel->addWidget(sa);
|
||||||
|
m_carousel->addWidget(new QLabel("1"));
|
||||||
|
m_carousel->addWidget(new QLabel("2"));
|
||||||
|
m_carousel->addWidget(new QLabel("3"));
|
||||||
|
//m_carousel->addWidget(new QLabel("4"));
|
||||||
|
//m_carousel->addWidget(new QLabel("5"));
|
||||||
|
//m_carousel->addWidget(new QLabel("6"));
|
||||||
|
//m_carousel->addWidget(new QLabel("7"));
|
||||||
|
//m_carousel->addWidget(new QLabel("8"));
|
||||||
|
//m_carousel->addWidget(new QLabel("9"));
|
||||||
|
//m_carousel->addWidget(new QLabel("10"));
|
||||||
|
//m_carousel->addWidget(new QLabel("11"));
|
||||||
|
//m_carousel->addWidget(new QLabel("12"));
|
||||||
|
//m_carousel->addWidget(new QLabel("13"));
|
||||||
|
//m_carousel->addWidget(new QLabel("14"));
|
||||||
|
//m_carousel->addWidget(new QLabel("15"));
|
||||||
|
//m_carousel->addWidget(new QLabel("16"));
|
||||||
|
m_carousel->play();
|
||||||
|
|
||||||
|
m_dock_carousel->setWidget(m_carousel);
|
||||||
|
|
||||||
|
initControlTabwidget();
|
||||||
|
|
||||||
|
|
||||||
|
splitDockWidget(dock_layers, dock_hyperimgViewer, Qt::Horizontal);
|
||||||
|
splitDockWidget(dock_hyperimgViewer, m_dock_carousel, Qt::Horizontal);
|
||||||
|
|
||||||
|
//m_dock_carousel->show();
|
||||||
|
//ui.mDockWidgetRGBCamera->setMinimumWidth(449);
|
||||||
|
//ui.mDockWidgetRGBCamera->setMaximumWidth(450);
|
||||||
|
//ui.mDockWidgetRGBCamera->setMinimumHeight(497);
|
||||||
|
//ui.mDockWidgetRGBCamera->setMaximumHeight(498);
|
||||||
|
|
||||||
|
splitDockWidget(dock_layers, ui.mDockWidgetSimulator, Qt::Vertical);
|
||||||
|
ui.mDockWidgetSimulator->show();
|
||||||
|
|
||||||
|
splitDockWidget(m_dock_carousel, ui.mDockWidgetSpectrometer, Qt::Vertical);
|
||||||
|
ui.mDockWidgetSpectrometer->show();
|
||||||
|
|
||||||
|
setStyleSheet(R"(
|
||||||
|
QMainWindow::separator{
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
background: #040125; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD>ɫ */
|
||||||
|
/*border: 1px solid #808080;*/ /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӱ߿<D3B1> */
|
||||||
|
}
|
||||||
|
|
||||||
|
QDockWidget {
|
||||||
|
border: 2px solid #2a347a; /* <20><><EFBFBD><EFBFBD>ɫ<EFBFBD>߿<EFBFBD> */
|
||||||
|
background-color: red; /* <20><><EFBFBD>屳<EFBFBD><E5B1B3>ɫ */
|
||||||
|
color: white; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
QDockWidget::title {
|
||||||
|
background-color: #0E1C4C; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
||||||
|
text-align: left; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD> */
|
||||||
|
|
||||||
|
/*padding: 4px;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DockWidget <20>Ĺرհ<D8B1>ť<EFBFBD><C5A5>ʽ */
|
||||||
|
QDockWidget::close-button, QDockWidget::float-button {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDockWidget::close-button:hover, QDockWidget::float-button:hover {
|
||||||
|
background: rgba(255,255,255,0.2);
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
createActionGroups();
|
||||||
|
connect(mImagerGroup, &QActionGroup::triggered, this, &HPPA::selectingImager);
|
||||||
|
|
||||||
|
createMoveplatformActionGroup();
|
||||||
|
connect(moveplatformActionGroup, &QActionGroup::triggered, this, &HPPA::selectingMoveplatform);
|
||||||
|
|
||||||
|
ui.mDockWidgetSimulator->setFeatures(QDockWidget::DockWidgetClosable);
|
||||||
|
|
||||||
|
QString strPath = QCoreApplication::applicationDirPath() + "/UILayout.ini";
|
||||||
|
QFile file(strPath);
|
||||||
|
if (file.open(QIODevice::ReadOnly))
|
||||||
|
{
|
||||||
|
QByteArray ba;
|
||||||
|
QDataStream in(&file);
|
||||||
|
in >> ba;
|
||||||
|
file.close();
|
||||||
|
this->restoreState(ba);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HPPA::initMenubarToolbar()
|
||||||
|
{
|
||||||
//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD>
|
//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD>
|
||||||
QWidget* menuWidget = new WidgetWithBackgroundPicture();
|
QWidget* menuWidget = new WidgetWithBackgroundPicture();
|
||||||
//menuWidget->setFixedWidth(200);
|
//menuWidget->setFixedWidth(200);
|
||||||
@ -172,377 +512,70 @@ HPPA::HPPA(QWidget* parent)
|
|||||||
verticalLayout_topWidget->addWidget(menuWidget);
|
verticalLayout_topWidget->addWidget(menuWidget);
|
||||||
//verticalLayout_topWidget->addWidget(toolBarWidget);
|
//verticalLayout_topWidget->addWidget(toolBarWidget);
|
||||||
setMenuWidget(topWidget);
|
setMenuWidget(topWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HPPA::initControlTabwidget()
|
||||||
|
{
|
||||||
|
ui.controlTabWidget->removeTab(1);
|
||||||
|
|
||||||
|
QWidget* videoWidget = new QWidget();
|
||||||
|
QVBoxLayout* vBoxLayout_videoWidget = new QVBoxLayout(videoWidget);
|
||||||
|
|
||||||
|
vBoxLayout_videoWidget->setSpacing(6);
|
||||||
|
vBoxLayout_videoWidget->setObjectName(QString::fromUtf8("vBoxLayout_videoWidget"));
|
||||||
|
vBoxLayout_videoWidget->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
m_open_rgb_camera_btn = new QPushButton(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
|
m_open_rgb_camera_btn->setObjectName(QString::fromUtf8("m_open_rgb_camera_btn"));
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD>
|
m_close_rgb_camera_btn = new QPushButton(QString::fromLocal8Bit("<EFBFBD>ر<EFBFBD>"));
|
||||||
m_Imager = nullptr;
|
m_close_rgb_camera_btn->setObjectName(QString::fromUtf8("m_close_rgb_camera_btn"));
|
||||||
m_RecordState = 0;
|
vBoxLayout_videoWidget->addWidget(m_open_rgb_camera_btn);
|
||||||
connect(this->ui.action_connect_imager, SIGNAL(triggered()), this, SLOT(onconnect()));//<2F>ź<EFBFBD><C5BA><EFBFBD><EFBFBD>ۣ<EFBFBD><DBA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><C5BA><EFBFBD><EFBFBD>۰<DBB0><F3B6A8B7>ں<EFBFBD><DABA><EFBFBD>onconnect<63><74>
|
vBoxLayout_videoWidget->addWidget(m_close_rgb_camera_btn);
|
||||||
|
|
||||||
//rgb<67><62><EFBFBD><EFBFBD>
|
//rgb<67><62><EFBFBD><EFBFBD>
|
||||||
m_RgbCameraThread = new QThread();
|
m_RgbCameraThread = new QThread();
|
||||||
m_RgbCamera = new RgbCameraOperation();
|
m_RgbCamera = new RgbCameraOperation();
|
||||||
m_RgbCamera->moveToThread(m_RgbCameraThread);
|
m_RgbCamera->moveToThread(m_RgbCameraThread);
|
||||||
m_RgbCameraThread->start();
|
m_RgbCameraThread->start();
|
||||||
connect(this->ui.open_rgb_camera_btn, SIGNAL(clicked()), m_RgbCamera, SLOT(OpenCamera()));//ʹ<><CAB9><EFBFBD>ź<EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD>̣߳<DFB3>ui<75>̣߳<DFB3>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD>Ƶ <20><> <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD>濨<EFBFBD><E6BFA8>
|
connect(m_open_rgb_camera_btn, SIGNAL(clicked()), m_RgbCamera, SLOT(OpenCamera()));//ʹ<><CAB9><EFBFBD>ź<EFBFBD>֪ͨ<CDA8><D6AA><EFBFBD>̣߳<DFB3>ui<75>̣߳<DFB3>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD>Ƶ <20><> <20>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD>濨<EFBFBD><E6BFA8>
|
||||||
connect(m_RgbCamera, SIGNAL(PlotSignal()), this, SLOT(onPlotRgbImage()));
|
connect(m_RgbCamera, SIGNAL(PlotSignal()), this, SLOT(onPlotRgbImage()));
|
||||||
|
|
||||||
//m_RgbCamera->setCallback(onPlotRgbImage);
|
//m_RgbCamera->setCallback(onPlotRgbImage);
|
||||||
//connect(this->ui.open_rgb_camera_btn, SIGNAL(clicked()), m_RgbCamera, SLOT(OpenCamera_callback()));//ʹ<>ûص<C3BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>̣߳<DFB3>ui<75>̣߳<DFB3><CCA3>ϵ<EFBFBD><CFB5><EFBFBD>Ƶ <20><> ʧ<><CAA7>
|
//connect(this->ui.open_rgb_camera_btn, SIGNAL(clicked()), m_RgbCamera, SLOT(OpenCamera_callback()));//ʹ<>ûص<C3BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><CBA2><EFBFBD><EFBFBD><EFBFBD>̣߳<DFB3>ui<75>̣߳<DFB3><CCA3>ϵ<EFBFBD><CFB5><EFBFBD>Ƶ <20><> ʧ<><CAA7>
|
||||||
|
|
||||||
connect(this->ui.close_rgb_camera_btn, SIGNAL(clicked()), this, SLOT(onCloseRgbCamera()));//<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD>
|
connect(m_close_rgb_camera_btn, SIGNAL(clicked()), this, SLOT(onCloseRgbCamera()));//<2F>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD>
|
||||||
connect(m_RgbCamera, SIGNAL(CamClosed()), this, SLOT(onClearLabel()));
|
connect(m_RgbCamera, SIGNAL(CamClosed()), this, SLOT(onClearLabel()));
|
||||||
|
|
||||||
|
ui.controlTabWidget->addTab(videoWidget, QString::fromLocal8Bit("rgb<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD>ʷ<EFBFBD>Χ<EFBFBD><CEA7><EFBFBD><EFBFBD>Щ<EFBFBD><D0A9><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD>slider<65><72><EFBFBD>źźͲ<C5BA><CDB2><EFBFBD><EFBFBD><EFBFBD>connectǰ<74><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>setMinimum<75><6D><EFBFBD>ı<EFBFBD>slider<65><72>ֵ
|
|
||||||
ui.FramerateSlider->setMinimum(1);
|
|
||||||
ui.FramerateSlider->setMaximum(250);
|
|
||||||
ui.GainSlider->setMinimum(0);
|
|
||||||
ui.GainSlider->setMaximum(24);
|
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
frame_number->setEnabled(false);
|
|
||||||
|
|
||||||
ui.framerate_lineEdit->setEnabled(false);
|
|
||||||
ui.integratioin_time_lineEdit->setEnabled(false);
|
|
||||||
ui.gain_lineEdit->setEnabled(false);
|
|
||||||
|
|
||||||
ui.FramerateSlider->setEnabled(false);
|
|
||||||
ui.IntegratioinTimeSlider->setEnabled(false);
|
|
||||||
ui.GainSlider->setEnabled(false);
|
|
||||||
|
|
||||||
startTimer(1000);
|
|
||||||
|
|
||||||
widthScale = 1;
|
|
||||||
heightScale = 1;
|
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ģ<EFBFBD><C4A3>
|
|
||||||
connect(ui.graphicsView->imager, SIGNAL(leftMouseButtonPressed(int, int)), this, SLOT(onimagerSimulatorMove(int, int)));
|
|
||||||
|
|
||||||
initPanelToolbar();
|
|
||||||
setDockNestingEnabled(true);
|
|
||||||
connect(this->ui.action_about, SIGNAL(triggered()), this, SLOT(onAbout()));
|
|
||||||
connect(this->ui.mActionOneMotorScenario, SIGNAL(triggered()), this, SLOT(createOneMotorScenario()));
|
|
||||||
|
|
||||||
delete ui.centralWidget;
|
|
||||||
ui.mDockWidgetRGBCamera->close();
|
|
||||||
ui.mDockWidgetSimulator->close();
|
|
||||||
ui.mDockWidgetSpectralViewer->close();
|
|
||||||
ui.mDockWidgetSpectrometer->close();
|
|
||||||
|
|
||||||
QString qss_DockWidget_contentWidget = R"(
|
|
||||||
background: #0D1233;
|
|
||||||
/*border: 1px solid #2c586b;*/
|
|
||||||
|
|
||||||
border-top: 1px solid #2c586b;
|
|
||||||
border-left: 1px solid #2c586b;
|
|
||||||
border-right: 1px solid #2c586b;
|
|
||||||
border-bottom: 1px solid #2c586b;
|
|
||||||
|
|
||||||
border-bottom-left-radius: 10px;
|
|
||||||
border-bottom-right-radius: 10px;
|
|
||||||
)";
|
|
||||||
QString qss_DockWidget = R"(
|
|
||||||
QDockWidget::title{
|
|
||||||
background: #0E1C4C;
|
|
||||||
/*border: 4px solid #2c586b;*/
|
|
||||||
|
|
||||||
|
|
||||||
border-top: 1px solid #2c586b;
|
|
||||||
border-left: 1px solid #2c586b;
|
|
||||||
border-right: 1px solid #2c586b;
|
|
||||||
border-bottom: none; /* ȡ<><C8A1><EFBFBD>ײ<EFBFBD><D7B2>߿<EFBFBD> */
|
|
||||||
|
|
||||||
border-top-left-radius: 10px;
|
|
||||||
border-top-right-radius: 10px;
|
|
||||||
}
|
|
||||||
)";
|
|
||||||
|
|
||||||
//TOC
|
|
||||||
QDockWidget* dock_layers = new QDockWidget(QString::fromLocal8Bit("layers"), this);
|
|
||||||
dock_layers->setObjectName("mDockLayers");
|
|
||||||
dock_layers->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
||||||
mPanelMenu->addAction(dock_layers->toggleViewAction());
|
|
||||||
addDockWidget(Qt::LeftDockWidgetArea, dock_layers);
|
|
||||||
|
|
||||||
QWidget * dock_layersWidgetContents = new QWidget();
|
|
||||||
dock_layersWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents_2"));
|
|
||||||
QGridLayout* gridLayout_toc = new QGridLayout(dock_layersWidgetContents);
|
|
||||||
gridLayout_toc->setSpacing(6);
|
|
||||||
gridLayout_toc->setContentsMargins(11, 11, 11, 11);
|
|
||||||
gridLayout_toc->setObjectName(QString::fromUtf8("gridLayout_toc"));
|
|
||||||
gridLayout_toc->setVerticalSpacing(0);
|
|
||||||
gridLayout_toc->setContentsMargins(0, 0, 0, 0);
|
|
||||||
|
|
||||||
ImagerPositionSimulation* graphicsView_delete = new ImagerPositionSimulation(dock_layersWidgetContents);
|
|
||||||
graphicsView_delete->setObjectName(QString::fromUtf8("graphicsView_delete"));
|
|
||||||
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
|
||||||
sizePolicy1.setHorizontalStretch(0);
|
|
||||||
sizePolicy1.setVerticalStretch(0);
|
|
||||||
sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidth());
|
|
||||||
graphicsView_delete->setSizePolicy(sizePolicy1);
|
|
||||||
graphicsView_delete->setFrameShape(QFrame::NoFrame);
|
|
||||||
graphicsView_delete->setFrameShadow(QFrame::Raised);
|
|
||||||
|
|
||||||
gridLayout_toc->addWidget(graphicsView_delete, 0, 0, 1, 1);
|
|
||||||
dock_layers->setWidget(dock_layersWidgetContents);
|
|
||||||
dock_layersWidgetContents->setStyleSheet(qss_DockWidget_contentWidget);
|
|
||||||
dock_layers->setStyleSheet(qss_DockWidget);
|
|
||||||
|
|
||||||
//dock_layers->setMinimumWidth(449);
|
|
||||||
//dock_layers->setMaximumWidth(450);
|
|
||||||
//dock_layers->setMinimumHeight(497);
|
|
||||||
//dock_layers->setMaximumHeight(498);
|
|
||||||
|
|
||||||
//ui.mDockWidgetRGBCamera->setMinimumWidth(449);
|
|
||||||
//ui.mDockWidgetRGBCamera->setMaximumWidth(450);
|
|
||||||
//ui.mDockWidgetRGBCamera->setMinimumHeight(497);
|
|
||||||
//ui.mDockWidgetRGBCamera->setMaximumHeight(498);
|
|
||||||
|
|
||||||
//<2F>߹<EFBFBD><DFB9>ײ鿴
|
|
||||||
QDockWidget* dock_hyperimgViewer = new QDockWidget(QString::fromLocal8Bit("hyimgViewer"), this);
|
|
||||||
dock_hyperimgViewer->setObjectName("hyimgViewer");
|
|
||||||
|
|
||||||
QWidget* dock_hyperimgViewerWidgetContents = new QWidget();
|
|
||||||
dock_hyperimgViewerWidgetContents->setObjectName(QString::fromUtf8("dock_hyperimgViewerWidgetContents"));
|
|
||||||
QGridLayout* gridLayout_hyperimgViewer = new QGridLayout(dock_hyperimgViewerWidgetContents);
|
|
||||||
gridLayout_hyperimgViewer->setSpacing(6);
|
|
||||||
gridLayout_hyperimgViewer->setObjectName(QString::fromUtf8("gridLayout_hyperimgViewer"));
|
|
||||||
gridLayout_hyperimgViewer->setVerticalSpacing(6);
|
|
||||||
gridLayout_hyperimgViewer->setContentsMargins(10, 10, 10, 10);
|
|
||||||
|
|
||||||
m_imageViewerTabWidget = new QTabWidget();
|
|
||||||
m_imageViewerTabWidget->clear();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD>棬<EFBFBD><E6A3AC><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>tab
|
|
||||||
//m_imageViewerTabWidget->setTabsClosable(true);//<2F><><EFBFBD><EFBFBD>ÿҳ<C3BF><D2B3><EFBFBD><EFBFBD><EFBFBD>йرհ<D8B1>ť
|
|
||||||
connect(m_imageViewerTabWidget, SIGNAL(currentChanged(int)), this, SLOT(onTabWidgetCurrentChanged(int)));
|
|
||||||
m_imageViewerTabWidget->setStyleSheet(R"(
|
|
||||||
QTabWidget::pane {
|
|
||||||
border: none; /* ȥ<><C8A5><EFBFBD><EFBFBD>ɫ<EFBFBD>߿<EFBFBD> */
|
|
||||||
background: #0D1233; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
|
||||||
}
|
|
||||||
|
|
||||||
QTabBar::tab {
|
|
||||||
background: #0D1233; /* <20><>ǩδѡ<CEB4><D1A1>ʱ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD> */
|
|
||||||
color: white; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
|
||||||
padding: 6px 12px;
|
|
||||||
border: 1px solid #0D1233;
|
|
||||||
}
|
|
||||||
|
|
||||||
QTabBar::tab:selected {
|
|
||||||
background: #1A2B6D; /* ѡ<>б<EFBFBD>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> */
|
|
||||||
border-bottom: 2px solid #4A5FE0;
|
|
||||||
}
|
|
||||||
|
|
||||||
QTabBar::tab:hover {
|
|
||||||
background: #141A45; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣʱ<CDA3><CAB1><EFBFBD><EFBFBD>ɫ */
|
|
||||||
}
|
|
||||||
|
|
||||||
QTabWidget QWidget {
|
|
||||||
background: #0D1233; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
||||||
}
|
|
||||||
)");
|
|
||||||
|
|
||||||
QFrame* line = new QFrame();
|
|
||||||
line->setFrameShape(QFrame::HLine);
|
|
||||||
line->setFrameShadow(QFrame::Plain);
|
|
||||||
line->setStyleSheet(R"(
|
|
||||||
QWidget {
|
|
||||||
color: #2c586b;
|
|
||||||
}
|
|
||||||
)");
|
|
||||||
|
|
||||||
m_chartView = new QChartView();
|
|
||||||
m_chartView->setRenderHint(QPainter::Antialiasing);
|
|
||||||
m_chartView->setStyleSheet(R"(
|
|
||||||
background: #0D1233;
|
|
||||||
)");
|
|
||||||
//m_chartView->setBackgroundBrush(QColor("#0D1233"));
|
|
||||||
|
|
||||||
m_chart = new QChart();
|
|
||||||
m_chart->setBackgroundBrush(QColor("#0D1233"));
|
|
||||||
m_chart->legend()->hide();
|
|
||||||
//m_chart->setTitle("Simple line chart example");
|
|
||||||
|
|
||||||
QValueAxis* axisX = new QValueAxis();
|
|
||||||
QValueAxis* axisY = new QValueAxis();
|
|
||||||
setAxis(axisX, axisY);
|
|
||||||
m_chart->addAxis(axisX, Qt::AlignBottom);
|
|
||||||
m_chart->addAxis(axisY, Qt::AlignLeft);
|
|
||||||
|
|
||||||
|
|
||||||
m_chartView->setChart(m_chart);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gridLayout_hyperimgViewer->addWidget(m_imageViewerTabWidget, 0, 0, 1, 1);
|
|
||||||
gridLayout_hyperimgViewer->addWidget(line, 1, 0, 1, 1);
|
|
||||||
gridLayout_hyperimgViewer->addWidget(m_chartView, 2, 0, 1, 1);
|
|
||||||
|
|
||||||
gridLayout_hyperimgViewer->setRowStretch(0, 1);
|
|
||||||
gridLayout_hyperimgViewer->setRowStretch(1, 1);
|
|
||||||
gridLayout_hyperimgViewer->setRowStretch(2, 1);
|
|
||||||
|
|
||||||
|
|
||||||
dock_hyperimgViewerWidgetContents->setStyleSheet(R"(
|
|
||||||
QWidget #dock_hyperimgViewerWidgetContents{
|
|
||||||
background: #0D1233;
|
|
||||||
/*border: 1px solid #2c586b;*/
|
|
||||||
|
|
||||||
border-top: 2px solid #2c586b;
|
|
||||||
border-left: 1px solid #2c586b;
|
|
||||||
border-right: 1px solid #2c586b;
|
|
||||||
border-bottom: 2px solid #2c586b;
|
|
||||||
|
|
||||||
border-top-left-radius: 10px;
|
|
||||||
border-top-right-radius: 10px;
|
|
||||||
border-bottom-left-radius: 10px;
|
|
||||||
border-bottom-right-radius: 10px;
|
|
||||||
}
|
|
||||||
)");
|
|
||||||
|
|
||||||
dock_hyperimgViewer->setWidget(dock_hyperimgViewerWidgetContents);
|
|
||||||
mPanelMenu->addAction(dock_hyperimgViewer->toggleViewAction());
|
|
||||||
dock_hyperimgViewer->setStyleSheet(qss_DockWidget);
|
|
||||||
QWidget* tmp6 = new QWidget();
|
|
||||||
dock_hyperimgViewer->setTitleBarWidget(tmp6);
|
|
||||||
|
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
||||||
|
|
||||||
//ui.mDockWidgetSpectralViewer->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
|
|
||||||
//ui.mDockWidgetSpectralViewer->setWidget(m_chartView);
|
|
||||||
////QLineSeries *series = new QLineSeries();
|
|
||||||
////QChart *chart = new QChart();
|
|
||||||
//mPanelMenu->addAction(ui.mDockWidgetSpectralViewer->toggleViewAction());
|
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dock
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>dock
|
||||||
adjustTable* adt = new adjustTable();
|
adjustTable* adt = new adjustTable();
|
||||||
|
adt->setWindowFlags(Qt::Widget);
|
||||||
|
ui.controlTabWidget->addTab(adt, QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
|
|
||||||
QDockWidget* dock_adt = new QDockWidget(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), this);
|
|
||||||
dock_adt->setObjectName("mDockAdjustTable");
|
|
||||||
dock_adt->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
||||||
dock_adt->setWidget(adt);
|
|
||||||
mPanelMenu->addAction(dock_adt->toggleViewAction());
|
|
||||||
|
|
||||||
//<2F><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
//<2F><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
||||||
PowerControl* pc = new PowerControl();
|
PowerControl* pc = new PowerControl();
|
||||||
|
pc->setWindowFlags(Qt::Widget);
|
||||||
QDockWidget* dock_pc = new QDockWidget(QString::fromLocal8Bit("<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), this);
|
ui.controlTabWidget->addTab(pc, QString::fromLocal8Bit("<EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
dock_pc->setObjectName("mDockPowerControl");
|
|
||||||
dock_pc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
||||||
dock_pc->setWidget(pc);
|
|
||||||
mPanelMenu->addAction(dock_pc->toggleViewAction());
|
|
||||||
|
|
||||||
//<2F><>е<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD>
|
//<2F><>е<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD>
|
||||||
rac = new RobotArmControl();
|
rac = new RobotArmControl();
|
||||||
connect(rac->robotController, SIGNAL(hsiRecordSignal(int)), this, SLOT(recordFromRobotArm(int)));
|
connect(rac->robotController, SIGNAL(hsiRecordSignal(int)), this, SLOT(recordFromRobotArm(int)));
|
||||||
QDockWidget* dock_rac = new QDockWidget(QString::fromLocal8Bit("<EFBFBD><EFBFBD>е<EFBFBD>ۿ<EFBFBD><EFBFBD><EFBFBD>"), this);
|
rac->setWindowFlags(Qt::Widget);
|
||||||
dock_rac->setObjectName("mDockRobotArmControl");
|
ui.controlTabWidget->addTab(rac, QString::fromLocal8Bit("<EFBFBD><EFBFBD>е<EFBFBD>ۿ<EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
dock_rac->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
||||||
dock_rac->setWidget(rac);
|
|
||||||
mPanelMenu->addAction(dock_rac->toggleViewAction());
|
|
||||||
|
|
||||||
//һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
omc = new OneMotorControl();
|
omc = new OneMotorControl();
|
||||||
|
omc->setWindowFlags(Qt::Widget);
|
||||||
dock_omc = new QDockWidget(QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), this);
|
ui.controlTabWidget->addTab(omc, QString::fromLocal8Bit("1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
dock_omc->setObjectName("mDockOneMotorControl");
|
|
||||||
dock_omc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
||||||
dock_omc->setWidget(omc);
|
|
||||||
mPanelMenu->addAction(dock_omc->toggleViewAction());
|
|
||||||
|
|
||||||
//2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//2<><32><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
tmc = new TwoMotorControl(this);
|
tmc = new TwoMotorControl(this);
|
||||||
connect(tmc, SIGNAL(startLineNumSignal(int)), this, SLOT(onCreateTab(int)));
|
connect(tmc, SIGNAL(startLineNumSignal(int)), this, SLOT(onCreateTab(int)));
|
||||||
connect(tmc, SIGNAL(sequenceComplete()), this, SLOT(onsequenceComplete()));
|
connect(tmc, SIGNAL(sequenceComplete()), this, SLOT(onsequenceComplete()));
|
||||||
dock_tmc = new QDockWidget(QString::fromLocal8Bit("2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), this);
|
tmc->setWindowFlags(Qt::Widget);
|
||||||
dock_tmc->setObjectName("mDockTwoMotorControl");
|
ui.controlTabWidget->addTab(tmc, QString::fromLocal8Bit("2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
dock_tmc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
||||||
dock_tmc->setWidget(tmc);
|
|
||||||
mPanelMenu->addAction(dock_tmc->toggleViewAction());
|
|
||||||
|
|
||||||
splitDockWidget(dock_layers, dock_hyperimgViewer, Qt::Horizontal);
|
|
||||||
splitDockWidget(dock_hyperimgViewer, ui.mDockWidgetRGBCamera, Qt::Horizontal);
|
|
||||||
ui.mDockWidgetRGBCamera->show();
|
|
||||||
|
|
||||||
splitDockWidget(dock_layers, ui.mDockWidgetSimulator, Qt::Vertical);
|
|
||||||
ui.mDockWidgetSimulator->show();
|
|
||||||
|
|
||||||
splitDockWidget(dock_hyperimgViewer, ui.mDockWidgetSpectralViewer, Qt::Vertical);
|
|
||||||
ui.mDockWidgetSpectralViewer->show();
|
|
||||||
|
|
||||||
splitDockWidget(ui.mDockWidgetRGBCamera, ui.mDockWidgetSpectrometer, Qt::Vertical);
|
|
||||||
ui.mDockWidgetSpectrometer->show();
|
|
||||||
tabifyDockWidget(ui.mDockWidgetSpectrometer, dock_omc);
|
|
||||||
tabifyDockWidget(dock_omc, dock_tmc);
|
|
||||||
tabifyDockWidget(dock_tmc, dock_rac);
|
|
||||||
tabifyDockWidget(dock_rac, dock_pc);
|
|
||||||
tabifyDockWidget(dock_pc, dock_adt);
|
|
||||||
|
|
||||||
dock_tmc->close();
|
|
||||||
dock_rac->close();
|
|
||||||
dock_pc->close();
|
|
||||||
dock_adt->close();
|
|
||||||
|
|
||||||
setStyleSheet(R"(
|
|
||||||
QMainWindow::separator{
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
background: #040125; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD>ɫ */
|
|
||||||
/*border: 1px solid #808080;*/ /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӱ߿<D3B1> */
|
|
||||||
}
|
|
||||||
|
|
||||||
QDockWidget {
|
|
||||||
border: 2px solid #2a347a; /* <20><><EFBFBD><EFBFBD>ɫ<EFBFBD>߿<EFBFBD> */
|
|
||||||
background-color: red; /* <20><><EFBFBD>屳<EFBFBD><E5B1B3>ɫ */
|
|
||||||
color: white; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
||||||
QDockWidget::title {
|
|
||||||
background-color: #0E1C4C; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
|
||||||
text-align: left; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD> */
|
|
||||||
|
|
||||||
/*padding: 4px;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/* <20><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DockWidget <20>Ĺرհ<D8B1>ť<EFBFBD><C5A5>ʽ */
|
|
||||||
QDockWidget::close-button, QDockWidget::float-button {
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDockWidget::close-button:hover, QDockWidget::float-button:hover {
|
|
||||||
background: rgba(255,255,255,0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
)");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
createActionGroups();
|
|
||||||
connect(mImagerGroup, &QActionGroup::triggered, this, &HPPA::selectingImager);
|
|
||||||
|
|
||||||
createMoveplatformActionGroup();
|
|
||||||
connect(moveplatformActionGroup, &QActionGroup::triggered, this, &HPPA::selectingMoveplatform);
|
|
||||||
|
|
||||||
QString strPath = QCoreApplication::applicationDirPath() + "/UILayout.ini";
|
|
||||||
QFile file(strPath);
|
|
||||||
if (file.open(QIODevice::ReadOnly))
|
|
||||||
{
|
|
||||||
QByteArray ba;
|
|
||||||
QDataStream in(&file);
|
|
||||||
in >> ba;
|
|
||||||
file.close();
|
|
||||||
this->restoreState(ba);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HPPA::recordFromRobotArm(int fileCounter)
|
void HPPA::recordFromRobotArm(int fileCounter)
|
||||||
@ -683,7 +716,6 @@ void HPPA::initPanelToolbar()
|
|||||||
|
|
||||||
mPanelMenu->addAction(ui.mDockWidgetSpectrometer->toggleViewAction());
|
mPanelMenu->addAction(ui.mDockWidgetSpectrometer->toggleViewAction());
|
||||||
|
|
||||||
mPanelMenu->addAction(ui.mDockWidgetRGBCamera->toggleViewAction());
|
|
||||||
mPanelMenu->addAction(ui.mDockWidgetSimulator->toggleViewAction());
|
mPanelMenu->addAction(ui.mDockWidgetSimulator->toggleViewAction());
|
||||||
|
|
||||||
mToolbarMenu->addAction(ui.mainToolBar->toggleViewAction());
|
mToolbarMenu->addAction(ui.mainToolBar->toggleViewAction());
|
||||||
@ -699,15 +731,11 @@ void HPPA::createOneMotorScenario()
|
|||||||
dock->hide();
|
dock->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.mDockWidgetSpectralViewer->show();
|
|
||||||
ui.mDockWidgetSpectrometer->show();
|
ui.mDockWidgetSpectrometer->show();
|
||||||
dock_omc->show();
|
|
||||||
|
|
||||||
//tabifyDockWidget(ui.mDockWidgetSpectrometer, dock_omc);
|
//tabifyDockWidget(ui.mDockWidgetSpectrometer, dock_omc);
|
||||||
|
|
||||||
//addDockWidget(Qt::RightDockWidgetArea, ui.mDockWidgetSpectralViewer);
|
|
||||||
//addDockWidget(Qt::RightDockWidgetArea, ui.mDockWidgetSpectrometer);
|
//addDockWidget(Qt::RightDockWidgetArea, ui.mDockWidgetSpectrometer);
|
||||||
//splitDockWidget(ui.mDockWidgetSpectralViewer, ui.mDockWidgetSpectrometer, Qt::Vertical);
|
|
||||||
|
|
||||||
//QDockWidget* dockTop = new QDockWidget(QString::fromLocal8Bit("1"), this);
|
//QDockWidget* dockTop = new QDockWidget(QString::fromLocal8Bit("1"), this);
|
||||||
//QDockWidget* dockBottom = new QDockWidget(QString::fromLocal8Bit("2"), this);
|
//QDockWidget* dockBottom = new QDockWidget(QString::fromLocal8Bit("2"), this);
|
||||||
@ -1133,12 +1161,12 @@ void HPPA::onPlotRgbImage()
|
|||||||
//std::cout << "<22><>ʾ<EFBFBD><CABE>Ƶ+++++++++++++++++++++++++++++++++++++++++++" << std::endl;
|
//std::cout << "<22><>ʾ<EFBFBD><CABE>Ƶ+++++++++++++++++++++++++++++++++++++++++++" << std::endl;
|
||||||
QPixmap pixmap = QPixmap::fromImage(m_RgbCamera->m_qImage);
|
QPixmap pixmap = QPixmap::fromImage(m_RgbCamera->m_qImage);
|
||||||
|
|
||||||
int width = ui.cam_label->width();
|
int width = m_cam_label->width();
|
||||||
int height = ui.cam_label->height();
|
int height = m_cam_label->height();
|
||||||
QPixmap fitpixmap = pixmap.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
QPixmap fitpixmap = pixmap.scaled(width, height, Qt::KeepAspectRatio, Qt::SmoothTransformation); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
ui.cam_label->setPixmap(fitpixmap);
|
m_cam_label->setPixmap(fitpixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HPPA::onCloseRgbCamera()
|
void HPPA::onCloseRgbCamera()
|
||||||
@ -1149,8 +1177,8 @@ void HPPA::onCloseRgbCamera()
|
|||||||
|
|
||||||
void HPPA::onClearLabel()
|
void HPPA::onClearLabel()
|
||||||
{
|
{
|
||||||
ui.cam_label->clear();
|
m_cam_label->clear();
|
||||||
ui.cam_label->setText("closed");
|
m_cam_label->setText("closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
void HPPA::onCopyFinished()
|
void HPPA::onCopyFinished()
|
||||||
|
|||||||
15
HPPA/HPPA.h
15
HPPA/HPPA.h
@ -43,6 +43,9 @@
|
|||||||
#include "ResononNirImager.h"
|
#include "ResononNirImager.h"
|
||||||
#include "Corning410Imager.h"
|
#include "Corning410Imager.h"
|
||||||
|
|
||||||
|
#include "CustomDockWidgetBase.h"
|
||||||
|
#include "Carousel.h"
|
||||||
|
|
||||||
#define PI 3.1415926
|
#define PI 3.1415926
|
||||||
|
|
||||||
QT_CHARTS_USE_NAMESPACE//QChartView ʹ<><CAB9> <20><>Ҫ<EFBFBD>Ӻ꣬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
|
QT_CHARTS_USE_NAMESPACE//QChartView ʹ<><CAB9> <20><>Ҫ<EFBFBD>Ӻ꣬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
|
||||||
@ -168,7 +171,9 @@ private:
|
|||||||
QMenu* mPanelMenu = nullptr;
|
QMenu* mPanelMenu = nullptr;
|
||||||
QMenu* mToolbarMenu = nullptr;
|
QMenu* mToolbarMenu = nullptr;
|
||||||
|
|
||||||
|
void initMenubarToolbar();
|
||||||
void initPanelToolbar();
|
void initPanelToolbar();
|
||||||
|
void initControlTabwidget();
|
||||||
|
|
||||||
QLineEdit * frame_number;
|
QLineEdit * frame_number;
|
||||||
QLineEdit * m_FilenameLineEdit;
|
QLineEdit * m_FilenameLineEdit;
|
||||||
@ -217,13 +222,17 @@ private:
|
|||||||
RobotArmControl* rac;
|
RobotArmControl* rac;
|
||||||
|
|
||||||
OneMotorControl* omc;
|
OneMotorControl* omc;
|
||||||
QDockWidget* dock_omc;
|
|
||||||
|
|
||||||
TwoMotorControl* tmc;
|
TwoMotorControl* tmc;
|
||||||
QDockWidget* dock_tmc;
|
|
||||||
|
|
||||||
FILE* m_hTimesFile;
|
FILE* m_hTimesFile;
|
||||||
|
|
||||||
|
CustomDockWidgetBase* m_dock_carousel;
|
||||||
|
|
||||||
|
MyCarousel* m_carousel;
|
||||||
|
QLabel* m_cam_label;
|
||||||
|
QPushButton* m_open_rgb_camera_btn;
|
||||||
|
QPushButton* m_close_rgb_camera_btn;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber);
|
void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber);
|
||||||
void PlotSpectral(int state);
|
void PlotSpectral(int state);
|
||||||
|
|||||||
242
HPPA/HPPA.ui
242
HPPA/HPPA.ui
@ -233,107 +233,7 @@ QToolBar QToolButton:hover {
|
|||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QDockWidget" name="mDockWidgetRGBCamera">
|
<widget class="CustomDockWidgetBase" name="mDockWidgetSimulator">
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>RGB 相机</string>
|
|
||||||
</property>
|
|
||||||
<attribute name="dockWidgetArea">
|
|
||||||
<number>1</number>
|
|
||||||
</attribute>
|
|
||||||
<widget class="QWidget" name="dockWidgetContents">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QGroupBox" name="groupBox_4">
|
|
||||||
<property name="mouseTracking">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">QGroupBox {
|
|
||||||
/* border: 2px solid #3498db; 边框颜色 */
|
|
||||||
border-radius: 5px; /* 圆角 */
|
|
||||||
padding: 10px; /* 内边距 */
|
|
||||||
background-color: rgb(255, 255, 255);
|
|
||||||
}
|
|
||||||
|
|
||||||
QGroupBox:title {
|
|
||||||
subcontrol-position: top left; /* 标题位置 */
|
|
||||||
padding: 0 10px; /* 标题内边距 */
|
|
||||||
font-weight: bold; /* 标题字体加粗 */
|
|
||||||
color: #3498db; /* 标题文字颜色 */
|
|
||||||
}
|
|
||||||
</string>
|
|
||||||
</property>
|
|
||||||
<property name="title">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QPushButton" name="close_rgb_camera_btn">
|
|
||||||
<property name="text">
|
|
||||||
<string>关闭</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QPushButton" name="open_rgb_camera_btn">
|
|
||||||
<property name="text">
|
|
||||||
<string>打开</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="cam_label">
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>摄像头关闭!</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QDockWidget" name="mDockWidgetSimulator">
|
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
@ -341,7 +241,7 @@ QGroupBox:title {
|
|||||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>线性平台位置模拟</string>
|
<string>3D模型</string>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="dockWidgetArea">
|
<attribute name="dockWidgetArea">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
@ -382,90 +282,52 @@ QGroupBox:title {
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QDockWidget" name="mDockWidgetSpectralViewer">
|
<widget class="CustomDockWidgetHideAbove" name="mDockWidgetSpectrometer">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>光谱曲线</string>
|
<string>控制</string>
|
||||||
</property>
|
|
||||||
<attribute name="dockWidgetArea">
|
|
||||||
<number>2</number>
|
|
||||||
</attribute>
|
|
||||||
<widget class="QWidget" name="dockWidgetContents_3">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_10">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QDockWidget" name="mDockWidgetSpectrometer">
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>光谱仪</string>
|
|
||||||
</property>
|
</property>
|
||||||
<attribute name="dockWidgetArea">
|
<attribute name="dockWidgetArea">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QWidget" name="dockWidgetContents_4">
|
<widget class="QWidget" name="dockWidgetContents_4">
|
||||||
<layout class="QGridLayout" name="gridLayout_13">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>9</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>9</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>9</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>9</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing">
|
<item row="0" column="0">
|
||||||
<number>6</number>
|
<widget class="QTabWidget" name="controlTabWidget">
|
||||||
|
<property name="tabPosition">
|
||||||
|
<enum>QTabWidget::South</enum>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
<widget class="QWidget" name="tab">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
<attribute name="title">
|
||||||
<item>
|
<string>光谱仪</string>
|
||||||
<spacer name="horizontalSpacer_16">
|
</attribute>
|
||||||
<property name="orientation">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<enum>Qt::Horizontal</enum>
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
<property name="topMargin">
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="rightMargin">
|
||||||
<size>
|
<number>0</number>
|
||||||
<width>100</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
<property name="bottomMargin">
|
||||||
</item>
|
<number>0</number>
|
||||||
<item>
|
|
||||||
<widget class="QDoubleSlider" name="FramerateSlider">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||||
<item>
|
<item>
|
||||||
@ -511,6 +373,33 @@ QGroupBox:title {
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_16">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSlider" name="FramerateSlider">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||||
<item>
|
<item>
|
||||||
@ -657,13 +546,22 @@ QGroupBox:title {
|
|||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>123</height>
|
<height>594</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="tab_2">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Tab 2</string>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<action name="action_exit">
|
<action name="action_exit">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -918,7 +816,19 @@ QGroupBox:title {
|
|||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ImagerPositionSimulation</class>
|
<class>ImagerPositionSimulation</class>
|
||||||
<extends>QGraphicsView</extends>
|
<extends>QGraphicsView</extends>
|
||||||
<header location="global">imagerpositionsimulation.h</header>
|
<header>imagerpositionsimulation.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>CustomDockWidgetBase</class>
|
||||||
|
<extends>QDockWidget</extends>
|
||||||
|
<header>customdockwidgetbase.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>CustomDockWidgetHideAbove</class>
|
||||||
|
<extends>QDockWidget</extends>
|
||||||
|
<header>CustomDockWidgetBase.h</header>
|
||||||
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
|
|||||||
@ -107,7 +107,9 @@
|
|||||||
<ClCompile Include="aboutWindow.cpp" />
|
<ClCompile Include="aboutWindow.cpp" />
|
||||||
<ClCompile Include="adjustTable.cpp" />
|
<ClCompile Include="adjustTable.cpp" />
|
||||||
<ClCompile Include="CaptureCoordinator.cpp" />
|
<ClCompile Include="CaptureCoordinator.cpp" />
|
||||||
|
<ClCompile Include="Carousel.cpp" />
|
||||||
<ClCompile Include="Corning410Imager.cpp" />
|
<ClCompile Include="Corning410Imager.cpp" />
|
||||||
|
<ClCompile Include="CustomDockWidgetBase.cpp" />
|
||||||
<ClCompile Include="hppaConfigFile.cpp" />
|
<ClCompile Include="hppaConfigFile.cpp" />
|
||||||
<ClCompile Include="ImagerOperationBase.cpp" />
|
<ClCompile Include="ImagerOperationBase.cpp" />
|
||||||
<ClCompile Include="imager_base.cpp" />
|
<ClCompile Include="imager_base.cpp" />
|
||||||
@ -166,6 +168,8 @@
|
|||||||
<QtMoc Include="RobotArmControl.h" />
|
<QtMoc Include="RobotArmControl.h" />
|
||||||
<QtMoc Include="Corning410Imager.h" />
|
<QtMoc Include="Corning410Imager.h" />
|
||||||
<QtMoc Include="CaptureCoordinator.h" />
|
<QtMoc Include="CaptureCoordinator.h" />
|
||||||
|
<QtMoc Include="CustomDockWidgetBase.h" />
|
||||||
|
<QtMoc Include="Carousel.h" />
|
||||||
<ClInclude Include="imager_base.h" />
|
<ClInclude Include="imager_base.h" />
|
||||||
<ClInclude Include="irisximeaimager.h" />
|
<ClInclude Include="irisximeaimager.h" />
|
||||||
<QtMoc Include="OneMotorControl.h" />
|
<QtMoc Include="OneMotorControl.h" />
|
||||||
|
|||||||
@ -133,6 +133,12 @@
|
|||||||
<ClCompile Include="TwoMotorControl.cpp">
|
<ClCompile Include="TwoMotorControl.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="CustomDockWidgetBase.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Carousel.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtMoc Include="fileOperation.h">
|
<QtMoc Include="fileOperation.h">
|
||||||
@ -192,6 +198,12 @@
|
|||||||
<QtMoc Include="CaptureCoordinator.h">
|
<QtMoc Include="CaptureCoordinator.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</QtMoc>
|
</QtMoc>
|
||||||
|
<QtMoc Include="CustomDockWidgetBase.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<QtMoc Include="Carousel.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="imageProcessor.h">
|
<ClInclude Include="imageProcessor.h">
|
||||||
|
|||||||
Reference in New Issue
Block a user