修改界面
This commit is contained in:
480
HPPA/HPPA.cpp
480
HPPA/HPPA.cpp
@ -8,7 +8,7 @@
|
|||||||
#include "ImageReaderWriter.h"
|
#include "ImageReaderWriter.h"
|
||||||
|
|
||||||
|
|
||||||
HPPA::HPPA(QWidget *parent)
|
HPPA::HPPA(QWidget* parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
@ -65,28 +65,115 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
ui.splitter->setStretchFactor(1, 1);
|
ui.splitter->setStretchFactor(1, 1);
|
||||||
ui.splitter->setStretchFactor(2, 3);*/
|
ui.splitter->setStretchFactor(2, 3);*/
|
||||||
|
|
||||||
|
//<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
QWidget* menuWidget = new WidgetWithBackgroundPicture();
|
||||||
|
//menuWidget->setFixedWidth(200);
|
||||||
|
menuWidget->setFixedHeight(66);
|
||||||
|
QHBoxLayout* hLayout_menuWidget = new QHBoxLayout(menuWidget);
|
||||||
|
|
||||||
|
//auto menuBar_tmp = menuBar();
|
||||||
|
auto menuBar_tmp = ui.menuBar;
|
||||||
|
hLayout_menuWidget->addWidget(menuBar_tmp);
|
||||||
|
menuBar_tmp->setAutoFillBackground(false);
|
||||||
|
menuBar_tmp->setStyleSheet(R"(
|
||||||
|
QMenuBar {
|
||||||
|
background: transparent;/*transparent*/
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
QMenuBar::item {
|
||||||
|
background: transparent;
|
||||||
|
color: white; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
||||||
|
padding: 4px 8px;
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
QMenuBar::item:selected {
|
||||||
|
background: rgba(255, 255, 255, 50); /* <20><><EFBFBD><CEA2><EFBFBD><EFBFBD> */
|
||||||
|
}
|
||||||
|
|
||||||
|
QMenu {
|
||||||
|
background-color: #0A1245; /* <20>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
||||||
|
border: 1px solid gray; /* <20><>ѡ<EFBFBD><D1A1><EFBFBD>߿<EFBFBD><DFBF><EFBFBD>ʽ */
|
||||||
|
color: white; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
||||||
|
}
|
||||||
|
QMenu::item:selected {
|
||||||
|
background-color: rgba(255, 255, 255, 50); /* ѡ<><D1A1>ʱ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>ɫ */
|
||||||
|
color: white; /* ѡ<><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>ѡ */
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
|
||||||
|
hLayout_menuWidget->addStretch();
|
||||||
|
QPushButton* closeBtn = new QPushButton(QString::fromLocal8Bit("<EFBFBD>˳<EFBFBD>ƽ̨"));
|
||||||
|
closeBtn->setStyleSheet(R"(
|
||||||
|
QPushButton {
|
||||||
|
background: #002CE0;
|
||||||
|
color: white;
|
||||||
|
font-size: 14px;
|
||||||
|
border: none;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
QPushButton:hover {
|
||||||
|
background: #34495e;
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
hLayout_menuWidget->addWidget(closeBtn);
|
||||||
|
|
||||||
|
QWidget* toolBarWidget = new QWidget();
|
||||||
|
toolBarWidget->setStyleSheet("background-color: #0D1233;");
|
||||||
|
QHBoxLayout* hLayout_toolBarWidget = new QHBoxLayout(toolBarWidget);
|
||||||
|
|
||||||
|
//QToolBar* toolBar = this->findChild<QToolBar*>("mainToolBar");
|
||||||
|
QToolBar* toolBar = ui.mainToolBar;
|
||||||
|
//hLayout_toolBarWidget->addWidget(toolBar);
|
||||||
|
toolBar->setAttribute(Qt::WA_TranslucentBackground, true);
|
||||||
|
toolBar->setAutoFillBackground(false);
|
||||||
|
toolBar->setIconSize(QSize(56, 56));
|
||||||
|
toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||||
//<2F>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QLineEdit
|
//<2F>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QLineEdit
|
||||||
frame_number = new QLineEdit(ui.mainToolBar);
|
frame_number = new QLineEdit(ui.mainToolBar);
|
||||||
frame_number->setStyleSheet("QLineEdit{background-color:rgb(255,255,255);}");
|
frame_number->setStyleSheet("QLineEdit{background-color:rgb(255,255,255);}");
|
||||||
frame_number->setMaximumWidth(100);
|
frame_number->setMaximumWidth(100);
|
||||||
frame_number->setText("5000");
|
frame_number->setText("5000");
|
||||||
QAction *action = ui.mainToolBar->insertWidget(ui.action_start_recording, frame_number);
|
QAction* action = ui.mainToolBar->insertWidget(ui.action_start_recording, frame_number);
|
||||||
|
|
||||||
m_FilenameLineEdit = new QLineEdit(ui.mainToolBar);
|
m_FilenameLineEdit = new QLineEdit(ui.mainToolBar);
|
||||||
m_FilenameLineEdit->setStyleSheet("QLineEdit{background-color:rgb(255,255,255);}");
|
m_FilenameLineEdit->setStyleSheet("QLineEdit{background-color:rgb(255,255,255);}");
|
||||||
m_FilenameLineEdit->setMaximumWidth(100);
|
m_FilenameLineEdit->setMaximumWidth(100);
|
||||||
m_FilenameLineEdit->setText("tmp_image");
|
m_FilenameLineEdit->setText("tmp_image");
|
||||||
QAction *action1 = ui.mainToolBar->insertWidget(ui.action_start_recording, m_FilenameLineEdit);
|
QAction* action1 = ui.mainToolBar->insertWidget(ui.action_start_recording, m_FilenameLineEdit);
|
||||||
|
|
||||||
|
ui.action_connect_imager->setIcon(QIcon(".//icon//all//connect_imager.png"));
|
||||||
|
ui.action_auto_exposure->setIcon(QIcon(".//icon//all//exposure.png"));
|
||||||
|
ui.action_focus->setIcon(QIcon(".//icon//all//focus.png"));
|
||||||
|
ui.action_dark->setIcon(QIcon(".//icon//all//dark.png"));
|
||||||
|
ui.action_reference->setIcon(QIcon(".//icon//all//reference.png"));
|
||||||
|
// ʹ<><CAB9><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
toolBar->setStyleSheet(R"(
|
||||||
|
QToolBar {
|
||||||
|
background: #0D1233;/*transparent*/
|
||||||
|
border: 1px solid #444;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
QToolButton {
|
||||||
|
background: transparent;
|
||||||
|
color: white; /* <20>ɸ<EFBFBD><C9B8>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ */
|
||||||
|
padding: 4px;
|
||||||
|
margin: 0 0 0 6px;
|
||||||
|
}
|
||||||
|
QToolButton:hover {
|
||||||
|
background: rgba(255,255,255,50); /* <20><>ͣʱ<CDA3><CAB1><EFBFBD><CEA2><EFBFBD><EFBFBD> */
|
||||||
|
}
|
||||||
|
)");
|
||||||
|
|
||||||
|
|
||||||
|
QWidget* topWidget = new QWidget();
|
||||||
|
topWidget->setStyleSheet("background-color: #040125;");
|
||||||
|
QVBoxLayout* verticalLayout_topWidget = new QVBoxLayout(topWidget);
|
||||||
|
verticalLayout_topWidget->addWidget(menuWidget);
|
||||||
|
//verticalLayout_topWidget->addWidget(toolBarWidget);
|
||||||
|
setMenuWidget(topWidget);
|
||||||
|
|
||||||
|
|
||||||
/*QToolBar *ptoolbar = ui.mainToolBar;
|
|
||||||
QAction *pAction = new QAction("tangchao");
|
|
||||||
ptoolbar->addAction(pAction);*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -135,35 +222,202 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ģ<EFBFBD><C4A3>
|
//<2F><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ģ<EFBFBD><C4A3>
|
||||||
connect(ui.graphicsView->imager, SIGNAL(leftMouseButtonPressed(int, int)), this, SLOT(onimagerSimulatorMove(int, int)));
|
connect(ui.graphicsView->imager, SIGNAL(leftMouseButtonPressed(int, int)), this, SLOT(onimagerSimulatorMove(int, int)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
ui.ImageViewerTabWidget->clear();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD>棬<EFBFBD><E6A3AC><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>tab
|
|
||||||
//ui.ImageViewerTabWidget->setTabsClosable(true);//<2F><><EFBFBD><EFBFBD>ÿҳ<C3BF><D2B3><EFBFBD><EFBFBD><EFBFBD>йرհ<D8B1>ť
|
|
||||||
connect(ui.ImageViewerTabWidget, SIGNAL(currentChanged(int)), this, SLOT(onTabWidgetCurrentChanged(int)));
|
|
||||||
|
|
||||||
//
|
|
||||||
connect(this->ui.action_about, SIGNAL(triggered()), this, SLOT(onAbout()));
|
|
||||||
|
|
||||||
initPanelToolbar();
|
initPanelToolbar();
|
||||||
|
setDockNestingEnabled(true);
|
||||||
|
connect(this->ui.action_about, SIGNAL(triggered()), this, SLOT(onAbout()));
|
||||||
connect(this->ui.mActionOneMotorScenario, SIGNAL(triggered()), this, SLOT(createOneMotorScenario()));
|
connect(this->ui.mActionOneMotorScenario, SIGNAL(triggered()), this, SLOT(createOneMotorScenario()));
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
delete ui.centralWidget;
|
||||||
QWidget* widget = new QWidget();
|
ui.mDockWidgetRGBCamera->close();
|
||||||
QGridLayout* grid = new QGridLayout(widget);
|
ui.mDockWidgetSimulator->close();
|
||||||
|
ui.mDockWidgetSpectralViewer->close();
|
||||||
|
ui.mDockWidgetSpectrometer->close();
|
||||||
|
|
||||||
m_chartView = new QChartView(ui.mDockWidgetSpectralViewer);
|
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->setRenderHint(QPainter::Antialiasing);
|
||||||
|
m_chartView->setStyleSheet(R"(
|
||||||
|
background: #0D1233;
|
||||||
|
)");
|
||||||
|
//m_chartView->setBackgroundBrush(QColor("#0D1233"));
|
||||||
|
|
||||||
grid->addWidget(m_chartView);
|
m_chart = new QChart();
|
||||||
//grid->setMargin(0);
|
m_chart->setBackgroundBrush(QColor("#0D1233"));
|
||||||
grid->setContentsMargins(0, 0, 0, 0);
|
m_chart->legend()->hide();
|
||||||
//grid->SetMaximumSize(0);
|
//m_chart->setTitle("Simple line chart example");
|
||||||
ui.mDockWidgetSpectralViewer->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
|
|
||||||
ui.mDockWidgetSpectralViewer->setWidget(widget);
|
QValueAxis* axisX = new QValueAxis();
|
||||||
//QLineSeries *series = new QLineSeries();
|
QValueAxis* axisY = new QValueAxis();
|
||||||
//QChart *chart = new QChart();
|
setAxis(axisX, axisY);
|
||||||
mPanelMenu->addAction(ui.mDockWidgetSpectralViewer->toggleViewAction());
|
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();
|
||||||
@ -172,7 +426,6 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
dock_adt->setObjectName("mDockAdjustTable");
|
dock_adt->setObjectName("mDockAdjustTable");
|
||||||
dock_adt->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
dock_adt->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
dock_adt->setWidget(adt);
|
dock_adt->setWidget(adt);
|
||||||
tabifyDockWidget(ui.mDockWidgetSpectrometer, dock_adt);
|
|
||||||
mPanelMenu->addAction(dock_adt->toggleViewAction());
|
mPanelMenu->addAction(dock_adt->toggleViewAction());
|
||||||
|
|
||||||
//<2F><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
//<2F><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>
|
||||||
@ -182,7 +435,6 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
dock_pc->setObjectName("mDockPowerControl");
|
dock_pc->setObjectName("mDockPowerControl");
|
||||||
dock_pc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
dock_pc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
dock_pc->setWidget(pc);
|
dock_pc->setWidget(pc);
|
||||||
tabifyDockWidget(dock_adt, dock_pc);
|
|
||||||
mPanelMenu->addAction(dock_pc->toggleViewAction());
|
mPanelMenu->addAction(dock_pc->toggleViewAction());
|
||||||
|
|
||||||
//<2F><>е<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD>
|
//<2F><>е<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD>
|
||||||
@ -192,7 +444,6 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
dock_rac->setObjectName("mDockRobotArmControl");
|
dock_rac->setObjectName("mDockRobotArmControl");
|
||||||
dock_rac->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
dock_rac->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
dock_rac->setWidget(rac);
|
dock_rac->setWidget(rac);
|
||||||
tabifyDockWidget(dock_adt, dock_rac);
|
|
||||||
mPanelMenu->addAction(dock_rac->toggleViewAction());
|
mPanelMenu->addAction(dock_rac->toggleViewAction());
|
||||||
|
|
||||||
//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
//һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
@ -202,7 +453,6 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
dock_omc->setObjectName("mDockOneMotorControl");
|
dock_omc->setObjectName("mDockOneMotorControl");
|
||||||
dock_omc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
dock_omc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
dock_omc->setWidget(omc);
|
dock_omc->setWidget(omc);
|
||||||
tabifyDockWidget(dock_rac, dock_omc);
|
|
||||||
mPanelMenu->addAction(dock_omc->toggleViewAction());
|
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>
|
||||||
@ -213,9 +463,69 @@ HPPA::HPPA(QWidget *parent)
|
|||||||
dock_tmc->setObjectName("mDockTwoMotorControl");
|
dock_tmc->setObjectName("mDockTwoMotorControl");
|
||||||
dock_tmc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
dock_tmc->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
dock_tmc->setWidget(tmc);
|
dock_tmc->setWidget(tmc);
|
||||||
tabifyDockWidget(dock_omc, dock_tmc);
|
|
||||||
mPanelMenu->addAction(dock_tmc->toggleViewAction());
|
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();
|
createActionGroups();
|
||||||
connect(mImagerGroup, &QActionGroup::triggered, this, &HPPA::selectingImager);
|
connect(mImagerGroup, &QActionGroup::triggered, this, &HPPA::selectingImager);
|
||||||
@ -252,10 +562,10 @@ void HPPA::recordFromRobotArm(int fileCounter)
|
|||||||
|
|
||||||
if (fileCounter - 1 == 0)
|
if (fileCounter - 1 == 0)
|
||||||
{
|
{
|
||||||
ui.ImageViewerTabWidget->clear();
|
m_imageViewerTabWidget->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
onCreateTab(fileCounter-1);
|
onCreateTab(fileCounter - 1);
|
||||||
emit StartRecordSignal();
|
emit StartRecordSignal();
|
||||||
|
|
||||||
ui.action_start_recording->setText(QString::fromLocal8Bit("<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>"));
|
ui.action_start_recording->setText(QString::fromLocal8Bit("<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
@ -474,7 +784,7 @@ void HPPA::onStartRecordStep1()
|
|||||||
|
|
||||||
if (m_RecordState % 2 == 1)
|
if (m_RecordState % 2 == 1)
|
||||||
{
|
{
|
||||||
ui.ImageViewerTabWidget->clear();
|
m_imageViewerTabWidget->clear();
|
||||||
|
|
||||||
onCreateTab(0);
|
onCreateTab(0);
|
||||||
|
|
||||||
@ -501,7 +811,7 @@ void HPPA::onStartRecordStep1()
|
|||||||
|
|
||||||
if (m_RecordState % 2 == 1)
|
if (m_RecordState % 2 == 1)
|
||||||
{
|
{
|
||||||
ui.ImageViewerTabWidget->clear();
|
m_imageViewerTabWidget->clear();
|
||||||
|
|
||||||
onCreateTab(0);
|
onCreateTab(0);
|
||||||
|
|
||||||
@ -530,7 +840,7 @@ void HPPA::onStartRecordStep1()
|
|||||||
|
|
||||||
if (m_RecordState % 2 == 1)
|
if (m_RecordState % 2 == 1)
|
||||||
{
|
{
|
||||||
ui.ImageViewerTabWidget->clear();
|
m_imageViewerTabWidget->clear();
|
||||||
|
|
||||||
m_Imager->setFileName2Save(imgPath);
|
m_Imager->setFileName2Save(imgPath);
|
||||||
m_Imager->setFrameNumber(this->frame_number->text().toInt());
|
m_Imager->setFrameNumber(this->frame_number->text().toInt());
|
||||||
@ -570,16 +880,16 @@ void HPPA::onCreateTab(int trackNumber)
|
|||||||
{
|
{
|
||||||
m_numberOfRecording = trackNumber;
|
m_numberOfRecording = trackNumber;
|
||||||
|
|
||||||
QWidget * tabTmp = new QWidget();
|
QWidget* tabTmp = new QWidget();
|
||||||
|
|
||||||
QGridLayout *GridLayout = new QGridLayout();
|
QGridLayout* GridLayout = new QGridLayout();
|
||||||
GridLayout->addWidget(new ImageViewer(tabTmp));
|
GridLayout->addWidget(new ImageViewer(tabTmp));
|
||||||
|
|
||||||
tabTmp->setLayout(GridLayout);
|
tabTmp->setLayout(GridLayout);
|
||||||
|
|
||||||
ui.ImageViewerTabWidget->addTab(tabTmp, QString::number(trackNumber + 1));
|
m_imageViewerTabWidget->addTab(tabTmp, QString::number(trackNumber + 1));
|
||||||
|
|
||||||
ui.ImageViewerTabWidget->setCurrentIndex(trackNumber);
|
m_imageViewerTabWidget->setCurrentIndex(trackNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -596,8 +906,8 @@ void HPPA::onTabWidgetCurrentChanged(int index)//
|
|||||||
m_TabWidgetCurrentIndex = index;
|
m_TabWidgetCurrentIndex = index;
|
||||||
|
|
||||||
//<2F><>ȡ<EFBFBD><C8A1>ͼ<EFBFBD>ؼ<EFBFBD>
|
//<2F><>ȡ<EFBFBD><C8A1>ͼ<EFBFBD>ؼ<EFBFBD>
|
||||||
QWidget* currentWidget = ui.ImageViewerTabWidget->widget(index);
|
QWidget* currentWidget = m_imageViewerTabWidget->widget(index);
|
||||||
QList<ImageViewer *> currentImageViewer = currentWidget->findChildren<ImageViewer *>();
|
QList<ImageViewer*> currentImageViewer = currentWidget->findChildren<ImageViewer*>();
|
||||||
|
|
||||||
//<2F><>disconnectȻ<74><C8BB><EFBFBD><EFBFBD>connect<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>л<EFBFBD>һ<EFBFBD>ζ<EFBFBD><CEB6><EFBFBD>connectһ<74>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD>ۻ<EFBFBD>connect<63>ܶ<EFBFBD><DCB6>Σ<EFBFBD>
|
//<2F><>disconnectȻ<74><C8BB><EFBFBD><EFBFBD>connect<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>л<EFBFBD>һ<EFBFBD>ζ<EFBFBD><CEB6><EFBFBD>connectһ<74>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD>ۻ<EFBFBD>connect<63>ܶ<EFBFBD><DCB6>Σ<EFBFBD>
|
||||||
disconnect(currentImageViewer[0], SIGNAL(leftMouseButtonPressed(int, int)), this, SLOT(onLeftMouseButtonPressed(int, int)));
|
disconnect(currentImageViewer[0], SIGNAL(leftMouseButtonPressed(int, int)), this, SLOT(onLeftMouseButtonPressed(int, int)));
|
||||||
@ -606,7 +916,7 @@ void HPPA::onTabWidgetCurrentChanged(int index)//
|
|||||||
|
|
||||||
void HPPA::onActionOpenDirectory()
|
void HPPA::onActionOpenDirectory()
|
||||||
{
|
{
|
||||||
FileOperation * fileOperation = new FileOperation();
|
FileOperation* fileOperation = new FileOperation();
|
||||||
string directory = fileOperation->getDirectoryFromString();
|
string directory = fileOperation->getDirectoryFromString();
|
||||||
|
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(directory)));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(directory)));
|
||||||
@ -697,11 +1007,11 @@ void HPPA::onLeftMouseButtonPressed(int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
FileOperation * fileOperation = new FileOperation();
|
FileOperation* fileOperation = new FileOperation();
|
||||||
string directory = fileOperation->getDirectoryFromString();
|
string directory = fileOperation->getDirectoryFromString();
|
||||||
string imgPath = directory + "\\" + m_FilenameLineEdit->text().toStdString() + "_" + std::to_string(m_TabWidgetCurrentIndex) + ".bil";
|
string imgPath = directory + "\\" + m_FilenameLineEdit->text().toStdString() + "_" + std::to_string(m_TabWidgetCurrentIndex) + ".bil";
|
||||||
|
|
||||||
ImageReaderWriter *ImageReader = new ImageReaderWriter(imgPath.c_str());
|
ImageReaderWriter* ImageReader = new ImageReaderWriter(imgPath.c_str());
|
||||||
|
|
||||||
|
|
||||||
if (x < 0 || x>ImageReader->getXCount() || y<0 || y>ImageReader->getyCount() - 1)
|
if (x < 0 || x>ImageReader->getXCount() || y<0 || y>ImageReader->getyCount() - 1)
|
||||||
@ -710,10 +1020,10 @@ void HPPA::onLeftMouseButtonPressed(int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float *data = ImageReader->ReadImage(x, y, 1, 1);
|
float* data = ImageReader->ReadImage(x, y, 1, 1);
|
||||||
|
|
||||||
|
|
||||||
QLineSeries *series = new QLineSeries();
|
QLineSeries* series = new QLineSeries();
|
||||||
//series->clear();//////////////////////////////
|
//series->clear();//////////////////////////////
|
||||||
|
|
||||||
QString imagerSelected = mImagerGroup->checkedAction()->objectName();
|
QString imagerSelected = mImagerGroup->checkedAction()->objectName();
|
||||||
@ -751,18 +1061,16 @@ void HPPA::onLeftMouseButtonPressed(int x, int y)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
series->setPen(QPen(QColor("#FF928A"), 2));
|
||||||
|
|
||||||
|
m_chart->removeAllSeries();
|
||||||
|
m_chart->addSeries(series);
|
||||||
|
m_chart->createDefaultAxes();
|
||||||
|
|
||||||
|
QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axisX());
|
||||||
|
QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axisY());
|
||||||
|
|
||||||
QChart *chart = new QChart();
|
setAxis(axisX, axisY);
|
||||||
chart->legend()->hide();
|
|
||||||
chart->addSeries(series);
|
|
||||||
chart->createDefaultAxes();
|
|
||||||
//chart->setTitle("Simple line chart example");
|
|
||||||
|
|
||||||
m_chartView->setChart(chart);
|
|
||||||
//m_chartView->update();//////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
/*std::cout << "x<><78><EFBFBD><EFBFBD>:" << x << std::endl;
|
/*std::cout << "x<><78><EFBFBD><EFBFBD>:" << x << std::endl;
|
||||||
std::cout << "y<><79><EFBFBD><EFBFBD>:" << y << std::endl;
|
std::cout << "y<><79><EFBFBD><EFBFBD>:" << y << std::endl;
|
||||||
@ -776,7 +1084,31 @@ void HPPA::onLeftMouseButtonPressed(int x, int y)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HPPA::timerEvent(QTimerEvent *event)
|
void HPPA::setAxis(QValueAxis* axisX, QValueAxis* axisY)
|
||||||
|
{
|
||||||
|
if (axisX && axisY)
|
||||||
|
{
|
||||||
|
QPen axisPen(QColor("#ACCDFF"));
|
||||||
|
axisPen.setWidth(1);
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
||||||
|
axisX->setLinePen(axisPen);
|
||||||
|
axisY->setLinePen(axisPen);
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǩ<EFBFBD><C7A9>ɫ
|
||||||
|
axisX->setLabelsColor(QColor("#ACCDFF"));
|
||||||
|
axisY->setLabelsColor(QColor("#ACCDFF"));
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
|
||||||
|
QPen gridPen(QColor("#262A4C"));
|
||||||
|
gridPen.setStyle(Qt::DashLine);
|
||||||
|
gridPen.setWidth(2);
|
||||||
|
axisX->setGridLinePen(gridPen);
|
||||||
|
axisY->setGridLinePen(gridPen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HPPA::timerEvent(QTimerEvent* event)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1031,17 +1363,17 @@ void HPPA::onFocus2(int command)
|
|||||||
if (command == 1)
|
if (command == 1)
|
||||||
{
|
{
|
||||||
//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
||||||
QWidget * tabTmp = new QWidget();
|
QWidget* tabTmp = new QWidget();
|
||||||
|
|
||||||
QGridLayout *GridLayout = new QGridLayout();
|
QGridLayout* GridLayout = new QGridLayout();
|
||||||
GridLayout->addWidget(new ImageViewer(tabTmp));
|
GridLayout->addWidget(new ImageViewer(tabTmp));
|
||||||
|
|
||||||
tabTmp->setLayout(GridLayout);
|
tabTmp->setLayout(GridLayout);
|
||||||
|
|
||||||
ui.ImageViewerTabWidget->addTab(tabTmp, QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
m_imageViewerTabWidget->addTab(tabTmp, QString::fromLocal8Bit("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
||||||
|
|
||||||
//ui.ImageViewerTabWidget->setCurrentIndex(trackNumber);
|
//m_imageViewerTabWidget->setCurrentIndex(trackNumber);
|
||||||
ui.ImageViewerTabWidget->setCurrentWidget(tabTmp);
|
m_imageViewerTabWidget->setCurrentWidget(tabTmp);
|
||||||
|
|
||||||
|
|
||||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
||||||
@ -1132,8 +1464,8 @@ void HPPA::onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber)
|
|||||||
|
|
||||||
//return;
|
//return;
|
||||||
//<2F><>ȡ<EFBFBD><C8A1>ͼ<EFBFBD>ؼ<EFBFBD>
|
//<2F><>ȡ<EFBFBD><C8A1>ͼ<EFBFBD>ؼ<EFBFBD>
|
||||||
QWidget* currentWidget = ui.ImageViewerTabWidget->widget(fileNumber);
|
QWidget* currentWidget = m_imageViewerTabWidget->widget(fileNumber);
|
||||||
QList<ImageViewer *> currentImageViewer = currentWidget->findChildren<ImageViewer *>();
|
QList<ImageViewer*> currentImageViewer = currentWidget->findChildren<ImageViewer*>();
|
||||||
currentImageViewer[0]->DisplayFrameNumber(m_Imager->getFrameCounter());//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ѿ<EFBFBD><D1BE>ɼ<EFBFBD><C9BC><EFBFBD>֡<EFBFBD><D6A1>
|
currentImageViewer[0]->DisplayFrameNumber(m_Imager->getFrameCounter());//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ѿ<EFBFBD><D1BE>ɼ<EFBFBD><C9BC><EFBFBD>֡<EFBFBD><D6A1>
|
||||||
|
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD><CABE>ͼ<EFBFBD><CDBC>--opencv<63>汾
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD><CABE>ͼ<EFBFBD><CDBC>--opencv<63>汾
|
||||||
@ -1167,8 +1499,8 @@ void HPPA::PlotSpectral(int state)
|
|||||||
if (state == 1)
|
if (state == 1)
|
||||||
{
|
{
|
||||||
//<2F><>ʾӰ<CABE><D3B0>
|
//<2F><>ʾӰ<CABE><D3B0>
|
||||||
QWidget* currentWidget = ui.ImageViewerTabWidget->currentWidget();
|
QWidget* currentWidget = m_imageViewerTabWidget->currentWidget();
|
||||||
QList<ImageViewer *> currentImageViewer = currentWidget->findChildren<ImageViewer *>();
|
QList<ImageViewer*> currentImageViewer = currentWidget->findChildren<ImageViewer*>();
|
||||||
currentImageViewer[0]->DisplayFrameNumber(m_Imager->getFocusFrameCounter());//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ѿ<EFBFBD><D1BE>ɼ<EFBFBD><C9BC><EFBFBD>֡<EFBFBD><D6A1>
|
currentImageViewer[0]->DisplayFrameNumber(m_Imager->getFocusFrameCounter());//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD>Ѿ<EFBFBD><D1BE>ɼ<EFBFBD><C9BC><EFBFBD>֡<EFBFBD><D6A1>
|
||||||
|
|
||||||
ImageProcessor imageProcessor;
|
ImageProcessor imageProcessor;
|
||||||
@ -1179,7 +1511,7 @@ void HPPA::PlotSpectral(int state)
|
|||||||
currentImageViewer[0]->SetImage(&QPixmap::fromImage(m_Imager->getQImageFocusGrayImage()));//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
currentImageViewer[0]->SetImage(&QPixmap::fromImage(m_Imager->getQImageFocusGrayImage()));//<2F><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
||||||
|
|
||||||
//<2F><><EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD>
|
//<2F><><EFBFBD>ƹ<EFBFBD><C6B9><EFBFBD>
|
||||||
QLineSeries *series = new QLineSeries();
|
QLineSeries* series = new QLineSeries();
|
||||||
//series->clear();//////////////////////////////
|
//series->clear();//////////////////////////////
|
||||||
int sampleCount = m_Imager->getSampleCount();
|
int sampleCount = m_Imager->getSampleCount();
|
||||||
for (size_t i = 0; i < sampleCount; i++)
|
for (size_t i = 0; i < sampleCount; i++)
|
||||||
@ -1190,7 +1522,7 @@ void HPPA::PlotSpectral(int state)
|
|||||||
series->append(i, m_Imager->buffer[1368 * 150 + i]);
|
series->append(i, m_Imager->buffer[1368 * 150 + i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
QChart *chart = new QChart();
|
QChart* chart = new QChart();
|
||||||
chart->legend()->hide();
|
chart->legend()->hide();
|
||||||
chart->addSeries(series);
|
chart->addSeries(series);
|
||||||
chart->createDefaultAxes();
|
chart->createDefaultAxes();
|
||||||
@ -1206,7 +1538,7 @@ void HPPA::PlotSpectral(int state)
|
|||||||
|
|
||||||
|
|
||||||
////<2F><>ʾӰ<CABE><D3B0>
|
////<2F><>ʾӰ<CABE><D3B0>
|
||||||
//QWidget* currentWidget = ui.ImageViewerTabWidget->currentWidget();
|
//QWidget* currentWidget = m_imageViewerTabWidget->currentWidget();
|
||||||
//QList<ImageViewer *> currentImageViewer = currentWidget->findChildren<ImageViewer *>();
|
//QList<ImageViewer *> currentImageViewer = currentWidget->findChildren<ImageViewer *>();
|
||||||
//
|
//
|
||||||
|
|
||||||
@ -1288,7 +1620,7 @@ void HPPA::onsequenceComplete()
|
|||||||
m_RecordState++;
|
m_RecordState++;
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkerThread3::WorkerThread3(CFocusMotorControl * ctrlFocusMotor)
|
WorkerThread3::WorkerThread3(CFocusMotorControl* ctrlFocusMotor)
|
||||||
{
|
{
|
||||||
m_ctrlFocusMotor = ctrlFocusMotor;
|
m_ctrlFocusMotor = ctrlFocusMotor;
|
||||||
}
|
}
|
||||||
|
|||||||
29
HPPA/HPPA.h
29
HPPA/HPPA.h
@ -12,6 +12,7 @@
|
|||||||
#include <QLineSeries>
|
#include <QLineSeries>
|
||||||
#include <QChart>
|
#include <QChart>
|
||||||
#include <QChartView>
|
#include <QChartView>
|
||||||
|
#include <QValueAxis>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
@ -123,6 +124,31 @@ signals:
|
|||||||
void threadSignal(QString s);
|
void threadSignal(QString s);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class WidgetWithBackgroundPicture : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit WidgetWithBackgroundPicture(QWidget* parent = nullptr)
|
||||||
|
: QWidget(parent),
|
||||||
|
m_pixmap(".//icon//titile_bar_bgp.png") // ʹ<><CAB9><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
|
||||||
|
{
|
||||||
|
// <20><>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>ʼ<EFBFBD><CABC>С
|
||||||
|
resize(800, 600);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void paintEvent(QPaintEvent* event) override
|
||||||
|
{
|
||||||
|
QPainter painter(this);
|
||||||
|
QPixmap scaled = m_pixmap.scaled(size(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
|
||||||
|
painter.drawPixmap(rect(), scaled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPixmap m_pixmap;
|
||||||
|
};
|
||||||
|
|
||||||
class HPPA : public QMainWindow
|
class HPPA : public QMainWindow
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -137,6 +163,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::HPPAClass ui;
|
Ui::HPPAClass ui;
|
||||||
|
QTabWidget* m_imageViewerTabWidget;
|
||||||
|
|
||||||
QMenu* mPanelMenu = nullptr;
|
QMenu* mPanelMenu = nullptr;
|
||||||
QMenu* mToolbarMenu = nullptr;
|
QMenu* mToolbarMenu = nullptr;
|
||||||
@ -160,6 +187,7 @@ private:
|
|||||||
FileOperation * m_FileOperation;
|
FileOperation * m_FileOperation;
|
||||||
|
|
||||||
QChartView * m_chartView;
|
QChartView * m_chartView;
|
||||||
|
QChart* m_chart;
|
||||||
|
|
||||||
//QLineSeries *series;
|
//QLineSeries *series;
|
||||||
//QChart *chart;
|
//QChart *chart;
|
||||||
@ -228,6 +256,7 @@ public Q_SLOTS:
|
|||||||
void OnGainSliderChanged(double Gain);//
|
void OnGainSliderChanged(double Gain);//
|
||||||
|
|
||||||
void onLeftMouseButtonPressed(int x, int y);//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
void onLeftMouseButtonPressed(int x, int y);//<2F><><EFBFBD><EFBFBD>Ӱ<EFBFBD><D3B0><EFBFBD><EFBFBD>Ԫ<EFBFBD><D4AA>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
||||||
|
void setAxis(QValueAxis* axisX, QValueAxis* axisY);
|
||||||
|
|
||||||
|
|
||||||
void timerEvent(QTimerEvent *event);
|
void timerEvent(QTimerEvent *event);
|
||||||
|
|||||||
74
HPPA/HPPA.ui
74
HPPA/HPPA.ui
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1194</width>
|
<width>1486</width>
|
||||||
<height>834</height>
|
<height>899</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -37,46 +37,6 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QTabWidget" name="ImageViewerTabWidget">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>5</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="currentIndex">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="tab_4">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Tab 1</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
|
||||||
<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 class="QWidget" name="tab_5">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Tab 2</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menuBar">
|
<widget class="QMenuBar" name="menuBar">
|
||||||
@ -84,7 +44,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1194</width>
|
<width>1486</width>
|
||||||
<height>30</height>
|
<height>30</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -275,12 +235,7 @@ QToolBar QToolButton:hover {
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QDockWidget" name="mDockWidgetRGBCamera">
|
<widget class="QDockWidget" name="mDockWidgetRGBCamera">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">/* 标题设置 */
|
<string notr="true"/>
|
||||||
QDockWidget::title {
|
|
||||||
text-align: left;
|
|
||||||
background-color: rgb(240, 240, 240);
|
|
||||||
/*padding-left: 35px;*/
|
|
||||||
}</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>RGB 相机</string>
|
<string>RGB 相机</string>
|
||||||
@ -380,12 +335,7 @@ QGroupBox:title {
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QDockWidget" name="mDockWidgetSimulator">
|
<widget class="QDockWidget" name="mDockWidgetSimulator">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">/* 标题设置 */
|
<string notr="true"/>
|
||||||
QDockWidget::title {
|
|
||||||
text-align: left;
|
|
||||||
background-color: rgb(240, 240, 240);
|
|
||||||
/*padding-left: 35px;*/
|
|
||||||
}</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="features">
|
<property name="features">
|
||||||
<set>QDockWidget::AllDockWidgetFeatures</set>
|
<set>QDockWidget::AllDockWidgetFeatures</set>
|
||||||
@ -434,12 +384,7 @@ QDockWidget::title {
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QDockWidget" name="mDockWidgetSpectralViewer">
|
<widget class="QDockWidget" name="mDockWidgetSpectralViewer">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">/* 标题设置 */
|
<string notr="true"/>
|
||||||
QDockWidget::title {
|
|
||||||
text-align: left;
|
|
||||||
background-color: rgb(240, 240, 240);
|
|
||||||
/*padding-left: 35px;*/
|
|
||||||
}</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>光谱曲线</string>
|
<string>光谱曲线</string>
|
||||||
@ -469,12 +414,7 @@ QDockWidget::title {
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QDockWidget" name="mDockWidgetSpectrometer">
|
<widget class="QDockWidget" name="mDockWidgetSpectrometer">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">/* 标题设置 */
|
<string notr="true"/>
|
||||||
QDockWidget::title {
|
|
||||||
text-align: left;
|
|
||||||
background-color: rgb(240, 240, 240);
|
|
||||||
/*padding-left: 35px;*/
|
|
||||||
}</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>光谱仪</string>
|
<string>光谱仪</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user