Compare commits
12 Commits
30fa211a22
...
3.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e119fbf91 | |||
| e3f882d77b | |||
| dac922eb29 | |||
| ae07b9c19e | |||
| 2cf86df608 | |||
| d358989579 | |||
| 0fb81ab3e8 | |||
| 8bbe402a63 | |||
| b23aedc6c7 | |||
| 06dffddfd0 | |||
| ca10848750 | |||
| 4af1187b7d |
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@ HPPA类图.drawio
|
||||
HPPA - 副本.ui
|
||||
icon
|
||||
ignore_*
|
||||
resources
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
28
HPPA/AspectRatioLabel.cpp
Normal file
28
HPPA/AspectRatioLabel.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include "stdafx.h"
|
||||
#include "AspectRatioLabel.h"
|
||||
|
||||
AspectRatioLabel::AspectRatioLabel(QWidget* parent)
|
||||
: QLabel(parent)
|
||||
{
|
||||
setAlignment(Qt::AlignCenter);
|
||||
}
|
||||
|
||||
void AspectRatioLabel::setOriginalPixmap(const QPixmap& pixmap)
|
||||
{
|
||||
m_originalPixmap = pixmap;
|
||||
updateScaledPixmap();
|
||||
}
|
||||
|
||||
void AspectRatioLabel::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
QLabel::resizeEvent(event);
|
||||
updateScaledPixmap();
|
||||
}
|
||||
|
||||
void AspectRatioLabel::updateScaledPixmap()
|
||||
{
|
||||
if (m_originalPixmap.isNull())
|
||||
return;
|
||||
|
||||
setPixmap(m_originalPixmap.scaled(size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
}
|
||||
22
HPPA/AspectRatioLabel.h
Normal file
22
HPPA/AspectRatioLabel.h
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPixmap>
|
||||
#include <QResizeEvent>
|
||||
|
||||
class AspectRatioLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AspectRatioLabel(QWidget* parent = nullptr);
|
||||
|
||||
void setOriginalPixmap(const QPixmap& pixmap);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
|
||||
private:
|
||||
void updateScaledPixmap();
|
||||
QPixmap m_originalPixmap;
|
||||
};
|
||||
@ -126,10 +126,27 @@ void MyCarousel::contextMenuEvent(QContextMenuEvent* event)
|
||||
void MyCarousel::showContextMenu(const QPoint& pos)
|
||||
{
|
||||
QMenu menu(this);
|
||||
menu.setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #2a5dec;
|
||||
color: white;
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: #1a4ddc;
|
||||
}
|
||||
QMenu::separator {
|
||||
height: 1px;
|
||||
background: white;
|
||||
}
|
||||
)");
|
||||
|
||||
QAction* startAct = menu.addAction(QString::fromLocal8Bit("开始轮播"));
|
||||
QAction* stopAct = menu.addAction(QString::fromLocal8Bit("停止轮播"));
|
||||
|
||||
menu.addSeparator();
|
||||
QAction* incAct = menu.addAction("+1");
|
||||
QAction* decAct = menu.addAction("-1");
|
||||
|
||||
if (!m_isLocked)
|
||||
startAct->setEnabled(false);
|
||||
|
||||
@ -142,6 +159,15 @@ void MyCarousel::showContextMenu(const QPoint& pos)
|
||||
startAutoPlay();
|
||||
else if (act == stopAct)
|
||||
stopAutoPlay();
|
||||
else if (act == incAct) {
|
||||
m_playInterval += 1000;
|
||||
m_autoPlayerTimer->setInterval(m_playInterval);
|
||||
}
|
||||
else if (act == decAct) {
|
||||
if (m_playInterval > 1)
|
||||
m_playInterval -= 1000;
|
||||
m_autoPlayerTimer->setInterval(m_playInterval);
|
||||
}
|
||||
}
|
||||
|
||||
void MyCarousel::startAutoPlay()
|
||||
|
||||
@ -6,269 +6,616 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>632</width>
|
||||
<height>444</height>
|
||||
<width>557</width>
|
||||
<height>432</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>调焦</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="HPPA.qrc">
|
||||
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLineEdit {
|
||||
background-color: #142D7F;
|
||||
color: #e6eeff;
|
||||
border: 1px solid #2f6bff;
|
||||
border-radius: 6px;
|
||||
padding: 4px 8px;
|
||||
min-width: 70px;
|
||||
min-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
QGroupBox
|
||||
{
|
||||
border: 12px solid transparent;
|
||||
/*border-top: 12px solid transparent;
|
||||
border-right: 0px solid transparent;
|
||||
border-bottom: 0px solid transparent;
|
||||
border-left: 0px solid transparent;*/
|
||||
color: #ACCDFF;
|
||||
}
|
||||
|
||||
QPushButton
|
||||
{
|
||||
/*width: 172px;
|
||||
height: 56px;*/
|
||||
font: 10pt "新宋体";
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0.5, y1:0, x2:0.5, y2:1,
|
||||
stop:0 #283D86,
|
||||
stop:1 #0F1A40
|
||||
);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
QPushButton:hover
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #3A4875,
|
||||
stop:1 #5F6B91
|
||||
);
|
||||
}
|
||||
/* 按下时的效果 */
|
||||
QPushButton:pressed
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #1A254F,
|
||||
stop:1 #3A466B
|
||||
);
|
||||
/* 可选:添加下压效果 */
|
||||
padding-top: 9px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
QLabel {
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
QSlider::groove:horizontal {
|
||||
height: 10px;
|
||||
background: #1e2a44;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 已滑过:渐变蓝 */
|
||||
QSlider::sub-page:horizontal {
|
||||
background: qlineargradient(
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #1f4fff,
|
||||
stop:0.5 #2f6bff,
|
||||
stop:1 #5fa0ff
|
||||
);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 未滑过 */
|
||||
QSlider::add-page:horizontal {
|
||||
height: 10px;
|
||||
background: #2a3550;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* ===== 滑块按钮 ===== */
|
||||
QSlider::handle:horizontal {
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
|
||||
/* 蓝色实心 */
|
||||
background: #2f6bff;
|
||||
|
||||
/* 白色外圈 */
|
||||
border: 2px solid #ffffff;
|
||||
border-radius: 5px;
|
||||
|
||||
/* 垂直居中 */
|
||||
margin: -5px 0;
|
||||
}
|
||||
|
||||
/* 悬停 */
|
||||
QSlider::handle:horizontal:hover {
|
||||
background: #4d8dff;
|
||||
}
|
||||
|
||||
/* 按下 */
|
||||
QSlider::handle:horizontal:pressed {
|
||||
background: #1f4fff;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="connectFocusModule_groupBox">
|
||||
<property name="title">
|
||||
<string>连接调焦模块</string>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<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>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QWidget" name="contentWidget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #contentWidget
|
||||
{
|
||||
background: #040125;
|
||||
/*border-radius: 8px 8px 8px 8px;*/
|
||||
border: 1px solid #2f6bff;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<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>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>线性平台</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="motorPort_comboBox"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="ultrasound_radioButton">
|
||||
<property name="text">
|
||||
<string>超声</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="ultrasoundPort_comboBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="is_new_version_radioButton">
|
||||
<property name="text">
|
||||
<string>新版</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="connectMotor_btn">
|
||||
<property name="text">
|
||||
<string>连接线性平台</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGroupBox" name="controlFocus_groupBox">
|
||||
<property name="title">
|
||||
<string>调焦</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>采样率</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="sample_ratio_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>20</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QProgressBar" name="autoFocusProgress_progressBar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="autoFocus_btn">
|
||||
<property name="text">
|
||||
<string>自动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>171</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="manualFocus_btn">
|
||||
<property name="text">
|
||||
<string>手动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="controlMotor_groupBox">
|
||||
<property name="title">
|
||||
<string>调整线性平台</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="updateCurrentLocation_btn">
|
||||
<widget class="QWidget" name="titlebarWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>更新实时位置</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="currentLocation_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>null</string>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #titlebarWidget
|
||||
{
|
||||
background: #0E1C4C;
|
||||
border: 1px solid #2f6bff;
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>505</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="closeBtn">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="HPPA.qrc">
|
||||
<normaloff>:/svg/resources/icons/svg/close.svg</normaloff>:/svg/resources/icons/svg/close.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="moveto_btn">
|
||||
<property name="text">
|
||||
<string>移动至</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="move2_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="add_btn">
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="addStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="subtract_btn">
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="subtractStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="logicZero_btn">
|
||||
<property name="text">
|
||||
<string>LogicZero</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="max_btn">
|
||||
<property name="text">
|
||||
<string>max</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="rangeMeasurement_btn">
|
||||
<property name="text">
|
||||
<string>量程测量</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QWidget" name="connectFocusModule_widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #connectFocusModule_widget
|
||||
{
|
||||
background: #121945;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
QRadioButton
|
||||
{
|
||||
color: #E2EDFF;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>连接调焦模块</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>线性平台</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="motorPort_comboBox"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="ultrasound_radioButton">
|
||||
<property name="text">
|
||||
<string>超声</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="ultrasoundPort_comboBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QRadioButton" name="is_new_version_radioButton">
|
||||
<property name="text">
|
||||
<string>新版</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>107</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="connectMotor_btn">
|
||||
<property name="text">
|
||||
<string>连接线性平台</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QWidget" name="controlMotor_widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #controlMotor_widget
|
||||
{
|
||||
background: #121945;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="moveto_btn">
|
||||
<property name="text">
|
||||
<string>移动至</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="logicZero_btn">
|
||||
<property name="text">
|
||||
<string>LogicZero</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="move2_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="add_btn">
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="subtractStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="updateCurrentLocation_btn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>更新实时位置</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="addStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="rangeMeasurement_btn">
|
||||
<property name="text">
|
||||
<string>量程测量</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="currentLocation_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>null</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="subtract_btn">
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="max_btn">
|
||||
<property name="text">
|
||||
<string>max</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>调整线性平台</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="controlFocus_widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #controlFocus_widget
|
||||
{
|
||||
background: #121945;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>采样率</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="sample_ratio_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>20</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QProgressBar" name="autoFocusProgress_progressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QProgressBar {
|
||||
border: 2px solid #08FACE; /* 边框颜色和宽度 */
|
||||
border-radius: 8px; /* 圆角 */
|
||||
background-color: #eee; /* 未完成部分颜色 */
|
||||
text-align: center; /* 百分比文本居中 */
|
||||
height: 13px; /* 高度 */
|
||||
}
|
||||
|
||||
QProgressBar::chunk {
|
||||
background-color: #08FACE; /* 渐变色进度块 */
|
||||
border-radius: 8px; /* 保持和整体圆角一致 */
|
||||
}</string>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="autoFocus_btn">
|
||||
<property name="text">
|
||||
<string>自动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>171</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="manualFocus_btn">
|
||||
<property name="text">
|
||||
<string>手动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
570
HPPA/HPPA.cpp
570
HPPA/HPPA.cpp
@ -31,6 +31,8 @@ HPPA::HPPA(QWidget* parent)
|
||||
s_instance = this;
|
||||
ui.setupUi(this);
|
||||
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
|
||||
// register MapLayer* metatype for queued signal/slot across threads
|
||||
qRegisterMetaType<MapLayer*>("MapLayer*");
|
||||
|
||||
@ -80,6 +82,8 @@ HPPA::HPPA(QWidget* parent)
|
||||
//ui.statusBar->addPermanentWidget(xmotor_state_label1);
|
||||
//ui.statusBar->addPermanentWidget(ymotor_state_label1);
|
||||
|
||||
m_recordFrameCounter = new recordFrameCounter(this);
|
||||
ui.statusBar->addWidget(m_recordFrameCounter);
|
||||
|
||||
connect(this->ui.action_exit, SIGNAL(triggered()), this, SLOT(onExit()));
|
||||
connect(this->ui.mActionOpenImg, SIGNAL(triggered()), this, SLOT(onOpenImg()));
|
||||
@ -91,27 +95,6 @@ HPPA::HPPA(QWidget* parent)
|
||||
ui.splitter->setStretchFactor(2, 3);*/
|
||||
|
||||
initMenubarToolbar();
|
||||
|
||||
//光谱仪操作
|
||||
m_Imager = nullptr;
|
||||
m_RecordState = 0;
|
||||
connect(this->ui.action_connect_imager, SIGNAL(triggered()), this, SLOT(onconnect()));//信号与槽:连接相机,相机操作相关信号与槽绑定放在函数onconnect中
|
||||
|
||||
//设置相机可用帧率范围:这些设置必须在slider的信号和槽连接connect前,否则setMinimum会改变slider的值
|
||||
ui.FramerateSlider->setMinimum(1);
|
||||
ui.FramerateSlider->setMaximum(250);
|
||||
ui.GainSlider->setMinimum(0);
|
||||
ui.GainSlider->setMaximum(24);
|
||||
//相机参数控件设置为不可用
|
||||
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);
|
||||
|
||||
@ -165,63 +148,13 @@ HPPA::HPPA(QWidget* parent)
|
||||
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());
|
||||
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);
|
||||
|
||||
//2、没用,仅仅使用QTreeWidget实现的简略ui
|
||||
QTreeWidget* treeWidget = new QTreeWidget();
|
||||
treeWidget->setColumnCount(1);
|
||||
treeWidget->setIndentation(18);
|
||||
treeWidget->setRootIsDecorated(true);
|
||||
treeWidget->header()->hide();
|
||||
treeWidget->setStyleSheet(R"(
|
||||
QTreeWidget
|
||||
{
|
||||
color: #ACCDFF;
|
||||
}
|
||||
QTreeWidget::branch {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
QTreeWidget::branch:has-children:!has-siblings:closed,
|
||||
QTreeWidget::branch:closed:has-children:has-siblings
|
||||
{
|
||||
border-image: none;
|
||||
image: url(D:/cpp_project_vs2022/HPPA/x64/Debug/3DModel/tree_tri_right.svg);
|
||||
}
|
||||
QTreeWidget::branch:open:has-children:!has-siblings,
|
||||
QTreeWidget::branch:open:has-children:has-siblings
|
||||
{
|
||||
border-image: none;
|
||||
image: url(D:/cpp_project_vs2022/HPPA/x64/Debug/3DModel/tree_tri_down.svg);
|
||||
}
|
||||
)");
|
||||
|
||||
//QList<QTreeWidgetItem*> items;
|
||||
//for (int i = 0; i < 3; ++i)
|
||||
// items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("tmp_image_%1").arg(i))));
|
||||
//treeWidget->insertTopLevelItems(0, items);
|
||||
|
||||
QTreeWidgetItem* group1 = new QTreeWidgetItem(treeWidget);
|
||||
group1->setText(0, "Raster");
|
||||
group1->setExpanded(true); // 默认展开
|
||||
|
||||
QTreeWidgetItem* group2 = new QTreeWidgetItem(treeWidget);
|
||||
group2->setText(0, "Vector");
|
||||
group2->setExpanded(true);
|
||||
|
||||
QTreeWidgetItem* layerA = new QTreeWidgetItem(group1);
|
||||
layerA->setText(0, "tmp_image_1");
|
||||
|
||||
QTreeWidgetItem* layerB = new QTreeWidgetItem(group1);
|
||||
layerB->setText(0, "tmp_image_2");
|
||||
|
||||
//gridLayout_toc->addWidget(treeWidget, 0, 0, 1, 1);
|
||||
|
||||
//3、正经TOC
|
||||
m_LayerTree = new LayerTree();
|
||||
m_LayerTreeModel = new LayerTreeModel(m_LayerTree, this, true);
|
||||
@ -258,13 +191,13 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
QTreeView::branch:closed:has-children:has-siblings
|
||||
{
|
||||
border-image: none;
|
||||
image: url(D:/cpp_project_vs2022/HPPA/x64/Debug/3DModel/tree_tri_right.svg);
|
||||
image: url(:/svg/resources/icons/svg/tree_tri_right.svg);
|
||||
}
|
||||
QTreeView::branch:open:has-children:!has-siblings,
|
||||
QTreeView::branch:open:has-children:has-siblings
|
||||
{
|
||||
border-image: none;
|
||||
image: url(D:/cpp_project_vs2022/HPPA/x64/Debug/3DModel/tree_tri_down.svg);
|
||||
image: url(:/svg/resources/icons/svg/tree_tri_down.svg);
|
||||
}
|
||||
)");
|
||||
|
||||
@ -274,8 +207,9 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
connect(m_layerTreeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
this, SLOT(onLayerTreeSelectionChanged(QItemSelection,QItemSelection)));
|
||||
|
||||
dock_layers->setWidget(dock_layersWidgetContents);
|
||||
dock_layersWidgetContents->setStyleSheet(qss_DockWidget_contentWidget);
|
||||
dock_layers->setWidget(tmp(dock_layersWidgetContents));
|
||||
|
||||
|
||||
//dock_layers->setMinimumWidth(449);
|
||||
//dock_layers->setMaximumWidth(450);
|
||||
@ -401,11 +335,12 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
}
|
||||
)");
|
||||
|
||||
dock_hyperimgViewer->setWidget(dock_hyperimgViewerWidgetContents);
|
||||
mPanelMenu->addAction(dock_hyperimgViewer->toggleViewAction());
|
||||
QWidget* tmp6 = new QWidget();
|
||||
dock_hyperimgViewer->setTitleBarWidget(tmp6);
|
||||
|
||||
dock_hyperimgViewer->setWidget(tmp(dock_hyperimgViewerWidgetContents));
|
||||
|
||||
//轮播看板
|
||||
m_dock_carousel = new CustomDockWidgetBase(QString::fromLocal8Bit("轮播"), this);
|
||||
m_dock_carousel->setObjectName("mDockCarousel");
|
||||
@ -427,8 +362,8 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
|
||||
border-top-left-radius: 0px;
|
||||
border-top-right-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
}
|
||||
)");
|
||||
QGridLayout* gridLayout_carouselContainer = new QGridLayout(carouselContainer);
|
||||
@ -474,7 +409,7 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
|
||||
gridLayout_carouselContainer->addWidget(m_carousel);
|
||||
|
||||
m_dock_carousel->setWidget(carouselContainer);
|
||||
m_dock_carousel->setWidget(tmp(carouselContainer));
|
||||
|
||||
//控制看板
|
||||
ui.mDockWidgetSpectrometer->setTile(QString::fromLocal8Bit("控制"));
|
||||
@ -482,6 +417,8 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
initControlTabwidget();
|
||||
m_tabManager = new TabManager(ui.controlTabWidget, this);
|
||||
|
||||
ui.mDockWidgetSpectrometer->setWidget(tmp(ui.controlContents));
|
||||
|
||||
//3D模型看板
|
||||
ui.mDockWidgetSimulator->setTile(QString::fromLocal8Bit("3D模型"));
|
||||
//ui.mDockWidgetSimulator->show();
|
||||
@ -517,7 +454,7 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
connect(m_view3DModelManager, SIGNAL(created3DModelPlantPhenotype()), this, SLOT(onCreated3DModelPlantPhenotype()));
|
||||
connect(m_view3DModelManager, SIGNAL(created3DModelOneMotor()), this, SLOT(onCreated3DModelOneMotor()));
|
||||
|
||||
ui.mDockWidgetSimulator->setWidget(modelWidgetContainer);
|
||||
ui.mDockWidgetSimulator->setWidget(tmp(modelWidgetContainer));
|
||||
|
||||
//看板排版
|
||||
splitDockWidget(dock_layers, dock_hyperimgViewer, Qt::Horizontal);
|
||||
@ -566,7 +503,10 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
|
||||
}
|
||||
)");
|
||||
|
||||
|
||||
//光谱仪操作
|
||||
m_Imager = nullptr;
|
||||
m_RecordState = 0;
|
||||
connect(this->ui.action_connect_imager, SIGNAL(triggered()), this, SLOT(onconnect()));//信号与槽:连接相机,相机操作相关信号与槽绑定放在函数onconnect中
|
||||
|
||||
createActionGroups();
|
||||
connect(mImagerGroup, &QActionGroup::triggered, this, &HPPA::selectingImager);
|
||||
@ -635,6 +575,7 @@ void HPPA::initMenubarToolbar()
|
||||
|
||||
hLayout_menuWidget->addStretch();
|
||||
QPushButton* closeBtn = new QPushButton(QString::fromLocal8Bit("退出平台"));
|
||||
connect(closeBtn, SIGNAL(released()), this, SLOT(onExit()));
|
||||
closeBtn->setStyleSheet(R"(
|
||||
QPushButton {
|
||||
background: #002CE0;
|
||||
@ -655,7 +596,7 @@ void HPPA::initMenubarToolbar()
|
||||
|
||||
//QToolBar* toolBar = this->findChild<QToolBar*>("mainToolBar");
|
||||
QToolBar* toolBar = ui.mainToolBar;
|
||||
//hLayout_toolBarWidget->addWidget(toolBar);
|
||||
hLayout_toolBarWidget->addWidget(toolBar);
|
||||
toolBar->setAttribute(Qt::WA_TranslucentBackground, true);
|
||||
toolBar->setAutoFillBackground(false);
|
||||
toolBar->setIconSize(QSize(56, 56));
|
||||
@ -665,24 +606,97 @@ void HPPA::initMenubarToolbar()
|
||||
frame_number->setStyleSheet("QLineEdit{background-color:rgb(255,255,255);}");
|
||||
frame_number->setMaximumWidth(100);
|
||||
frame_number->setText("5000");
|
||||
frame_number->setStyleSheet(R"(
|
||||
QLineEdit {
|
||||
background-color: #142D7F;
|
||||
color: #e6eeff;
|
||||
border: 1px solid #2f6bff;
|
||||
border-radius: 6px;
|
||||
padding: 4px 8px;
|
||||
min-width: 70px;
|
||||
min-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
QLineEdit:hover {
|
||||
border: 1px solid #4d8dff;
|
||||
}
|
||||
|
||||
QLineEdit:focus {
|
||||
border: 1px solid #6aa2ff;
|
||||
background-color: #23345c;
|
||||
}
|
||||
)");
|
||||
QAction* action = ui.mainToolBar->insertWidget(ui.action_start_recording, frame_number);
|
||||
frame_number->setEnabled(false);
|
||||
|
||||
m_FilenameLineEdit = new QLineEdit(ui.mainToolBar);
|
||||
m_FilenameLineEdit->setStyleSheet("QLineEdit{background-color:rgb(255,255,255);}");
|
||||
m_FilenameLineEdit->setMaximumWidth(100);
|
||||
m_FilenameLineEdit->setText("tmp_image");
|
||||
m_FilenameLineEdit->setStyleSheet(R"(
|
||||
QLineEdit {
|
||||
background-color: #142D7F;
|
||||
color: #e6eeff;
|
||||
border: 1px solid #2f6bff;
|
||||
border-radius: 6px;
|
||||
padding: 4px 8px;
|
||||
min-width: 70px;
|
||||
min-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
QLineEdit:hover {
|
||||
border: 1px solid #4d8dff;
|
||||
}
|
||||
|
||||
QLineEdit:focus {
|
||||
border: 1px solid #6aa2ff;
|
||||
background-color: #23345c;
|
||||
}
|
||||
)");
|
||||
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"));
|
||||
QWidget* spacer = new QWidget();
|
||||
spacer->setFixedWidth(10); // 间距大小自己调
|
||||
ui.mainToolBar->insertWidget(action1, spacer);
|
||||
|
||||
|
||||
QAction* sepAction = ui.mainToolBar->insertSeparator(ui.mActionPan);
|
||||
QWidget* sepWidget = ui.mainToolBar->widgetForAction(sepAction);
|
||||
if (sepWidget) {
|
||||
//sepWidget->setFixedWidth(15); // 调整宽度
|
||||
sepWidget->setStyleSheet("background-color: #2C586C;"); // 调整颜色
|
||||
}
|
||||
|
||||
ui.action_connect_imager->setIcon(QIcon(":/svg/resources/icons/svg/connect_imager.svg"));
|
||||
ui.action_auto_exposure->setIcon(QIcon(":/svg/resources/icons/svg/exposure.svg"));
|
||||
ui.action_focus->setIcon(QIcon(":/svg/resources/icons/svg/focus.svg"));
|
||||
ui.action_dark->setIcon(QIcon(":/svg/resources/icons/svg/dark.svg"));
|
||||
ui.action_reference->setIcon(QIcon(":/svg/resources/icons/svg/reference.svg"));
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record.svg"));
|
||||
ui.actionOpenDirectory->setIcon(QIcon(":/svg/resources/icons/svg/openDirectory.svg"));
|
||||
|
||||
ui.mActionPan->setIcon(QIcon(":/svg/resources/icons/svg/pan.svg"));
|
||||
ui.mActionSpectral->setIcon(QIcon(":/svg/resources/icons/svg/spectral.svg"));
|
||||
|
||||
connect(ui.mActionPan, &QAction::toggled, this, [=](bool checked) {
|
||||
if (checked)
|
||||
ui.mActionPan->setIcon(QIcon(":/svg/resources/icons/svg/pan_done.svg"));
|
||||
else
|
||||
ui.mActionPan->setIcon(QIcon(":/svg/resources/icons/svg/pan.svg"));
|
||||
});
|
||||
|
||||
connect(ui.mActionSpectral, &QAction::toggled, this, [=](bool checked) {
|
||||
if (checked)
|
||||
ui.mActionSpectral->setIcon(QIcon(":/svg/resources/icons/svg/spectral_done.svg"));
|
||||
else
|
||||
ui.mActionSpectral->setIcon(QIcon(":/svg/resources/icons/svg/spectral.svg"));
|
||||
});
|
||||
|
||||
// 使用样式表设置透明背景
|
||||
toolBar->setStyleSheet(R"(
|
||||
QToolBar {
|
||||
background: #0D1233;/*transparent*/
|
||||
border: 1px solid #444;
|
||||
border: 1px solid #2C586C;
|
||||
border-radius: 6px;
|
||||
}
|
||||
QToolButton {
|
||||
@ -700,12 +714,34 @@ ui.action_dark->setIcon(QIcon(".//icon//all//dark.png"));
|
||||
topWidget->setStyleSheet("background-color: #040125;");
|
||||
QVBoxLayout* verticalLayout_topWidget = new QVBoxLayout(topWidget);
|
||||
verticalLayout_topWidget->addWidget(menuWidget);
|
||||
//verticalLayout_topWidget->addWidget(toolBarWidget);
|
||||
verticalLayout_topWidget->addWidget(toolBarWidget);
|
||||
setMenuWidget(topWidget);
|
||||
}
|
||||
|
||||
QWidget* HPPA::tmp(QWidget* a)
|
||||
{
|
||||
QWidget* Background = new QWidget(this);
|
||||
Background->setObjectName("Background");
|
||||
QGridLayout* layout_Background = new QGridLayout(Background);
|
||||
layout_Background->setContentsMargins(0, 0, 0, 0);
|
||||
Background->setStyleSheet(R"(
|
||||
QWidget #Background{
|
||||
background: #040125;
|
||||
}
|
||||
)");
|
||||
layout_Background->addWidget(a);
|
||||
|
||||
return Background;
|
||||
}
|
||||
|
||||
void HPPA::initControlTabwidget()
|
||||
{
|
||||
m_hic = new HyperImagerControl();
|
||||
//ui.controlTabWidget->addTab(m_hic, QString::fromLocal8Bit("光谱仪"));
|
||||
ui.controlTabWidget->insertTab(0, m_hic, QString::fromLocal8Bit("光谱仪"));
|
||||
m_hic->setDisabled(true);
|
||||
ui.controlTabWidget->setCurrentIndex(0);
|
||||
|
||||
//rgb相机
|
||||
m_RgbCameraThread = new QThread();
|
||||
m_RgbCamera = new RgbCameraOperation();
|
||||
@ -771,7 +807,8 @@ void HPPA::recordFromRobotArm(int fileCounter)
|
||||
m_Imager->setRecordControlState(false);
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
//qDebug() << "recordFromRobotArm: 1111111111111111111111";
|
||||
|
||||
return;
|
||||
@ -787,7 +824,8 @@ void HPPA::recordFromRobotArm(int fileCounter)
|
||||
emit StartRecordSignal();
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集中"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_ing.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
//qDebug() << "recordFromRobotArm: 2222222222222222222222";
|
||||
}
|
||||
|
||||
@ -823,6 +861,7 @@ void HPPA::createActionGroups()
|
||||
ui.mActionCorning_410->setChecked(true);
|
||||
}
|
||||
|
||||
updateImagerPicture(lastSelectedAction);
|
||||
}
|
||||
|
||||
void HPPA::selectingImager(QAction* selectedAction)
|
||||
@ -830,6 +869,44 @@ void HPPA::selectingImager(QAction* selectedAction)
|
||||
QSettings settings;
|
||||
settings.setValue("LastSelectedImagerAction", selectedAction->objectName());
|
||||
settings.sync();
|
||||
|
||||
updateImagerPicture(selectedAction->objectName());
|
||||
}
|
||||
|
||||
void HPPA::updateImagerPicture(const QString& actionName)
|
||||
{
|
||||
QString picPath;
|
||||
if (actionName == "mActionPica_L")
|
||||
picPath = ":/imagerPicture/resources/icons/imagerPicture/L.png";
|
||||
else if (actionName == "mActionPica_NIR")
|
||||
picPath = ":/imagerPicture/resources/icons/imagerPicture/IR.png";
|
||||
else if (actionName == "mActionPika_XC2")
|
||||
picPath = ":/imagerPicture/resources/icons/imagerPicture/XC2.png";
|
||||
else if (actionName == "mActionCorning_410")
|
||||
picPath = ":/imagerPicture/resources/icons/imagerPicture/corning410.png";
|
||||
|
||||
if (!picPath.isEmpty())
|
||||
{
|
||||
QPixmap pixmap(picPath);
|
||||
if (!pixmap.isNull())
|
||||
{
|
||||
QImage img = pixmap.toImage().convertToFormat(QImage::Format_ARGB32);
|
||||
const int threshold = 240;
|
||||
for (int y = 0; y < img.height(); ++y)
|
||||
{
|
||||
QRgb* line = reinterpret_cast<QRgb*>(img.scanLine(y));
|
||||
for (int x = 0; x < img.width(); ++x)
|
||||
{
|
||||
if (qRed(line[x]) >= threshold && qGreen(line[x]) >= threshold && qBlue(line[x]) >= threshold)
|
||||
{
|
||||
line[x] = qRgba(qRed(line[x]), qGreen(line[x]), qBlue(line[x]), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_hic->imagerPictureLabel()->setAttribute(Qt::WA_TranslucentBackground);
|
||||
m_hic->imagerPictureLabel()->setOriginalPixmap(QPixmap::fromImage(img));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HPPA::createMoveplatformActionGroup()
|
||||
@ -920,6 +997,10 @@ void HPPA::removeLayerByTreeIndex()
|
||||
const int tabIndex = m_imageViewerTabWidget->indexOf(layerWidget);
|
||||
if (tabIndex >= 0)
|
||||
{
|
||||
if (m_recordFrameCounter)
|
||||
{
|
||||
m_recordFrameCounter->removeCounter(layerWidget);
|
||||
}
|
||||
m_imageViewerTabWidget->removeTab(tabIndex);
|
||||
}
|
||||
layerWidget->deleteLater();
|
||||
@ -972,6 +1053,10 @@ void HPPA::removeAllLayersInRasterGroup()
|
||||
const int tabIndex = m_imageViewerTabWidget->indexOf(layerWidget);
|
||||
if (tabIndex >= 0)
|
||||
{
|
||||
if (m_recordFrameCounter)
|
||||
{
|
||||
m_recordFrameCounter->removeCounter(layerWidget);
|
||||
}
|
||||
m_imageViewerTabWidget->removeTab(tabIndex);
|
||||
}
|
||||
layerWidget->deleteLater();
|
||||
@ -1000,6 +1085,29 @@ void HPPA::initPanelToolbar()
|
||||
ui.mWindowsMenu->addMenu(mPanelMenu);
|
||||
ui.mWindowsMenu->addMenu(mToolbarMenu);
|
||||
|
||||
mPanelMenu->setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #0A1245; /* 菜单背景色 */
|
||||
border: 1px solid gray; /* 可选,边框样式 */
|
||||
color: white; /* 根据你的背景调整文字颜色 */
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: rgba(255, 255, 255, 50); /* 选中时的背景色 */
|
||||
color: white; /* 选中项字体颜色,可选 */
|
||||
}
|
||||
)");
|
||||
mToolbarMenu->setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #0A1245; /* 菜单背景色 */
|
||||
border: 1px solid gray; /* 可选,边框样式 */
|
||||
color: white; /* 根据你的背景调整文字颜色 */
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: rgba(255, 255, 255, 50); /* 选中时的背景色 */
|
||||
color: white; /* 选中项字体颜色,可选 */
|
||||
}
|
||||
)");
|
||||
|
||||
mPanelMenu->addAction(ui.mDockWidgetSpectrometer->toggleViewAction());
|
||||
|
||||
mPanelMenu->addAction(ui.mDockWidgetSimulator->toggleViewAction());
|
||||
@ -1146,15 +1254,6 @@ void HPPA::createPlantPhenotypeScenario()
|
||||
|
||||
}
|
||||
|
||||
void HPPA::CalculateIntegratioinTimeRange()
|
||||
{
|
||||
double range = 1 / m_Imager->getFramerate() * 1000;//毫秒
|
||||
|
||||
ui.IntegratioinTimeSlider->blockSignals(true);//因为setMaximum会触发valueChanged信号,所以调用setMaximum前需要阻断信号
|
||||
ui.IntegratioinTimeSlider->setMaximum(range);
|
||||
ui.IntegratioinTimeSlider->blockSignals(false);
|
||||
}
|
||||
|
||||
void HPPA::onStartRecordStep1()
|
||||
{
|
||||
QAction* checked = moveplatformActionGroup->checkedAction();
|
||||
@ -1214,7 +1313,8 @@ void HPPA::onStartRecordStep1()
|
||||
emit StartRecordSignal();//发射开始采集信号
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("停止采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_ing.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1222,7 +1322,8 @@ void HPPA::onStartRecordStep1()
|
||||
m_RecordState -= 1;
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1236,7 +1337,8 @@ void HPPA::onStartRecordStep1()
|
||||
removeAllLayersInRasterGroup();
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("停止采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_ing.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
|
||||
//应该先控制马达运动,当马达运动后,再开始光谱仪采集(发射开始采集信号)
|
||||
m_Imager->setFileName2Save(imgPath);
|
||||
@ -1247,10 +1349,11 @@ void HPPA::onStartRecordStep1()
|
||||
else
|
||||
{
|
||||
m_omc->stop();
|
||||
m_RecordState -= 1;
|
||||
m_RecordState -= 1;
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -1264,13 +1367,14 @@ void HPPA::onStartRecordStep1()
|
||||
removeAllLayersInRasterGroup();
|
||||
|
||||
m_Imager->setFileName2Save(imgPath);
|
||||
m_Imager->setFrameNumber(this->frame_number->text().toInt());
|
||||
m_Imager->setFrameNumber(this->frame_number->text().toInt());
|
||||
m_tmc->setImager(m_Imager);
|
||||
m_tmc->setPosFileName(QString::fromStdString(x_location));
|
||||
m_tmc->run();
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("停止采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_ing.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1279,7 +1383,8 @@ void HPPA::onStartRecordStep1()
|
||||
m_RecordState--;
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
}
|
||||
|
||||
return;
|
||||
@ -1308,6 +1413,11 @@ QWidget* HPPA::onCreateTab(QString tabName)
|
||||
|
||||
m_imageViewerTabWidget->setCurrentIndex(m_imageViewerTabWidget->count() - 1);
|
||||
|
||||
if (m_recordFrameCounter)
|
||||
{
|
||||
m_recordFrameCounter->addCounter(tabTmp);
|
||||
}
|
||||
|
||||
return tabTmp;
|
||||
}
|
||||
|
||||
@ -1321,6 +1431,12 @@ void HPPA::onTabWidgetCurrentChanged(int index)//代码新建一个tab,会调
|
||||
//记录当前
|
||||
m_TabWidgetCurrentIndex = index;
|
||||
|
||||
if (m_recordFrameCounter)
|
||||
{
|
||||
QWidget* currentWidget = m_imageViewerTabWidget->widget(index);
|
||||
m_recordFrameCounter->switchTo(currentWidget);
|
||||
}
|
||||
|
||||
//获取绘图控件
|
||||
QWidget* currentWidget = m_imageViewerTabWidget->widget(index);
|
||||
QList<Mapcavas*> currentImageViewer = currentWidget->findChildren<Mapcavas*>();
|
||||
@ -1377,52 +1493,24 @@ void HPPA::onActionOpenDirectory()
|
||||
string directory = fileOperation->getDirectoryFromString();
|
||||
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(directory)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void HPPA::OnFramerateLineeditEditingFinished()
|
||||
void HPPA::onFramerateChanged(double framerate)
|
||||
{
|
||||
std::cout << "Lineedit设置帧率------------------------------------------" << std::endl;
|
||||
m_Imager->setFramerate(this->ui.framerate_lineEdit->text().toDouble());
|
||||
ui.FramerateSlider->setValue(ui.framerate_lineEdit->text().toDouble());
|
||||
|
||||
CalculateIntegratioinTimeRange();
|
||||
m_Imager->setFramerate(framerate);
|
||||
m_hic->setFrameRate(m_Imager->getFramerate());
|
||||
}
|
||||
|
||||
void HPPA::OnFramerateSliderChanged(double framerate)
|
||||
void HPPA::onIntegrationTimeChanged(double integrationTime)
|
||||
{
|
||||
std::cout << "Slider设置帧率------------------------------------------" << std::endl;
|
||||
m_Imager->setFramerate(this->ui.framerate_lineEdit->text().toDouble());
|
||||
ui.framerate_lineEdit->setText(QString::number(framerate));
|
||||
|
||||
CalculateIntegratioinTimeRange();
|
||||
m_Imager->setIntegrationTime(integrationTime);
|
||||
m_hic->setIntegrationTime(m_Imager->getIntegrationTime());
|
||||
}
|
||||
|
||||
void HPPA::OnIntegratioinTimeEditingFinished()
|
||||
void HPPA::onGainChanged(double gain)
|
||||
{
|
||||
std::cout << "Lineedit设置积分时间------------------------------------------" << std::endl;
|
||||
m_Imager->setIntegrationTime(this->ui.integratioin_time_lineEdit->text().toDouble());
|
||||
ui.IntegratioinTimeSlider->setValue(ui.integratioin_time_lineEdit->text().toDouble());
|
||||
}
|
||||
|
||||
void HPPA::OnIntegratioinTimeSliderChanged(double IntegratioinTime)
|
||||
{
|
||||
std::cout << "Slider设置积分时间------------------------------------------" << std::endl;
|
||||
m_Imager->setIntegrationTime(IntegratioinTime);
|
||||
ui.integratioin_time_lineEdit->setText(QString::number(IntegratioinTime));
|
||||
}
|
||||
|
||||
void HPPA::OnGainEditingFinished()
|
||||
{
|
||||
m_Imager->setGain(this->ui.gain_lineEdit->text().toDouble());
|
||||
ui.GainSlider->setValue(ui.gain_lineEdit->text().toDouble());
|
||||
}
|
||||
|
||||
void HPPA::OnGainSliderChanged(double Gain)
|
||||
{
|
||||
m_Imager->setGain(this->ui.gain_lineEdit->text().toDouble());
|
||||
ui.gain_lineEdit->setText(QString::number(Gain));
|
||||
m_Imager->setGain(gain);
|
||||
m_hic->setGain(m_Imager->getGain());
|
||||
}
|
||||
|
||||
void HPPA::onLeftMouseButtonPressed(int x, int y, QVector<double> wavelengths, QVector<double> spectrum)
|
||||
@ -1588,6 +1676,51 @@ void HPPA::onExit()
|
||||
this->close();
|
||||
}
|
||||
|
||||
void HPPA::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
QMessageBox msgBox(this);
|
||||
msgBox.setWindowTitle(QString::fromLocal8Bit("退出确认"));
|
||||
msgBox.setText(QString::fromLocal8Bit("确定要退出程序吗?"));
|
||||
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
msgBox.setDefaultButton(QMessageBox::No);
|
||||
msgBox.setStyleSheet(R"(
|
||||
QMessageBox {
|
||||
background-color: #0D1233;
|
||||
}
|
||||
QMessageBox QLabel {
|
||||
color: #ACCDFF;
|
||||
font-size: 14px;
|
||||
}
|
||||
QPushButton {
|
||||
background-color: #142D7F;
|
||||
color: #e6eeff;
|
||||
border: 1px solid #2f6bff;
|
||||
border-radius: 6px;
|
||||
padding: 6px 20px;
|
||||
min-width: 60px;
|
||||
font-size: 13px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
border: 1px solid #4d8dff;
|
||||
background-color: red;
|
||||
}
|
||||
QPushButton:pressed {
|
||||
background-color: #23345c;
|
||||
}
|
||||
)");
|
||||
|
||||
QMessageBox::StandardButton ret = static_cast<QMessageBox::StandardButton>(msgBox.exec());
|
||||
|
||||
if (ret == QMessageBox::Yes)
|
||||
{
|
||||
event->accept(); // 允许关闭
|
||||
}
|
||||
else
|
||||
{
|
||||
event->ignore(); // 取消关闭
|
||||
}
|
||||
}
|
||||
|
||||
void HPPA::onOpenImg()
|
||||
{
|
||||
// 1) 弹出文件对话框获取uri
|
||||
@ -1643,21 +1776,27 @@ void HPPA::onconnect()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QString::fromLocal8Bit("请选择相机!"));
|
||||
msgBox.exec();
|
||||
msgBox.exec();
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
ui.action_connect_imager->setIcon(QIcon(":/svg/resources/icons/svg/connect_imager_ing.svg"));
|
||||
|
||||
m_Imager->moveToThread(m_RecordThread);
|
||||
m_RecordThread->start();
|
||||
|
||||
m_Imager->connect_imager(frame_number->text().toInt());
|
||||
m_Imager->setFileName2Save(m_FilenameLineEdit->text().toStdString());
|
||||
|
||||
connect(m_Imager, SIGNAL(PlotSignal(int, int, QString)), this, SLOT(onPlotHyperspectralImageRgbImage(int, int, QString)));
|
||||
connect(m_Imager, SIGNAL(RecordFinishedSignal_WhenFrameNumberMeet()), this, SLOT(onRecordFinishedSignal_WhenFrameNumberMeet()));
|
||||
connect(m_Imager, SIGNAL(RecordFinishedSignal_WhenFrameNumberNotMeet()), this, SLOT(onRecordFinishedSignal_WhenFrameNumberNotMeet()));
|
||||
connect(m_Imager, SIGNAL(SpectralSignal(int)), this, SLOT(PlotSpectral(int)));
|
||||
//connect(m_Imager, SIGNAL(testImagerStatus()), this, SLOT(testImagerStatus()));
|
||||
|
||||
connect(m_Imager, SIGNAL(testImagerStatus()), this, SLOT(testImagerStatus()));
|
||||
connect(m_Imager, &ImagerOperationBase::autoExposureSignal, this, &HPPA::autoExposureFinished);
|
||||
|
||||
m_Imager->connect_imager(frame_number->text().toInt());
|
||||
m_Imager->setFileName2Save(m_FilenameLineEdit->text().toStdString());
|
||||
|
||||
//文件拷贝
|
||||
m_CopyFileThread = new QThread();
|
||||
@ -1689,25 +1828,13 @@ void HPPA::onconnect()
|
||||
|
||||
connect(this->ui.actionOpenDirectory, SIGNAL(triggered()), this, SLOT(onActionOpenDirectory()));
|
||||
|
||||
|
||||
connect(this->ui.framerate_lineEdit, SIGNAL(editingFinished()), this, SLOT(OnFramerateLineeditEditingFinished()));
|
||||
connect(this->ui.FramerateSlider, SIGNAL(valueChanged(double)), this, SLOT(OnFramerateSliderChanged(double)));
|
||||
connect(this->ui.integratioin_time_lineEdit, SIGNAL(editingFinished()), this, SLOT(OnIntegratioinTimeEditingFinished()));
|
||||
connect(this->ui.IntegratioinTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(OnIntegratioinTimeSliderChanged(double)));
|
||||
connect(this->ui.gain_lineEdit, SIGNAL(editingFinished()), this, SLOT(OnGainEditingFinished()));
|
||||
connect(this->ui.GainSlider, SIGNAL(valueChanged(double)), this, SLOT(OnGainSliderChanged(double)));
|
||||
|
||||
connect(m_hic, SIGNAL(framerateChanged(double)), this, SLOT(onFramerateChanged(double)));
|
||||
connect(m_hic, SIGNAL(integrationTimeChanged(double)), this, SLOT(onIntegrationTimeChanged(double)));
|
||||
connect(m_hic, SIGNAL(gainChanged(double)), this, SLOT(onGainChanged(double)));
|
||||
|
||||
//相机参数控件设置为可用 + 输入控制
|
||||
frame_number->setEnabled(true);
|
||||
|
||||
ui.framerate_lineEdit->setEnabled(true);
|
||||
ui.integratioin_time_lineEdit->setEnabled(true);
|
||||
ui.gain_lineEdit->setEnabled(true);
|
||||
|
||||
ui.FramerateSlider->setEnabled(true);
|
||||
ui.IntegratioinTimeSlider->setEnabled(true);
|
||||
ui.GainSlider->setEnabled(true);
|
||||
m_hic->setDisabled(false);
|
||||
|
||||
/*QRegExp rx("\\d{0,3}[1-9]$");
|
||||
ui.framerate_lineEdit->setValidator(new QRegExpValidator(rx));
|
||||
@ -1717,18 +1844,14 @@ void HPPA::onconnect()
|
||||
ui.gain_lineEdit->setValidator(new QRegExpValidator(rx));*/
|
||||
|
||||
//获取相机参数并显示到界面中
|
||||
ui.framerate_lineEdit->setText(QString::number(m_Imager->getFramerate(), 10, 2));
|
||||
ui.FramerateSlider->setValue(m_Imager->getFramerate(), true);
|
||||
CalculateIntegratioinTimeRange();
|
||||
|
||||
ui.integratioin_time_lineEdit->setText(QString::number(m_Imager->getIntegrationTime(), 10, 2));
|
||||
ui.IntegratioinTimeSlider->setValue(m_Imager->getIntegrationTime());
|
||||
|
||||
ui.gain_lineEdit->setText(QString::number(m_Imager->getGain(), 10, 2));
|
||||
ui.GainSlider->setValue(m_Imager->getGain());
|
||||
m_hic->setFrameRate(m_Imager->getFramerate());
|
||||
m_hic->setIntegrationTime(m_Imager->getIntegrationTime());
|
||||
m_hic->setGain(m_Imager->getGain());
|
||||
}
|
||||
catch (std::exception const& e)
|
||||
{
|
||||
ui.action_connect_imager->setIcon(QIcon(":/svg/resources/icons/svg/connect_imager.svg"));
|
||||
|
||||
std::cerr << "Error: " << e.what() << std::endl;
|
||||
|
||||
delete m_Imager;
|
||||
@ -1745,27 +1868,34 @@ void HPPA::onconnect()
|
||||
|
||||
void HPPA::testImagerStatus()
|
||||
{
|
||||
m_TestImagerStausThread->start();
|
||||
ui.action_connect_imager->setIcon(QIcon(":/svg/resources/icons/svg/connect_imager_done.svg"));
|
||||
//m_TestImagerStausThread->start();
|
||||
}
|
||||
|
||||
void HPPA::autoExposureFinished()
|
||||
{
|
||||
ui.action_auto_exposure->setIcon(QIcon(":/svg/resources/icons/svg/exposure_done.svg"));
|
||||
}
|
||||
|
||||
void HPPA::onAutoExposure()
|
||||
{
|
||||
ui.action_auto_exposure->setIcon(QIcon(":/svg/resources/icons/svg/exposure_ing.svg"));
|
||||
|
||||
double ReturnedExposureTime = m_Imager->auto_exposure();
|
||||
|
||||
//将自动曝光所得的值显示到界面
|
||||
ui.IntegratioinTimeSlider->setValue(ReturnedExposureTime, false);
|
||||
m_hic->setIntegrationTime(ReturnedExposureTime);
|
||||
|
||||
|
||||
ui.mainToolBar->widgetForAction(ui.action_auto_exposure)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
//ui.mainToolBar->widgetForAction(ui.action_auto_exposure)->setStyleSheet("QLineEdit{background-color:rgb(255,255,255);}");
|
||||
//ui.mainToolBar->widgetForAction(ui.action_auto_exposure)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
}
|
||||
|
||||
void HPPA::onFocus1()
|
||||
{
|
||||
focusWindow* w = new focusWindow(this, m_Imager);
|
||||
connect(w, SIGNAL(StartManualFocusSignal(int)), this, SLOT(onFocus2(int)));
|
||||
connect(w, SIGNAL(closeSignal()), this, SLOT(onFocusWindowClosed()));
|
||||
|
||||
//w->setModal(true);//设置窗口为模态:只能操作当前窗口
|
||||
w->setModal(true);//设置窗口为模态:只能操作当前窗口
|
||||
w->show();
|
||||
w->exec();
|
||||
|
||||
@ -1776,18 +1906,23 @@ void HPPA::onFocus2(int command)
|
||||
{
|
||||
if (command == 1)
|
||||
{
|
||||
if (m_focusTab)
|
||||
{
|
||||
emit StartFocusSignal();
|
||||
return;
|
||||
}
|
||||
//创建影像显示窗口
|
||||
QWidget* tabTmp = new QWidget();
|
||||
m_focusTab = new QWidget();
|
||||
|
||||
QGridLayout* GridLayout = new QGridLayout();
|
||||
GridLayout->addWidget(new Mapcavas(tabTmp));
|
||||
GridLayout->addWidget(new Mapcavas(m_focusTab));
|
||||
|
||||
tabTmp->setLayout(GridLayout);
|
||||
m_focusTab->setLayout(GridLayout);
|
||||
|
||||
m_imageViewerTabWidget->addTab(tabTmp, QString::fromLocal8Bit("调焦"));
|
||||
m_imageViewerTabWidget->addTab(m_focusTab, QString::fromLocal8Bit("调焦"));
|
||||
|
||||
//m_imageViewerTabWidget->setCurrentIndex(trackNumber);
|
||||
m_imageViewerTabWidget->setCurrentWidget(tabTmp);
|
||||
m_imageViewerTabWidget->setCurrentWidget(m_focusTab);
|
||||
|
||||
|
||||
//开始调焦
|
||||
@ -1799,6 +1934,19 @@ void HPPA::onFocus2(int command)
|
||||
}
|
||||
}
|
||||
|
||||
void HPPA::onFocusWindowClosed()
|
||||
{
|
||||
//关闭调焦窗口时,停止调焦功能
|
||||
m_Imager->setFocusControlState(false);
|
||||
//关闭调焦窗口tab
|
||||
int index = m_imageViewerTabWidget->indexOf(m_focusTab);
|
||||
if (index != -1)
|
||||
{
|
||||
m_imageViewerTabWidget->removeTab(index);
|
||||
}
|
||||
m_focusTab = nullptr;
|
||||
}
|
||||
|
||||
void HPPA::onAbout()
|
||||
{
|
||||
aboutWindow about;
|
||||
@ -1812,6 +1960,8 @@ void HPPA::onDark()
|
||||
msgBox.setText(QString::fromLocal8Bit("采集暗电流,请确保镜头盖盖上!"));
|
||||
msgBox.exec();
|
||||
|
||||
ui.action_dark->setIcon(QIcon(":/svg/resources/icons/svg/dark_ing.svg"));
|
||||
|
||||
QAction* checked = moveplatformActionGroup->checkedAction();
|
||||
QString checkedName = checked->objectName();
|
||||
if (checkedName == "mAction_is_no_motor" || checkedName == "mAction_RobotArm")
|
||||
@ -1833,14 +1983,17 @@ void HPPA::onDark()
|
||||
|
||||
void HPPA::recordDarkFinish()
|
||||
{
|
||||
ui.mainToolBar->widgetForAction(ui.action_dark)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_dark->setIcon(QIcon(":/svg/resources/icons/svg/dark_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_dark)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
}
|
||||
|
||||
void HPPA::onReference()
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(QString::fromLocal8Bit("请确保白板放置正确!"));
|
||||
msgBox.exec();
|
||||
msgBox.exec();
|
||||
|
||||
ui.action_reference->setIcon(QIcon(":/svg/resources/icons/svg/reference_ing.svg"));
|
||||
|
||||
QAction* checked = moveplatformActionGroup->checkedAction();
|
||||
QString checkedName = checked->objectName();
|
||||
@ -1863,7 +2016,8 @@ void HPPA::onReference()
|
||||
|
||||
void HPPA::recordWhiteFinish()
|
||||
{
|
||||
ui.mainToolBar->widgetForAction(ui.action_reference)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_reference->setIcon(QIcon(":/svg/resources/icons/svg/reference_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_reference)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
}
|
||||
|
||||
void HPPA::onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QString filePath)
|
||||
@ -1884,6 +2038,11 @@ void HPPA::onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QSt
|
||||
QList<Mapcavas*> currentImageViewer = currentWidget->findChildren<Mapcavas*>();
|
||||
currentImageViewer[0]->DisplayFrameNumber(m_Imager->getFrameCounter());//界面中显示已经采集的帧数
|
||||
|
||||
if (m_recordFrameCounter)
|
||||
{
|
||||
m_recordFrameCounter->updateFrameCount(currentWidget, m_Imager->getFrameCounter());
|
||||
}
|
||||
|
||||
//创建需要显示的图像--opencv版本
|
||||
ImageProcessor imageProcessor;
|
||||
//cv::Mat rgbImage(*m_Imager->getRgbImage()->m_matRgbImage, cv::Range(0, m_Imager->getFrameCounter()), cv::Range::all());//2022.3.18重构的
|
||||
@ -1938,13 +2097,16 @@ void HPPA::PlotSpectral(int state)
|
||||
series->append(i, m_Imager->buffer[1368 * 150 + i]);
|
||||
}
|
||||
|
||||
QChart* chart = new QChart();
|
||||
chart->legend()->hide();
|
||||
chart->addSeries(series);
|
||||
chart->createDefaultAxes();
|
||||
//chart->setTitle("Simple line chart example");
|
||||
series->setPen(QPen(QColor("#FF928A"), 2));
|
||||
|
||||
m_chartView->setChart(chart);
|
||||
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());
|
||||
|
||||
setAxis(axisX, axisY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1997,10 +2159,16 @@ void HPPA::onRecordFinishedSignal_WhenFrameNumberMeet()
|
||||
QAction* checked = moveplatformActionGroup->checkedAction();
|
||||
QString checkedName = checked->objectName();
|
||||
|
||||
if (checkedName == "mAction_2AxisMotor_new")//会有多条采集线,中间的某条采集线完成后不代表整个采集过程完成
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::cout << "停止采集原因:帧数采集完了。" << std::endl;
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
|
||||
m_RecordState++;//当自动停止采集
|
||||
}
|
||||
@ -2023,7 +2191,8 @@ void HPPA::onRecordFinishedSignal_WhenFrameNumberNotMeet()
|
||||
std::cout << "停止采集原因:(1)帧数没有采集够时,马达到达最大位置;(2)手动停止采集。" << std::endl;
|
||||
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
|
||||
m_RecordState++;
|
||||
}
|
||||
@ -2031,7 +2200,8 @@ void HPPA::onRecordFinishedSignal_WhenFrameNumberNotMeet()
|
||||
void HPPA::onsequenceComplete()
|
||||
{
|
||||
ui.action_start_recording->setText(QString::fromLocal8Bit("采集"));
|
||||
ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
ui.action_start_recording->setIcon(QIcon(":/svg/resources/icons/svg/record_done.svg"));
|
||||
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(0,255,0);}");
|
||||
|
||||
m_RecordState++;
|
||||
}
|
||||
|
||||
36
HPPA/HPPA.h
36
HPPA/HPPA.h
@ -67,6 +67,12 @@
|
||||
#include "MapToolSpectral.h"
|
||||
#include "MapTools.h"
|
||||
|
||||
#include "AspectRatioLabel.h"
|
||||
|
||||
#include "HyperImagerControl.h"
|
||||
|
||||
#include "recordFrameCounter.h"
|
||||
|
||||
#define PI 3.1415926
|
||||
|
||||
QT_CHARTS_USE_NAMESPACE//QChartView 使用 需要加宏, 否则无法使用
|
||||
@ -155,7 +161,7 @@ class WidgetWithBackgroundPicture : public QWidget
|
||||
public:
|
||||
explicit WidgetWithBackgroundPicture(QWidget* parent = nullptr)
|
||||
: QWidget(parent),
|
||||
m_pixmap(".//icon//titile_bar_bgp.png") // 使用资源或绝对路径
|
||||
m_pixmap(":/png/resources/icons/png/titile_bar_bgp.png") // 使用资源或绝对路径
|
||||
{
|
||||
// 可选:设置初始大小
|
||||
resize(800, 600);
|
||||
@ -184,8 +190,6 @@ public:
|
||||
static HPPA* instance();
|
||||
LayerTreeNode* rasterGroupNode() const;
|
||||
|
||||
void CalculateIntegratioinTimeRange();//通过帧率计算积分时间范围,设置slider最大值
|
||||
|
||||
WorkerThread * m_TestImagerStausThread;//检测相机连接状态的线程
|
||||
|
||||
private:
|
||||
@ -199,6 +203,7 @@ private:
|
||||
void initMenubarToolbar();
|
||||
void initPanelToolbar();
|
||||
void initControlTabwidget();
|
||||
QWidget* tmp(QWidget* a);
|
||||
|
||||
QLineEdit * frame_number;
|
||||
QLineEdit * m_FilenameLineEdit;
|
||||
@ -241,6 +246,7 @@ private:
|
||||
QActionGroup* mImagerGroup = nullptr;
|
||||
void createActionGroups();
|
||||
void selectingImager(QAction* selectedAction);
|
||||
void updateImagerPicture(const QString& actionName);
|
||||
|
||||
QActionGroup* moveplatformActionGroup = nullptr;
|
||||
void createMoveplatformActionGroup();
|
||||
@ -263,6 +269,7 @@ private:
|
||||
|
||||
TabManager* m_tabManager;
|
||||
|
||||
HyperImagerControl* m_hic;
|
||||
ImageControl* m_ic;
|
||||
adjustTable* m_adt;
|
||||
PowerControl* m_pc;
|
||||
@ -285,6 +292,10 @@ private:
|
||||
void initMapTools();
|
||||
void setMapTool();
|
||||
|
||||
QWidget* m_focusTab=nullptr;
|
||||
|
||||
recordFrameCounter* m_recordFrameCounter = nullptr;
|
||||
|
||||
public Q_SLOTS:
|
||||
void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QString filePath);
|
||||
void PlotSpectral(int state);
|
||||
@ -296,9 +307,11 @@ public Q_SLOTS:
|
||||
void onOpenImg();
|
||||
void onconnect();//连接相机
|
||||
void testImagerStatus();//获取相机状态:连接是否正常
|
||||
void autoExposureFinished();
|
||||
void onAutoExposure();
|
||||
void onFocus1();
|
||||
void onFocus2(int command);
|
||||
void onFocusWindowClosed();
|
||||
void onAbout();
|
||||
void onDark();
|
||||
void recordDarkFinish();
|
||||
@ -309,16 +322,12 @@ public Q_SLOTS:
|
||||
void onTabWidgetCurrentChanged(int index);
|
||||
void onActionOpenDirectory();
|
||||
|
||||
void OnFramerateLineeditEditingFinished();//
|
||||
void OnFramerateSliderChanged(double framerate);//
|
||||
void onFramerateChanged(double framerate);
|
||||
void onIntegrationTimeChanged(double integrationTime);
|
||||
void onGainChanged(double gain);
|
||||
|
||||
void OnIntegratioinTimeEditingFinished();//
|
||||
void OnIntegratioinTimeSliderChanged(double IntegratioinTime);//
|
||||
void OnGainEditingFinished();//
|
||||
void OnGainSliderChanged(double Gain);//
|
||||
|
||||
void onLeftMouseButtonPressed(int x, int y, QVector<double> wavelengths, QVector<double> spectrum);//点击影像像元显示光谱
|
||||
void setAxis(QValueAxis* axisX, QValueAxis* axisY);
|
||||
void onLeftMouseButtonPressed(int x, int y, QVector<double> wavelengths, QVector<double> spectrum);//点击影像像元显示光谱
|
||||
void setAxis(QValueAxis* axisX, QValueAxis* axisY);
|
||||
|
||||
|
||||
void timerEvent(QTimerEvent *event);
|
||||
@ -351,6 +360,9 @@ public Q_SLOTS:
|
||||
|
||||
void onMapToolPanTriggered();
|
||||
void onMapToolSpectralTriggered();
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
signals:
|
||||
void StartFocusSignal();
|
||||
void StartRecordSignal();
|
||||
|
||||
BIN
HPPA/HPPA.ico
BIN
HPPA/HPPA.ico
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
@ -1,5 +1,53 @@
|
||||
<RCC>
|
||||
<qresource prefix="/HPPA">
|
||||
<file>HPPA.ico</file>
|
||||
<qresource prefix="/svg">
|
||||
<file>resources/icons/svg/arrow_down.svg</file>
|
||||
<file>resources/icons/svg/arrow_up.svg</file>
|
||||
<file>resources/icons/svg/close.svg</file>
|
||||
<file>resources/icons/svg/connect_imager.svg</file>
|
||||
<file>resources/icons/svg/connect_imager_done.svg</file>
|
||||
<file>resources/icons/svg/connect_imager_ing.svg</file>
|
||||
<file>resources/icons/svg/dark.svg</file>
|
||||
<file>resources/icons/svg/dark_done.svg</file>
|
||||
<file>resources/icons/svg/dark_ing.svg</file>
|
||||
<file>resources/icons/svg/exposure.svg</file>
|
||||
<file>resources/icons/svg/exposure_done.svg</file>
|
||||
<file>resources/icons/svg/exposure_ing.svg</file>
|
||||
<file>resources/icons/svg/focus.svg</file>
|
||||
<file>resources/icons/svg/focus_done.svg</file>
|
||||
<file>resources/icons/svg/focus_ing.svg</file>
|
||||
<file>resources/icons/svg/openDirectory.svg</file>
|
||||
<file>resources/icons/svg/openDirectory_done.svg</file>
|
||||
<file>resources/icons/svg/pan.svg</file>
|
||||
<file>resources/icons/svg/pan_done.svg</file>
|
||||
<file>resources/icons/svg/record.svg</file>
|
||||
<file>resources/icons/svg/record_done.svg</file>
|
||||
<file>resources/icons/svg/record_ing.svg</file>
|
||||
<file>resources/icons/svg/reference.svg</file>
|
||||
<file>resources/icons/svg/reference_done.svg</file>
|
||||
<file>resources/icons/svg/reference_ing.svg</file>
|
||||
<file>resources/icons/svg/software_icon.svg</file>
|
||||
<file>resources/icons/svg/software_icon_small.svg</file>
|
||||
<file>resources/icons/svg/spectral.svg</file>
|
||||
<file>resources/icons/svg/spectral_done.svg</file>
|
||||
<file>resources/icons/svg/tree_tri_down.svg</file>
|
||||
<file>resources/icons/svg/tree_tri_right.svg</file>
|
||||
<file>resources/icons/svg/mIconRaster.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/png">
|
||||
<file>resources/icons/png/Spectral_Insight_27.png</file>
|
||||
<file>resources/icons/png/Spectral_Insight_54.png</file>
|
||||
<file>resources/icons/png/Spectral_Insight_170.png</file>
|
||||
<file>resources/icons/png/Spectral_Insight_340.png</file>
|
||||
<file>resources/icons/png/titile_bar_bgp.png</file>
|
||||
<file>resources/icons/png/titile_bar_bgp2x.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/imagerPicture">
|
||||
<file>resources/icons/imagerPicture/corning410.png</file>
|
||||
<file>resources/icons/imagerPicture/IR.png</file>
|
||||
<file>resources/icons/imagerPicture/L.png</file>
|
||||
<file>resources/icons/imagerPicture/XC2.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/ico">
|
||||
<file>resources/icons/ico/Spectral_Insight_128.ico</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
BIN
HPPA/HPPA.rc
BIN
HPPA/HPPA.rc
Binary file not shown.
426
HPPA/HPPA.ui
426
HPPA/HPPA.ui
@ -11,11 +11,11 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Hyper Plant Phenotypic Analysis</string>
|
||||
<string>Spectral Insight</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="HPPA.qrc">
|
||||
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset>
|
||||
<normaloff>:/ico/resources/icons/ico/Spectral_Insight_128.ico</normaloff>:/ico/resources/icons/ico/Spectral_Insight_128.ico</iconset>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
@ -197,17 +197,21 @@ QToolBar QToolButton:hover {
|
||||
<addaction name="action_reference"/>
|
||||
<addaction name="action_start_recording"/>
|
||||
<addaction name="actionOpenDirectory"/>
|
||||
<addaction name="mActionPan"/>
|
||||
<addaction name="mActionSpectral"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QStatusBar {
|
||||
|
||||
background-color: rgb(255, 255, 255);
|
||||
color: white; /* 文字颜色 */
|
||||
border-top: 1px solid #ccc; /* 顶部边框 */
|
||||
padding: 5px; /* 内边距 */
|
||||
<string notr="true">QStatusBar
|
||||
{
|
||||
background-color: #0D1233;
|
||||
color: white;
|
||||
}
|
||||
</string>
|
||||
|
||||
QStatusBar::item
|
||||
{
|
||||
border: none;
|
||||
}</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="CustomDockWidgetBase" name="mDockWidgetSimulator">
|
||||
@ -253,9 +257,9 @@ QToolBar QToolButton:hover {
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>2</number>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="dockWidgetContents_4">
|
||||
<widget class="QWidget" name="controlContents">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #dockWidgetContents_4
|
||||
<string notr="true">QWidget #controlContents
|
||||
{
|
||||
background-color: #0E1C4C;
|
||||
|
||||
@ -324,329 +328,11 @@ QTabWidget::pane {
|
||||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="elideMode">
|
||||
<enum>Qt::ElideNone</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
QLineEdit {
|
||||
background-color: #142D7F;
|
||||
color: #e6eeff;
|
||||
border: 1px solid #2f6bff;
|
||||
border-radius: 6px;
|
||||
padding: 4px 8px;
|
||||
min-width: 70px;
|
||||
min-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
QLineEdit:hover {
|
||||
border: 1px solid #4d8dff;
|
||||
}
|
||||
|
||||
QLineEdit:focus {
|
||||
border: 1px solid #6aa2ff;
|
||||
background-color: #23345c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QSlider::groove:horizontal {
|
||||
height: 10px;
|
||||
background: #1e2a44;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 已滑过:渐变蓝 */
|
||||
QSlider::sub-page:horizontal {
|
||||
background: qlineargradient(
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #1f4fff,
|
||||
stop:0.5 #2f6bff,
|
||||
stop:1 #5fa0ff
|
||||
);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 未滑过 */
|
||||
QSlider::add-page:horizontal {
|
||||
height: 10px;
|
||||
background: #2a3550;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* ===== 滑块按钮 ===== */
|
||||
QSlider::handle:horizontal {
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
|
||||
/* 蓝色实心 */
|
||||
background: #2f6bff;
|
||||
|
||||
/* 白色外圈 */
|
||||
border: 2px solid #ffffff;
|
||||
border-radius: 5px;
|
||||
|
||||
/* 垂直居中 */
|
||||
margin: -5px 0;
|
||||
}
|
||||
|
||||
/* 悬停 */
|
||||
QSlider::handle:horizontal:hover {
|
||||
background: #4d8dff;
|
||||
}
|
||||
|
||||
/* 按下 */
|
||||
QSlider::handle:horizontal:pressed {
|
||||
background: #1f4fff;
|
||||
}</string>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>光谱仪</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="HPPA.qrc">:/HPPA/HPPA.ico</pixmap>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<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="horizontalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>帧率</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="framerate_lineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSlider" name="FramerateSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>积分时间</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="integratioin_time_lineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSlider" name="IntegratioinTimeSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>gain</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="gain_lineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSlider" name="GainSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="rgbCameraWidget">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox
|
||||
@ -816,18 +502,83 @@ QPushButton:pressed
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="mapToolBar">
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>图像查看</string>
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolBar {
|
||||
background: #040125;/*transparent*/
|
||||
border: 1px solid #040125;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
<enum>LeftToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>toolBar_2</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolBar {
|
||||
background: #040125;/*transparent*/
|
||||
border: 1px solid #040125;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>RightToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar_3">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>toolBar_3</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolBar {
|
||||
background: #040125;/*transparent*/
|
||||
border: 1px solid #040125;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>BottomToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="mActionPan"/>
|
||||
<addaction name="mActionSpectral"/>
|
||||
</widget>
|
||||
<action name="action_exit">
|
||||
<property name="text">
|
||||
@ -1090,11 +841,6 @@ QPushButton:pressed
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QDoubleSlider</class>
|
||||
<extends>QSlider</extends>
|
||||
<header>qdoubleslider.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>CustomDockWidgetBase</class>
|
||||
<extends>QDockWidget</extends>
|
||||
|
||||
@ -32,12 +32,12 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.13.2_msvc2017_64</QtInstall>
|
||||
<QtModules>core;network;gui;widgets;serialport;websockets;3dcore;3danimation;3dextras;3dinput;3dlogic;3drender;3dquick;charts</QtModules>
|
||||
<QtModules>core;network;gui;svg;widgets;serialport;websockets;3dcore;3danimation;3dextras;3dinput;3dlogic;3drender;3dquick;charts</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>5.9_msvc2017_64</QtInstall>
|
||||
<QtModules>core;network;gui;widgets;serialport;websockets;charts</QtModules>
|
||||
<QtInstall>5.13.2_msvc2017_64</QtInstall>
|
||||
<QtModules>core;network;gui;svg;widgets;serialport;websockets;3dcore;3danimation;3dextras;3dinput;3dlogic;3drender;3dquick;charts</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
@ -57,10 +57,12 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<IncludePath>D:\cpp_library\gdal2.2.3_vs2017\include;C:\Program Files\ResononAPI\include;D:\cpp_library\opencv3.4.11\opencv\build\include;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv2;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PCOMM\Include;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PortControl;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL;D:\cpp_project_vs2022\HPPA\HPPA;D:\cpp_library\libconfig-1.7.3\lib;D:\cpp_project_vs2022\HPPA\vincecontrol;D:\cpp_library\vincecontrol_vs2017;C:\XIMEA\API\xiAPI;D:\cpp_project_vs2022\HPPA\IrisMultiMotorController\IrisMultiMotorController;D:\cpp_library\eigen-3.4-rc1;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\cpp_library\opencv3.4.11\opencv\build\x64\vc15\lib;D:\cpp_library\gdal2.2.3_vs2017\lib;C:\Program Files\ResononAPI\lib64;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\x64\Debug;D:\cpp_library\libconfig-1.7.3\build\x64;D:\cpp_project_vs2022\HPPA\x64\Debug;C:\XIMEA\API\xiAPI;D:\cpp_project_vs2022\HPPA\IrisMultiMotorController\x64\Debug;$(LibraryPath)</LibraryPath>
|
||||
<TargetName>Spectral Insight</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<IncludePath>D:\cpp_library\gdal2.2.3_vs2017\include;C:\Program Files\ResononAPI\include;D:\cpp_library\opencv3.4.11\opencv\build\include;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv2;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PCOMM\Include;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PortControl;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL;D:\cpp_project_vs2022\HPPA\HPPA;D:\cpp_library\libconfig-1.7.3\lib;D:\cpp_project_vs2022\HPPA\vincecontrol;C:\XIMEA\API\xiAPI;D:\cpp_project_vs2022\HPPA\IrisMultiMotorController\IrisMultiMotorController;D:\cpp_library\eigen-3.4-rc1;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\cpp_library\opencv3.4.11\opencv\build\x64\vc15\lib;D:\cpp_library\vincecontrol_vs2017_release;D:\cpp_library\gdal2.2.3_vs2017\lib;C:\Program Files\ResononAPI\lib64;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\x64\Release;D:\cpp_library\libconfig-1.7.3\build\x64;D:\cpp_project_vs2022\IrisMultiMotorController\x64\Release;C:\XIMEA\API\xiAPI;$(LibraryPath)</LibraryPath>
|
||||
<TargetName>Spectral Insight</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Link>
|
||||
@ -106,11 +108,13 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="aboutWindow.cpp" />
|
||||
<ClCompile Include="adjustTable.cpp" />
|
||||
<ClCompile Include="AspectRatioLabel.cpp" />
|
||||
<ClCompile Include="CaptureCoordinator.cpp" />
|
||||
<ClCompile Include="Carousel.cpp" />
|
||||
<ClCompile Include="Corning410Imager.cpp" />
|
||||
<ClCompile Include="CustomDockWidgetBase.cpp" />
|
||||
<ClCompile Include="hppaConfigFile.cpp" />
|
||||
<ClCompile Include="HyperImagerControl.cpp" />
|
||||
<ClCompile Include="imageControl.cpp" />
|
||||
<ClCompile Include="ImagerOperationBase.cpp" />
|
||||
<ClCompile Include="imager_base.cpp" />
|
||||
@ -136,6 +140,7 @@
|
||||
<ClCompile Include="RasterDataProvider.cpp" />
|
||||
<ClCompile Include="RasterLayer.cpp" />
|
||||
<ClCompile Include="RasterRenderer.cpp" />
|
||||
<ClCompile Include="recordFrameCounter.cpp" />
|
||||
<ClCompile Include="resononImager.cpp" />
|
||||
<ClCompile Include="ResononNirImager.cpp" />
|
||||
<ClCompile Include="RgbCameraOperation.cpp" />
|
||||
@ -165,6 +170,7 @@
|
||||
<ClCompile Include="imagerSimulatioin.cpp" />
|
||||
<ClCompile Include="ImageViewer.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
<QtUic Include="hyperImagerControl.ui" />
|
||||
<QtUic Include="imgControl.ui" />
|
||||
<QtUic Include="oneMotorControl.ui" />
|
||||
<QtUic Include="PathPlan.ui" />
|
||||
@ -194,6 +200,8 @@
|
||||
<QtMoc Include="CustomDockWidgetBase.h" />
|
||||
<QtMoc Include="Carousel.h" />
|
||||
<QtMoc Include="imageControl.h" />
|
||||
<QtMoc Include="AspectRatioLabel.h" />
|
||||
<QtMoc Include="HyperImagerControl.h" />
|
||||
<ClInclude Include="imager_base.h" />
|
||||
<ClInclude Include="irisximeaimager.h" />
|
||||
<QtMoc Include="OneMotorControl.h" />
|
||||
@ -215,6 +223,7 @@
|
||||
<QtMoc Include="MapTools.h" />
|
||||
<ClInclude Include="RasterDataProvider.h" />
|
||||
<ClInclude Include="RasterRenderer.h" />
|
||||
<QtMoc Include="recordFrameCounter.h" />
|
||||
<ClInclude Include="utility_tc.h" />
|
||||
<QtMoc Include="aboutWindow.h" />
|
||||
<ClInclude Include="hppaConfigFile.h" />
|
||||
@ -240,7 +249,7 @@
|
||||
<ResourceCompile Include="HPPA.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="HPPA.ico" />
|
||||
<Image Include="resources\icons\ico\Spectral_Insight_128.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
|
||||
@ -190,6 +190,15 @@
|
||||
<ClCompile Include="MapTools.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="AspectRatioLabel.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HyperImagerControl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="recordFrameCounter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="fileOperation.h">
|
||||
@ -306,6 +315,15 @@
|
||||
<QtMoc Include="MapTools.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="AspectRatioLabel.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="HyperImagerControl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="recordFrameCounter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="imageProcessor.h">
|
||||
@ -382,6 +400,9 @@
|
||||
<QtUic Include="imgControl.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="hyperImagerControl.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
@ -392,7 +413,7 @@
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="HPPA.ico">
|
||||
<Image Include="resources\icons\ico\Spectral_Insight_128.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
|
||||
195
HPPA/HyperImagerControl.cpp
Normal file
195
HPPA/HyperImagerControl.cpp
Normal file
@ -0,0 +1,195 @@
|
||||
#include "HyperImagerControl.h"
|
||||
|
||||
HyperImagerControl::HyperImagerControl(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
connect(ui.framerate_spinBox, &QDoubleSpinBox::editingFinished, this, &HyperImagerControl::onFramerateSpinBoxEditingFinished);
|
||||
connect(ui.FramerateSlider, &QDoubleSlider::valueChanged, this, &HyperImagerControl::onFramerateSliderChanged);
|
||||
connect(ui.FramerateSlider, &QDoubleSlider::sliderReleased, this, &HyperImagerControl::onFramerateSliderReleased);
|
||||
|
||||
connect(ui.integratioin_time_spinBox, &QDoubleSpinBox::editingFinished, this, &HyperImagerControl::onIntegrationTimeSpinBoxEditingFinished);
|
||||
connect(ui.IntegratioinTimeSlider, &QDoubleSlider::valueChanged, this, &HyperImagerControl::onIntegrationTimeSliderChanged);
|
||||
connect(ui.IntegratioinTimeSlider, &QDoubleSlider::sliderReleased, this, &HyperImagerControl::onIntegrationTimeSliderReleased);
|
||||
|
||||
connect(ui.gain_spinBox, &QDoubleSpinBox::editingFinished, this, &HyperImagerControl::onGainSpinBoxEditingFinished);
|
||||
connect(ui.GainSlider, &QSlider::valueChanged, this, &HyperImagerControl::onGainSliderChanged);
|
||||
connect(ui.GainSlider, &QSlider::sliderReleased, this, &HyperImagerControl::onGainSliderReleased);
|
||||
|
||||
ui.GainSlider->setMaximum(12);
|
||||
ui.GainSlider->setMinimum(0);
|
||||
|
||||
ui.gain_spinBox->setMaximum(12);
|
||||
ui.gain_spinBox->setMinimum(0);
|
||||
|
||||
ui.widget_3->setStyleSheet(R"(
|
||||
QDoubleSpinBox {
|
||||
border: 1px solid #999;
|
||||
border-radius: 4px;
|
||||
padding: 2px 20px 2px 6px; /* 右侧留空间给按钮 */
|
||||
background: #0e1c4c;
|
||||
selection-background-color: #0078d7;
|
||||
font-size: 12px;
|
||||
color:#ACCDFF ;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: top right;
|
||||
width: 16px;
|
||||
border-left: 1px solid #ccc;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::down-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: bottom right;
|
||||
width: 16px;
|
||||
border-left: 1px solid #ccc;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-arrow {
|
||||
image: url(:/svg/resources/icons/svg/arrow_up.svg);
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::down-arrow {
|
||||
image: url(:/svg/resources/icons/svg/arrow_down.svg);
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-button:hover,
|
||||
QDoubleSpinBox::down-button:hover {
|
||||
background: #e6f2ff;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-button:pressed,
|
||||
QDoubleSpinBox::down-button:pressed {
|
||||
background: #cce4ff;
|
||||
}
|
||||
)");
|
||||
|
||||
}
|
||||
|
||||
HyperImagerControl::~HyperImagerControl()
|
||||
{
|
||||
}
|
||||
|
||||
void HyperImagerControl::setFrameRate(double frameRate)
|
||||
{
|
||||
ui.framerate_spinBox->setValue(frameRate);
|
||||
ui.FramerateSlider->setValue(frameRate);
|
||||
|
||||
updateIntegrationTimeRange(frameRate);
|
||||
}
|
||||
|
||||
void HyperImagerControl::setIntegrationTime(double integrationTime)
|
||||
{
|
||||
ui.integratioin_time_spinBox->setValue(integrationTime);
|
||||
ui.IntegratioinTimeSlider->setValue(integrationTime);
|
||||
|
||||
updateFramerateRange(integrationTime);
|
||||
}
|
||||
|
||||
void HyperImagerControl::setGain(double gain)
|
||||
{
|
||||
ui.gain_spinBox->setValue(gain);
|
||||
ui.GainSlider->setValue(gain);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onFramerateSpinBoxEditingFinished()
|
||||
{
|
||||
double framerate = ui.framerate_spinBox->value();
|
||||
ui.FramerateSlider->setValue(framerate);
|
||||
emit framerateChanged(framerate);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onFramerateSliderChanged(double framerate)
|
||||
{
|
||||
ui.framerate_spinBox->blockSignals(true);
|
||||
ui.framerate_spinBox->setValue(framerate);
|
||||
ui.framerate_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onFramerateSliderReleased()
|
||||
{
|
||||
double framerate = ui.framerate_spinBox->value();
|
||||
emit framerateChanged(framerate);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onIntegrationTimeSpinBoxEditingFinished()
|
||||
{
|
||||
double integrationTime = ui.integratioin_time_spinBox->value();
|
||||
ui.IntegratioinTimeSlider->setValue(integrationTime);
|
||||
emit integrationTimeChanged(integrationTime);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onIntegrationTimeSliderChanged(double integrationTime)
|
||||
{
|
||||
ui.integratioin_time_spinBox->blockSignals(true);
|
||||
ui.integratioin_time_spinBox->setValue(integrationTime);
|
||||
ui.integratioin_time_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onIntegrationTimeSliderReleased()
|
||||
{
|
||||
double integrationTime = ui.integratioin_time_spinBox->value();
|
||||
emit integrationTimeChanged(integrationTime);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onGainSpinBoxEditingFinished()
|
||||
{
|
||||
double gain = ui.gain_spinBox->value();
|
||||
ui.GainSlider->setValue(gain);
|
||||
emit gainChanged(gain);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onGainSliderChanged(double gain)
|
||||
{
|
||||
ui.gain_spinBox->blockSignals(true);
|
||||
ui.gain_spinBox->setValue(gain);
|
||||
ui.gain_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::onGainSliderReleased()
|
||||
{
|
||||
double gain = ui.gain_spinBox->value();
|
||||
emit gainChanged(gain);
|
||||
}
|
||||
|
||||
void HyperImagerControl::updateIntegrationTimeRange(double frameRate)
|
||||
{
|
||||
double maxIntegrationTime = 1.0 / frameRate * 1000.0; // 毫秒
|
||||
|
||||
ui.IntegratioinTimeSlider->blockSignals(true);
|
||||
ui.IntegratioinTimeSlider->setMaximum(maxIntegrationTime);
|
||||
ui.IntegratioinTimeSlider->setMinimum(1);
|
||||
ui.IntegratioinTimeSlider->blockSignals(false);
|
||||
|
||||
ui.integratioin_time_spinBox->blockSignals(true);
|
||||
ui.integratioin_time_spinBox->setMaximum(maxIntegrationTime);
|
||||
ui.integratioin_time_spinBox->setMinimum(1);
|
||||
ui.integratioin_time_spinBox->blockSignals(false);
|
||||
}
|
||||
|
||||
void HyperImagerControl::updateFramerateRange(double integrationTime)
|
||||
{
|
||||
double maxFramerate = 1.0 / (integrationTime / 1000.0); // 积分时间(毫秒)转帧率
|
||||
|
||||
if(maxFramerate > m_frameRateLimit)
|
||||
{
|
||||
maxFramerate = m_frameRateLimit;
|
||||
}
|
||||
|
||||
ui.FramerateSlider->blockSignals(true);
|
||||
ui.FramerateSlider->setMaximum(maxFramerate);
|
||||
ui.FramerateSlider->setMinimum(1);
|
||||
ui.FramerateSlider->blockSignals(false);
|
||||
|
||||
ui.framerate_spinBox->blockSignals(true);
|
||||
ui.framerate_spinBox->setMaximum(maxFramerate);
|
||||
ui.framerate_spinBox->setMinimum(1);
|
||||
ui.framerate_spinBox->blockSignals(false);
|
||||
}
|
||||
47
HPPA/HyperImagerControl.h
Normal file
47
HPPA/HyperImagerControl.h
Normal file
@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "ui_hyperImagerControl.h"
|
||||
|
||||
#include "AspectRatioLabel.h"
|
||||
|
||||
class QDoubleSlider;
|
||||
|
||||
class HyperImagerControl : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HyperImagerControl(QWidget* parent = nullptr);
|
||||
~HyperImagerControl();
|
||||
|
||||
AspectRatioLabel* imagerPictureLabel() const { return ui.imagerPictureLabel; }
|
||||
|
||||
void setFrameRate(double frameRate);
|
||||
void setIntegrationTime(double integrationTime);
|
||||
void setGain(double gain);
|
||||
|
||||
signals:
|
||||
void framerateChanged(double framerate);
|
||||
void integrationTimeChanged(double integrationTime);
|
||||
void gainChanged(double gain);
|
||||
|
||||
private Q_SLOTS:
|
||||
void onFramerateSpinBoxEditingFinished();
|
||||
void onFramerateSliderChanged(double framerate);
|
||||
void onFramerateSliderReleased();
|
||||
void onIntegrationTimeSpinBoxEditingFinished();
|
||||
void onIntegrationTimeSliderChanged(double integrationTime);
|
||||
void onIntegrationTimeSliderReleased();
|
||||
void onGainSpinBoxEditingFinished();
|
||||
void onGainSliderChanged(double gain);
|
||||
void onGainSliderReleased();
|
||||
|
||||
private:
|
||||
void updateIntegrationTimeRange(double frameRate);
|
||||
void updateFramerateRange(double integrationTime);
|
||||
double m_frameRateLimit = 150;//相机的最大帧率限制为250fps
|
||||
|
||||
Ui::HyperImagerControl ui;
|
||||
};
|
||||
@ -67,6 +67,8 @@ double ImagerOperationBase::auto_exposure()
|
||||
|
||||
imagerStopCollect();
|
||||
|
||||
emit autoExposureSignal();
|
||||
|
||||
//std::cout << "<22>Զ<EFBFBD><D4B6>ع⣺" << getIntegrationTime() << std::endl;
|
||||
|
||||
return getIntegrationTime();
|
||||
|
||||
@ -114,6 +114,7 @@ signals:
|
||||
|
||||
|
||||
void testImagerStatus();//<2F><>ʾ<EFBFBD><CABE><EFBFBD>Բ<EFBFBD><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<D7B4><CCAC><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
void autoExposureSignal();
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Ӱ<EFBFBD><D3B0><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>.bil/.hdr<64><72>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ɺ<C9BA><F3B7A2B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӳɼ<D3B2><C9BC>̷߳<DFB3><CCB7><EFBFBD><EFBFBD><EFBFBD>Qt <20><><EFBFBD><EFBFBD> queued connection<6F><6E>
|
||||
void ImageFileSaved(const QString& path, int fileIndex);
|
||||
|
||||
@ -64,12 +64,12 @@ QVariant LayerTreeModel::data(const QModelIndex& index, int role) const
|
||||
else if (LayerTreeNode::isLayer(tmp))
|
||||
{
|
||||
QString basePath = QCoreApplication::applicationDirPath();
|
||||
return QIcon(basePath + "/icons/mIconRaster.svg");
|
||||
return QIcon(":/svg/resources/icons/svg/mIconRaster.svg");
|
||||
}
|
||||
}
|
||||
|
||||
case Qt::CheckStateRole:
|
||||
return static_cast<int>(n->visible());
|
||||
//case Qt::CheckStateRole:
|
||||
// return static_cast<int>(n->visible());
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
return (n->type() == LayerTreeNode::Type::Group) ? "Group" : "Layer";
|
||||
|
||||
@ -30,6 +30,19 @@ void LayerTreeView::contextMenuEvent(QContextMenuEvent* event)
|
||||
setCurrentIndex(QModelIndex());
|
||||
|
||||
QMenu* menu = m_menuProvider->createContextMenu();
|
||||
menu->setStyleSheet(R"(
|
||||
QMenu {
|
||||
background-color: #2a5dec;
|
||||
color: white;
|
||||
}
|
||||
QMenu::item:selected {
|
||||
background-color: #1a4ddc;
|
||||
}
|
||||
QMenu::separator {
|
||||
height: 1px;
|
||||
background: white;
|
||||
}
|
||||
)");
|
||||
if (menu)
|
||||
{
|
||||
menu->exec(event->globalPos());
|
||||
|
||||
@ -7,6 +7,7 @@ m_Multiplier(100.0)
|
||||
connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int)));
|
||||
|
||||
setSingleStep(1);
|
||||
setRange(1, 500);
|
||||
|
||||
setOrientation(Qt::Horizontal);
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
@ -23,8 +23,8 @@ public:
|
||||
private slots:
|
||||
|
||||
signals :
|
||||
void valueChanged(double Value);
|
||||
void rangeChanged(double Min, double Max);
|
||||
void valueChanged(double Value);//QSlider<65><72>valueChanged<65>źŵIJ<C5B5><C4B2><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
void rangeChanged(double Min, double Max);//QSlider<65><72>rangeChanged<65>źŵIJ<C5B5><C4B2><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
|
||||
private:
|
||||
double m_Multiplier;
|
||||
|
||||
@ -232,20 +232,44 @@ void TwoMotorControl::display_motors_connectivity(std::vector<int> connectivity)
|
||||
//std::cout << "-----------------------------------"<<connectivity.size()<< std::endl;
|
||||
if (connectivity[0])
|
||||
{
|
||||
this->ui.xMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(0,255,0);}");
|
||||
this->ui.xMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: #08FACE;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui.xMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(255,0,0);}");
|
||||
this->ui.xMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: red;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
|
||||
if (connectivity[1])
|
||||
{
|
||||
this->ui.yMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(0,255,0);}");
|
||||
this->ui.yMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: #08FACE;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
else
|
||||
{
|
||||
this->ui.yMotorStateLabel->setStyleSheet("QLabel{background-color:rgb(255,0,0);}");
|
||||
this->ui.yMotorStateLabel->setStyleSheet(R"(
|
||||
QLabel
|
||||
{
|
||||
background-color: red;
|
||||
border-radius: 4px;
|
||||
}
|
||||
)");
|
||||
}
|
||||
}
|
||||
|
||||
@ -440,7 +464,7 @@ void TwoMotorControl::onSaveRecordLine2File_btn()
|
||||
fclose(RecordLineFileHandle);
|
||||
delete[] data;
|
||||
|
||||
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
|
||||
//QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
|
||||
}
|
||||
|
||||
void TwoMotorControl::onReadRecordLineFile_btn()
|
||||
@ -499,5 +523,5 @@ void TwoMotorControl::onReadRecordLineFile_btn()
|
||||
fclose(RecordLineFileHandle);
|
||||
delete[] data;
|
||||
|
||||
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("读取成功!"));
|
||||
//QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("读取成功!"));
|
||||
}
|
||||
|
||||
371
HPPA/about.ui
371
HPPA/about.ui
@ -9,103 +9,300 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>629</width>
|
||||
<height>463</height>
|
||||
<width>486</width>
|
||||
<height>401</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>HPPA.ico</normaloff>HPPA.ico</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>250</y>
|
||||
<width>434</width>
|
||||
<height>134</height>
|
||||
</rect>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="companylname_label">
|
||||
<property name="text">
|
||||
<string>公司:北京依锐思遥感技术有限公司</string>
|
||||
<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="QWidget" name="contentWidget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #contentWidget
|
||||
{
|
||||
background: #040125;
|
||||
/*border-radius: 8px 8px 8px 8px;*/
|
||||
border: 1px solid #2f6bff;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>地址:北京市海淀区清河安宁庄东路18号5号楼二层205</string>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>电话:010-51292601</string>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>邮箱:hanshanlong@iris-rs.cn</string>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>150</y>
|
||||
<width>141</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>版本:2.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<y>70</y>
|
||||
<width>391</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hyper Plant Phenotypic Analysis</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>50</y>
|
||||
<width>141</width>
|
||||
<height>141</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap>HPPA.ico</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QWidget" name="titlebarWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #titlebarWidget
|
||||
{
|
||||
background: #0E1C4C;
|
||||
border: 1px solid #2f6bff;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="HPPA.qrc">:/png/resources/icons/png/Spectral_Insight_27.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel
|
||||
{
|
||||
color:#E2EDFF;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>关于</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>505</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="closeBtn">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton
|
||||
{
|
||||
/*width: 172px;
|
||||
height: 56px;*/
|
||||
font: 10pt "新宋体";
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0.5, y1:0, x2:0.5, y2:1,
|
||||
stop:0 #283D86,
|
||||
stop:1 #0F1A40
|
||||
);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
QPushButton:hover
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #3A4875,
|
||||
stop:1 #5F6B91
|
||||
);
|
||||
}
|
||||
/* 按下时的效果 */
|
||||
QPushButton:pressed
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #1A254F,
|
||||
stop:1 #3A466B
|
||||
);
|
||||
/* 可选:添加下压效果 */
|
||||
padding-top: 9px;
|
||||
padding-bottom: 7px;
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="HPPA.qrc">
|
||||
<normaloff>:/svg/resources/icons/svg/close.svg</normaloff>:/svg/resources/icons/svg/close.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>20</y>
|
||||
<width>171</width>
|
||||
<height>171</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="HPPA.qrc">:/png/resources/icons/png/Spectral_Insight_170.png</pixmap>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>210</y>
|
||||
<width>306</width>
|
||||
<height>111</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel
|
||||
{
|
||||
color: #E2EDFF;
|
||||
font: 10pt "Adobe Devanagari";
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>地址:北京市海淀区清河安宁庄东路18号5号楼二层205</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>电话:010-51292601</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>邮箱:hanshanlong@iris-rs.cn</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="companylname_label">
|
||||
<property name="text">
|
||||
<string>公司:北京依锐思遥感技术有限公司</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>260</x>
|
||||
<y>50</y>
|
||||
<width>171</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="verticalSpacing">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="nameLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel
|
||||
{
|
||||
color:#E2EDFF;
|
||||
font: italic 18pt "Adobe Devanagari";
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Spectral Insight</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="versionLabel">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel
|
||||
{
|
||||
color:#E2EDFF;
|
||||
font: 10pt "Adobe Devanagari";
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>版本:3.0.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="HPPA.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "aboutWindow.h"
|
||||
|
||||
#include <QSvgRenderer>
|
||||
#include <QPainter>
|
||||
|
||||
aboutWindow::aboutWindow(QWidget* parent)
|
||||
{
|
||||
@ -9,14 +10,22 @@ aboutWindow::aboutWindow(QWidget* parent)
|
||||
QString text = ui.companylname_label->text();
|
||||
ui.companylname_label->setText("<a style='color: green; text-decoration: none' href = http://www.iris-rs.cn/pr.jsp?_jcp=3_10>" + text);
|
||||
|
||||
Qt::WindowFlags flags = 0;
|
||||
//flags |= Qt::WindowMinimizeButtonHint;
|
||||
flags |= Qt::WindowCloseButtonHint;
|
||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
setWindowFlags(flags);
|
||||
//Qt::WindowFlags flags = 0;
|
||||
////flags |= Qt::WindowMinimizeButtonHint;
|
||||
//flags |= Qt::WindowCloseButtonHint;
|
||||
//flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||
//setWindowFlags(flags);
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
|
||||
connect(this->ui.closeBtn, SIGNAL(released()), this, SLOT(onExit()));
|
||||
}
|
||||
|
||||
aboutWindow::~aboutWindow()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void aboutWindow::onExit()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
@ -2,6 +2,7 @@
|
||||
#include <QtWidgets/qdialog.h>
|
||||
#include <qstring.h>
|
||||
|
||||
|
||||
#include "ui_about.h"
|
||||
|
||||
class aboutWindow :public QDialog
|
||||
@ -19,6 +20,7 @@ private:
|
||||
Ui::aboutDialog ui;
|
||||
|
||||
public Q_SLOTS:
|
||||
void onExit();
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
@ -1,10 +1,22 @@
|
||||
#include "stdafx.h"
|
||||
#include "focusWindow.h"
|
||||
#include <QSvgRenderer>
|
||||
#include <QMouseEvent>
|
||||
|
||||
focusWindow::focusWindow(QWidget *parent, ImagerOperationBase* imager)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
ui.titlebarWidget->installEventFilter(this);
|
||||
|
||||
QSvgRenderer svgRenderer(QString(":/svg/resources/icons/svg/focus.svg"));
|
||||
QPixmap pixmap(24, 24);
|
||||
pixmap.fill(Qt::transparent); // 背景透明
|
||||
QPainter painter(&pixmap);
|
||||
svgRenderer.render(&painter);
|
||||
ui.iconLabel->setPixmap(pixmap);
|
||||
|
||||
//读取配置文件
|
||||
string HPPACfgFile = getPathofEXE() + "\\HPPA.cfg";
|
||||
Configfile configfile;
|
||||
@ -39,6 +51,7 @@ focusWindow::focusWindow(QWidget *parent, ImagerOperationBase* imager)
|
||||
connect(this->ui.moveto_btn, SIGNAL(clicked()), this, SLOT(onMoveto()));
|
||||
|
||||
connect(this->ui.rangeMeasurement_btn, SIGNAL(pressed()), this, SLOT(onx_rangeMeasurement()));
|
||||
connect(this->ui.closeBtn, SIGNAL(released()), this, SLOT(onExit()));
|
||||
|
||||
//查找可用串口,并显示
|
||||
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||
@ -67,6 +80,7 @@ focusWindow::~focusWindow()
|
||||
printf("destroy focusWindow-------------------------\n");
|
||||
|
||||
emit StartManualFocusSignal(0);//当用户没有点击停止调焦就关闭窗口
|
||||
emit closeSignal();
|
||||
|
||||
delete m_ctrlFocusMotor;
|
||||
//delete thread1, progressThread;
|
||||
@ -78,9 +92,50 @@ focusWindow::~focusWindow()
|
||||
m_MotionCaptureCoordinatorThread.wait();
|
||||
}
|
||||
|
||||
void focusWindow::onExit()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
bool focusWindow::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (obj == ui.titlebarWidget)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonPress)
|
||||
{
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton)
|
||||
{
|
||||
m_bDrag = true;
|
||||
m_dragPosition = mouseEvent->globalPos() - frameGeometry().topLeft();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::MouseMove)
|
||||
{
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (m_bDrag && (mouseEvent->buttons() & Qt::LeftButton))
|
||||
{
|
||||
move(mouseEvent->globalPos() - m_dragPosition);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::MouseButtonRelease)
|
||||
{
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton)
|
||||
{
|
||||
m_bDrag = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
void focusWindow::disableBeforeConnect(bool disable)
|
||||
{
|
||||
ui.controlMotor_groupBox->setDisabled(disable);
|
||||
ui.controlMotor_widget->setDisabled(disable);
|
||||
ui.autoFocus_btn->setDisabled(disable);
|
||||
}
|
||||
|
||||
@ -151,7 +206,7 @@ void focusWindow::onConnectMotor()
|
||||
int motorPort = rx.cap(0).toInt();
|
||||
rx.indexIn(ultrasoundPortTmp, 0);
|
||||
int ultrasoundPort = rx.cap(0).toInt();
|
||||
|
||||
|
||||
|
||||
|
||||
if (isUltrasound)
|
||||
|
||||
@ -105,8 +105,13 @@ public:
|
||||
|
||||
ImagerOperationBase* m_Imager;
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private:
|
||||
QPoint m_dragPosition;
|
||||
bool m_bDrag = false;
|
||||
|
||||
Ui::focusDialog ui;
|
||||
QThread *m_AutoFocusThread;
|
||||
int m_FocusState;
|
||||
@ -151,6 +156,8 @@ public Q_SLOTS:
|
||||
|
||||
void moveAfterAutoFocus(int motorID, double location);
|
||||
|
||||
void onExit();
|
||||
|
||||
signals:
|
||||
void StartManualFocusSignal(int);//1<><31><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
@ -161,6 +168,7 @@ signals:
|
||||
void zeroStartSignal(int);
|
||||
|
||||
void startStepMotion(double speed, int stepInterval = 100, double startPos = 0, double endPos = -1);
|
||||
void closeSignal();
|
||||
};
|
||||
|
||||
class WorkerThread2 : public QThread
|
||||
|
||||
341
HPPA/hyperImagerControl.ui
Normal file
341
HPPA/hyperImagerControl.ui
Normal file
@ -0,0 +1,341 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>HyperImagerControl</class>
|
||||
<widget class="QWidget" name="HyperImagerControl">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>437</width>
|
||||
<height>372</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Color Adjust</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QGroupBox
|
||||
{
|
||||
border: 12px solid transparent;
|
||||
/*border-top: 12px solid transparent;
|
||||
border-right: 0px solid transparent;
|
||||
border-bottom: 0px solid transparent;
|
||||
border-left: 0px solid transparent;*/
|
||||
color: #ACCDFF;
|
||||
}
|
||||
|
||||
QPushButton
|
||||
{
|
||||
/*width: 172px;
|
||||
height: 56px;*/
|
||||
font: 10pt "新宋体";
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0.5, y1:0, x2:0.5, y2:1,
|
||||
stop:0 #283D86,
|
||||
stop:1 #0F1A40
|
||||
);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
QPushButton:hover
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #3A4875,
|
||||
stop:1 #5F6B91
|
||||
);
|
||||
}
|
||||
/* 按下时的效果 */
|
||||
QPushButton:pressed
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #1A254F,
|
||||
stop:1 #3A466B
|
||||
);
|
||||
/* 可选:添加下压效果 */
|
||||
padding-top: 9px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
QLabel {
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
QSlider::groove:horizontal {
|
||||
height: 10px;
|
||||
background: #1e2a44;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 已滑过:渐变蓝 */
|
||||
QSlider::sub-page:horizontal {
|
||||
background: qlineargradient(
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #1f4fff,
|
||||
stop:0.5 #2f6bff,
|
||||
stop:1 #5fa0ff
|
||||
);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 未滑过 */
|
||||
QSlider::add-page:horizontal {
|
||||
height: 10px;
|
||||
background: #2a3550;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* ===== 滑块按钮 ===== */
|
||||
QSlider::handle:horizontal {
|
||||
width: 15px;
|
||||
height: 10px;
|
||||
|
||||
/* 蓝色实心 */
|
||||
background: #2f6bff;
|
||||
|
||||
/* 白色外圈 */
|
||||
border: 2px solid #ffffff;
|
||||
border-radius: 5px;
|
||||
|
||||
/* 垂直居中 */
|
||||
margin: -5px 0;
|
||||
}
|
||||
|
||||
/* 悬停 */
|
||||
QSlider::handle:horizontal:hover {
|
||||
background: #4d8dff;
|
||||
}
|
||||
|
||||
/* 按下 */
|
||||
QSlider::handle:horizontal:pressed {
|
||||
background: #1f4fff;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="3,2">
|
||||
<item row="0" column="0">
|
||||
<widget class="AspectRatioLabel" name="imagerPictureLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QDoubleSpinBox" name="framerate_spinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QDoubleSlider" name="FramerateSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>gain</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>积分时间</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="gain_spinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QSlider" name="GainSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="integratioin_time_spinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QDoubleSlider" name="IntegratioinTimeSlider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>帧率</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>hz</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>ms</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>AspectRatioLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>AspectRatioLabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>QDoubleSlider</class>
|
||||
<extends>QSlider</extends>
|
||||
<header location="global">qdoubleslider.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -37,6 +37,54 @@ ImageControl::ImageControl(QWidget* parent)
|
||||
ui.spinRed->setKeyboardTracking(false);
|
||||
ui.spinGreen->setKeyboardTracking(false);
|
||||
ui.spinBlue->setKeyboardTracking(false);
|
||||
|
||||
ui.groupAdjustments->setStyleSheet(R"(
|
||||
QDoubleSpinBox {
|
||||
border: 1px solid #999;
|
||||
border-radius: 4px;
|
||||
padding: 2px 20px 2px 6px; /* <20>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>ť */
|
||||
background: #0e1c4c;
|
||||
selection-background-color: #0078d7;
|
||||
font-size: 12px;
|
||||
color:#ACCDFF ;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: top right;
|
||||
width: 16px;
|
||||
border-left: 1px solid #ccc;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::down-button {
|
||||
subcontrol-origin: border;
|
||||
subcontrol-position: bottom right;
|
||||
width: 16px;
|
||||
border-left: 1px solid #ccc;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-arrow {
|
||||
image: url(:/svg/resources/icons/svg/arrow_up.svg);
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::down-arrow {
|
||||
image: url(:/svg/resources/icons/svg/arrow_down.svg);
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-button:hover,
|
||||
QDoubleSpinBox::down-button:hover {
|
||||
background: #e6f2ff;
|
||||
}
|
||||
|
||||
QDoubleSpinBox::up-button:pressed,
|
||||
QDoubleSpinBox::down-button:pressed {
|
||||
background: #cce4ff;
|
||||
}
|
||||
)");
|
||||
}
|
||||
|
||||
ImageControl::~ImageControl()
|
||||
|
||||
@ -14,7 +14,56 @@
|
||||
<string>Color Adjust</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel {
|
||||
<string notr="true">QGroupBox
|
||||
{
|
||||
border: 12px solid transparent;
|
||||
/*border-top: 12px solid transparent;
|
||||
border-right: 0px solid transparent;
|
||||
border-bottom: 0px solid transparent;
|
||||
border-left: 0px solid transparent;*/
|
||||
color: #ACCDFF;
|
||||
}
|
||||
|
||||
QPushButton
|
||||
{
|
||||
/*width: 172px;
|
||||
height: 56px;*/
|
||||
font: 10pt "新宋体";
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0.5, y1:0, x2:0.5, y2:1,
|
||||
stop:0 #283D86,
|
||||
stop:1 #0F1A40
|
||||
);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
QPushButton:hover
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #3A4875,
|
||||
stop:1 #5F6B91
|
||||
);
|
||||
}
|
||||
/* 按下时的效果 */
|
||||
QPushButton:pressed
|
||||
{
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0, y1:0, x2:1, y2:0,
|
||||
stop:0 #1A254F,
|
||||
stop:1 #3A466B
|
||||
);
|
||||
/* 可选:添加下压效果 */
|
||||
padding-top: 9px;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
QLabel {
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
@ -71,10 +120,21 @@ QSlider::handle:horizontal:pressed {
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupAdjustments">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel
|
||||
{
|
||||
color: #ACCDFF;
|
||||
font-size: 14px;
|
||||
font: 9pt "Adobe Devanagari";
|
||||
}</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>调整</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="horizontalSpacing">
|
||||
<number>16</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="labelRed">
|
||||
<property name="text">
|
||||
@ -185,16 +245,40 @@ QSlider::handle:horizontal:pressed {
|
||||
<property name="title">
|
||||
<string>预设</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="presetLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="btnTrueColor">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>真彩色</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="btnColorInfrared">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>假彩色</string>
|
||||
</property>
|
||||
|
||||
57
HPPA/recordFrameCounter.cpp
Normal file
57
HPPA/recordFrameCounter.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
#include "stdafx.h"
|
||||
#include "recordFrameCounter.h"
|
||||
|
||||
recordFrameCounter::recordFrameCounter(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_stackedWidget = new QStackedWidget();
|
||||
m_stackedWidget->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QLabel* titleLabel = new QLabel(QString::fromLocal8Bit("帧数: "));
|
||||
titleLabel->setStyleSheet("color: white;");
|
||||
layout->addWidget(titleLabel);
|
||||
layout->addWidget(m_stackedWidget);
|
||||
}
|
||||
|
||||
void recordFrameCounter::addCounter(QWidget* tabWidget)
|
||||
{
|
||||
QLabel* label = new QLabel("0");
|
||||
label->setStyleSheet("color: white;");
|
||||
label->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
|
||||
m_labelMap.insert(tabWidget, label);
|
||||
m_stackedWidget->addWidget(label);
|
||||
m_stackedWidget->setCurrentWidget(label);
|
||||
}
|
||||
|
||||
void recordFrameCounter::removeCounter(QWidget* tabWidget)
|
||||
{
|
||||
auto it = m_labelMap.find(tabWidget);
|
||||
if (it != m_labelMap.end())
|
||||
{
|
||||
QLabel* label = it.value();
|
||||
m_stackedWidget->removeWidget(label);
|
||||
delete label;
|
||||
m_labelMap.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
void recordFrameCounter::switchTo(QWidget* tabWidget)
|
||||
{
|
||||
auto it = m_labelMap.find(tabWidget);
|
||||
if (it != m_labelMap.end())
|
||||
{
|
||||
m_stackedWidget->setCurrentWidget(it.value());
|
||||
}
|
||||
}
|
||||
|
||||
void recordFrameCounter::updateFrameCount(QWidget* tabWidget, int frameCount)
|
||||
{
|
||||
auto it = m_labelMap.find(tabWidget);
|
||||
if (it != m_labelMap.end())
|
||||
{
|
||||
it.value()->setText(QString::number(frameCount));
|
||||
}
|
||||
}
|
||||
24
HPPA/recordFrameCounter.h
Normal file
24
HPPA/recordFrameCounter.h
Normal file
@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStackedWidget>
|
||||
#include <QLabel>
|
||||
#include <QHBoxLayout>
|
||||
#include <QMap>
|
||||
|
||||
class recordFrameCounter : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit recordFrameCounter(QWidget* parent = nullptr);
|
||||
|
||||
void addCounter(QWidget* tabWidget);
|
||||
void removeCounter(QWidget* tabWidget);
|
||||
void switchTo(QWidget* tabWidget);
|
||||
void updateFrameCount(QWidget* tabWidget, int frameCount);
|
||||
|
||||
private:
|
||||
QStackedWidget* m_stackedWidget = nullptr;
|
||||
QMap<QWidget*, QLabel*> m_labelMap;
|
||||
};
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
// Microsoft Visual C++ <20><><EFBFBD>ɵİ<C9B5><C4B0><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||
// <20><> HPPA.rc ʹ<><CAB9>
|
||||
//
|
||||
#define IDI_ICON1 101
|
||||
#define IDI_ICON1 106
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_RESOURCE_VALUE 107
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
|
||||
Reference in New Issue
Block a user