Compare commits
16 Commits
741e0e6734
...
3.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e119fbf91 | |||
| e3f882d77b | |||
| dac922eb29 | |||
| ae07b9c19e | |||
| 2cf86df608 | |||
| d358989579 | |||
| 0fb81ab3e8 | |||
| 8bbe402a63 | |||
| b23aedc6c7 | |||
| 06dffddfd0 | |||
| ca10848750 | |||
| 4af1187b7d | |||
| 30fa211a22 | |||
| 7473a45f41 | |||
| 6d8c2f0419 | |||
| 1c7780eb14 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,6 +7,7 @@ HPPA类图.drawio
|
|||||||
HPPA - 副本.ui
|
HPPA - 副本.ui
|
||||||
icon
|
icon
|
||||||
ignore_*
|
ignore_*
|
||||||
|
resources
|
||||||
|
|
||||||
## Ignore Visual Studio temporary files, build results, and
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
## files generated by popular Visual Studio add-ons.
|
## 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)
|
void MyCarousel::showContextMenu(const QPoint& pos)
|
||||||
{
|
{
|
||||||
QMenu menu(this);
|
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* startAct = menu.addAction(QString::fromLocal8Bit("开始轮播"));
|
||||||
QAction* stopAct = 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)
|
if (!m_isLocked)
|
||||||
startAct->setEnabled(false);
|
startAct->setEnabled(false);
|
||||||
|
|
||||||
@ -142,6 +159,15 @@ void MyCarousel::showContextMenu(const QPoint& pos)
|
|||||||
startAutoPlay();
|
startAutoPlay();
|
||||||
else if (act == stopAct)
|
else if (act == stopAct)
|
||||||
stopAutoPlay();
|
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()
|
void MyCarousel::startAutoPlay()
|
||||||
|
|||||||
@ -6,269 +6,616 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>632</width>
|
<width>557</width>
|
||||||
<height>444</height>
|
<height>432</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>调焦</string>
|
<string>调焦</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="styleSheet">
|
||||||
<iconset resource="HPPA.qrc">
|
<string notr="true">QLineEdit {
|
||||||
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset>
|
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>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
<item row="0" column="0" rowspan="2">
|
<property name="leftMargin">
|
||||||
<widget class="QGroupBox" name="connectFocusModule_groupBox">
|
<number>0</number>
|
||||||
<property name="title">
|
</property>
|
||||||
<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>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>
|
</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">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QWidget" name="titlebarWidget" native="true">
|
||||||
<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">
|
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</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">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>0</height>
|
<height>43</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="maximumSize">
|
||||||
<string>null</string>
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>43</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="styleSheet">
|
||||||
<set>Qt::AlignCenter</set>
|
<string notr="true">QWidget #titlebarWidget
|
||||||
</property>
|
{
|
||||||
<property name="readOnly">
|
background: #0E1C4C;
|
||||||
<bool>true</bool>
|
border: 1px solid #2f6bff;
|
||||||
|
}
|
||||||
|
</string>
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QPushButton" name="moveto_btn">
|
<widget class="QWidget" name="widget" native="true">
|
||||||
<property name="text">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<string>移动至</string>
|
<property name="leftMargin">
|
||||||
</property>
|
<number>10</number>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<property name="topMargin">
|
||||||
<item row="1" column="1" colspan="2">
|
<number>10</number>
|
||||||
<widget class="QLineEdit" name="move2_lineEdit">
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="rightMargin">
|
||||||
<size>
|
<number>10</number>
|
||||||
<width>0</width>
|
</property>
|
||||||
<height>0</height>
|
<property name="bottomMargin">
|
||||||
</size>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="spacing">
|
||||||
<string>10</string>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<item row="0" column="0" rowspan="2">
|
||||||
<set>Qt::AlignCenter</set>
|
<widget class="QWidget" name="connectFocusModule_widget" native="true">
|
||||||
</property>
|
<property name="styleSheet">
|
||||||
</widget>
|
<string notr="true">QWidget #connectFocusModule_widget
|
||||||
</item>
|
{
|
||||||
<item row="2" column="0">
|
background: #121945;
|
||||||
<widget class="QPushButton" name="add_btn">
|
border-radius: 5px 5px 5px 5px;
|
||||||
<property name="text">
|
}
|
||||||
<string>+</string>
|
|
||||||
</property>
|
QRadioButton
|
||||||
</widget>
|
{
|
||||||
</item>
|
color: #E2EDFF;
|
||||||
<item row="2" column="1" colspan="2">
|
}</string>
|
||||||
<widget class="QLineEdit" name="addStepSize_lineEdit">
|
</property>
|
||||||
<property name="minimumSize">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<size>
|
<property name="leftMargin">
|
||||||
<width>0</width>
|
<number>9</number>
|
||||||
<height>0</height>
|
</property>
|
||||||
</size>
|
<property name="topMargin">
|
||||||
</property>
|
<number>9</number>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>10</string>
|
<property name="rightMargin">
|
||||||
</property>
|
<number>9</number>
|
||||||
<property name="alignment">
|
</property>
|
||||||
<set>Qt::AlignCenter</set>
|
<property name="bottomMargin">
|
||||||
</property>
|
<number>9</number>
|
||||||
</widget>
|
</property>
|
||||||
</item>
|
<item row="0" column="0">
|
||||||
<item row="3" column="0">
|
<widget class="QLabel" name="label">
|
||||||
<widget class="QPushButton" name="subtract_btn">
|
<property name="sizePolicy">
|
||||||
<property name="text">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<string>-</string>
|
<horstretch>0</horstretch>
|
||||||
</property>
|
<verstretch>0</verstretch>
|
||||||
</widget>
|
</sizepolicy>
|
||||||
</item>
|
</property>
|
||||||
<item row="3" column="1" colspan="2">
|
<property name="text">
|
||||||
<widget class="QLineEdit" name="subtractStepSize_lineEdit">
|
<string>连接调焦模块</string>
|
||||||
<property name="minimumSize">
|
</property>
|
||||||
<size>
|
</widget>
|
||||||
<width>0</width>
|
</item>
|
||||||
<height>0</height>
|
<item row="1" column="0">
|
||||||
</size>
|
<widget class="QLabel" name="label_2">
|
||||||
</property>
|
<property name="enabled">
|
||||||
<property name="text">
|
<bool>true</bool>
|
||||||
<string>10</string>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="alignment">
|
<string>线性平台</string>
|
||||||
<set>Qt::AlignCenter</set>
|
</property>
|
||||||
</property>
|
<property name="alignment">
|
||||||
</widget>
|
<set>Qt::AlignCenter</set>
|
||||||
</item>
|
</property>
|
||||||
<item row="4" column="0">
|
</widget>
|
||||||
<widget class="QPushButton" name="logicZero_btn">
|
</item>
|
||||||
<property name="text">
|
<item row="1" column="1">
|
||||||
<string>LogicZero</string>
|
<widget class="QComboBox" name="motorPort_comboBox"/>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item row="2" column="0">
|
||||||
</item>
|
<widget class="QRadioButton" name="ultrasound_radioButton">
|
||||||
<item row="4" column="1">
|
<property name="text">
|
||||||
<widget class="QPushButton" name="max_btn">
|
<string>超声</string>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>max</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item row="2" column="1">
|
||||||
</item>
|
<widget class="QComboBox" name="ultrasoundPort_comboBox">
|
||||||
<item row="4" column="2">
|
<property name="enabled">
|
||||||
<widget class="QPushButton" name="rangeMeasurement_btn">
|
<bool>false</bool>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>量程测量</string>
|
</widget>
|
||||||
</property>
|
</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>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
728
HPPA/HPPA.cpp
728
HPPA/HPPA.cpp
File diff suppressed because it is too large
Load Diff
41
HPPA/HPPA.h
41
HPPA/HPPA.h
@ -67,6 +67,12 @@
|
|||||||
#include "MapToolSpectral.h"
|
#include "MapToolSpectral.h"
|
||||||
#include "MapTools.h"
|
#include "MapTools.h"
|
||||||
|
|
||||||
|
#include "AspectRatioLabel.h"
|
||||||
|
|
||||||
|
#include "HyperImagerControl.h"
|
||||||
|
|
||||||
|
#include "recordFrameCounter.h"
|
||||||
|
|
||||||
#define PI 3.1415926
|
#define PI 3.1415926
|
||||||
|
|
||||||
QT_CHARTS_USE_NAMESPACE//QChartView 使用 需要加宏, 否则无法使用
|
QT_CHARTS_USE_NAMESPACE//QChartView 使用 需要加宏, 否则无法使用
|
||||||
@ -155,7 +161,7 @@ class WidgetWithBackgroundPicture : public QWidget
|
|||||||
public:
|
public:
|
||||||
explicit WidgetWithBackgroundPicture(QWidget* parent = nullptr)
|
explicit WidgetWithBackgroundPicture(QWidget* parent = nullptr)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
m_pixmap(".//icon//titile_bar_bgp.png") // 使用资源或绝对路径
|
m_pixmap(":/png/resources/icons/png/titile_bar_bgp.png") // 使用资源或绝对路径
|
||||||
{
|
{
|
||||||
// 可选:设置初始大小
|
// 可选:设置初始大小
|
||||||
resize(800, 600);
|
resize(800, 600);
|
||||||
@ -184,8 +190,6 @@ public:
|
|||||||
static HPPA* instance();
|
static HPPA* instance();
|
||||||
LayerTreeNode* rasterGroupNode() const;
|
LayerTreeNode* rasterGroupNode() const;
|
||||||
|
|
||||||
void CalculateIntegratioinTimeRange();//通过帧率计算积分时间范围,设置slider最大值
|
|
||||||
|
|
||||||
WorkerThread * m_TestImagerStausThread;//检测相机连接状态的线程
|
WorkerThread * m_TestImagerStausThread;//检测相机连接状态的线程
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -199,6 +203,7 @@ private:
|
|||||||
void initMenubarToolbar();
|
void initMenubarToolbar();
|
||||||
void initPanelToolbar();
|
void initPanelToolbar();
|
||||||
void initControlTabwidget();
|
void initControlTabwidget();
|
||||||
|
QWidget* tmp(QWidget* a);
|
||||||
|
|
||||||
QLineEdit * frame_number;
|
QLineEdit * frame_number;
|
||||||
QLineEdit * m_FilenameLineEdit;
|
QLineEdit * m_FilenameLineEdit;
|
||||||
@ -241,6 +246,7 @@ private:
|
|||||||
QActionGroup* mImagerGroup = nullptr;
|
QActionGroup* mImagerGroup = nullptr;
|
||||||
void createActionGroups();
|
void createActionGroups();
|
||||||
void selectingImager(QAction* selectedAction);
|
void selectingImager(QAction* selectedAction);
|
||||||
|
void updateImagerPicture(const QString& actionName);
|
||||||
|
|
||||||
QActionGroup* moveplatformActionGroup = nullptr;
|
QActionGroup* moveplatformActionGroup = nullptr;
|
||||||
void createMoveplatformActionGroup();
|
void createMoveplatformActionGroup();
|
||||||
@ -263,6 +269,7 @@ private:
|
|||||||
|
|
||||||
TabManager* m_tabManager;
|
TabManager* m_tabManager;
|
||||||
|
|
||||||
|
HyperImagerControl* m_hic;
|
||||||
ImageControl* m_ic;
|
ImageControl* m_ic;
|
||||||
adjustTable* m_adt;
|
adjustTable* m_adt;
|
||||||
PowerControl* m_pc;
|
PowerControl* m_pc;
|
||||||
@ -281,7 +288,13 @@ private:
|
|||||||
|
|
||||||
// Map tools
|
// Map tools
|
||||||
MapTools* m_mapTools = nullptr;
|
MapTools* m_mapTools = nullptr;
|
||||||
|
QActionGroup* m_mapToolActionGroup = nullptr;
|
||||||
void initMapTools();
|
void initMapTools();
|
||||||
|
void setMapTool();
|
||||||
|
|
||||||
|
QWidget* m_focusTab=nullptr;
|
||||||
|
|
||||||
|
recordFrameCounter* m_recordFrameCounter = nullptr;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QString filePath);
|
void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QString filePath);
|
||||||
@ -294,9 +307,11 @@ public Q_SLOTS:
|
|||||||
void onOpenImg();
|
void onOpenImg();
|
||||||
void onconnect();//连接相机
|
void onconnect();//连接相机
|
||||||
void testImagerStatus();//获取相机状态:连接是否正常
|
void testImagerStatus();//获取相机状态:连接是否正常
|
||||||
|
void autoExposureFinished();
|
||||||
void onAutoExposure();
|
void onAutoExposure();
|
||||||
void onFocus1();
|
void onFocus1();
|
||||||
void onFocus2(int command);
|
void onFocus2(int command);
|
||||||
|
void onFocusWindowClosed();
|
||||||
void onAbout();
|
void onAbout();
|
||||||
void onDark();
|
void onDark();
|
||||||
void recordDarkFinish();
|
void recordDarkFinish();
|
||||||
@ -307,16 +322,12 @@ public Q_SLOTS:
|
|||||||
void onTabWidgetCurrentChanged(int index);
|
void onTabWidgetCurrentChanged(int index);
|
||||||
void onActionOpenDirectory();
|
void onActionOpenDirectory();
|
||||||
|
|
||||||
void OnFramerateLineeditEditingFinished();//
|
void onFramerateChanged(double framerate);
|
||||||
void OnFramerateSliderChanged(double framerate);//
|
void onIntegrationTimeChanged(double integrationTime);
|
||||||
|
void onGainChanged(double gain);
|
||||||
|
|
||||||
void OnIntegratioinTimeEditingFinished();//
|
void onLeftMouseButtonPressed(int x, int y, QVector<double> wavelengths, QVector<double> spectrum);//点击影像像元显示光谱
|
||||||
void OnIntegratioinTimeSliderChanged(double IntegratioinTime);//
|
void setAxis(QValueAxis* axisX, QValueAxis* axisY);
|
||||||
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 timerEvent(QTimerEvent *event);
|
void timerEvent(QTimerEvent *event);
|
||||||
@ -339,8 +350,7 @@ public Q_SLOTS:
|
|||||||
void onCreated3DModelPlantPhenotype();
|
void onCreated3DModelPlantPhenotype();
|
||||||
void onCreated3DModelOneMotor();
|
void onCreated3DModelOneMotor();
|
||||||
|
|
||||||
void onImageFileSaved(QString path, int fileIndex);
|
void addLayer(const QString& baseName, const QString& filePath, bool refresh);
|
||||||
|
|
||||||
void onLayerCreatedFromFile(const QString& baseName, const QString& filePath, int fileIndex);
|
void onLayerCreatedFromFile(const QString& baseName, const QString& filePath, int fileIndex);
|
||||||
void removeLayerByTreeIndex();
|
void removeLayerByTreeIndex();
|
||||||
void removeAllLayersInRasterGroup();
|
void removeAllLayersInRasterGroup();
|
||||||
@ -350,6 +360,9 @@ public Q_SLOTS:
|
|||||||
|
|
||||||
void onMapToolPanTriggered();
|
void onMapToolPanTriggered();
|
||||||
void onMapToolSpectralTriggered();
|
void onMapToolSpectralTriggered();
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent* event) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void StartFocusSignal();
|
void StartFocusSignal();
|
||||||
void StartRecordSignal();
|
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>
|
<RCC>
|
||||||
<qresource prefix="/HPPA">
|
<qresource prefix="/svg">
|
||||||
<file>HPPA.ico</file>
|
<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>
|
</qresource>
|
||||||
</RCC>
|
</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>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Hyper Plant Phenotypic Analysis</string>
|
<string>Spectral Insight</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="HPPA.qrc">
|
<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>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
@ -197,17 +197,21 @@ QToolBar QToolButton:hover {
|
|||||||
<addaction name="action_reference"/>
|
<addaction name="action_reference"/>
|
||||||
<addaction name="action_start_recording"/>
|
<addaction name="action_start_recording"/>
|
||||||
<addaction name="actionOpenDirectory"/>
|
<addaction name="actionOpenDirectory"/>
|
||||||
|
<addaction name="mActionPan"/>
|
||||||
|
<addaction name="mActionSpectral"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusBar">
|
<widget class="QStatusBar" name="statusBar">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QStatusBar {
|
<string notr="true">QStatusBar
|
||||||
|
{
|
||||||
background-color: rgb(255, 255, 255);
|
background-color: #0D1233;
|
||||||
color: white; /* 文字颜色 */
|
color: white;
|
||||||
border-top: 1px solid #ccc; /* 顶部边框 */
|
|
||||||
padding: 5px; /* 内边距 */
|
|
||||||
}
|
}
|
||||||
</string>
|
|
||||||
|
QStatusBar::item
|
||||||
|
{
|
||||||
|
border: none;
|
||||||
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="CustomDockWidgetBase" name="mDockWidgetSimulator">
|
<widget class="CustomDockWidgetBase" name="mDockWidgetSimulator">
|
||||||
@ -253,9 +257,9 @@ QToolBar QToolButton:hover {
|
|||||||
<attribute name="dockWidgetArea">
|
<attribute name="dockWidgetArea">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QWidget" name="dockWidgetContents_4">
|
<widget class="QWidget" name="controlContents">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QWidget #dockWidgetContents_4
|
<string notr="true">QWidget #controlContents
|
||||||
{
|
{
|
||||||
background-color: #0E1C4C;
|
background-color: #0E1C4C;
|
||||||
|
|
||||||
@ -324,329 +328,11 @@ QTabWidget::pane {
|
|||||||
<enum>QTabWidget::Rounded</enum>
|
<enum>QTabWidget::Rounded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="elideMode">
|
<property name="elideMode">
|
||||||
<enum>Qt::ElideNone</enum>
|
<enum>Qt::ElideNone</enum>
|
||||||
</property>
|
</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">
|
<widget class="QWidget" name="rgbCameraWidget">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QGroupBox
|
<string notr="true">QGroupBox
|
||||||
@ -816,18 +502,83 @@ QPushButton:pressed
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</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">
|
<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>
|
</property>
|
||||||
<attribute name="toolBarArea">
|
<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>
|
||||||
<attribute name="toolBarBreak">
|
<attribute name="toolBarBreak">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="mActionPan"/>
|
|
||||||
<addaction name="mActionSpectral"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<action name="action_exit">
|
<action name="action_exit">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -1090,11 +841,6 @@ QPushButton:pressed
|
|||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
|
||||||
<class>QDoubleSlider</class>
|
|
||||||
<extends>QSlider</extends>
|
|
||||||
<header>qdoubleslider.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>CustomDockWidgetBase</class>
|
<class>CustomDockWidgetBase</class>
|
||||||
<extends>QDockWidget</extends>
|
<extends>QDockWidget</extends>
|
||||||
|
|||||||
@ -32,12 +32,12 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||||
<QtInstall>5.13.2_msvc2017_64</QtInstall>
|
<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>
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
<QtInstall>5.9_msvc2017_64</QtInstall>
|
<QtInstall>5.13.2_msvc2017_64</QtInstall>
|
||||||
<QtModules>core;network;gui;widgets;serialport;websockets;charts</QtModules>
|
<QtModules>core;network;gui;svg;widgets;serialport;websockets;3dcore;3danimation;3dextras;3dinput;3dlogic;3drender;3dquick;charts</QtModules>
|
||||||
<QtBuildConfig>release</QtBuildConfig>
|
<QtBuildConfig>release</QtBuildConfig>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
<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'">
|
<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>
|
<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>
|
<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>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
<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>
|
<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>
|
<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>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<Link>
|
<Link>
|
||||||
@ -106,11 +108,13 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="aboutWindow.cpp" />
|
<ClCompile Include="aboutWindow.cpp" />
|
||||||
<ClCompile Include="adjustTable.cpp" />
|
<ClCompile Include="adjustTable.cpp" />
|
||||||
|
<ClCompile Include="AspectRatioLabel.cpp" />
|
||||||
<ClCompile Include="CaptureCoordinator.cpp" />
|
<ClCompile Include="CaptureCoordinator.cpp" />
|
||||||
<ClCompile Include="Carousel.cpp" />
|
<ClCompile Include="Carousel.cpp" />
|
||||||
<ClCompile Include="Corning410Imager.cpp" />
|
<ClCompile Include="Corning410Imager.cpp" />
|
||||||
<ClCompile Include="CustomDockWidgetBase.cpp" />
|
<ClCompile Include="CustomDockWidgetBase.cpp" />
|
||||||
<ClCompile Include="hppaConfigFile.cpp" />
|
<ClCompile Include="hppaConfigFile.cpp" />
|
||||||
|
<ClCompile Include="HyperImagerControl.cpp" />
|
||||||
<ClCompile Include="imageControl.cpp" />
|
<ClCompile Include="imageControl.cpp" />
|
||||||
<ClCompile Include="ImagerOperationBase.cpp" />
|
<ClCompile Include="ImagerOperationBase.cpp" />
|
||||||
<ClCompile Include="imager_base.cpp" />
|
<ClCompile Include="imager_base.cpp" />
|
||||||
@ -136,6 +140,7 @@
|
|||||||
<ClCompile Include="RasterDataProvider.cpp" />
|
<ClCompile Include="RasterDataProvider.cpp" />
|
||||||
<ClCompile Include="RasterLayer.cpp" />
|
<ClCompile Include="RasterLayer.cpp" />
|
||||||
<ClCompile Include="RasterRenderer.cpp" />
|
<ClCompile Include="RasterRenderer.cpp" />
|
||||||
|
<ClCompile Include="recordFrameCounter.cpp" />
|
||||||
<ClCompile Include="resononImager.cpp" />
|
<ClCompile Include="resononImager.cpp" />
|
||||||
<ClCompile Include="ResononNirImager.cpp" />
|
<ClCompile Include="ResononNirImager.cpp" />
|
||||||
<ClCompile Include="RgbCameraOperation.cpp" />
|
<ClCompile Include="RgbCameraOperation.cpp" />
|
||||||
@ -165,6 +170,7 @@
|
|||||||
<ClCompile Include="imagerSimulatioin.cpp" />
|
<ClCompile Include="imagerSimulatioin.cpp" />
|
||||||
<ClCompile Include="ImageViewer.cpp" />
|
<ClCompile Include="ImageViewer.cpp" />
|
||||||
<ClCompile Include="main.cpp" />
|
<ClCompile Include="main.cpp" />
|
||||||
|
<QtUic Include="hyperImagerControl.ui" />
|
||||||
<QtUic Include="imgControl.ui" />
|
<QtUic Include="imgControl.ui" />
|
||||||
<QtUic Include="oneMotorControl.ui" />
|
<QtUic Include="oneMotorControl.ui" />
|
||||||
<QtUic Include="PathPlan.ui" />
|
<QtUic Include="PathPlan.ui" />
|
||||||
@ -194,6 +200,8 @@
|
|||||||
<QtMoc Include="CustomDockWidgetBase.h" />
|
<QtMoc Include="CustomDockWidgetBase.h" />
|
||||||
<QtMoc Include="Carousel.h" />
|
<QtMoc Include="Carousel.h" />
|
||||||
<QtMoc Include="imageControl.h" />
|
<QtMoc Include="imageControl.h" />
|
||||||
|
<QtMoc Include="AspectRatioLabel.h" />
|
||||||
|
<QtMoc Include="HyperImagerControl.h" />
|
||||||
<ClInclude Include="imager_base.h" />
|
<ClInclude Include="imager_base.h" />
|
||||||
<ClInclude Include="irisximeaimager.h" />
|
<ClInclude Include="irisximeaimager.h" />
|
||||||
<QtMoc Include="OneMotorControl.h" />
|
<QtMoc Include="OneMotorControl.h" />
|
||||||
@ -215,6 +223,7 @@
|
|||||||
<QtMoc Include="MapTools.h" />
|
<QtMoc Include="MapTools.h" />
|
||||||
<ClInclude Include="RasterDataProvider.h" />
|
<ClInclude Include="RasterDataProvider.h" />
|
||||||
<ClInclude Include="RasterRenderer.h" />
|
<ClInclude Include="RasterRenderer.h" />
|
||||||
|
<QtMoc Include="recordFrameCounter.h" />
|
||||||
<ClInclude Include="utility_tc.h" />
|
<ClInclude Include="utility_tc.h" />
|
||||||
<QtMoc Include="aboutWindow.h" />
|
<QtMoc Include="aboutWindow.h" />
|
||||||
<ClInclude Include="hppaConfigFile.h" />
|
<ClInclude Include="hppaConfigFile.h" />
|
||||||
@ -240,7 +249,7 @@
|
|||||||
<ResourceCompile Include="HPPA.rc" />
|
<ResourceCompile Include="HPPA.rc" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Image Include="HPPA.ico" />
|
<Image Include="resources\icons\ico\Spectral_Insight_128.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
|||||||
@ -190,6 +190,15 @@
|
|||||||
<ClCompile Include="MapTools.cpp">
|
<ClCompile Include="MapTools.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</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>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtMoc Include="fileOperation.h">
|
<QtMoc Include="fileOperation.h">
|
||||||
@ -306,6 +315,15 @@
|
|||||||
<QtMoc Include="MapTools.h">
|
<QtMoc Include="MapTools.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</QtMoc>
|
</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>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="imageProcessor.h">
|
<ClInclude Include="imageProcessor.h">
|
||||||
@ -382,6 +400,9 @@
|
|||||||
<QtUic Include="imgControl.ui">
|
<QtUic Include="imgControl.ui">
|
||||||
<Filter>Form Files</Filter>
|
<Filter>Form Files</Filter>
|
||||||
</QtUic>
|
</QtUic>
|
||||||
|
<QtUic Include="hyperImagerControl.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="cpp.hint" />
|
<None Include="cpp.hint" />
|
||||||
@ -392,7 +413,7 @@
|
|||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Image Include="HPPA.ico">
|
<Image Include="resources\icons\ico\Spectral_Insight_128.ico">
|
||||||
<Filter>Resource Files</Filter>
|
<Filter>Resource Files</Filter>
|
||||||
</Image>
|
</Image>
|
||||||
</ItemGroup>
|
</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;
|
||||||
|
};
|
||||||
@ -45,7 +45,6 @@ Mapcavas::Mapcavas(QWidget* pParent) :QGraphicsView(pParent)
|
|||||||
m_translateSpeed = 1.0;
|
m_translateSpeed = 1.0;
|
||||||
m_bMouseTranslate = false;
|
m_bMouseTranslate = false;
|
||||||
|
|
||||||
|
|
||||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setFrameShape(QFrame::NoFrame);
|
setFrameShape(QFrame::NoFrame);
|
||||||
@ -104,6 +103,50 @@ bool Mapcavas::HasImage()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Mapcavas::updateCrosshair(double sceneX, double sceneY)
|
||||||
|
{
|
||||||
|
QPen pen(Qt::red, 2.0);
|
||||||
|
pen.setCosmetic(true); // constant screen-width regardless of zoom
|
||||||
|
|
||||||
|
if (!m_hLine)
|
||||||
|
{
|
||||||
|
m_hLine = m_qtGraphicsScene->addLine(0, 0, 0, 0, pen);
|
||||||
|
m_hLine->setZValue(1e9);
|
||||||
|
}
|
||||||
|
if (!m_vLine)
|
||||||
|
{
|
||||||
|
m_vLine = m_qtGraphicsScene->addLine(0, 0, 0, 0, pen);
|
||||||
|
m_vLine->setZValue(1e9);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_hLine->setPen(pen);
|
||||||
|
m_vLine->setPen(pen);
|
||||||
|
|
||||||
|
m_hLine->setLine(sceneX - m_CrosshairHalfLen, sceneY,
|
||||||
|
sceneX + m_CrosshairHalfLen, sceneY);
|
||||||
|
m_vLine->setLine(sceneX, sceneY - m_CrosshairHalfLen,
|
||||||
|
sceneX, sceneY + m_CrosshairHalfLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Mapcavas::removeCrosshair()
|
||||||
|
{
|
||||||
|
if (m_hLine)
|
||||||
|
{
|
||||||
|
if (m_hLine->scene())
|
||||||
|
m_hLine->scene()->removeItem(m_hLine);
|
||||||
|
delete m_hLine;
|
||||||
|
m_hLine = nullptr;
|
||||||
|
}
|
||||||
|
if (m_vLine)
|
||||||
|
{
|
||||||
|
if (m_vLine->scene())
|
||||||
|
m_vLine->scene()->removeItem(m_vLine);
|
||||||
|
delete m_vLine;
|
||||||
|
m_vLine = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Mapcavas::wheelEvent(QWheelEvent *event)
|
void Mapcavas::wheelEvent(QWheelEvent *event)
|
||||||
{
|
{
|
||||||
// Always let the tool have a chance first
|
// Always let the tool have a chance first
|
||||||
@ -136,29 +179,9 @@ void Mapcavas::mousePressEvent(QMouseEvent *event)
|
|||||||
if (m_mapTool)
|
if (m_mapTool)
|
||||||
{
|
{
|
||||||
m_mapTool->canvasMousePressEvent(event);
|
m_mapTool->canvasMousePressEvent(event);
|
||||||
|
QGraphicsView::mousePressEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy fallback when no tool is set
|
|
||||||
if (event->button()==Qt::LeftButton)
|
|
||||||
{
|
|
||||||
m_bMouseTranslate = true;
|
|
||||||
m_lastMousePos = event->pos();
|
|
||||||
|
|
||||||
const QPointF scenePt = mapToScene(m_lastMousePos);
|
|
||||||
const int x = static_cast<int>(std::floor(scenePt.x()));
|
|
||||||
const int y = static_cast<int>(std::floor(scenePt.y()));
|
|
||||||
|
|
||||||
if (m_rasterLayer && m_rasterLayer->isValidPixel(x, y))
|
|
||||||
{
|
|
||||||
QVector<double> wavelengths;
|
|
||||||
QVector<double> spectrum;
|
|
||||||
if (m_rasterLayer->readPixelSpectrum(x, y, wavelengths, spectrum))
|
|
||||||
{
|
|
||||||
emit leftMouseButtonPressed(x, y, wavelengths, spectrum);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QGraphicsView::mousePressEvent(event);
|
QGraphicsView::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,16 +190,10 @@ void Mapcavas::mouseMoveEvent(QMouseEvent *event)
|
|||||||
if (m_mapTool)
|
if (m_mapTool)
|
||||||
{
|
{
|
||||||
m_mapTool->canvasMouseMoveEvent(event);
|
m_mapTool->canvasMouseMoveEvent(event);
|
||||||
|
QGraphicsView::mousePressEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy fallback
|
|
||||||
if (m_bMouseTranslate){
|
|
||||||
QPointF mouseDelta = mapToScene(event->pos()) - mapToScene(m_lastMousePos);
|
|
||||||
translate(mouseDelta.x(),mouseDelta.y());
|
|
||||||
}
|
|
||||||
|
|
||||||
m_lastMousePos = event->pos();
|
|
||||||
QGraphicsView::mousePressEvent(event);
|
QGraphicsView::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,11 +202,10 @@ void Mapcavas::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
if (m_mapTool)
|
if (m_mapTool)
|
||||||
{
|
{
|
||||||
m_mapTool->canvasMouseReleaseEvent(event);
|
m_mapTool->canvasMouseReleaseEvent(event);
|
||||||
|
QGraphicsView::mouseReleaseEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy fallback
|
|
||||||
m_bMouseTranslate = false;
|
|
||||||
QGraphicsView::mouseReleaseEvent(event);
|
QGraphicsView::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,9 @@ public:
|
|||||||
bool HasImage();
|
bool HasImage();
|
||||||
void ensureSceneVisible();
|
void ensureSceneVisible();
|
||||||
|
|
||||||
|
void updateCrosshair(double sceneX, double sceneY);
|
||||||
|
void removeCrosshair();
|
||||||
|
|
||||||
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
|
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
|
||||||
void scaling(qreal scaleFactor);
|
void scaling(qreal scaleFactor);
|
||||||
|
|
||||||
@ -71,6 +74,10 @@ private:
|
|||||||
QPoint m_lastMousePos; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>λ<EFBFBD><CEBB>
|
QPoint m_lastMousePos; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>λ<EFBFBD><CEBB>
|
||||||
qreal m_scale; // <20><><EFBFBD><EFBFBD>ֵ
|
qreal m_scale; // <20><><EFBFBD><EFBFBD>ֵ
|
||||||
|
|
||||||
|
double m_CrosshairHalfLen = 10.0;
|
||||||
|
QGraphicsLineItem* m_hLine = nullptr; // horizontal line
|
||||||
|
QGraphicsLineItem* m_vLine = nullptr; // vertical line
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void leftMouseButtonPressed(int, int, QVector<double>, QVector<double>);
|
void leftMouseButtonPressed(int, int, QVector<double>, QVector<double>);
|
||||||
|
|||||||
@ -67,6 +67,8 @@ double ImagerOperationBase::auto_exposure()
|
|||||||
|
|
||||||
imagerStopCollect();
|
imagerStopCollect();
|
||||||
|
|
||||||
|
emit autoExposureSignal();
|
||||||
|
|
||||||
//std::cout << "<22>Զ<EFBFBD><D4B6>ع⣺" << getIntegrationTime() << std::endl;
|
//std::cout << "<22>Զ<EFBFBD><D4B6>ع⣺" << getIntegrationTime() << std::endl;
|
||||||
|
|
||||||
return getIntegrationTime();
|
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 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>
|
// <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);
|
void ImageFileSaved(const QString& path, int fileIndex);
|
||||||
|
|||||||
@ -1,39 +1,13 @@
|
|||||||
#include "LayerTree.h"
|
#include "LayerTree.h"
|
||||||
#include "LayerTreeGroupNode.h"
|
|
||||||
|
|
||||||
LayerTree::LayerTree(QObject* parent)
|
LayerTree::LayerTree(QObject* parent)
|
||||||
: QObject(parent)
|
: LayerTreeGroup("__root__", parent)
|
||||||
{
|
{
|
||||||
// root <20><>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> view <20><><EFBFBD><EFBFBD>ʾ
|
setVisible(Qt::Checked);
|
||||||
m_root = new LayerTreeGroupNode("__root__", this);
|
|
||||||
m_root->setVisible(Qt::Checked);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerTree::~LayerTree()
|
LayerTree::~LayerTree()
|
||||||
{
|
{
|
||||||
delete m_root;
|
|
||||||
m_root = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
LayerTreeNode* LayerTree::root() const
|
|
||||||
{
|
|
||||||
return m_root;
|
|
||||||
}
|
|
||||||
|
|
||||||
LayerTreeNode* LayerTree::insertNode(LayerTreeNode* parent, int row, LayerTreeNode* node)
|
|
||||||
{
|
|
||||||
if (!node) return nullptr;
|
|
||||||
if (!parent) parent = m_root;
|
|
||||||
|
|
||||||
if (row < 0) row = parent->childCount();
|
|
||||||
parent->insertChild(row, node);
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
|
|
||||||
LayerTreeNode* LayerTree::removeNode(LayerTreeNode* parent, int row)
|
|
||||||
{
|
|
||||||
if (!parent) parent = m_root;
|
|
||||||
return parent->takeChild(row);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerTree::setChildrenVisible(LayerTreeNode* n, Qt::CheckState state)
|
void LayerTree::setChildrenVisible(LayerTreeNode* n, Qt::CheckState state)
|
||||||
|
|||||||
@ -1,18 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include "LayerTreeGroupNode.h"
|
||||||
#include "LayerTreeNode.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LayerTree<65><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
* LayerTree<65><65>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
||||||
* - <20><><EFBFBD><EFBFBD> root
|
* - <20>̳<EFBFBD><EFBFBD><EFBFBD> LayerTreeGroup<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD>ڵ<EFBFBD>
|
||||||
* - <20>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD>/<2F>Ƴ<EFBFBD><C6B3>ڵ<EFBFBD><DAB5><EFBFBD> API
|
|
||||||
* - <20>ṩ<EFBFBD>ɼ<EFBFBD><C9BC>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>븸<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>̬<EFBFBD><CCAC><EFBFBD>µľ<C2B5>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>
|
* - <20>ṩ<EFBFBD>ɼ<EFBFBD><C9BC>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>븸<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>̬<EFBFBD><CCAC><EFBFBD>µľ<C2B5>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>
|
||||||
*
|
*
|
||||||
* ע<>⣺beginInsertRows/endInsertRows <20><> Qt Model <20><><EFBFBD><EFBFBD>֪ͨӦ<D6AA><D3A6> Model <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD>
|
* ע<>⣺beginInsertRows/endInsertRows <20><> Qt Model <20><><EFBFBD><EFBFBD>֪ͨӦ<D6AA><D3A6> Model <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD>
|
||||||
* LayerTree ֻ<><D6BB><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD>ݽṹ<DDBD><E1B9B9>ȷ<EFBFBD>ԡ<EFBFBD>
|
* LayerTree ֻ<><D6BB><EFBFBD><EFBFBD>ά<EFBFBD><CEAC><EFBFBD><EFBFBD><EFBFBD>ݽṹ<DDBD><E1B9B9>ȷ<EFBFBD>ԡ<EFBFBD>
|
||||||
*/
|
*/
|
||||||
class LayerTree : public QObject
|
class LayerTree : public LayerTreeGroup
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
@ -22,28 +20,7 @@ public:
|
|||||||
LayerTree(const LayerTree&) = delete;
|
LayerTree(const LayerTree&) = delete;
|
||||||
LayerTree& operator=(const LayerTree&) = delete;
|
LayerTree& operator=(const LayerTree&) = delete;
|
||||||
|
|
||||||
LayerTreeNode* root() const;
|
|
||||||
|
|
||||||
// <20><><EFBFBD>룺parent Ϊ nullptr <20><>ʾ root<6F><74>row=-1 <20><>ʾ append
|
|
||||||
LayerTreeNode* insertNode(LayerTreeNode* parent, int row, LayerTreeNode* node);
|
|
||||||
|
|
||||||
// <20>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD> delete<74><65><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1>Ƴ<EFBFBD><C6B3>ڵ㣨<DAB5><E3A3A8><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD><DFB8><EFBFBD> delete <20><><EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><C2B2>룩
|
|
||||||
LayerTreeNode* removeNode(LayerTreeNode* parent, int row);
|
|
||||||
|
|
||||||
// <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD> Model <20><><EFBFBD>ã<EFBFBD>
|
// <20>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD> Model <20><><EFBFBD>ã<EFBFBD>
|
||||||
static void setChildrenVisible(LayerTreeNode* n, Qt::CheckState state);
|
static void setChildrenVisible(LayerTreeNode* n, Qt::CheckState state);
|
||||||
static void updateParentVisibleFromChildren(LayerTreeNode* parent);
|
static void updateParentVisibleFromChildren(LayerTreeNode* parent);
|
||||||
|
|
||||||
static inline bool isLayer(LayerTreeNode* node)
|
|
||||||
{
|
|
||||||
return node && node->type() == LayerTreeNode::Type::Layer;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool isGroup(LayerTreeNode* node)
|
|
||||||
{
|
|
||||||
return node && node->type() == LayerTreeNode::Type::Group;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
LayerTreeNode* m_root = nullptr; // owned
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,103 @@
|
|||||||
#include "LayerTreeGroupNode.h"
|
#include "LayerTreeGroupNode.h"
|
||||||
|
#include "LayerTreeLayerNode.h"
|
||||||
|
|
||||||
LayerTreeGroupNode::LayerTreeGroupNode(const QString& name, QObject* parent)
|
LayerTreeGroup::LayerTreeGroup(const QString& name, QObject* parent)
|
||||||
: LayerTreeNode(name, parent)
|
: LayerTreeNode(name, parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LayerTreeGroup* LayerTreeGroup::insertGroup(int index, const QString& name)
|
||||||
|
{
|
||||||
|
auto* group = new LayerTreeGroup(name);
|
||||||
|
insertChildNode(index, group);
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
|
LayerTreeGroup* LayerTreeGroup::addGroup(const QString& name)
|
||||||
|
{
|
||||||
|
return insertGroup(childCount(), name);
|
||||||
|
}
|
||||||
|
|
||||||
|
LayerTreeLayer* LayerTreeGroup::insertLayer(int index, LayerTreeLayer* layer)
|
||||||
|
{
|
||||||
|
if (!layer) return nullptr;
|
||||||
|
insertChildNode(index, layer);
|
||||||
|
return layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
LayerTreeLayer* LayerTreeGroup::addLayer(LayerTreeLayer* layer)
|
||||||
|
{
|
||||||
|
return insertLayer(childCount(), layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerTreeGroup::insertChildNode(int index, LayerTreeNode* node)
|
||||||
|
{
|
||||||
|
insertChild(index, node);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LayerTreeGroup::addChildNode(LayerTreeNode* node)
|
||||||
|
{
|
||||||
|
appendChild(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
LayerTreeNode* LayerTreeGroup::removeChildNode(LayerTreeNode* node)
|
||||||
|
{
|
||||||
|
if (!node) return nullptr;
|
||||||
|
int row = -1;
|
||||||
|
for (int i = 0; i < childCount(); ++i)
|
||||||
|
{
|
||||||
|
if (childAt(i) == node)
|
||||||
|
{
|
||||||
|
row = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (row < 0) return nullptr;
|
||||||
|
removeChild(row, 1, false);
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
LayerTreeLayer* LayerTreeGroup::findLayer(const QString& name) const
|
||||||
|
{
|
||||||
|
const auto layers = findLayers();
|
||||||
|
for (auto* l : layers)
|
||||||
|
{
|
||||||
|
if (l->name() == name)
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<LayerTreeLayer*> LayerTreeGroup::findLayers() const
|
||||||
|
{
|
||||||
|
QList<LayerTreeLayer*> result;
|
||||||
|
for (int i = 0; i < childCount(); ++i)
|
||||||
|
{
|
||||||
|
LayerTreeNode* child = childAt(i);
|
||||||
|
if (LayerTreeNode::isLayer(child))
|
||||||
|
{
|
||||||
|
result.append(static_cast<LayerTreeLayer*>(child));
|
||||||
|
}
|
||||||
|
else if (LayerTreeNode::isGroup(child))
|
||||||
|
{
|
||||||
|
result.append(static_cast<LayerTreeGroup*>(child)->findLayers());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<LayerTreeGroup*> LayerTreeGroup::findGroups() const
|
||||||
|
{
|
||||||
|
QList<LayerTreeGroup*> result;
|
||||||
|
for (int i = 0; i < childCount(); ++i)
|
||||||
|
{
|
||||||
|
LayerTreeNode* child = childAt(i);
|
||||||
|
if (LayerTreeNode::isGroup(child))
|
||||||
|
{
|
||||||
|
auto* g = static_cast<LayerTreeGroup*>(child);
|
||||||
|
result.append(g);
|
||||||
|
result.append(g->findGroups());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,15 +1,44 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "LayerTreeNode.h"
|
#include "LayerTreeNode.h"
|
||||||
|
|
||||||
/** Group <20>ڵ<EFBFBD> */
|
class LayerTreeLayer;
|
||||||
class LayerTreeGroupNode : public LayerTreeNode
|
|
||||||
|
/**
|
||||||
|
* LayerTreeGroup<75><70>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
||||||
|
* - <20><><EFBFBD><EFBFBD>Ϊ LayerTreeNode
|
||||||
|
* - <20>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ڵ㣨LayerTreeLayer<65><72><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>飨LayerTreeGroup<75><70><EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
class LayerTreeGroup : public LayerTreeNode
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit LayerTreeGroupNode(const QString& name,
|
explicit LayerTreeGroup(const QString& name = QString(),
|
||||||
QObject* parent = nullptr);
|
QObject* parent = nullptr);
|
||||||
|
|
||||||
Type type() const override { return Type::Group; }
|
Type type() const override { return Type::Group; }
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
LayerTreeGroup* insertGroup(int index, const QString& name);
|
||||||
|
LayerTreeGroup* addGroup(const QString& name);
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ڵ<EFBFBD>
|
||||||
|
LayerTreeLayer* insertLayer(int index, LayerTreeLayer* layer);
|
||||||
|
LayerTreeLayer* addLayer(LayerTreeLayer* layer);
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
||||||
|
void insertChildNode(int index, LayerTreeNode* node);
|
||||||
|
void addChildNode(LayerTreeNode* node);
|
||||||
|
|
||||||
|
// <20>Ƴ<EFBFBD><C6B3>ӽڵ㣨<DAB5><E3A3A8> delete<74><65><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><D8B1>Ƴ<EFBFBD><C6B3>ڵ㣩
|
||||||
|
LayerTreeNode* removeChildNode(LayerTreeNode* node);
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD>
|
||||||
|
LayerTreeLayer* findLayer(const QString& name) const;
|
||||||
|
QList<LayerTreeLayer*> findLayers() const;
|
||||||
|
QList<LayerTreeGroup*> findGroups() const;
|
||||||
|
|
||||||
// <20>Ժ<EFBFBD><D4BA><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>collapsed / groupOpacity <20><>
|
// <20>Ժ<EFBFBD><D4BA><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>collapsed / groupOpacity <20><>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
using LayerTreeGroupNode = LayerTreeGroup;
|
||||||
|
|||||||
@ -1,22 +1,22 @@
|
|||||||
#include "LayerTreeLayerNode.h"
|
#include "LayerTreeLayerNode.h"
|
||||||
|
|
||||||
LayerTreeLayerNode::LayerTreeLayerNode(MapLayer* layer, QObject* parent)
|
LayerTreeLayer::LayerTreeLayer(MapLayer* layer, QObject* parent)
|
||||||
: LayerTreeNode(layer ? layer->name() : QString(), parent), m_layer(layer)
|
: LayerTreeNode(layer ? layer->name() : QString(), parent), m_layer(layer)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerTreeNode::Type LayerTreeLayerNode::type() const
|
LayerTreeNode::Type LayerTreeLayer::type() const
|
||||||
{
|
{
|
||||||
return Type::Layer;
|
return Type::Layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> MapLayer ָ<>루<EFBFBD><EBA3A8>ӵ<EFBFBD>У<EFBFBD>
|
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> MapLayer ָ<>루<EFBFBD><EBA3A8>ӵ<EFBFBD>У<EFBFBD>
|
||||||
void LayerTreeLayerNode::setMapLayer(MapLayer* layer)
|
void LayerTreeLayer::setMapLayer(MapLayer* layer)
|
||||||
{
|
{
|
||||||
m_layer = layer;
|
m_layer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapLayer* LayerTreeLayerNode::mapLayer() const
|
MapLayer* LayerTreeLayer::mapLayer() const
|
||||||
{
|
{
|
||||||
return m_layer;
|
return m_layer;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,16 +2,19 @@
|
|||||||
#include "LayerTreeNode.h"
|
#include "LayerTreeNode.h"
|
||||||
#include "MapLayer.h"
|
#include "MapLayer.h"
|
||||||
|
|
||||||
/** Layer <20>ڵ<EFBFBD> */
|
/**
|
||||||
class LayerTreeLayerNode : public LayerTreeNode
|
* LayerTreeLayer<EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>
|
||||||
|
* - <20><><EFBFBD><EFBFBD>Ϊ LayerTreeNode
|
||||||
|
* - <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> MapLayer ָ<>루<EFBFBD><EBA3A8>ӵ<EFBFBD>У<EFBFBD>
|
||||||
|
*/
|
||||||
|
class LayerTreeLayer : public LayerTreeNode
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit LayerTreeLayerNode(MapLayer* layer, QObject* parent = nullptr);
|
explicit LayerTreeLayer(MapLayer* layer, QObject* parent = nullptr);
|
||||||
|
|
||||||
Type type() const override;
|
Type type() const override;
|
||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> MapLayer ָ<>루<EFBFBD><EBA3A8>ӵ<EFBFBD>У<EFBFBD>
|
|
||||||
void setMapLayer(MapLayer* layer);
|
void setMapLayer(MapLayer* layer);
|
||||||
MapLayer* mapLayer() const;
|
MapLayer* mapLayer() const;
|
||||||
|
|
||||||
@ -20,3 +23,6 @@ private:
|
|||||||
|
|
||||||
// <20><><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>layerId / pointer / legendItems <20><>
|
// <20><><EFBFBD><EFBFBD>չ<EFBFBD><D5B9>layerId / pointer / legendItems <20><>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
using LayerTreeLayerNode = LayerTreeLayer;
|
||||||
|
|||||||
@ -28,10 +28,10 @@ QModelIndex LayerTreeModel::index(int row, int column, const QModelIndex& parent
|
|||||||
QModelIndex LayerTreeModel::parent(const QModelIndex& child) const
|
QModelIndex LayerTreeModel::parent(const QModelIndex& child) const
|
||||||
{
|
{
|
||||||
LayerTreeNode* node = nodeFromIndex(child);
|
LayerTreeNode* node = nodeFromIndex(child);
|
||||||
if (!node || node == m_tree->root()) return {};
|
if (!node || node == m_tree) return {};
|
||||||
|
|
||||||
LayerTreeNode* p = node->parentNode();
|
LayerTreeNode* p = node->parentNode();
|
||||||
if (!p || p == m_tree->root()) return {};
|
if (!p || p == m_tree) return {};
|
||||||
|
|
||||||
return createIndex(p->rowInParent(), 0, p);
|
return createIndex(p->rowInParent(), 0, p);
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ int LayerTreeModel::columnCount(const QModelIndex&) const
|
|||||||
QVariant LayerTreeModel::data(const QModelIndex& index, int role) const
|
QVariant LayerTreeModel::data(const QModelIndex& index, int role) const
|
||||||
{
|
{
|
||||||
LayerTreeNode* n = nodeFromIndex(index);
|
LayerTreeNode* n = nodeFromIndex(index);
|
||||||
if (!n || n == m_tree->root()) return {};
|
if (!n || n == m_tree) return {};
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
@ -59,17 +59,17 @@ QVariant LayerTreeModel::data(const QModelIndex& index, int role) const
|
|||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
{
|
{
|
||||||
auto* tmp = nodeFromIndex(index);
|
auto* tmp = nodeFromIndex(index);
|
||||||
if (LayerTree::isGroup(tmp))
|
if (LayerTreeNode::isGroup(tmp))
|
||||||
return QIcon();
|
return QIcon();
|
||||||
else if (LayerTree::isLayer(tmp))
|
else if (LayerTreeNode::isLayer(tmp))
|
||||||
{
|
{
|
||||||
QString basePath = QCoreApplication::applicationDirPath();
|
QString basePath = QCoreApplication::applicationDirPath();
|
||||||
return QIcon(basePath + "/icons/mIconRaster.svg");
|
return QIcon(":/svg/resources/icons/svg/mIconRaster.svg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case Qt::CheckStateRole:
|
//case Qt::CheckStateRole:
|
||||||
return static_cast<int>(n->visible());
|
// return static_cast<int>(n->visible());
|
||||||
|
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
return (n->type() == LayerTreeNode::Type::Group) ? "Group" : "Layer";
|
return (n->type() == LayerTreeNode::Type::Group) ? "Group" : "Layer";
|
||||||
@ -82,7 +82,7 @@ QVariant LayerTreeModel::data(const QModelIndex& index, int role) const
|
|||||||
bool LayerTreeModel::setData(const QModelIndex& index, const QVariant& value, int role)
|
bool LayerTreeModel::setData(const QModelIndex& index, const QVariant& value, int role)
|
||||||
{
|
{
|
||||||
LayerTreeNode* n = nodeFromIndex(index);
|
LayerTreeNode* n = nodeFromIndex(index);
|
||||||
if (!n || n == m_tree->root()) return false;
|
if (!n || n == m_tree) return false;
|
||||||
|
|
||||||
if (role == Qt::CheckStateRole) {
|
if (role == Qt::CheckStateRole) {
|
||||||
auto newState = static_cast<Qt::CheckState>(value.toInt());
|
auto newState = static_cast<Qt::CheckState>(value.toInt());
|
||||||
@ -111,39 +111,39 @@ Qt::ItemFlags LayerTreeModel::flags(const QModelIndex& index) const
|
|||||||
if (!index.isValid()) return Qt::NoItemFlags;
|
if (!index.isValid()) return Qt::NoItemFlags;
|
||||||
|
|
||||||
LayerTreeNode* n = nodeFromIndex(index);
|
LayerTreeNode* n = nodeFromIndex(index);
|
||||||
if (!n || n == m_tree->root()) return Qt::NoItemFlags;
|
if (!n || n == m_tree) return Qt::NoItemFlags;
|
||||||
|
|
||||||
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
|
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerTreeNode* LayerTreeModel::root() const
|
LayerTreeNode* LayerTreeModel::root() const
|
||||||
{
|
{
|
||||||
return m_tree->root();
|
return m_tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerTreeNode* LayerTreeModel::addGroup(LayerTreeNode* parent, const QString& name, const QIcon& icon)
|
LayerTreeNode* LayerTreeModel::addGroup(LayerTreeNode* parent, const QString& name, const QIcon& icon)
|
||||||
{
|
{
|
||||||
if (!parent) parent = m_tree->root();
|
if (!parent) parent = m_tree;
|
||||||
|
|
||||||
const int row = parent->childCount();
|
const int row = parent->childCount();
|
||||||
beginInsertRows(indexFromNode(parent), row, row);
|
beginInsertRows(indexFromNode(parent), row, row);
|
||||||
LayerTreeNode* g = m_tree->insertNode(parent, row, new LayerTreeGroupNode(name));
|
LayerTreeNode* g = m_tree->addGroup(name);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerTreeNode* LayerTreeModel::addLayer(LayerTreeNode* parent, LayerTreeLayerNode* layerNode, const QIcon& icon)
|
LayerTreeNode* LayerTreeModel::addLayer(LayerTreeNode* parent, LayerTreeLayer* layerNode, const QIcon& icon)
|
||||||
{
|
{
|
||||||
if (!parent) parent = m_tree->root();
|
if (!parent) parent = m_tree;
|
||||||
if (!layerNode) return nullptr;
|
if (!layerNode) return nullptr;
|
||||||
|
|
||||||
const int row = parent->childCount();
|
const int row = parent->childCount();
|
||||||
beginInsertRows(indexFromNode(parent), row, row);
|
beginInsertRows(indexFromNode(parent), row, row);
|
||||||
LayerTreeNode* l = m_tree->insertNode(parent, row, layerNode);
|
parent->insertChild(row, layerNode);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
|
|
||||||
return l;
|
return layerNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LayerTreeModel::setCascadeCheckEnabled(bool enabled)
|
void LayerTreeModel::setCascadeCheckEnabled(bool enabled)
|
||||||
@ -159,11 +159,12 @@ bool LayerTreeModel::cascadeCheckEnabled() const
|
|||||||
// <20><><EFBFBD><EFBFBD>ʵ<EFBFBD>֣<EFBFBD><D6A3>Ƴ<EFBFBD><C6B3>ӽڵ㲢<DAB5><E3B2A2> model <20>Ϸ<EFBFBD><CFB7><EFBFBD> begin/endRemoveRows
|
// <20><><EFBFBD><EFBFBD>ʵ<EFBFBD>֣<EFBFBD><D6A3>Ƴ<EFBFBD><C6B3>ӽڵ㲢<DAB5><E3B2A2> model <20>Ϸ<EFBFBD><CFB7><EFBFBD> begin/endRemoveRows
|
||||||
LayerTreeNode* LayerTreeModel::removeNode(LayerTreeNode* parent, int row)
|
LayerTreeNode* LayerTreeModel::removeNode(LayerTreeNode* parent, int row)
|
||||||
{
|
{
|
||||||
if (!parent) parent = m_tree->root();
|
if (!parent) parent = m_tree;
|
||||||
if (row < 0 || row >= parent->childCount()) return nullptr;
|
if (row < 0 || row >= parent->childCount()) return nullptr;
|
||||||
|
|
||||||
|
LayerTreeNode* removed = parent->childAt(row);
|
||||||
beginRemoveRows(indexFromNode(parent), row, row);
|
beginRemoveRows(indexFromNode(parent), row, row);
|
||||||
LayerTreeNode* removed = m_tree->removeNode(parent, row);
|
parent->removeChild(row, 1, false);
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
|
|
||||||
return removed;
|
return removed;
|
||||||
@ -171,12 +172,12 @@ LayerTreeNode* LayerTreeModel::removeNode(LayerTreeNode* parent, int row)
|
|||||||
|
|
||||||
LayerTreeNode* LayerTreeModel::nodeFromIndex(const QModelIndex& index) const
|
LayerTreeNode* LayerTreeModel::nodeFromIndex(const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid()) return m_tree->root();
|
if (!index.isValid()) return m_tree;
|
||||||
return static_cast<LayerTreeNode*>(index.internalPointer());
|
return static_cast<LayerTreeNode*>(index.internalPointer());
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex LayerTreeModel::indexFromNode(LayerTreeNode* n) const
|
QModelIndex LayerTreeModel::indexFromNode(LayerTreeNode* n) const
|
||||||
{
|
{
|
||||||
if (!n || n == m_tree->root()) return {};
|
if (!n || n == m_tree) return {};
|
||||||
return createIndex(n->rowInParent(), 0, n);
|
return createIndex(n->rowInParent(), 0, n);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include "LayerTree.h"
|
#include "LayerTree.h"
|
||||||
|
|
||||||
class LayerTreeLayerNode; // forward declare
|
class LayerTreeLayer; // forward declare
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LayerTreeModel<65><6C>Qt <20><><EFBFBD><EFBFBD><EFBFBD>㣨<EFBFBD><E3A3A8><EFBFBD>ٹ<EFBFBD><D9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
* LayerTreeModel<65><6C>Qt <20><><EFBFBD><EFBFBD><EFBFBD>㣨<EFBFBD><E3A3A8><EFBFBD>ٹ<EFBFBD><D9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
@ -34,7 +34,7 @@ public:
|
|||||||
LayerTreeNode* root() const;
|
LayerTreeNode* root() const;
|
||||||
|
|
||||||
LayerTreeNode* addGroup(LayerTreeNode* parent, const QString& name, const QIcon& icon = QIcon());
|
LayerTreeNode* addGroup(LayerTreeNode* parent, const QString& name, const QIcon& icon = QIcon());
|
||||||
LayerTreeNode* addLayer(LayerTreeNode* parent, LayerTreeLayerNode* layerNode, const QIcon& icon = QIcon());
|
LayerTreeNode* addLayer(LayerTreeNode* parent, LayerTreeLayer* layerNode, const QIcon& icon = QIcon());
|
||||||
|
|
||||||
void setCascadeCheckEnabled(bool enabled);
|
void setCascadeCheckEnabled(bool enabled);
|
||||||
bool cascadeCheckEnabled() const;
|
bool cascadeCheckEnabled() const;
|
||||||
|
|||||||
@ -20,7 +20,11 @@ QString LayerTreeNode::name() const
|
|||||||
|
|
||||||
void LayerTreeNode::setName(const QString& name)
|
void LayerTreeNode::setName(const QString& name)
|
||||||
{
|
{
|
||||||
m_name = name;
|
if (m_name != name)
|
||||||
|
{
|
||||||
|
m_name = name;
|
||||||
|
emit nameChanged(this, name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon LayerTreeNode::icon() const
|
QIcon LayerTreeNode::icon() const
|
||||||
@ -97,14 +101,35 @@ void LayerTreeNode::insertChild(int row, LayerTreeNode* child)
|
|||||||
if (row < 0 || row > m_children.size())
|
if (row < 0 || row > m_children.size())
|
||||||
row = m_children.size();
|
row = m_children.size();
|
||||||
|
|
||||||
|
emit willAddChildren(this, row, row);
|
||||||
child->setParentNode(this);
|
child->setParentNode(this);
|
||||||
m_children.insert(row, child);
|
m_children.insert(row, child);
|
||||||
|
emit addedChildren(this, row, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
LayerTreeNode* LayerTreeNode::takeChild(int row)
|
void LayerTreeNode::removeChild(int from, int count, bool destroy)
|
||||||
{
|
{
|
||||||
if (row < 0 || row >= m_children.size()) return nullptr;
|
if (from < 0 || count <= 0 || from + count > m_children.size()) return;
|
||||||
LayerTreeNode* taken = m_children.takeAt(row);
|
|
||||||
if (taken) taken->setParentNode(nullptr);
|
emit willRemoveChildren(this, from, from + count - 1);
|
||||||
return taken;
|
|
||||||
|
QVector<LayerTreeNode*> removed;
|
||||||
|
removed.reserve(count);
|
||||||
|
for (int i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
removed.append(m_children.at(from));
|
||||||
|
m_children.removeAt(from);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (LayerTreeNode* node : removed)
|
||||||
|
{
|
||||||
|
node->setParentNode(nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
emit removedChildren(this, from, from + count - 1);
|
||||||
|
|
||||||
|
if (destroy)
|
||||||
|
{
|
||||||
|
qDeleteAll(removed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,9 +9,10 @@
|
|||||||
* LayerTreeNode<64><65><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD>ࣨ<EFBFBD><E0A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
* LayerTreeNode<64><65><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD>ࣨ<EFBFBD><E0A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
* - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD><EFBFBD><EFBFBD>/ͼ<><CDBC>/<2F>ɼ<EFBFBD><C9BC><EFBFBD>/<2F><><EFBFBD>ӹ<EFBFBD>ϵ
|
* - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD><EFBFBD><EFBFBD>/ͼ<><CDBC>/<2F>ɼ<EFBFBD><C9BC><EFBFBD>/<2F><><EFBFBD>ӹ<EFBFBD>ϵ
|
||||||
* - Group / Layer <20>ڵ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>̳<EFBFBD>ʵ<EFBFBD><CAB5>
|
* - Group / Layer <20>ڵ<EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD>̳<EFBFBD>ʵ<EFBFBD><CAB5>
|
||||||
|
* - <20>ṩ<EFBFBD><E1B9A9><EFBFBD><EFBFBD>/ɾ<><C9BE><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD>ź<EFBFBD>֪ͨ
|
||||||
*
|
*
|
||||||
* ˵<><CBB5><EFBFBD><EFBFBD>
|
* ˵<><CBB5><EFBFBD><EFBFBD>
|
||||||
* - <20><><EFBFBD><EFBFBD>ͬʱά<CAB1><CEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD>롱<EFBFBD><EFBFBD>m_parentNode<EFBFBD><EFBFBD><EFBFBD><EFBFBD> QObject parent<6E><74><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
* - <20><><EFBFBD><EFBFBD>ͬʱά<CAB1><CEAC>"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD>"<EFBFBD><EFBFBD>m_parentNode<EFBFBD><EFBFBD><EFBFBD><EFBFBD> QObject parent<6E><74><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
||||||
* - children <20>ɽڵ<C9BD><DAB5>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<CDB7><C5A3><EFBFBD><EFBFBD><EFBFBD>ʱ delete children<65><6E>
|
* - children <20>ɽڵ<C9BD><DAB5>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷţ<CDB7><C5A3><EFBFBD><EFBFBD><EFBFBD>ʱ delete children<65><6E>
|
||||||
*/
|
*/
|
||||||
class LayerTreeNode : public QObject
|
class LayerTreeNode : public QObject
|
||||||
@ -50,7 +51,32 @@ public:
|
|||||||
// ---- structure mutation (used by LayerTree / Model) ----
|
// ---- structure mutation (used by LayerTree / Model) ----
|
||||||
void appendChild(LayerTreeNode* child);
|
void appendChild(LayerTreeNode* child);
|
||||||
void insertChild(int row, LayerTreeNode* child);
|
void insertChild(int row, LayerTreeNode* child);
|
||||||
LayerTreeNode* takeChild(int row); // remove but not delete
|
|
||||||
|
// <20><><EFBFBD><EFBFBD> QgsLayerTreeNode::removeChildrenPrivate <20>Ľ<EFBFBD>
|
||||||
|
// from: <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>, count: <20>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD>, destroy: true <20><> delete <20><><EFBFBD>Ƴ<EFBFBD><C6B3>ڵ<EFBFBD>
|
||||||
|
void removeChild(int from, int count, bool destroy = true);
|
||||||
|
|
||||||
|
// ---- static type helpers ----
|
||||||
|
static inline bool isLayer(LayerTreeNode* node)
|
||||||
|
{
|
||||||
|
return node && node->type() == LayerTreeNode::Type::Layer;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool isGroup(LayerTreeNode* node)
|
||||||
|
{
|
||||||
|
return node && node->type() == LayerTreeNode::Type::Group;
|
||||||
|
}
|
||||||
|
|
||||||
|
signals:
|
||||||
|
// <20>ڲ<EFBFBD><DAB2><EFBFBD><EFBFBD>ӽڵ<D3BD>֮ǰ/֮<><EFBFBD>
|
||||||
|
void willAddChildren(LayerTreeNode* node, int indexFrom, int indexTo);
|
||||||
|
void addedChildren(LayerTreeNode* node, int indexFrom, int indexTo);
|
||||||
|
|
||||||
|
// <20><><EFBFBD>Ƴ<EFBFBD><C6B3>ӽڵ<D3BD>֮ǰ/֮<><EFBFBD>
|
||||||
|
void willRemoveChildren(LayerTreeNode* node, int indexFrom, int indexTo);
|
||||||
|
void removedChildren(LayerTreeNode* node, int indexFrom, int indexTo);
|
||||||
|
|
||||||
|
void nameChanged(LayerTreeNode* node, const QString& name);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setParentNode(LayerTreeNode* p);
|
void setParentNode(LayerTreeNode* p);
|
||||||
|
|||||||
@ -30,6 +30,19 @@ void LayerTreeView::contextMenuEvent(QContextMenuEvent* event)
|
|||||||
setCurrentIndex(QModelIndex());
|
setCurrentIndex(QModelIndex());
|
||||||
|
|
||||||
QMenu* menu = m_menuProvider->createContextMenu();
|
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)
|
if (menu)
|
||||||
{
|
{
|
||||||
menu->exec(event->globalPos());
|
menu->exec(event->globalPos());
|
||||||
|
|||||||
@ -81,3 +81,12 @@ QWidget* MapLayerStore::widgetForLayer(const QString& absolutePath) const
|
|||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MapLayer* MapLayerStore::layerForWidget(QWidget* widget) const
|
||||||
|
{
|
||||||
|
if (!widget) return nullptr;
|
||||||
|
for (const auto& kv : m_layerWidgets) {
|
||||||
|
if (kv.second == widget) return kv.first;
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|||||||
@ -35,6 +35,9 @@ public slots:
|
|||||||
// Get associated widget by layer absolute data path
|
// Get associated widget by layer absolute data path
|
||||||
QWidget* widgetForLayer(const QString& absolutePath) const;
|
QWidget* widgetForLayer(const QString& absolutePath) const;
|
||||||
|
|
||||||
|
// Reverse lookup: find the MapLayer associated with a given widget (or nullptr)
|
||||||
|
MapLayer* layerForWidget(QWidget* widget) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void layerAdded(MapLayer* layer);
|
void layerAdded(MapLayer* layer);
|
||||||
// Emitted just before the layer is destroyed/removed from store
|
// Emitted just before the layer is destroyed/removed from store
|
||||||
|
|||||||
@ -34,7 +34,7 @@ void MapTool::setMapcavas(Mapcavas* canvas)
|
|||||||
|
|
||||||
if (m_isActive && m_canvas)
|
if (m_isActive && m_canvas)
|
||||||
{
|
{
|
||||||
deactivate();
|
//deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_canvas = canvas;
|
m_canvas = canvas;
|
||||||
|
|||||||
@ -3,6 +3,9 @@
|
|||||||
#include "ImageViewer.h"
|
#include "ImageViewer.h"
|
||||||
#include "RasterLayer.h"
|
#include "RasterLayer.h"
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include <QGraphicsScene>
|
||||||
|
#include <QGraphicsLineItem>
|
||||||
|
#include <QPen>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
MapToolSpectral::MapToolSpectral(QObject* parent)
|
MapToolSpectral::MapToolSpectral(QObject* parent)
|
||||||
@ -15,6 +18,17 @@ MapToolSpectral::~MapToolSpectral()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapToolSpectral::activate()
|
||||||
|
{
|
||||||
|
MapTool::activate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MapToolSpectral::deactivate()
|
||||||
|
{
|
||||||
|
canvas()->removeCrosshair();
|
||||||
|
MapTool::deactivate();
|
||||||
|
}
|
||||||
|
|
||||||
void MapToolSpectral::canvasMousePressEvent(QMouseEvent* e)
|
void MapToolSpectral::canvasMousePressEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
if (e->button() != Qt::LeftButton)
|
if (e->button() != Qt::LeftButton)
|
||||||
@ -30,6 +44,9 @@ void MapToolSpectral::canvasMousePressEvent(QMouseEvent* e)
|
|||||||
RasterLayer* rl = canvas()->rasterLayer();
|
RasterLayer* rl = canvas()->rasterLayer();
|
||||||
if (rl && rl->isValidPixel(x, y))
|
if (rl && rl->isValidPixel(x, y))
|
||||||
{
|
{
|
||||||
|
// Place crosshair at pixel center
|
||||||
|
canvas()->updateCrosshair(x + 0.5, y + 0.5);
|
||||||
|
|
||||||
QVector<double> wavelengths;
|
QVector<double> wavelengths;
|
||||||
QVector<double> spectrum;
|
QVector<double> spectrum;
|
||||||
if (rl->readPixelSpectrum(x, y, wavelengths, spectrum))
|
if (rl->readPixelSpectrum(x, y, wavelengths, spectrum))
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
#include "MapTool.h"
|
#include "MapTool.h"
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
|
class QGraphicsLineItem;
|
||||||
|
|
||||||
class MapToolSpectral : public MapTool
|
class MapToolSpectral : public MapTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -14,8 +16,13 @@ public:
|
|||||||
|
|
||||||
void canvasMousePressEvent(QMouseEvent* e) override;
|
void canvasMousePressEvent(QMouseEvent* e) override;
|
||||||
|
|
||||||
|
void activate() override;
|
||||||
|
void deactivate() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void spectralClicked(int x, int y, QVector<double> wavelengths, QVector<double> spectrum);
|
void spectralClicked(int x, int y, QVector<double> wavelengths, QVector<double> spectrum);
|
||||||
|
|
||||||
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAPTOOLSPECTRAL_H
|
#endif // MAPTOOLSPECTRAL_H
|
||||||
|
|||||||
@ -6,39 +6,45 @@
|
|||||||
MapTools::MapTools(QObject* parent)
|
MapTools::MapTools(QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
m_mapToolPan = new MapToolPan(this);
|
m_tools.insert(Pan, new MapToolPan(this));
|
||||||
m_mapToolSpectral = new MapToolSpectral(this);
|
m_tools.insert(Spectral, new MapToolSpectral(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
MapTools::~MapTools()
|
MapTools::~MapTools()
|
||||||
{
|
{
|
||||||
|
qDeleteAll(m_tools);
|
||||||
|
m_tools.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
MapToolPan* MapTools::mapToolPan() const
|
MapToolPan* MapTools::mapToolPan() const
|
||||||
{
|
{
|
||||||
return m_mapToolPan;
|
return qobject_cast<MapToolPan*>(m_tools.value(Pan));
|
||||||
}
|
}
|
||||||
|
|
||||||
MapToolSpectral* MapTools::mapToolSpectral() const
|
MapToolSpectral* MapTools::mapToolSpectral() const
|
||||||
{
|
{
|
||||||
return m_mapToolSpectral;
|
return qobject_cast<MapToolSpectral*>(m_tools.value(Spectral));
|
||||||
}
|
}
|
||||||
|
|
||||||
MapTool* MapTools::mapTool(Tool tool) const
|
MapTool* MapTools::mapTool(Tool tool) const
|
||||||
{
|
{
|
||||||
switch (tool)
|
return m_tools.value(tool, nullptr);
|
||||||
{
|
}
|
||||||
case Pan:
|
|
||||||
return m_mapToolPan;
|
MapTool* MapTools::activeTool() const
|
||||||
case Spectral:
|
{
|
||||||
return m_mapToolSpectral;
|
return m_activeTool;
|
||||||
default:
|
}
|
||||||
return nullptr;
|
|
||||||
}
|
void MapTools::setActiveTool(MapTool* tool)
|
||||||
|
{
|
||||||
|
m_activeTool = tool;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapTools::setMapcavas(Mapcavas* canvas)
|
void MapTools::setMapcavas(Mapcavas* canvas)
|
||||||
{
|
{
|
||||||
m_mapToolPan->setMapcavas(canvas);
|
if (m_activeTool)
|
||||||
m_mapToolSpectral->setMapcavas(canvas);
|
{
|
||||||
|
m_activeTool->setMapcavas(canvas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
#define MAPTOOLS_H
|
#define MAPTOOLS_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QHash>
|
||||||
|
|
||||||
class MapTool;
|
class MapTool;
|
||||||
class MapToolPan;
|
class MapToolPan;
|
||||||
@ -27,11 +28,14 @@ public:
|
|||||||
|
|
||||||
MapTool* mapTool(Tool tool) const;
|
MapTool* mapTool(Tool tool) const;
|
||||||
|
|
||||||
|
MapTool* activeTool() const;
|
||||||
|
void setActiveTool(MapTool* tool);
|
||||||
|
|
||||||
void setMapcavas(Mapcavas* canvas);
|
void setMapcavas(Mapcavas* canvas);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MapToolPan* m_mapToolPan = nullptr;
|
QHash<Tool, MapTool*> m_tools;
|
||||||
MapToolSpectral* m_mapToolSpectral = nullptr;
|
MapTool* m_activeTool = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAPTOOLS_H
|
#endif // MAPTOOLS_H
|
||||||
|
|||||||
@ -7,6 +7,7 @@ m_Multiplier(100.0)
|
|||||||
connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int)));
|
connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int)));
|
||||||
|
|
||||||
setSingleStep(1);
|
setSingleStep(1);
|
||||||
|
setRange(1, 500);
|
||||||
|
|
||||||
setOrientation(Qt::Horizontal);
|
setOrientation(Qt::Horizontal);
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
|
|||||||
@ -23,8 +23,8 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
signals :
|
signals :
|
||||||
void valueChanged(double Value);
|
void valueChanged(double Value);//QSlider<65><72>valueChanged<65>źŵIJ<C5B5><C4B2><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||||
void rangeChanged(double Min, double Max);
|
void rangeChanged(double Min, double Max);//QSlider<65><72>rangeChanged<65>źŵIJ<C5B5><C4B2><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double m_Multiplier;
|
double m_Multiplier;
|
||||||
|
|||||||
@ -232,20 +232,44 @@ void TwoMotorControl::display_motors_connectivity(std::vector<int> connectivity)
|
|||||||
//std::cout << "-----------------------------------"<<connectivity.size()<< std::endl;
|
//std::cout << "-----------------------------------"<<connectivity.size()<< std::endl;
|
||||||
if (connectivity[0])
|
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
|
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])
|
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
|
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);
|
fclose(RecordLineFileHandle);
|
||||||
delete[] data;
|
delete[] data;
|
||||||
|
|
||||||
QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
|
//QMessageBox::information(this, QString::fromLocal8Bit("提示"), QString::fromLocal8Bit("保存成功!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwoMotorControl::onReadRecordLineFile_btn()
|
void TwoMotorControl::onReadRecordLineFile_btn()
|
||||||
@ -499,5 +523,5 @@ void TwoMotorControl::onReadRecordLineFile_btn()
|
|||||||
fclose(RecordLineFileHandle);
|
fclose(RecordLineFileHandle);
|
||||||
delete[] data;
|
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>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>629</width>
|
<width>486</width>
|
||||||
<height>463</height>
|
<height>401</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Dialog</string>
|
<string>Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<iconset>
|
<property name="leftMargin">
|
||||||
<normaloff>HPPA.ico</normaloff>HPPA.ico</iconset>
|
<number>0</number>
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="layoutWidget">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>90</x>
|
|
||||||
<y>250</y>
|
|
||||||
<width>434</width>
|
|
||||||
<height>134</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<property name="topMargin">
|
||||||
<item>
|
<number>0</number>
|
||||||
<widget class="QLabel" name="companylname_label">
|
</property>
|
||||||
<property name="text">
|
<property name="rightMargin">
|
||||||
<string>公司:北京依锐思遥感技术有限公司</string>
|
<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>
|
</property>
|
||||||
</widget>
|
<property name="topMargin">
|
||||||
</item>
|
<number>0</number>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>地址:北京市海淀区清河安宁庄东路18号5号楼二层205</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="rightMargin">
|
||||||
</item>
|
<number>0</number>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>电话:010-51292601</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="bottomMargin">
|
||||||
</item>
|
<number>0</number>
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>邮箱:hanshanlong@iris-rs.cn</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="spacing">
|
||||||
</item>
|
<number>10</number>
|
||||||
</layout>
|
</property>
|
||||||
</widget>
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QWidget" name="titlebarWidget" native="true">
|
||||||
<property name="geometry">
|
<property name="sizePolicy">
|
||||||
<rect>
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<x>270</x>
|
<horstretch>0</horstretch>
|
||||||
<y>150</y>
|
<verstretch>0</verstretch>
|
||||||
<width>141</width>
|
</sizepolicy>
|
||||||
<height>24</height>
|
</property>
|
||||||
</rect>
|
<property name="minimumSize">
|
||||||
</property>
|
<size>
|
||||||
<property name="text">
|
<width>0</width>
|
||||||
<string>版本:2.0</string>
|
<height>43</height>
|
||||||
</property>
|
</size>
|
||||||
</widget>
|
</property>
|
||||||
<widget class="QLabel" name="label_4">
|
<property name="maximumSize">
|
||||||
<property name="geometry">
|
<size>
|
||||||
<rect>
|
<width>16777215</width>
|
||||||
<x>270</x>
|
<height>43</height>
|
||||||
<y>70</y>
|
</size>
|
||||||
<width>391</width>
|
</property>
|
||||||
<height>31</height>
|
<property name="styleSheet">
|
||||||
</rect>
|
<string notr="true">QWidget #titlebarWidget
|
||||||
</property>
|
{
|
||||||
<property name="text">
|
background: #0E1C4C;
|
||||||
<string>Hyper Plant Phenotypic Analysis</string>
|
border: 1px solid #2f6bff;
|
||||||
</property>
|
}</string>
|
||||||
<property name="textFormat">
|
</property>
|
||||||
<enum>Qt::PlainText</enum>
|
<layout class="QGridLayout" name="gridLayout_6">
|
||||||
</property>
|
<item row="0" column="0">
|
||||||
</widget>
|
<widget class="QLabel" name="iconLabel">
|
||||||
<widget class="QLabel" name="label_7">
|
<property name="text">
|
||||||
<property name="geometry">
|
<string/>
|
||||||
<rect>
|
</property>
|
||||||
<x>90</x>
|
<property name="pixmap">
|
||||||
<y>50</y>
|
<pixmap resource="HPPA.qrc">:/png/resources/icons/png/Spectral_Insight_27.png</pixmap>
|
||||||
<width>141</width>
|
</property>
|
||||||
<height>141</height>
|
</widget>
|
||||||
</rect>
|
</item>
|
||||||
</property>
|
<item row="0" column="1">
|
||||||
<property name="text">
|
<widget class="QLabel" name="label_9">
|
||||||
<string/>
|
<property name="styleSheet">
|
||||||
</property>
|
<string notr="true">QLabel
|
||||||
<property name="pixmap">
|
{
|
||||||
<pixmap>HPPA.ico</pixmap>
|
color:#E2EDFF;
|
||||||
</property>
|
}</string>
|
||||||
</widget>
|
</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>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="HPPA.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#include "aboutWindow.h"
|
#include "aboutWindow.h"
|
||||||
|
#include <QSvgRenderer>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
aboutWindow::aboutWindow(QWidget* parent)
|
aboutWindow::aboutWindow(QWidget* parent)
|
||||||
{
|
{
|
||||||
@ -9,14 +10,22 @@ aboutWindow::aboutWindow(QWidget* parent)
|
|||||||
QString text = ui.companylname_label->text();
|
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);
|
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;
|
//Qt::WindowFlags flags = 0;
|
||||||
//flags |= Qt::WindowMinimizeButtonHint;
|
////flags |= Qt::WindowMinimizeButtonHint;
|
||||||
flags |= Qt::WindowCloseButtonHint;
|
//flags |= Qt::WindowCloseButtonHint;
|
||||||
flags |= Qt::MSWindowsFixedSizeDialogHint;
|
//flags |= Qt::MSWindowsFixedSizeDialogHint;
|
||||||
setWindowFlags(flags);
|
//setWindowFlags(flags);
|
||||||
|
setWindowFlags(Qt::FramelessWindowHint);
|
||||||
|
|
||||||
|
connect(this->ui.closeBtn, SIGNAL(released()), this, SLOT(onExit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
aboutWindow::~aboutWindow()
|
aboutWindow::~aboutWindow()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void aboutWindow::onExit()
|
||||||
|
{
|
||||||
|
this->close();
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
#include <QtWidgets/qdialog.h>
|
#include <QtWidgets/qdialog.h>
|
||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
|
|
||||||
|
|
||||||
#include "ui_about.h"
|
#include "ui_about.h"
|
||||||
|
|
||||||
class aboutWindow :public QDialog
|
class aboutWindow :public QDialog
|
||||||
@ -19,6 +20,7 @@ private:
|
|||||||
Ui::aboutDialog ui;
|
Ui::aboutDialog ui;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
void onExit();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,22 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "focusWindow.h"
|
#include "focusWindow.h"
|
||||||
|
#include <QSvgRenderer>
|
||||||
|
#include <QMouseEvent>
|
||||||
|
|
||||||
focusWindow::focusWindow(QWidget *parent, ImagerOperationBase* imager)
|
focusWindow::focusWindow(QWidget *parent, ImagerOperationBase* imager)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
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";
|
string HPPACfgFile = getPathofEXE() + "\\HPPA.cfg";
|
||||||
Configfile configfile;
|
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.moveto_btn, SIGNAL(clicked()), this, SLOT(onMoveto()));
|
||||||
|
|
||||||
connect(this->ui.rangeMeasurement_btn, SIGNAL(pressed()), this, SLOT(onx_rangeMeasurement()));
|
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())
|
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||||
@ -67,6 +80,7 @@ focusWindow::~focusWindow()
|
|||||||
printf("destroy focusWindow-------------------------\n");
|
printf("destroy focusWindow-------------------------\n");
|
||||||
|
|
||||||
emit StartManualFocusSignal(0);//当用户没有点击停止调焦就关闭窗口
|
emit StartManualFocusSignal(0);//当用户没有点击停止调焦就关闭窗口
|
||||||
|
emit closeSignal();
|
||||||
|
|
||||||
delete m_ctrlFocusMotor;
|
delete m_ctrlFocusMotor;
|
||||||
//delete thread1, progressThread;
|
//delete thread1, progressThread;
|
||||||
@ -78,9 +92,50 @@ focusWindow::~focusWindow()
|
|||||||
m_MotionCaptureCoordinatorThread.wait();
|
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)
|
void focusWindow::disableBeforeConnect(bool disable)
|
||||||
{
|
{
|
||||||
ui.controlMotor_groupBox->setDisabled(disable);
|
ui.controlMotor_widget->setDisabled(disable);
|
||||||
ui.autoFocus_btn->setDisabled(disable);
|
ui.autoFocus_btn->setDisabled(disable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -105,8 +105,13 @@ public:
|
|||||||
|
|
||||||
ImagerOperationBase* m_Imager;
|
ImagerOperationBase* m_Imager;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QPoint m_dragPosition;
|
||||||
|
bool m_bDrag = false;
|
||||||
|
|
||||||
Ui::focusDialog ui;
|
Ui::focusDialog ui;
|
||||||
QThread *m_AutoFocusThread;
|
QThread *m_AutoFocusThread;
|
||||||
int m_FocusState;
|
int m_FocusState;
|
||||||
@ -151,6 +156,8 @@ public Q_SLOTS:
|
|||||||
|
|
||||||
void moveAfterAutoFocus(int motorID, double location);
|
void moveAfterAutoFocus(int motorID, double location);
|
||||||
|
|
||||||
|
void onExit();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void StartManualFocusSignal(int);//1<><31><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
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 zeroStartSignal(int);
|
||||||
|
|
||||||
void startStepMotion(double speed, int stepInterval = 100, double startPos = 0, double endPos = -1);
|
void startStepMotion(double speed, int stepInterval = 100, double startPos = 0, double endPos = -1);
|
||||||
|
void closeSignal();
|
||||||
};
|
};
|
||||||
|
|
||||||
class WorkerThread2 : public QThread
|
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.spinRed->setKeyboardTracking(false);
|
||||||
ui.spinGreen->setKeyboardTracking(false);
|
ui.spinGreen->setKeyboardTracking(false);
|
||||||
ui.spinBlue->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()
|
ImageControl::~ImageControl()
|
||||||
|
|||||||
@ -14,7 +14,56 @@
|
|||||||
<string>Color Adjust</string>
|
<string>Color Adjust</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<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);
|
color: rgb(255, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,10 +120,21 @@ QSlider::handle:horizontal:pressed {
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupAdjustments">
|
<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">
|
<property name="title">
|
||||||
<string>调整</string>
|
<string>调整</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>16</number>
|
||||||
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="labelRed">
|
<widget class="QLabel" name="labelRed">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -185,16 +245,40 @@ QSlider::handle:horizontal:pressed {
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>预设</string>
|
<string>预设</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="presetLayout">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<widget class="QPushButton" name="btnTrueColor">
|
<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">
|
<property name="text">
|
||||||
<string>真彩色</string>
|
<string>真彩色</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1">
|
||||||
<widget class="QPushButton" name="btnColorInfrared">
|
<widget class="QPushButton" name="btnColorInfrared">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>43</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>假彩色</string>
|
<string>假彩色</string>
|
||||||
</property>
|
</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>
|
// Microsoft Visual C++ <20><><EFBFBD>ɵİ<C9B5><C4B0><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
||||||
// <20><> HPPA.rc ʹ<><CAB9>
|
// <20><> HPPA.rc ʹ<><CAB9>
|
||||||
//
|
//
|
||||||
#define IDI_ICON1 101
|
#define IDI_ICON1 106
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#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_COMMAND_VALUE 40001
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
|||||||
Reference in New Issue
Block a user