<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>PlcConnectionDialog</class> <widget class="QDialog" name="PlcConnectionDialog"> <property name="windowTitle"> <string>PLC 通信配置</string> </property> <property name="minimumSize"> <size><width>440</width><height>0</height></size> </property> <layout class="QVBoxLayout" name="dialogLayout"> <item> <widget class="QGroupBox" name="serialGroupBox"> <property name="title"><string>Modbus RTU 串口</string></property> <layout class="QVBoxLayout" name="serialGroupLayout"> <item> <layout class="QHBoxLayout" name="discoveryControlLayout"> <item> <widget class="QPushButton" name="autoSearchButton"> <property name="text"><string>自动搜索</string></property> </widget> </item> <item> <widget class="QProgressBar" name="discoveryProgressBar"> <property name="minimum"><number>0</number></property> <property name="maximum"><number>100</number></property> <property name="value"><number>0</number></property> <property name="textVisible"><bool>false</bool></property> </widget> </item> </layout> </item> <item> <widget class="QLabel" name="discoveryStatusLabel"> <property name="text"><string>自动搜索使用当前 PLC 站号</string></property> <property name="wordWrap"><bool>true</bool></property> </widget> </item> <item> <layout class="QFormLayout" name="serialFormLayout"> <property name="fieldGrowthPolicy"><enum>QFormLayout::AllNonFixedFieldsGrow</enum></property> <item row="0" column="0"><widget class="QLabel" name="serialPortLabel"><property name="text"><string>端口</string></property></widget></item> <item row="0" column="1"> <layout class="QHBoxLayout" name="serialPortEditorLayout"> <item> <widget class="QComboBox" name="serialPortComboBox"> <property name="editable"><bool>true</bool></property> <property name="placeholderText"><string>选择或输入 COM 端口</string></property> </widget> </item> <item> <widget class="QToolButton" name="refreshPortsButton"> <property name="minimumSize"><size><width>28</width><height>28</height></size></property> <property name="maximumSize"><size><width>28</width><height>28</height></size></property> <property name="toolTip"><string>刷新串口</string></property> <property name="accessibleName"><string>刷新串口</string></property> <property name="autoRaise"><bool>true</bool></property> </widget> </item> </layout> </item> <item row="1" column="0"><widget class="QLabel" name="serverAddressLabel"><property name="text"><string>PLC 站号</string></property></widget></item> <item row="1" column="1"><widget class="QSpinBox" name="serverAddressSpinBox"><property name="minimum"><number>1</number></property><property name="maximum"><number>247</number></property></widget></item> <item row="2" column="0"><widget class="QLabel" name="baudRateLabel"><property name="text"><string>波特率</string></property></widget></item> <item row="2" column="1"> <widget class="QComboBox" name="baudRateComboBox"> <item><property name="text"><string>9600</string></property><property name="userData"><string notr="true">9600</string></property></item> <item><property name="text"><string>19200</string></property><property name="userData"><string notr="true">19200</string></property></item> <item><property name="text"><string>38400</string></property><property name="userData"><string notr="true">38400</string></property></item> <item><property name="text"><string>57600</string></property><property name="userData"><string notr="true">57600</string></property></item> <item><property name="text"><string>115200</string></property><property name="userData"><string notr="true">115200</string></property></item> </widget> </item> <item row="3" column="0"><widget class="QLabel" name="dataBitsLabel"><property name="text"><string>数据位</string></property></widget></item> <item row="3" column="1"> <widget class="QComboBox" name="dataBitsComboBox"> <item><property name="text"><string>7</string></property><property name="userData"><string notr="true">7</string></property></item> <item><property name="text"><string>8</string></property><property name="userData"><string notr="true">8</string></property></item> </widget> </item> <item row="4" column="0"><widget class="QLabel" name="parityLabel"><property name="text"><string>校验方式</string></property></widget></item> <item row="4" column="1"> <widget class="QComboBox" name="parityComboBox"> <item><property name="text"><string>无校验</string></property><property name="userData"><string notr="true">0</string></property></item> <item><property name="text"><string>奇校验</string></property><property name="userData"><string notr="true">3</string></property></item> <item><property name="text"><string>偶校验</string></property><property name="userData"><string notr="true">2</string></property></item> </widget> </item> <item row="5" column="0"><widget class="QLabel" name="stopBitsLabel"><property name="text"><string>停止位</string></property></widget></item> <item row="5" column="1"> <widget class="QComboBox" name="stopBitsComboBox"> <item><property name="text"><string>1</string></property><property name="userData"><string notr="true">1</string></property></item> <item><property name="text"><string>2</string></property><property name="userData"><string notr="true">2</string></property></item> </widget> </item> </layout> </item> </layout> </widget> </item> <item> <widget class="QGroupBox" name="timingGroupBox"> <property name="title"><string>通信时序</string></property> <layout class="QFormLayout" name="timingFormLayout"> <item row="0" column="0"><widget class="QLabel" name="responseTimeoutLabel"><property name="text"><string>响应超时</string></property></widget></item> <item row="0" column="1"><widget class="QSpinBox" name="responseTimeoutSpinBox"><property name="suffix"><string> ms</string></property><property name="minimum"><number>100</number></property><property name="maximum"><number>30000</number></property><property name="singleStep"><number>100</number></property><property name="value"><number>1000</number></property></widget></item> <item row="1" column="0"><widget class="QLabel" name="retriesLabel"><property name="text"><string>失败重试</string></property></widget></item> <item row="1" column="1"><widget class="QSpinBox" name="retriesSpinBox"><property name="suffix"><string> 次</string></property><property name="maximum"><number>5</number></property><property name="value"><number>2</number></property></widget></item> <item row="2" column="0"><widget class="QLabel" name="pollIntervalLabel"><property name="text"><string>轮询周期</string></property></widget></item> <item row="2" column="1"><widget class="QSpinBox" name="pollIntervalSpinBox"><property name="suffix"><string> ms</string></property><property name="minimum"><number>50</number></property><property name="maximum"><number>10000</number></property><property name="singleStep"><number>50</number></property><property name="value"><number>200</number></property></widget></item> </layout> </widget> </item> <item> <widget class="QDialogButtonBox" name="buttonBox"> <property name="standardButtons"><set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set></property> </widget> </item> </layout> </widget> <connections> <connection><sender>buttonBox</sender><signal>accepted()</signal><receiver>PlcConnectionDialog</receiver><slot>accept()</slot><hints><hint type="sourcelabel"><x>320</x><y>360</y></hint><hint type="destinationlabel"><x>210</x><y>180</y></hint></hints></connection> <connection><sender>buttonBox</sender><signal>rejected()</signal><receiver>PlcConnectionDialog</receiver><slot>reject()</slot><hints><hint type="sourcelabel"><x>320</x><y>360</y></hint><hint type="destinationlabel"><x>210</x><y>180</y></hint></hints></connection> </connections> </ui>