3 Commits

Author SHA1 Message Date
b23aedc6c7 美化ui 2026-03-18 15:56:06 +08:00
06dffddfd0 美化窗口:关于+图像控制 2026-03-18 00:03:56 +08:00
ca10848750 调焦窗口美化 2026-03-17 19:11:33 +08:00
16 changed files with 1271 additions and 382 deletions

View File

@ -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()

View File

@ -6,8 +6,8 @@
<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">
@ -17,258 +17,609 @@
<iconset resource="HPPA.qrc"> <iconset resource="HPPA.qrc">
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset> <normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <property name="styleSheet">
<item row="0" column="0" rowspan="2"> <string notr="true">QLineEdit {
<widget class="QGroupBox" name="connectFocusModule_groupBox"> background-color: #142D7F;
<property name="title"> color: #e6eeff;
<string>连接调焦模块</string> 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 &quot;新宋体&quot;;
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_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>10</number>
</property>
<item row="0" column="0">
<widget class="QWidget" name="contentWidget" native="true">
<property name="styleSheet">
<string notr="true">QWidget #contentWidget
{
background: #040125;
/*border-radius: 8px 8px 8px 8px;*/
border: 1px solid #2f6bff;
}</string>
</property> </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>
<normaloff>icon/all/close.svg</normaloff>icon/all/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>

View File

@ -276,8 +276,9 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
connect(m_layerTreeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), connect(m_layerTreeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(onLayerTreeSelectionChanged(QItemSelection,QItemSelection))); this, SLOT(onLayerTreeSelectionChanged(QItemSelection,QItemSelection)));
dock_layers->setWidget(dock_layersWidgetContents);
dock_layersWidgetContents->setStyleSheet(qss_DockWidget_contentWidget); dock_layersWidgetContents->setStyleSheet(qss_DockWidget_contentWidget);
dock_layers->setWidget(tmp(dock_layersWidgetContents));
//dock_layers->setMinimumWidth(449); //dock_layers->setMinimumWidth(449);
//dock_layers->setMaximumWidth(450); //dock_layers->setMaximumWidth(450);
@ -403,11 +404,12 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
} }
)"); )");
dock_hyperimgViewer->setWidget(dock_hyperimgViewerWidgetContents);
mPanelMenu->addAction(dock_hyperimgViewer->toggleViewAction()); mPanelMenu->addAction(dock_hyperimgViewer->toggleViewAction());
QWidget* tmp6 = new QWidget(); QWidget* tmp6 = new QWidget();
dock_hyperimgViewer->setTitleBarWidget(tmp6); dock_hyperimgViewer->setTitleBarWidget(tmp6);
dock_hyperimgViewer->setWidget(tmp(dock_hyperimgViewerWidgetContents));
//轮播看板 //轮播看板
m_dock_carousel = new CustomDockWidgetBase(QString::fromLocal8Bit("轮播"), this); m_dock_carousel = new CustomDockWidgetBase(QString::fromLocal8Bit("轮播"), this);
m_dock_carousel->setObjectName("mDockCarousel"); m_dock_carousel->setObjectName("mDockCarousel");
@ -429,8 +431,8 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
border-top-left-radius: 0px; border-top-left-radius: 0px;
border-top-right-radius: 0px; border-top-right-radius: 0px;
border-bottom-left-radius: 0px; border-bottom-left-radius: 10px;
border-bottom-right-radius: 0px; border-bottom-right-radius: 10px;
} }
)"); )");
QGridLayout* gridLayout_carouselContainer = new QGridLayout(carouselContainer); QGridLayout* gridLayout_carouselContainer = new QGridLayout(carouselContainer);
@ -476,7 +478,7 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
gridLayout_carouselContainer->addWidget(m_carousel); gridLayout_carouselContainer->addWidget(m_carousel);
m_dock_carousel->setWidget(carouselContainer); m_dock_carousel->setWidget(tmp(carouselContainer));
//控制看板 //控制看板
ui.mDockWidgetSpectrometer->setTile(QString::fromLocal8Bit("控制")); ui.mDockWidgetSpectrometer->setTile(QString::fromLocal8Bit("控制"));
@ -484,6 +486,8 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
initControlTabwidget(); initControlTabwidget();
m_tabManager = new TabManager(ui.controlTabWidget, this); m_tabManager = new TabManager(ui.controlTabWidget, this);
ui.mDockWidgetSpectrometer->setWidget(tmp(ui.dockWidgetContents_4));
//3D模型看板 //3D模型看板
ui.mDockWidgetSimulator->setTile(QString::fromLocal8Bit("3D模型")); ui.mDockWidgetSimulator->setTile(QString::fromLocal8Bit("3D模型"));
//ui.mDockWidgetSimulator->show(); //ui.mDockWidgetSimulator->show();
@ -519,7 +523,7 @@ sizePolicy1.setHeightForWidth(graphicsView_delete->sizePolicy().hasHeightForWidt
connect(m_view3DModelManager, SIGNAL(created3DModelPlantPhenotype()), this, SLOT(onCreated3DModelPlantPhenotype())); connect(m_view3DModelManager, SIGNAL(created3DModelPlantPhenotype()), this, SLOT(onCreated3DModelPlantPhenotype()));
connect(m_view3DModelManager, SIGNAL(created3DModelOneMotor()), this, SLOT(onCreated3DModelOneMotor())); connect(m_view3DModelManager, SIGNAL(created3DModelOneMotor()), this, SLOT(onCreated3DModelOneMotor()));
ui.mDockWidgetSimulator->setWidget(modelWidgetContainer); ui.mDockWidgetSimulator->setWidget(tmp(modelWidgetContainer));
//看板排版 //看板排版
splitDockWidget(dock_layers, dock_hyperimgViewer, Qt::Horizontal); splitDockWidget(dock_layers, dock_hyperimgViewer, Qt::Horizontal);
@ -750,7 +754,7 @@ void HPPA::initMenubarToolbar()
if (checked) if (checked)
ui.mActionSpectral->setIcon(QIcon(".//icon//all//spectral_done.svg")); ui.mActionSpectral->setIcon(QIcon(".//icon//all//spectral_done.svg"));
else else
ui.mActionSpectral->setIcon(QIcon(".//icon//all//spectral.svg")); ui.mActionSpectral->setIcon(QIcon(".//icon//all//spectral.svg"));
}); });
// 使用样式表设置透明背景 // 使用样式表设置透明背景
@ -779,6 +783,22 @@ void HPPA::initMenubarToolbar()
setMenuWidget(topWidget); setMenuWidget(topWidget);
} }
QWidget* HPPA::tmp(QWidget* a)
{
QWidget* Background = new QWidget(this);
Background->setObjectName("Background");
QGridLayout* layout_Background = new QGridLayout(Background);
layout_Background->setContentsMargins(0, 0, 0, 0);
Background->setStyleSheet(R"(
QWidget #Background{
background: #040125;
}
)");
layout_Background->addWidget(a);
return Background;
}
void HPPA::initControlTabwidget() void HPPA::initControlTabwidget()
{ {
//rgb相机 //rgb相机
@ -900,6 +920,7 @@ void HPPA::createActionGroups()
ui.mActionCorning_410->setChecked(true); ui.mActionCorning_410->setChecked(true);
} }
updateImagerPicture(lastSelectedAction);
} }
void HPPA::selectingImager(QAction* selectedAction) void HPPA::selectingImager(QAction* selectedAction)
@ -907,6 +928,30 @@ void HPPA::selectingImager(QAction* selectedAction)
QSettings settings; QSettings settings;
settings.setValue("LastSelectedImagerAction", selectedAction->objectName()); settings.setValue("LastSelectedImagerAction", selectedAction->objectName());
settings.sync(); settings.sync();
updateImagerPicture(selectedAction->objectName());
}
void HPPA::updateImagerPicture(const QString& actionName)
{
QString picPath;
if (actionName == "mActionPica_L")
picPath = ".//icon//imagerPicture//L.png";
else if (actionName == "mActionPica_NIR")
picPath = ".//icon//imagerPicture//IR.png";
else if (actionName == "mActionPika_XC2")
picPath = ".//icon//imagerPicture//XC2.png";
else if (actionName == "mActionCorning_410")
picPath = ".//icon//imagerPicture//corning410.png";
if (!picPath.isEmpty())
{
QPixmap pixmap(picPath);
if (!pixmap.isNull())
{
ui.imagerPictureLabel->setPixmap(pixmap);
}
}
} }
void HPPA::createMoveplatformActionGroup() void HPPA::createMoveplatformActionGroup()
@ -1077,6 +1122,29 @@ void HPPA::initPanelToolbar()
ui.mWindowsMenu->addMenu(mPanelMenu); ui.mWindowsMenu->addMenu(mPanelMenu);
ui.mWindowsMenu->addMenu(mToolbarMenu); ui.mWindowsMenu->addMenu(mToolbarMenu);
mPanelMenu->setStyleSheet(R"(
QMenu {
background-color: #0A1245; /* 菜单背景色 */
border: 1px solid gray; /* 可选,边框样式 */
color: white; /* 根据你的背景调整文字颜色 */
}
QMenu::item:selected {
background-color: rgba(255, 255, 255, 50); /* 选中时的背景色 */
color: white; /* 选中项字体颜色,可选 */
}
)");
mToolbarMenu->setStyleSheet(R"(
QMenu {
background-color: #0A1245; /* 菜单背景色 */
border: 1px solid gray; /* 可选,边框样式 */
color: white; /* 根据你的背景调整文字颜色 */
}
QMenu::item:selected {
background-color: rgba(255, 255, 255, 50); /* 选中时的背景色 */
color: white; /* 选中项字体颜色,可选 */
}
)");
mPanelMenu->addAction(ui.mDockWidgetSpectrometer->toggleViewAction()); mPanelMenu->addAction(ui.mDockWidgetSpectrometer->toggleViewAction());
mPanelMenu->addAction(ui.mDockWidgetSimulator->toggleViewAction()); mPanelMenu->addAction(ui.mDockWidgetSimulator->toggleViewAction());
@ -1315,7 +1383,7 @@ void HPPA::onStartRecordStep1()
removeAllLayersInRasterGroup(); removeAllLayersInRasterGroup();
ui.action_start_recording->setText(QString::fromLocal8Bit("停止采集")); ui.action_start_recording->setText(QString::fromLocal8Bit("停止采集"));
ui.action_start_recording->setIcon(QIcon(".//icon//all//record_ing.svg")); ui.action_start_recording->setIcon(QIcon(".//icon//all//record_ing.svg"));
//ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}"); //ui.mainToolBar->widgetForAction(ui.action_start_recording)->setStyleSheet("QWidget{background-color:rgb(255,0,0);}");
//应该先控制马达运动,当马达运动后,再开始光谱仪采集(发射开始采集信号) //应该先控制马达运动,当马达运动后,再开始光谱仪采集(发射开始采集信号)
@ -1673,14 +1741,38 @@ void HPPA::onExit()
void HPPA::closeEvent(QCloseEvent* event) void HPPA::closeEvent(QCloseEvent* event)
{ {
QMessageBox::StandardButton ret; QMessageBox msgBox(this);
msgBox.setWindowTitle(QString::fromLocal8Bit("退出确认"));
msgBox.setText(QString::fromLocal8Bit("确定要退出程序吗?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::No);
msgBox.setStyleSheet(R"(
QMessageBox {
background-color: #0D1233;
}
QMessageBox QLabel {
color: #ACCDFF;
font-size: 14px;
}
QPushButton {
background-color: #142D7F;
color: #e6eeff;
border: 1px solid #2f6bff;
border-radius: 6px;
padding: 6px 20px;
min-width: 60px;
font-size: 13px;
}
QPushButton:hover {
border: 1px solid #4d8dff;
background-color: red;
}
QPushButton:pressed {
background-color: #23345c;
}
)");
ret = QMessageBox::question( QMessageBox::StandardButton ret = static_cast<QMessageBox::StandardButton>(msgBox.exec());
this,
QString::fromLocal8Bit("退出确认"),
QString::fromLocal8Bit("确定要退出程序吗?"),
QMessageBox::Yes | QMessageBox::No
);
if (ret == QMessageBox::Yes) if (ret == QMessageBox::Yes)
{ {
@ -1747,9 +1839,9 @@ void HPPA::onconnect()
{ {
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setText(QString::fromLocal8Bit("请选择相机!")); msgBox.setText(QString::fromLocal8Bit("请选择相机!"));
msgBox.exec(); msgBox.exec();
return; return;
} }
ui.action_connect_imager->setIcon(QIcon(".//icon//all//connect_imager_ing.svg")); ui.action_connect_imager->setIcon(QIcon(".//icon//all//connect_imager_ing.svg"));
@ -1882,8 +1974,9 @@ void HPPA::onFocus1()
{ {
focusWindow* w = new focusWindow(this, m_Imager); focusWindow* w = new focusWindow(this, m_Imager);
connect(w, SIGNAL(StartManualFocusSignal(int)), this, SLOT(onFocus2(int))); connect(w, SIGNAL(StartManualFocusSignal(int)), this, SLOT(onFocus2(int)));
connect(w, SIGNAL(closeSignal()), this, SLOT(onFocusWindowClosed()));
//w->setModal(true);//设置窗口为模态:只能操作当前窗口 w->setModal(true);//设置窗口为模态:只能操作当前窗口
w->show(); w->show();
w->exec(); w->exec();
@ -1894,18 +1987,23 @@ void HPPA::onFocus2(int command)
{ {
if (command == 1) if (command == 1)
{ {
if (m_focusTab)
{
emit StartFocusSignal();
return;
}
//创建影像显示窗口 //创建影像显示窗口
QWidget* tabTmp = new QWidget(); m_focusTab = new QWidget();
QGridLayout* GridLayout = new QGridLayout(); QGridLayout* GridLayout = new QGridLayout();
GridLayout->addWidget(new Mapcavas(tabTmp)); GridLayout->addWidget(new Mapcavas(m_focusTab));
tabTmp->setLayout(GridLayout); m_focusTab->setLayout(GridLayout);
m_imageViewerTabWidget->addTab(tabTmp, QString::fromLocal8Bit("调焦")); m_imageViewerTabWidget->addTab(m_focusTab, QString::fromLocal8Bit("调焦"));
//m_imageViewerTabWidget->setCurrentIndex(trackNumber); //m_imageViewerTabWidget->setCurrentIndex(trackNumber);
m_imageViewerTabWidget->setCurrentWidget(tabTmp); m_imageViewerTabWidget->setCurrentWidget(m_focusTab);
//开始调焦 //开始调焦
@ -1917,6 +2015,19 @@ void HPPA::onFocus2(int command)
} }
} }
void HPPA::onFocusWindowClosed()
{
//关闭调焦窗口时,停止调焦功能
m_Imager->setFocusControlState(false);
//关闭调焦窗口tab
int index = m_imageViewerTabWidget->indexOf(m_focusTab);
if (index != -1)
{
m_imageViewerTabWidget->removeTab(index);
}
m_focusTab = nullptr;
}
void HPPA::onAbout() void HPPA::onAbout()
{ {
aboutWindow about; aboutWindow about;
@ -2062,13 +2173,16 @@ void HPPA::PlotSpectral(int state)
series->append(i, m_Imager->buffer[1368 * 150 + i]); series->append(i, m_Imager->buffer[1368 * 150 + i]);
} }
QChart* chart = new QChart(); series->setPen(QPen(QColor("#FF928A"), 2));
chart->legend()->hide();
chart->addSeries(series);
chart->createDefaultAxes();
//chart->setTitle("Simple line chart example");
m_chartView->setChart(chart); m_chart->removeAllSeries();
m_chart->addSeries(series);
m_chart->createDefaultAxes();
QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axisX());
QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axisY());
setAxis(axisX, axisY);
} }
else else
{ {

View File

@ -199,6 +199,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 +242,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();
@ -285,6 +287,8 @@ private:
void initMapTools(); void initMapTools();
void setMapTool(); void setMapTool();
QWidget* m_focusTab=nullptr;
public Q_SLOTS: public Q_SLOTS:
void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QString filePath); void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QString filePath);
void PlotSpectral(int state); void PlotSpectral(int state);
@ -300,6 +304,7 @@ public Q_SLOTS:
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();

View File

@ -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>
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset> <normaloff>icon/all/png/Group 356_slices/22.png</normaloff>icon/all/png/Group 356_slices/22.png</iconset>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
@ -322,7 +322,7 @@ 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>
@ -412,7 +412,7 @@ QSlider::handle:horizontal:pressed {
<number>10</number> <number>10</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>0</number> <number>10</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>10</number> <number>10</number>
@ -421,15 +421,21 @@ QSlider::handle:horizontal:pressed {
<number>10</number> <number>10</number>
</property> </property>
<property name="spacing"> <property name="spacing">
<number>0</number> <number>10</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="imagerPictureLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="scaledContents">
<pixmap resource="HPPA.qrc">:/HPPA/HPPA.ico</pixmap> <bool>true</bool>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -457,11 +463,8 @@ QSlider::handle:horizontal:pressed {
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="horizontalSpacing"> <property name="spacing">
<number>2</number> <number>10</number>
</property>
<property name="verticalSpacing">
<number>6</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">

View File

@ -32,7 +32,7 @@
</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">

View File

@ -68,8 +68,8 @@ QVariant LayerTreeModel::data(const QModelIndex& index, int role) const
} }
} }
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";

View File

@ -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());

View File

@ -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("读取成功!"));
} }

View File

@ -9,8 +9,8 @@
<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">
@ -18,93 +18,292 @@
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset> <iconset>
<normaloff>HPPA.ico</normaloff>HPPA.ico</iconset> <normaloff>C:/Users/73505/.designer/backup/HPPA.ico</normaloff>C:/Users/73505/.designer/backup/HPPA.ico</iconset>
</property> </property>
<widget class="QWidget" name="layoutWidget"> <layout class="QGridLayout" name="gridLayout">
<property name="geometry"> <property name="leftMargin">
<rect> <number>0</number>
<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>icon/all/png/Group 356_slices/22.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 &quot;新宋体&quot;;
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>
<normaloff>icon/all/close.svg</normaloff>icon/all/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>C:/Users/73505/.designer/backup/icon/all/png/Group 356_slices/Group 356.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 &quot;Adobe Devanagari&quot;;
}</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 &quot;Adobe Devanagari&quot;;
}</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 &quot;Adobe Devanagari&quot;;
}</string>
</property>
<property name="text">
<string>版本3.0</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -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();
}

View File

@ -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:

View File

@ -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(".//icon//all//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);
} }

View File

@ -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

View File

@ -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(D:/cpp_project_vs2022/HPPA/HPPA/icon/all/arrow_up.svg);
width: 10px;
height: 10px;
}
QDoubleSpinBox::down-arrow {
image: url(D:/cpp_project_vs2022/HPPA/HPPA/icon/all/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()

View File

@ -28,7 +28,7 @@ QPushButton
{ {
/*width: 172px; /*width: 172px;
height: 56px;*/ height: 56px;*/
font: 19pt &quot;新宋体&quot;; font: 10pt &quot;新宋体&quot;;
background-color: qlineargradient( background-color: qlineargradient(
spread:pad, spread:pad,
x1:0.5, y1:0, x2:0.5, y2:1, x1:0.5, y1:0, x2:0.5, y2:1,
@ -37,7 +37,7 @@ QPushButton
); );
color: white; color: white;
border: none; border: none;
padding: 8px 16px; padding: 8px 8px;
border-radius: 4px; border-radius: 4px;
} }
QPushButton:hover QPushButton:hover
@ -120,6 +120,14 @@ 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 &quot;Adobe Devanagari&quot;;
}</string>
</property>
<property name="title"> <property name="title">
<string>调整</string> <string>调整</string>
</property> </property>
@ -237,6 +245,24 @@ QSlider::handle:horizontal:pressed {
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <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>
@ -244,6 +270,12 @@ QSlider::handle:horizontal:pressed {
</item> </item>
<item row="0" column="1"> <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>