调焦窗口美化
This commit is contained in:
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>632</width>
|
||||
<height>444</height>
|
||||
<width>557</width>
|
||||
<height>432</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -17,258 +17,597 @@
|
||||
<iconset resource="HPPA.qrc">
|
||||
<normaloff>:/HPPA/HPPA.ico</normaloff>:/HPPA/HPPA.ico</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="connectFocusModule_groupBox">
|
||||
<property name="title">
|
||||
<string>连接调焦模块</string>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLineEdit {
|
||||
background-color: #142D7F;
|
||||
color: #e6eeff;
|
||||
border: 1px solid #2f6bff;
|
||||
border-radius: 6px;
|
||||
padding: 4px 8px;
|
||||
min-width: 70px;
|
||||
min-height: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
QGroupBox
|
||||
{
|
||||
border: 12px solid transparent;
|
||||
/*border-top: 12px solid transparent;
|
||||
border-right: 0px solid transparent;
|
||||
border-bottom: 0px solid transparent;
|
||||
border-left: 0px solid transparent;*/
|
||||
color: #ACCDFF;
|
||||
}
|
||||
|
||||
QPushButton
|
||||
{
|
||||
/*width: 172px;
|
||||
height: 56px;*/
|
||||
font: 10pt "新宋体";
|
||||
background-color: qlineargradient(
|
||||
spread:pad,
|
||||
x1:0.5, y1:0, x2:0.5, y2:1,
|
||||
stop:0 #283D86,
|
||||
stop:1 #0F1A40
|
||||
);
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
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>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>线性平台</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="motorPort_comboBox"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="ultrasound_radioButton">
|
||||
<property name="text">
|
||||
<string>超声</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="ultrasoundPort_comboBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="is_new_version_radioButton">
|
||||
<property name="text">
|
||||
<string>新版</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="connectMotor_btn">
|
||||
<property name="text">
|
||||
<string>连接线性平台</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QGroupBox" name="controlFocus_groupBox">
|
||||
<property name="title">
|
||||
<string>调焦</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>采样率</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="sample_ratio_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>20</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QProgressBar" name="autoFocusProgress_progressBar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="autoFocus_btn">
|
||||
<property name="text">
|
||||
<string>自动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>171</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="manualFocus_btn">
|
||||
<property name="text">
|
||||
<string>手动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QGroupBox" name="controlMotor_groupBox">
|
||||
<property name="title">
|
||||
<string>调整线性平台</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="updateCurrentLocation_btn">
|
||||
<widget class="QWidget" name="titlebarWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>更新实时位置</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="currentLocation_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>null</string>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>43</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #titlebarWidget
|
||||
{
|
||||
background: #0E1C4C;
|
||||
border: 1px solid #2f6bff;
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="iconLabel">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>505</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QPushButton" name="closeBtn">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normaloff>icon/all/close.svg</normaloff>icon/all/close.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="moveto_btn">
|
||||
<property name="text">
|
||||
<string>移动至</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="move2_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="add_btn">
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="addStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="subtract_btn">
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="subtractStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="logicZero_btn">
|
||||
<property name="text">
|
||||
<string>LogicZero</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="max_btn">
|
||||
<property name="text">
|
||||
<string>max</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QPushButton" name="rangeMeasurement_btn">
|
||||
<property name="text">
|
||||
<string>量程测量</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<widget class="QWidget" name="connectFocusModule_widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #connectFocusModule_widget
|
||||
{
|
||||
background: #121945;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
QRadioButton
|
||||
{
|
||||
color: #E2EDFF;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>连接调焦模块</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>线性平台</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="motorPort_comboBox"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="ultrasound_radioButton">
|
||||
<property name="text">
|
||||
<string>超声</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="ultrasoundPort_comboBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QRadioButton" name="is_new_version_radioButton">
|
||||
<property name="text">
|
||||
<string>新版</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>107</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="connectMotor_btn">
|
||||
<property name="text">
|
||||
<string>连接线性平台</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QWidget" name="controlMotor_widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #controlMotor_widget
|
||||
{
|
||||
background: #121945;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="moveto_btn">
|
||||
<property name="text">
|
||||
<string>移动至</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="logicZero_btn">
|
||||
<property name="text">
|
||||
<string>LogicZero</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="move2_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QPushButton" name="add_btn">
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="subtractStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="updateCurrentLocation_btn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>更新实时位置</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="addStepSize_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="rangeMeasurement_btn">
|
||||
<property name="text">
|
||||
<string>量程测量</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="currentLocation_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>null</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="subtract_btn">
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QPushButton" name="max_btn">
|
||||
<property name="text">
|
||||
<string>max</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>调整线性平台</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="controlFocus_widget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QWidget #controlFocus_widget
|
||||
{
|
||||
background: #121945;
|
||||
border-radius: 5px 5px 5px 5px;
|
||||
}</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>采样率</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="sample_ratio_lineEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>88</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>20</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QProgressBar" name="autoFocusProgress_progressBar">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QProgressBar {
|
||||
border: 2px solid #08FACE; /* 边框颜色和宽度 */
|
||||
border-radius: 8px; /* 圆角 */
|
||||
background-color: #eee; /* 未完成部分颜色 */
|
||||
text-align: center; /* 百分比文本居中 */
|
||||
height: 13px; /* 高度 */
|
||||
}
|
||||
|
||||
QProgressBar::chunk {
|
||||
background-color: #08FACE; /* 渐变色进度块 */
|
||||
border-radius: 8px; /* 保持和整体圆角一致 */
|
||||
}</string>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="autoFocus_btn">
|
||||
<property name="text">
|
||||
<string>自动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>171</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="manualFocus_btn">
|
||||
<property name="text">
|
||||
<string>手动调焦</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@ -1882,8 +1882,9 @@ void HPPA::onFocus1()
|
||||
{
|
||||
focusWindow* w = new focusWindow(this, m_Imager);
|
||||
connect(w, SIGNAL(StartManualFocusSignal(int)), this, SLOT(onFocus2(int)));
|
||||
connect(w, SIGNAL(closeSignal()), this, SLOT(onFocusWindowClosed()));
|
||||
|
||||
//w->setModal(true);//设置窗口为模态:只能操作当前窗口
|
||||
w->setModal(true);//设置窗口为模态:只能操作当前窗口
|
||||
w->show();
|
||||
w->exec();
|
||||
|
||||
@ -1894,18 +1895,23 @@ void HPPA::onFocus2(int command)
|
||||
{
|
||||
if (command == 1)
|
||||
{
|
||||
if (m_focusTab)
|
||||
{
|
||||
emit StartFocusSignal();
|
||||
return;
|
||||
}
|
||||
//创建影像显示窗口
|
||||
QWidget* tabTmp = new QWidget();
|
||||
m_focusTab = new QWidget();
|
||||
|
||||
QGridLayout* GridLayout = new QGridLayout();
|
||||
GridLayout->addWidget(new Mapcavas(tabTmp));
|
||||
GridLayout->addWidget(new Mapcavas(m_focusTab));
|
||||
|
||||
tabTmp->setLayout(GridLayout);
|
||||
m_focusTab->setLayout(GridLayout);
|
||||
|
||||
m_imageViewerTabWidget->addTab(tabTmp, QString::fromLocal8Bit("调焦"));
|
||||
m_imageViewerTabWidget->addTab(m_focusTab, QString::fromLocal8Bit("调焦"));
|
||||
|
||||
//m_imageViewerTabWidget->setCurrentIndex(trackNumber);
|
||||
m_imageViewerTabWidget->setCurrentWidget(tabTmp);
|
||||
m_imageViewerTabWidget->setCurrentWidget(m_focusTab);
|
||||
|
||||
|
||||
//开始调焦
|
||||
@ -1917,6 +1923,19 @@ void HPPA::onFocus2(int command)
|
||||
}
|
||||
}
|
||||
|
||||
void HPPA::onFocusWindowClosed()
|
||||
{
|
||||
//关闭调焦窗口时,停止调焦功能
|
||||
m_Imager->setFocusControlState(false);
|
||||
//关闭调焦窗口tab
|
||||
int index = m_imageViewerTabWidget->indexOf(m_focusTab);
|
||||
if (index != -1)
|
||||
{
|
||||
m_imageViewerTabWidget->removeTab(index);
|
||||
}
|
||||
m_focusTab = nullptr;
|
||||
}
|
||||
|
||||
void HPPA::onAbout()
|
||||
{
|
||||
aboutWindow about;
|
||||
@ -2062,13 +2081,16 @@ void HPPA::PlotSpectral(int state)
|
||||
series->append(i, m_Imager->buffer[1368 * 150 + i]);
|
||||
}
|
||||
|
||||
QChart* chart = new QChart();
|
||||
chart->legend()->hide();
|
||||
chart->addSeries(series);
|
||||
chart->createDefaultAxes();
|
||||
//chart->setTitle("Simple line chart example");
|
||||
series->setPen(QPen(QColor("#FF928A"), 2));
|
||||
|
||||
m_chartView->setChart(chart);
|
||||
m_chart->removeAllSeries();
|
||||
m_chart->addSeries(series);
|
||||
m_chart->createDefaultAxes();
|
||||
|
||||
QValueAxis* axisX = qobject_cast<QValueAxis*>(m_chart->axisX());
|
||||
QValueAxis* axisY = qobject_cast<QValueAxis*>(m_chart->axisY());
|
||||
|
||||
setAxis(axisX, axisY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -285,6 +285,8 @@ private:
|
||||
void initMapTools();
|
||||
void setMapTool();
|
||||
|
||||
QWidget* m_focusTab=nullptr;
|
||||
|
||||
public Q_SLOTS:
|
||||
void onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QString filePath);
|
||||
void PlotSpectral(int state);
|
||||
@ -300,6 +302,7 @@ public Q_SLOTS:
|
||||
void onAutoExposure();
|
||||
void onFocus1();
|
||||
void onFocus2(int command);
|
||||
void onFocusWindowClosed();
|
||||
void onAbout();
|
||||
void onDark();
|
||||
void recordDarkFinish();
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.13.2_msvc2017_64</QtInstall>
|
||||
<QtModules>core;network;gui;widgets;serialport;websockets;3dcore;3danimation;3dextras;3dinput;3dlogic;3drender;3dquick;charts</QtModules>
|
||||
<QtModules>core;network;gui;svg;widgets;serialport;websockets;3dcore;3danimation;3dextras;3dinput;3dlogic;3drender;3dquick;charts</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
|
||||
@ -1,10 +1,22 @@
|
||||
#include "stdafx.h"
|
||||
#include "focusWindow.h"
|
||||
#include <QSvgRenderer>
|
||||
#include <QMouseEvent>
|
||||
|
||||
focusWindow::focusWindow(QWidget *parent, ImagerOperationBase* imager)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
||||
setWindowFlags(Qt::FramelessWindowHint);
|
||||
ui.titlebarWidget->installEventFilter(this);
|
||||
|
||||
QSvgRenderer svgRenderer(QString(".//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";
|
||||
Configfile configfile;
|
||||
@ -39,6 +51,7 @@ focusWindow::focusWindow(QWidget *parent, ImagerOperationBase* imager)
|
||||
connect(this->ui.moveto_btn, SIGNAL(clicked()), this, SLOT(onMoveto()));
|
||||
|
||||
connect(this->ui.rangeMeasurement_btn, SIGNAL(pressed()), this, SLOT(onx_rangeMeasurement()));
|
||||
connect(this->ui.closeBtn, SIGNAL(released()), this, SLOT(onExit()));
|
||||
|
||||
//查找可用串口,并显示
|
||||
foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts())
|
||||
@ -67,6 +80,7 @@ focusWindow::~focusWindow()
|
||||
printf("destroy focusWindow-------------------------\n");
|
||||
|
||||
emit StartManualFocusSignal(0);//当用户没有点击停止调焦就关闭窗口
|
||||
emit closeSignal();
|
||||
|
||||
delete m_ctrlFocusMotor;
|
||||
//delete thread1, progressThread;
|
||||
@ -78,9 +92,50 @@ focusWindow::~focusWindow()
|
||||
m_MotionCaptureCoordinatorThread.wait();
|
||||
}
|
||||
|
||||
void focusWindow::onExit()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
bool focusWindow::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (obj == ui.titlebarWidget)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonPress)
|
||||
{
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton)
|
||||
{
|
||||
m_bDrag = true;
|
||||
m_dragPosition = mouseEvent->globalPos() - frameGeometry().topLeft();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::MouseMove)
|
||||
{
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (m_bDrag && (mouseEvent->buttons() & Qt::LeftButton))
|
||||
{
|
||||
move(mouseEvent->globalPos() - m_dragPosition);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::MouseButtonRelease)
|
||||
{
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
if (mouseEvent->button() == Qt::LeftButton)
|
||||
{
|
||||
m_bDrag = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
void focusWindow::disableBeforeConnect(bool disable)
|
||||
{
|
||||
ui.controlMotor_groupBox->setDisabled(disable);
|
||||
ui.controlMotor_widget->setDisabled(disable);
|
||||
ui.autoFocus_btn->setDisabled(disable);
|
||||
}
|
||||
|
||||
|
||||
@ -105,8 +105,13 @@ public:
|
||||
|
||||
ImagerOperationBase* m_Imager;
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private:
|
||||
QPoint m_dragPosition;
|
||||
bool m_bDrag = false;
|
||||
|
||||
Ui::focusDialog ui;
|
||||
QThread *m_AutoFocusThread;
|
||||
int m_FocusState;
|
||||
@ -151,6 +156,8 @@ public Q_SLOTS:
|
||||
|
||||
void moveAfterAutoFocus(int motorID, double location);
|
||||
|
||||
void onExit();
|
||||
|
||||
signals:
|
||||
void StartManualFocusSignal(int);//1<><31><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30>ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
@ -161,6 +168,7 @@ signals:
|
||||
void zeroStartSignal(int);
|
||||
|
||||
void startStepMotion(double speed, int stepInterval = 100, double startPos = 0, double endPos = -1);
|
||||
void closeSignal();
|
||||
};
|
||||
|
||||
class WorkerThread2 : public QThread
|
||||
|
||||
Reference in New Issue
Block a user