#!/usr/bin/env python
# -*- encoding: utf-8 -*-

from ui.own.frame_theme import MyFrame
from utils.qt import QtWidgets, QtCore, Qt, QtGui
from utils.globalvar import SD


class Protect(MyFrame):

    def setupUi(self, Protect):

        self.reg = QtCore.QRegExp('^[\-\+]?\d+(\.\d)?$')
        self.validator = QtGui.QRegExpValidator(self)
        self.validator.setRegExp(self.reg)

        self.protect = MyFrame(Protect)
        self.protect_layout = QtWidgets.QHBoxLayout(self.protect)
        self.protect_layout.setContentsMargins(5, 5, 5, 5)
        self.protect_layout.setSpacing(0)

        self.protect_left_groupbox = QtWidgets.QGroupBox(self.protect)
        self.protect_left_groupbox.setTitle("保护参数"  if SD.SYSTEM_LANGUAGE == 0 else "Protect Param.")
        self.protect_left_groupbox_layout = QtWidgets.QVBoxLayout(self.protect_left_groupbox)

        self.protect_table = QtWidgets.QTableWidget(self.protect_left_groupbox)
        self.protect_table.setColumnCount(11)

        self.protect_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        # 设置只能选择行
        self.protect_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)

        self.protect_table.setHorizontalHeaderLabels(["参数名称", "物理值", "单位", "地址", "数据类型", "长度（字节）", "分辨率", "偏移量", "原始值", "最小值", "最大值"])

        # self.protect_table.verticalHeader().setVisible(False)
        self.protect_table.verticalHeader().setHighlightSections(True)
        self.protect_table.verticalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
        self.protect_table.horizontalHeader().setSectionResizeMode(QtWidgets.QHeaderView.Stretch)
        self.protect_table.horizontalHeader().setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents)
        self.protect_table.setRowCount(76)

        for i in range(76):
            item = QtWidgets.QTableWidgetItem("N/A")
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 1, item)
            item = QtWidgets.QTableWidgetItem(str.upper('{:0>4x}'.format(0xA000 + i)))
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 3, item)
            item = QtWidgets.QTableWidgetItem("uint16")
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 4, item)
            item = QtWidgets.QTableWidgetItem("2")
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 5, item)
            # item = QtWidgets.QTableWidgetItem("1")
            # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            # self.protect_table.setItem(i, 6, item)
            item = QtWidgets.QTableWidgetItem("0")
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 7, item)
            item = QtWidgets.QTableWidgetItem("")
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 8, item)
            item = QtWidgets.QTableWidgetItem("")
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 9, item)
            item = QtWidgets.QTableWidgetItem("")
            item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
            self.protect_table.setItem(i, 10, item)

        item = QtWidgets.QTableWidgetItem("单体过压三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(0, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(0, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(0, 6, item)

        item = QtWidgets.QTableWidgetItem("单体过压二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(1, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(1, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(1, 6, item)

        item = QtWidgets.QTableWidgetItem("单体过压一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(2, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(2, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(2, 6, item)

        item = QtWidgets.QTableWidgetItem("单体过压恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(3, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(3, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(3, 6, item)

        item = QtWidgets.QTableWidgetItem("单体欠压三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(4, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(4, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(4, 6, item)

        item = QtWidgets.QTableWidgetItem("单体欠压二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(5, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(5, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(5, 6, item)

        item = QtWidgets.QTableWidgetItem("单体欠压一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(6, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(6, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(6, 6, item)

        item = QtWidgets.QTableWidgetItem("单体欠压恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(7, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(7, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(7, 6, item)

        item = QtWidgets.QTableWidgetItem("单体压差三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(8, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(8, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(8, 6, item)

        item = QtWidgets.QTableWidgetItem("单体压差二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(9, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(9, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(9, 6, item)

        item = QtWidgets.QTableWidgetItem("单体压差一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(10, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(10, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(10, 6, item)

        item = QtWidgets.QTableWidgetItem("单体压差恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(11, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(11, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(11, 6, item)

        item = QtWidgets.QTableWidgetItem("总压过压三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(12, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(12, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(12, 6, item)

        item = QtWidgets.QTableWidgetItem("总压过压二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(13, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(13, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(13, 6, item)

        item = QtWidgets.QTableWidgetItem("总压过压一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(14, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(14, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(14, 6, item)

        item = QtWidgets.QTableWidgetItem("总压过压恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(15, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(15, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(15, 6, item)

        item = QtWidgets.QTableWidgetItem("总压欠压三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(16, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(16, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(16, 6, item)

        item = QtWidgets.QTableWidgetItem("总压欠压二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(17, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(17, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(17, 6, item)

        item = QtWidgets.QTableWidgetItem("总压欠压一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(18, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(18, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(18, 6, item)

        item = QtWidgets.QTableWidgetItem("总压欠压恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(19, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(19, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(19, 6, item)

        item = QtWidgets.QTableWidgetItem("充电高温三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(20, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(20, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(20, 6, item)

        item = QtWidgets.QTableWidgetItem("充电高温二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(21, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(21, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(21, 6, item)

        item = QtWidgets.QTableWidgetItem("充电高温一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(22, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(22, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(22, 6, item)

        item = QtWidgets.QTableWidgetItem("充电高温恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(23, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(23, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(23, 6, item)

        item = QtWidgets.QTableWidgetItem("充电低温三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(24, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(24, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(24, 6, item)

        item = QtWidgets.QTableWidgetItem("充电低温二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(25, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(25, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(25, 6, item)

        item = QtWidgets.QTableWidgetItem("充电低温一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(26, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(26, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(26, 6, item)

        item = QtWidgets.QTableWidgetItem("充电低温恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(27, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(27, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(27, 6, item)

        item = QtWidgets.QTableWidgetItem("放电高温三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(28, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(28, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(28, 6, item)

        item = QtWidgets.QTableWidgetItem("放电高温二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(29, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(29, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(29, 6, item)

        item = QtWidgets.QTableWidgetItem("放电高温一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(30, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(30, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(30, 6, item)

        item = QtWidgets.QTableWidgetItem("放电高温恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(31, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(31, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(31, 6, item)

        item = QtWidgets.QTableWidgetItem("放电低温三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(32, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(32, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(32, 6, item)

        item = QtWidgets.QTableWidgetItem("放电低温二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(33, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(33, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(33, 6, item)

        item = QtWidgets.QTableWidgetItem("放电低温一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(34, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(34, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(34, 6, item)

        item = QtWidgets.QTableWidgetItem("放电低温恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(35, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(35, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(35, 6, item)

        item = QtWidgets.QTableWidgetItem("充电过流三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(36, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(36, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(36, 6, item)

        item = QtWidgets.QTableWidgetItem("充电过流二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(37, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(37, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(37, 6, item)

        item = QtWidgets.QTableWidgetItem("充电过流一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(38, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(38, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(38, 6, item)

        item = QtWidgets.QTableWidgetItem("充电过流恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(39, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(39, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(39, 6, item)

        item = QtWidgets.QTableWidgetItem("放电过流三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(40, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(40, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(40, 6, item)

        item = QtWidgets.QTableWidgetItem("放电过流二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(41, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(41, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(41, 6, item)

        item = QtWidgets.QTableWidgetItem("放电过流一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(42, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(42, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(42, 6, item)

        item = QtWidgets.QTableWidgetItem("放电过流恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(43, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(43, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(43, 6, item)

        item = QtWidgets.QTableWidgetItem("电芯温差三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(44, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(44, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(44, 6, item)

        item = QtWidgets.QTableWidgetItem("电芯温差二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(45, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(45, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(45, 6, item)

        item = QtWidgets.QTableWidgetItem("电芯温差一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(46, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(46, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(46, 6, item)

        item = QtWidgets.QTableWidgetItem("电芯温差恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(47, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(47, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(47, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(48, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(48, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(48, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(49, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(49, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(49, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(50, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(50, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(50, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(51, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(51, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(51, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(52, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(52, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(52, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(53, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(53, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(53, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(54, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(54, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(54, 6, item)

        item = QtWidgets.QTableWidgetItem("MOS高温恢复回差阈值")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(55, 0, item)
        item = QtWidgets.QTableWidgetItem("℃")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(55, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(55, 6, item)

        item = QtWidgets.QTableWidgetItem("绝缘过低三级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(56, 0, item)
        item = QtWidgets.QTableWidgetItem("KΩ")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(56, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(56, 6, item)

        item = QtWidgets.QTableWidgetItem("绝缘过低二级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(57, 0, item)
        item = QtWidgets.QTableWidgetItem("KΩ")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(57, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(57, 6, item)

        item = QtWidgets.QTableWidgetItem("绝缘过低一级告警")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(58, 0, item)
        item = QtWidgets.QTableWidgetItem("KΩ")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(58, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(58, 6, item)

        item = QtWidgets.QTableWidgetItem("均衡开启电压")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(59, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(59, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(59, 6, item)

        item = QtWidgets.QTableWidgetItem("均衡关闭电压")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(60, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(60, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(60, 6, item)

        item = QtWidgets.QTableWidgetItem("均衡开启压差")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(61, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(61, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(61, 6, item)

        item = QtWidgets.QTableWidgetItem("均衡关闭压差")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(62, 0, item)
        item = QtWidgets.QTableWidgetItem("mV")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(62, 2, item)
        item = QtWidgets.QTableWidgetItem("1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(62, 6, item)

        item = QtWidgets.QTableWidgetItem("单次均衡开启时长")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(63, 0, item)
        item = QtWidgets.QTableWidgetItem("s")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(63, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(63, 6, item)

        item = QtWidgets.QTableWidgetItem("告警判定延时")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(64, 0, item)
        item = QtWidgets.QTableWidgetItem("s")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(64, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(64, 6, item)

        item = QtWidgets.QTableWidgetItem("告警恢复延时")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(65, 0, item)
        item = QtWidgets.QTableWidgetItem("s")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(65, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(65, 6, item)

        item = QtWidgets.QTableWidgetItem("当前允许最大充电功率")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(66, 0, item)
        item = QtWidgets.QTableWidgetItem("kW")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(66, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(66, 6, item)

        item = QtWidgets.QTableWidgetItem("当前允许最大放电功率")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(67, 0, item)
        item = QtWidgets.QTableWidgetItem("kW")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(67, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(67, 6, item)

        item = QtWidgets.QTableWidgetItem("当前允许最大充电电压")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(68, 0, item)
        item = QtWidgets.QTableWidgetItem("V")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(68, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(68, 6, item)

        item = QtWidgets.QTableWidgetItem("当前允许最大充电电流")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(69, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(69, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(69, 6, item)

        item = QtWidgets.QTableWidgetItem("当前允许最大放电电流")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(70, 0, item)
        item = QtWidgets.QTableWidgetItem("A")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(70, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(70, 6, item)

        item = QtWidgets.QTableWidgetItem("标称容量配置")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(71, 0, item)
        item = QtWidgets.QTableWidgetItem("Ah")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(71, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(71, 6, item)

        item = QtWidgets.QTableWidgetItem("总容量配置")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(72, 0, item)
        item = QtWidgets.QTableWidgetItem("Ah")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(72, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(72, 6, item)

        item = QtWidgets.QTableWidgetItem("剩余容量配置")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(73, 0, item)
        item = QtWidgets.QTableWidgetItem("Ah")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(73, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(73, 6, item)

        item = QtWidgets.QTableWidgetItem("累计充电电量")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(74, 0, item)
        item = QtWidgets.QTableWidgetItem("kWh")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(74, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(74, 6, item)

        item = QtWidgets.QTableWidgetItem("累计放电电量")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(75, 0, item)
        item = QtWidgets.QTableWidgetItem("kWh")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(75, 2, item)
        item = QtWidgets.QTableWidgetItem("0.1")
        item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        self.protect_table.setItem(75, 6, item)

        # item = QtWidgets.QTableWidgetItem("单体过压三级告警")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 0, item)
        # item = QtWidgets.QTableWidgetItem("N/A")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 2, item)
        # item = QtWidgets.QTableWidgetItem("mV")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 2, item)
        # item = QtWidgets.QTableWidgetItem("A000")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 5, item)
        # item = QtWidgets.QTableWidgetItem("uint16")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 5, item)
        # item = QtWidgets.QTableWidgetItem("2")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 6, item)
        # item = QtWidgets.QTableWidgetItem("1")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 7, item)
        # item = QtWidgets.QTableWidgetItem("0")
        # item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
        # self.protect_table.setItem(0, 8, item)
        self.protect_table.resizeColumnsToContents()

        self.protect_left_groupbox_layout.addWidget(self.protect_table)

        self.btn_read_param = QtWidgets.QPushButton("读取参数")
        self.protect_left_groupbox_layout.addWidget(self.btn_read_param)

        self.protect_layout.addWidget(self.protect_left_groupbox, 8)

        self.protect_right_groupbox = QtWidgets.QGroupBox(self.protect)
        self.protect_right_groupbox.setTitle("修改参数")
        self.protect_right_groupbox_layout = QtWidgets.QGridLayout(self.protect_right_groupbox)

        self.lb_name = QtWidgets.QLabel("参数名称")
        self.protect_right_groupbox_layout.addWidget(self.lb_name, 1, 0, 1, 1)
        self.qline_name = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_name.setAlignment(Qt.AlignCenter)
        self.qline_name.setReadOnly(True)
        self.protect_right_groupbox_layout.addWidget(self.qline_name, 1, 1, 1, 1)

        self.lb_addr = QtWidgets.QLabel("参数地址")
        self.protect_right_groupbox_layout.addWidget(self.lb_addr, 2, 0, 1, 1)
        self.qline_addr = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_addr.setAlignment(Qt.AlignCenter)
        self.qline_addr.setReadOnly(True)
        self.protect_right_groupbox_layout.addWidget(self.qline_addr, 2, 1, 1, 1)

        self.lb_data_long = QtWidgets.QLabel("数据长度")
        self.protect_right_groupbox_layout.addWidget(self.lb_data_long, 3, 0, 1, 1)
        self.qline_data_long = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_data_long.setAlignment(Qt.AlignCenter)
        self.qline_data_long.setReadOnly(True)
        self.protect_right_groupbox_layout.addWidget(self.qline_data_long, 3, 1, 1, 1)

        self.lb_fbl = QtWidgets.QLabel("分辨率")
        self.protect_right_groupbox_layout.addWidget(self.lb_fbl, 4, 0, 1, 1)
        self.qline_fbl = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_fbl.setAlignment(Qt.AlignCenter)
        self.qline_fbl.setReadOnly(True)
        self.protect_right_groupbox_layout.addWidget(self.qline_fbl, 4, 1, 1, 1)

        self.lb_offset = QtWidgets.QLabel("偏移量")
        self.protect_right_groupbox_layout.addWidget(self.lb_offset, 5, 0, 1, 1)
        self.qline_offset = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_offset.setAlignment(Qt.AlignCenter)
        self.qline_offset.setReadOnly(True)
        self.protect_right_groupbox_layout.addWidget(self.qline_offset, 5, 1, 1, 1)

        self.lb_dw = QtWidgets.QLabel("数据单位")
        self.protect_right_groupbox_layout.addWidget(self.lb_dw, 6, 0, 1, 1)
        self.qline_dw = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_dw.setAlignment(Qt.AlignCenter)
        self.qline_dw.setReadOnly(True)
        self.protect_right_groupbox_layout.addWidget(self.qline_dw, 6, 1, 1, 1)

        self.lb_data = QtWidgets.QLabel("原始值")
        self.protect_right_groupbox_layout.addWidget(self.lb_data, 7, 0, 1, 1)
        self.qline_data = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_data.setAlignment(Qt.AlignCenter)
        self.qline_data.setReadOnly(True)
        self.protect_right_groupbox_layout.addWidget(self.qline_data, 7, 1, 1, 1)

        self.lb_data_set = QtWidgets.QLabel("物理值")
        self.protect_right_groupbox_layout.addWidget(self.lb_data_set, 8, 0, 1, 1)
        self.qline_data_set = QtWidgets.QLineEdit(self.protect_right_groupbox)
        self.qline_data_set.setAlignment(Qt.AlignCenter)
        self.qline_data_set.setValidator(self.validator)
        self.protect_right_groupbox_layout.addWidget(self.qline_data_set, 8, 1, 1, 1)

        self.btn_write_param = QtWidgets.QPushButton("写入参数")
        self.protect_right_groupbox_layout.addWidget(self.btn_write_param, 9, 0, 1, 2)

        self.btn_exit_param = QtWidgets.QPushButton("退出参数标定")
        self.protect_right_groupbox_layout.addWidget(self.btn_exit_param, 10, 0, 1, 2)

        self.protect_layout.addWidget(self.protect_right_groupbox, 2)

        QtCore.QMetaObject.connectSlotsByName(Protect)
