# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'C:\Users\薛志远\eric6\main_window.ui'
#
# Created by: PyQt5 UI code generator 5.9.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets
import time
import os
from PyRadar import Radar
from PyRadar import ppi
from PIL import Image
import json

number_dic = {'Z9250': '南京', 'Z9592': '厦门', 'Z9571': '杭州'}
station_dic = {v: k for k, v in number_dic.items()}
with open('c:/data/gui/configure/configure.json', 'r') as f:
    configuration_dic = json.load(f)

class Ui_mainWindow(object):
    def setupUi(self, mainWindow):
        mainWindow.setObjectName("mainWindow")
        mainWindow.resize(1200, 810)
        mainWindow.setMinimumSize(QtCore.QSize(1200, 810))
        mainWindow.setMaximumSize(QtCore.QSize(1200, 810))
        mainWindow.setStatusTip("")
        self.centralWidget = QtWidgets.QWidget(mainWindow)
        self.centralWidget.setObjectName("centralWidget")
        self.tabWidget = QtWidgets.QTabWidget(self.centralWidget)
        self.tabWidget.setGeometry(QtCore.QRect(10, 10, 1191, 721))
        self.tabWidget.setObjectName("tabWidget")
        self.tab_4 = QtWidgets.QWidget()
        self.tab_4.setObjectName("tab_4")
        self.groupBox_9 = QtWidgets.QGroupBox(self.tab_4)
        self.groupBox_9.setGeometry(QtCore.QRect(0, 10, 191, 681))
        self.groupBox_9.setObjectName("groupBox_9")
        self.progressBar_1 = QtWidgets.QProgressBar(self.groupBox_9)
        self.progressBar_1.setGeometry(QtCore.QRect(10, 650, 181, 20))
        self.progressBar_1.setProperty("value", 0)
        self.progressBar_1.setObjectName("progressBar_1")
        self.start_process = QtWidgets.QPushButton(self.groupBox_9)
        self.start_process.setGeometry(QtCore.QRect(10, 520, 171, 41))
        self.start_process.setObjectName("start_process")
        self.formLayoutWidget_3 = QtWidgets.QWidget(self.groupBox_9)
        self.formLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 178, 471))
        self.formLayoutWidget_3.setObjectName("formLayoutWidget_3")
        self.formLayout_2 = QtWidgets.QFormLayout(self.formLayoutWidget_3)
        self.formLayout_2.setContentsMargins(0, 0, 0, 0)
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_8 = QtWidgets.QLabel(self.formLayoutWidget_3)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.label_8.setFont(font)
        self.label_8.setObjectName("label_8")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_8)
        self.station_set_2 = QtWidgets.QComboBox(self.formLayoutWidget_3)
        self.station_set_2.setObjectName("station_set_2")
        self.station_set_2.addItem("")
        self.station_set_2.addItem("")
        self.station_set_2.addItem("")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.station_set_2)
        self.label_13 = QtWidgets.QLabel(self.formLayoutWidget_3)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.label_13.setFont(font)
        self.label_13.setObjectName("label_13")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_13)
        self.date_set = QtWidgets.QComboBox(self.formLayoutWidget_3)
        self.date_set.setObjectName("date_set")
        self.date_set.addItem("")
        self.date_set.addItem("")
        self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.date_set)
        self.label_14 = QtWidgets.QLabel(self.formLayoutWidget_3)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.label_14.setFont(font)
        self.label_14.setObjectName("label_14")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_14)
        self.time_set = QtWidgets.QComboBox(self.formLayoutWidget_3)
        self.time_set.setObjectName("time_set")
        self.time_set.addItem("")
        self.time_set.addItem("")
        self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.time_set)
        self.points = QtWidgets.QPushButton(self.groupBox_9)
        self.points.setGeometry(QtCore.QRect(10, 580, 171, 41))
        self.points.setObjectName("points")
        self.groupBox_10 = QtWidgets.QGroupBox(self.tab_4)
        self.groupBox_10.setGeometry(QtCore.QRect(200, 10, 721, 681))
        self.groupBox_10.setObjectName("groupBox_10")
        self.gridLayoutWidget_3 = QtWidgets.QWidget(self.groupBox_10)
        self.gridLayoutWidget_3.setGeometry(QtCore.QRect(10, 540, 701, 141))
        self.gridLayoutWidget_3.setObjectName("gridLayoutWidget_3")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.gridLayoutWidget_3)
        self.gridLayout_3.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.display_iteam = QtWidgets.QComboBox(self.gridLayoutWidget_3)
        self.display_iteam.setObjectName("display_iteam")
        self.display_iteam.addItem("")
        self.display_iteam.addItem("")
        self.display_iteam.addItem("")
        self.gridLayout_3.addWidget(self.display_iteam, 0, 1, 1, 1)
        self.azi_set = QtWidgets.QSlider(self.gridLayoutWidget_3)
        self.azi_set.setOrientation(QtCore.Qt.Horizontal)
        self.azi_set.setObjectName("azi_set")
        self.gridLayout_3.addWidget(self.azi_set, 3, 1, 1, 1)
        self.display_mode = QtWidgets.QComboBox(self.gridLayoutWidget_3)
        self.display_mode.setObjectName("display_mode")
        self.display_mode.addItem("")
        self.display_mode.addItem("")
        self.gridLayout_3.addWidget(self.display_mode, 1, 1, 1, 1)
        self.label_42 = QtWidgets.QLabel(self.gridLayoutWidget_3)
        self.label_42.setObjectName("label_42")
        self.gridLayout_3.addWidget(self.label_42, 2, 0, 1, 1)
        self.label_44 = QtWidgets.QLabel(self.gridLayoutWidget_3)
        self.label_44.setObjectName("label_44")
        self.gridLayout_3.addWidget(self.label_44, 0, 0, 1, 1)
        self.label_41 = QtWidgets.QLabel(self.gridLayoutWidget_3)
        self.label_41.setObjectName("label_41")
        self.gridLayout_3.addWidget(self.label_41, 1, 0, 1, 1)
        self.ele_set = QtWidgets.QSlider(self.gridLayoutWidget_3)
        self.ele_set.setOrientation(QtCore.Qt.Horizontal)
        self.ele_set.setObjectName("ele_set")
        self.gridLayout_3.addWidget(self.ele_set, 2, 1, 1, 1)
        self.label_43 = QtWidgets.QLabel(self.gridLayoutWidget_3)
        self.label_43.setObjectName("label_43")
        self.gridLayout_3.addWidget(self.label_43, 3, 0, 1, 1)
        self.display_of_elev = QtWidgets.QLabel(self.gridLayoutWidget_3)
        self.display_of_elev.setObjectName("display_of_elev")
        self.gridLayout_3.addWidget(self.display_of_elev, 2, 2, 1, 1)
        self.display_of_azim = QtWidgets.QLabel(self.gridLayoutWidget_3)
        self.display_of_azim.setObjectName("display_of_azim")
        self.gridLayout_3.addWidget(self.display_of_azim, 3, 2, 1, 1)
        self.radarimage1 = QtWidgets.QLabel(self.groupBox_10)
        self.radarimage1.setGeometry(QtCore.QRect(10, 20, 701, 511))
        self.radarimage1.setObjectName("radarimage1")
        self.groupBox_11 = QtWidgets.QGroupBox(self.tab_4)
        self.groupBox_11.setGeometry(QtCore.QRect(930, 10, 251, 331))
        self.groupBox_11.setObjectName("groupBox_11")
        self.formLayoutWidget_5 = QtWidgets.QWidget(self.groupBox_11)
        self.formLayoutWidget_5.setGeometry(QtCore.QRect(10, 30, 231, 299))
        self.formLayoutWidget_5.setObjectName("formLayoutWidget_5")
        self.formLayout_5 = QtWidgets.QFormLayout(self.formLayoutWidget_5)
        self.formLayout_5.setContentsMargins(0, 0, 0, 0)
        self.formLayout_5.setObjectName("formLayout_5")
        self.label_31 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_31.setFont(font)
        self.label_31.setObjectName("label_31")
        self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_31)
        self.station_number_2 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.station_number_2.setFont(font)
        self.station_number_2.setObjectName("station_number_2")
        self.formLayout_5.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.station_number_2)
        self.label_32 = QtWidgets.QLabel(self.formLayoutWidget_5)
        self.label_32.setSizeIncrement(QtCore.QSize(0, 0))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_32.setFont(font)
        self.label_32.setObjectName("label_32")
        self.formLayout_5.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_32)
        self.time = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.time.setFont(font)
        self.time.setObjectName("time")
        self.formLayout_5.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.time)
        self.label_33 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_33.setFont(font)
        self.label_33.setObjectName("label_33")
        self.formLayout_5.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_33)
        self.scan_mode_2 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.scan_mode_2.setFont(font)
        self.scan_mode_2.setObjectName("scan_mode_2")
        self.formLayout_5.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.scan_mode_2)
        self.label_34 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_34.setFont(font)
        self.label_34.setObjectName("label_34")
        self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_34)
        self.date = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.date.setFont(font)
        self.date.setObjectName("date")
        self.formLayout_5.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.date)
        self.ele_number = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.ele_number.setFont(font)
        self.ele_number.setObjectName("ele_number")
        self.formLayout_5.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.ele_number)
        self.label_35 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_35.setFont(font)
        self.label_35.setObjectName("label_35")
        self.formLayout_5.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_35)
        self.label_36 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_36.setFont(font)
        self.label_36.setObjectName("label_36")
        self.formLayout_5.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_36)
        self.ref_number = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.ref_number.setFont(font)
        self.ref_number.setObjectName("ref_number")
        self.formLayout_5.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.ref_number)
        self.label_37 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_37.setFont(font)
        self.label_37.setObjectName("label_37")
        self.formLayout_5.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.label_37)
        self.ref_step = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.ref_step.setFont(font)
        self.ref_step.setObjectName("ref_step")
        self.formLayout_5.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.ref_step)
        self.label_38 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_38.setFont(font)
        self.label_38.setObjectName("label_38")
        self.formLayout_5.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.label_38)
        self.spe_number = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.spe_number.setFont(font)
        self.spe_number.setObjectName("spe_number")
        self.formLayout_5.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.spe_number)
        self.label_39 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_39.setFont(font)
        self.label_39.setObjectName("label_39")
        self.formLayout_5.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.label_39)
        self.spe_step = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.spe_step.setFont(font)
        self.spe_step.setObjectName("spe_step")
        self.formLayout_5.setWidget(8, QtWidgets.QFormLayout.FieldRole, self.spe_step)
        self.label_40 = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12) 
        self.label_40.setFont(font)
        self.label_40.setObjectName("label_40")
        self.formLayout_5.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.label_40)
        self.spe_resolution = QtWidgets.QLabel(self.formLayoutWidget_5)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.spe_resolution.setFont(font)
        self.spe_resolution.setObjectName("spe_resolution")
        self.formLayout_5.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.spe_resolution)
        self.groupBox_12 = QtWidgets.QGroupBox(self.tab_4)
        self.groupBox_12.setGeometry(QtCore.QRect(930, 350, 241, 341))
        self.groupBox_12.setObjectName("groupBox_12")
        self.textBrowser_1 = QtWidgets.QTextBrowser(self.groupBox_12)
        self.textBrowser_1.setGeometry(QtCore.QRect(10, 20, 231, 311))
        self.textBrowser_1.setObjectName("textBrowser_1")
        self.tabWidget.addTab(self.tab_4, "")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.groupBox_data_chose = QtWidgets.QGroupBox(self.tab)
        self.groupBox_data_chose.setGeometry(QtCore.QRect(0, 10, 191, 681))
        self.groupBox_data_chose.setObjectName("groupBox_data_chose")
        self.progressBar_3 = QtWidgets.QProgressBar(self.groupBox_data_chose)
        self.progressBar_3.setGeometry(QtCore.QRect(10, 650, 181, 20))
        self.progressBar_3.setProperty("value", 0)
        self.progressBar_3.setObjectName("progressBar_3")
        self.formLayoutWidget = QtWidgets.QWidget(self.groupBox_data_chose)
        self.formLayoutWidget.setGeometry(QtCore.QRect(10, 20, 183, 561))
        self.formLayoutWidget.setObjectName("formLayoutWidget")
        self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget)
        self.formLayout.setContentsMargins(0, 0, 0, 0)
        self.formLayout.setObjectName("formLayout")
        self.label_2 = QtWidgets.QLabel(self.formLayoutWidget)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.label_2.setFont(font)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_2)
        self.station_set = QtWidgets.QComboBox(self.formLayoutWidget)
        self.station_set.setObjectName("station_set")
        self.station_set.addItem("")
        self.station_set.addItem("")
        self.station_set.addItem("")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.station_set)
        self.label_3 = QtWidgets.QLabel(self.formLayoutWidget)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.label_3.setFont(font)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_3)
        self.label_4 = QtWidgets.QLabel(self.formLayoutWidget)
        font = QtGui.QFont()
        font.setPointSize(9)
        self.label_4.setFont(font)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_4)
        self.date_begin_set = QtWidgets.QComboBox(self.formLayoutWidget)
        self.date_begin_set.setObjectName("date_begin_set")
        self.date_begin_set.addItem("")
        self.date_begin_set.addItem("")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.date_begin_set)
        self.time_begin_set = QtWidgets.QComboBox(self.formLayoutWidget)
        self.time_begin_set.setObjectName("time_begin_set")
        self.time_begin_set.addItem("")
        self.time_begin_set.addItem("")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.time_begin_set)
        self.elevation_set = QtWidgets.QComboBox(self.formLayoutWidget)
        self.elevation_set.setObjectName("elevation_set")
        self.elevation_set.addItem("")
        self.elevation_set.addItem("")
        self.elevation_set.addItem("")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.elevation_set)
        self.label_6 = QtWidgets.QLabel(self.formLayoutWidget)
        self.label_6.setObjectName("label_6")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_6)
        self.label_29 = QtWidgets.QLabel(self.formLayoutWidget)
        self.label_29.setObjectName("label_29")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_29)
        self.date_end_set = QtWidgets.QComboBox(self.formLayoutWidget)
        self.date_end_set.setObjectName("date_end_set")
        self.date_end_set.addItem("")
        self.date_end_set.addItem("")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.date_end_set)
        self.label_30 = QtWidgets.QLabel(self.formLayoutWidget)
        self.label_30.setObjectName("label_30")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_30)
        self.time_end_set = QtWidgets.QComboBox(self.formLayoutWidget)
        self.time_end_set.setObjectName("time_end_set")
        self.time_end_set.addItem("")
        self.time_end_set.addItem("")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.time_end_set)
        self.set_done = QtWidgets.QPushButton(self.groupBox_data_chose)
        self.set_done.setGeometry(QtCore.QRect(10, 590, 171, 41))
        self.set_done.setObjectName("set_done")
        self.groupBox_2 = QtWidgets.QGroupBox(self.tab)
        self.groupBox_2.setGeometry(QtCore.QRect(200, 10, 721, 681))
        self.groupBox_2.setObjectName("groupBox_2")
        self.gridLayoutWidget = QtWidgets.QWidget(self.groupBox_2)
        self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 540, 701, 141))
        self.gridLayoutWidget.setObjectName("gridLayoutWidget")
        self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.first_img = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.first_img.setObjectName("first_img")
        self.gridLayout.addWidget(self.first_img, 1, 0, 1, 1)
        self.after_slide = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.after_slide.setObjectName("after_slide")
        self.gridLayout.addWidget(self.after_slide, 3, 2, 1, 1)
        self.before_slide = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.before_slide.setObjectName("before_slide")
        self.gridLayout.addWidget(self.before_slide, 3, 0, 1, 1)
        self.auto_play = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.auto_play.setObjectName("auto_play")
        self.gridLayout.addWidget(self.auto_play, 1, 1, 1, 1)
        self.stop_play = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.stop_play.setObjectName("stop_play")
        self.gridLayout.addWidget(self.stop_play, 3, 1, 1, 1)
        self.last_img = QtWidgets.QPushButton(self.gridLayoutWidget)
        self.last_img.setObjectName("last_img")
        self.gridLayout.addWidget(self.last_img, 1, 2, 1, 1)
        self.radarimage = QtWidgets.QLabel(self.groupBox_2)
        self.radarimage.setGeometry(QtCore.QRect(10, 20, 701, 511))
        self.radarimage.setObjectName("radarimage")
        self.groupBox = QtWidgets.QGroupBox(self.tab)
        self.groupBox.setGeometry(QtCore.QRect(930, 10, 251, 331))
        self.groupBox.setObjectName("groupBox")
        self.formLayoutWidget_2 = QtWidgets.QWidget(self.groupBox)
        self.formLayoutWidget_2.setGeometry(QtCore.QRect(20, 30, 221, 281))
        self.formLayoutWidget_2.setObjectName("formLayoutWidget_2")
        self.formLayout_3 = QtWidgets.QFormLayout(self.formLayoutWidget_2)
        self.formLayout_3.setContentsMargins(0, 0, 0, 0)
        self.formLayout_3.setObjectName("formLayout_3")
        self.label_5 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_5.setFont(font)
        self.label_5.setObjectName("label_5")
        self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_5)
        self.station_number = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.station_number.setFont(font)
        self.station_number.setObjectName("station_number")
        self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.station_number)
        self.label_7 = QtWidgets.QLabel(self.formLayoutWidget_2)
        self.label_7.setSizeIncrement(QtCore.QSize(0, 0))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_7.setFont(font)
        self.label_7.setObjectName("label_7")
        self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_7)
        self.date_time = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.date_time.setFont(font)
        self.date_time.setObjectName("date_time")
        self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.date_time)
        self.label = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label)
        self.scan_mode = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.scan_mode.setFont(font)
        self.scan_mode.setObjectName("scan_mode")
        self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.scan_mode)
        self.label_16 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_16.setFont(font)
        self.label_16.setObjectName("label_16")
        self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_16)
        self.elevation = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.elevation.setFont(font)
        self.elevation.setObjectName("elevation")
        self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.elevation)
        self.label_19 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_19.setFont(font)
        self.label_19.setObjectName("label_19")
        self.formLayout_3.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_19)
        self.number_of_elevation = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.number_of_elevation.setFont(font)
        self.number_of_elevation.setObjectName("number_of_elevation")
        self.formLayout_3.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.number_of_elevation)
        self.label_11 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_11.setFont(font)
        self.label_11.setObjectName("label_11")
        self.formLayout_3.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_11)
        self.number_reflectivity = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.number_reflectivity.setFont(font)
        self.number_reflectivity.setObjectName("number_reflectivity")
        self.formLayout_3.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.number_reflectivity)
        self.label_12 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_12.setFont(font)
        self.label_12.setObjectName("label_12")
        self.formLayout_3.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.label_12)
        self.step_reflectivity = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.step_reflectivity.setFont(font)
        self.step_reflectivity.setObjectName("step_reflectivity")
        self.formLayout_3.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.step_reflectivity)
        self.label_24 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_24.setFont(font)
        self.label_24.setObjectName("label_24")
        self.formLayout_3.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.label_24)
        self.sudukushu = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.sudukushu.setFont(font)
        self.sudukushu.setObjectName("sudukushu")
        self.formLayout_3.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.sudukushu)
        self.label_10 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_10.setFont(font)
        self.label_10.setObjectName("label_10")
        self.formLayout_3.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.label_10)
        self.sudukuchang = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.sudukuchang.setFont(font)
        self.sudukuchang.setObjectName("sudukuchang")
        self.formLayout_3.setWidget(8, QtWidgets.QFormLayout.FieldRole, self.sudukuchang)
        self.label_9 = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_9.setFont(font)
        self.label_9.setObjectName("label_9")
        self.formLayout_3.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.label_9)
        self.sudufenbianlv = QtWidgets.QLabel(self.formLayoutWidget_2)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.sudufenbianlv.setFont(font)
        self.sudufenbianlv.setObjectName("sudufenbianlv")
        self.formLayout_3.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.sudufenbianlv)
        self.groupBox_4 = QtWidgets.QGroupBox(self.tab)
        self.groupBox_4.setGeometry(QtCore.QRect(930, 350, 241, 341))
        self.groupBox_4.setObjectName("groupBox_4")
        self.textBrowser_2 = QtWidgets.QTextBrowser(self.groupBox_4)
        self.textBrowser_2.setGeometry(QtCore.QRect(10, 20, 231, 311))
        self.textBrowser_2.setObjectName("textBrowser_2")
        self.tabWidget.addTab(self.tab, "")
        self.tab_3 = QtWidgets.QWidget()
        self.tab_3.setObjectName("tab_3")
        self.gridLayoutWidget_4 = QtWidgets.QWidget(self.tab_3)
        self.gridLayoutWidget_4.setGeometry(QtCore.QRect(10, 10, 1171, 671))
        self.gridLayoutWidget_4.setObjectName("gridLayoutWidget_4")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.gridLayoutWidget_4)
        self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.label_49 = QtWidgets.QLabel(self.gridLayoutWidget_4)
        self.label_49.setObjectName("label_49")
        self.gridLayout_4.addWidget(self.label_49, 1, 0, 1, 1)
        self.label_48 = QtWidgets.QLabel(self.gridLayoutWidget_4)
        self.label_48.setObjectName("label_48")
        self.gridLayout_4.addWidget(self.label_48, 0, 0, 1, 1)
        self.label_50 = QtWidgets.QLabel(self.gridLayoutWidget_4)
        self.label_50.setObjectName("label_50")
        self.gridLayout_4.addWidget(self.label_50, 1, 1, 1, 1)
        self.label_47 = QtWidgets.QLabel(self.gridLayoutWidget_4)
        self.label_47.setObjectName("label_47")
        self.gridLayout_4.addWidget(self.label_47, 0, 1, 1, 1)
        self.label_51 = QtWidgets.QLabel(self.gridLayoutWidget_4)
        self.label_51.setObjectName("label_51")
        self.gridLayout_4.addWidget(self.label_51, 0, 2, 1, 1)
        self.label_52 = QtWidgets.QLabel(self.gridLayoutWidget_4)
        self.label_52.setObjectName("label_52")
        self.gridLayout_4.addWidget(self.label_52, 1, 2, 1, 1)
        self.tabWidget.addTab(self.tab_3, "")
        self.tab_5 = QtWidgets.QWidget()
        self.tab_5.setObjectName("tab_5")
        self.tabWidget.addTab(self.tab_5, "")
        mainWindow.setCentralWidget(self.centralWidget)
        self.menuBar = QtWidgets.QMenuBar(mainWindow)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 1200, 26))
        self.menuBar.setObjectName("menuBar")
        self.menu = QtWidgets.QMenu(self.menuBar)
        self.menu.setObjectName("menu")
        self.menu_2 = QtWidgets.QMenu(self.menuBar)
        self.menu_2.setObjectName("menu_2")
        self.menu_3 = QtWidgets.QMenu(self.menuBar)
        self.menu_3.setObjectName("menu_3")
        self.menu_4 = QtWidgets.QMenu(self.menuBar)
        self.menu_4.setObjectName("menu_4")
        mainWindow.setMenuBar(self.menuBar)
        self.statusBar = QtWidgets.QStatusBar(mainWindow)
        self.statusBar.setObjectName("statusBar")
        mainWindow.setStatusBar(self.statusBar)
        self.toolBar = QtWidgets.QToolBar(mainWindow)
        self.toolBar.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
        self.toolBar.setMovable(False)
        self.toolBar.setIconSize(QtCore.QSize(30, 30))
        self.toolBar.setObjectName("toolBar")
        mainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
        self.actionopen = QtWidgets.QAction(mainWindow)
        self.actionopen.setObjectName("actionopen")
        self.actionOpen_folder = QtWidgets.QAction(mainWindow)
        self.actionOpen_folder.setObjectName("actionOpen_folder")
        self.action = QtWidgets.QAction(mainWindow)
        self.action.setObjectName("action")
        self.action_2 = QtWidgets.QAction(mainWindow)
        self.action_2.setObjectName("action_2")
        self.menu.addAction(self.actionopen)
        self.menu.addAction(self.actionOpen_folder)
        self.menu.addAction(self.action_2)
        self.menu_4.addAction(self.action)
        self.menuBar.addAction(self.menu.menuAction())
        self.menuBar.addAction(self.menu_2.menuAction())
        self.menuBar.addAction(self.menu_4.menuAction())
        self.menuBar.addAction(self.menu_3.menuAction())
        self.toolBar.addAction(self.actionopen)
        self.toolBar.addAction(self.actionOpen_folder)

        self.retranslateUi(mainWindow)
        self.tabWidget.setCurrentIndex(0)
        self.actionopen.triggered.connect(self.statusBar.update)
        QtCore.QMetaObject.connectSlotsByName(mainWindow)
        self.data_absolute_path = ''
        self.work_path = configuration_dic['data_path']
        self.ppi_ref_path = configuration_dic['ppi_ref_path']
        self.rhi_ref_path = configuration_dic['rhi_ref_path']
        self.station_set.clear()
        self.station_set_2.clear()
        for i in os.listdir(self.work_path):
            self.station_set.addItem(number_dic[i])
        for i in os.listdir(self.work_path):
            self.station_set_2.addItem(number_dic[i])
        self.refresh_date_begin()
        self.refresh_time_begin()
        self.refresh_date_end()
        self.refresh_time_end()
        self.set_file()
        self.animation_path = configuration_dic['animation_path']
        self.play_list = []
        self.ppi_play_list = []
        self.rhi_play_list = []
        self.counter = 0
        self.actionOpen_folder.triggered.connect(self.set_path)
        self.station_set.currentIndexChanged.connect(self.refresh_date_begin)
        self.station_set_2.currentIndexChanged.connect(self.refresh_date_begin)
        self.date_begin_set.currentIndexChanged.connect(self.refresh_time_begin)
        self.time_begin_set.currentIndexChanged.connect(self.refresh_date_end)
        self.date_set.currentIndexChanged.connect(self.refresh_time_begin)
        self.time_set.currentIndexChanged.connect(self.set_file)
        self.date_end_set.currentIndexChanged.connect(self.refresh_time_end)
        self.actionopen.triggered.connect(lambda: self.display_1(0))
        self.actionopen.triggered.connect(self.open_file)
        self.set_done.clicked.connect(lambda: self.counter_zero)
        self.set_done.clicked.connect(self.play_list_reset)
        self.set_done.clicked.connect(self.generate_animation)
        self.first_img.clicked.connect(self.counter_zero)
        self.first_img.clicked.connect(lambda: self.show_radarimage1(self.counter))
        self.last_img.clicked.connect(self.counter_end)
        self.last_img.clicked.connect(lambda: self.show_radarimage1(-1))
        self.before_slide.clicked.connect(self.counter_reduce)
        self.before_slide.clicked.connect(lambda: self.show_radarimage1(self.counter))
        self.after_slide.clicked.connect(self.counter_add)
        self.after_slide.clicked.connect(lambda: self.show_radarimage1(self.counter))
        self.auto_play.clicked.connect(self.play_all)
        self.start_process.clicked.connect(self.ppi_play_list_reset)
        self.start_process.clicked.connect(self.rhi_play_list_reset)
        self.start_process.clicked.connect(self.process_data)
        self.points.clicked.connect(self.plot_points)
        self.ele_set.valueChanged.connect(lambda: self.show_ppi_img(int(len(self.ppi_play_list) * self.ele_set.value()/100)))
        self.azi_set.valueChanged.connect(lambda: self.show_rhi_img(int(len(self.rhi_play_list) * self.azi_set.value()/100)))

    def open_file(self):
        try:
            SAfile = QtWidgets.QFileDialog.getOpenFileName(mainWindow, "选取基数据文件",
                                                           "c:/data/gui/data")  # time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
            self.data_absolute_path = SAfile[0]
            self.textBrowser_1.append(self.data_absolute_path)
            self.display_1(1)
        except:
            pass

    def display_1(self, order):
        info = ['正在读取数据...', '数据已选择', '数据处理中...', '处理完成', '正在绘制图像...', '绘制完成',
                '正在初始化数据...', '工作路径已选择', '', '', '', '', '', '', '', '', '', '', '', '', ]
        self.textBrowser_1.append(time.strftime("%H:%M:%S", time.localtime()))
        self.textBrowser_1.append(info[order])

    def display_2(self, order):
        info = ['正在读取数据...', '数据已选择', '数据处理中...', '处理完成', '正在绘制图像...', '绘制完成',
                '正在初始化数据...', '数据路径已选择', '', '', '', '', '', '', '', '', '', '', '', '', ]
        self.textBrowser_2.append(time.strftime("%H:%M:%S", time.localtime()))
        self.textBrowser_2.append(info[order])

    def set_path(self):
        try:
            file_path = QtWidgets.QFileDialog.getExistingDirectory(mainWindow, "设定基数据目录", "C:/data/gui/")
            self.work_path = file_path
            self.display_1(7)
            self.display_2(7)
            self.station_set.clear()
            for i in os.listdir(self.work_path):
                self.station_set.addItem(number_dic[i])
            for i in os.listdir(self.work_path):
                self.station_set.addItem(number_dic[i])
            self.textBrowser_2.append(self.work_path)
            self.textBrowser_1.append(self.work_path)
        except:
            pass

    def set_file(self):
        for i in os.listdir(self.work_path + '/' + station_dic[self.station_set_2.currentText()]):
            if i.find(self.date_set.currentText() + self.time_set.currentText()) > 0:
                self.data_absolute_path = self.work_path  + station_dic[self.station_set_2.currentText()] + '/' + i
                self.textBrowser_1.append(self.data_absolute_path)

    def refresh_date_begin(self):
        try:
            self.textBrowser_2.append(time.strftime("%H:%M:%S", time.localtime()))
            self.textBrowser_2.append('已选择站号：' + station_dic[self.station_set.currentText()])
            self.textBrowser_1.append(time.strftime("%H:%M:%S", time.localtime()))
            self.textBrowser_1.append('已选择站号：' + station_dic[self.station_set.currentText()])
            self.date_begin_set.clear()
            self.date_set.clear()
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()]):
                self.date_begin_set.addItem(i[15:23])
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set_2.currentText()]):
                self.date_set.addItem(i[15:23])
        except:
            pass

    def refresh_time_begin(self):
        try:
            self.time_begin_set.clear()
            self.time_set.clear()
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()]):
                if i.find(self.date_begin_set.currentText()) >= 0:
                    self.time_begin_set.addItem(i[23:29])
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set_2.currentText()]):
                if i.find(self.date_set.currentText()) >= 0:
                    self.time_set.addItem(i[23:29])
        except:
            pass

    def refresh_date_end(self):
        try:
            separator = 0
            self.date_end_set.clear()
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()]):
                if i.find(self.date_begin_set.currentText() + self.time_begin_set.currentText()) >= 0:
                    separator = os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()]).index(i)
                    break
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()])[separator + 1:]:
                self.date_end_set.addItem(i[15:23])
        except:
            pass

    def refresh_time_end(self):
        try:
            separator = 0
            self.time_end_set.clear()
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()]):
                if i.find(self.date_begin_set.currentText()) >= 0:
                    separator = os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()]).index(i)
                    break
            for i in os.listdir(self.work_path + '/' + station_dic[self.station_set.currentText()])[separator + 1:]:
                if i.find(self.date_end_set.currentText()) >= 0:
                    self.time_end_set.addItem(i[23:29])
        except:
            pass

    def generate_animation(self):
        try:
            self.progressBar_3.setValue(10)
            start = self.date_begin_set.currentText() + self.time_begin_set.currentText()
            end = self.date_end_set.currentText() + self.time_end_set.currentText()
            start_number = 0
            end_number = 1
            goal_dir = self.work_path + '/' + station_dic[self.station_set.currentText()]  # c:/data/gui/data/Z9250
            for i in os.listdir(goal_dir):
                if i.find(start) >= 0:
                    start_number = os.listdir(goal_dir).index(i)
                if i.find(end) >= 0:
                    end_number = os.listdir(goal_dir).index(i)
                    break
            name_list = [goal_dir
                         + '/' + i for i in
                         os.listdir(goal_dir)[start_number:end_number + 1]]
            self.textBrowser_1.append('共计' + str(end_number - start_number) + '张图像')  # 701*501
            for i in os.listdir(self.animation_path):
                os.remove(self.animation_path + i)
            value = 0
            self.progressBar_3.setValue(value)
            for i in name_list:
                ppi(i)
                self.progressBar_3.setValue(value / (end_number - start_number) * 100)
                value += 1

            self.textBrowser_2.append(time.strftime("%H:%M:%S", time.localtime()))
            self.textBrowser_2.append('共生成' + str(value) + '张图像')

            for i in os.listdir(self.animation_path):
                with Image.open(self.animation_path + i) as img:
                    resized_img = img.resize((701, 511), resample=Image.LANCZOS)
                    resized_img.save(self.animation_path + i[-46:-4] + '_.png', format="png")
                    self.play_list.append(self.animation_path + i[-46:-4] + '_.png')

            self.textBrowser_2.append(time.strftime("%H:%M:%S", time.localtime()))
            self.textBrowser_2.append('图片准备就绪')
            # img2 = QtGui.QPixmap(self.play_list[0])  # Image.open(self.picture_name)
            # self.radarimage.setPixmap(img2)
            self.show_radarimage1(0)
        except:
            pass

    def show_radarimage1(self, i):
        try:
            img = QtGui.QPixmap(self.play_list[i])  # Image.open(self.picture_name)
            self.radarimage.setPixmap(img)
            self.station_number.setText(self.station_set.currentText())
            self.date_time.setText(
                self.play_list[i][-28:-26] + self.play_list[i][-26:-24] + ' ' + self.play_list[i][-24:-22] +
                self.play_list[i][-22:-20])
            self.textBrowser_2.append(time.strftime("%H:%M:%S", time.localtime()))
            self.textBrowser_2.append('第' + str(self.counter + 1) + '/' + str(len(self.play_list)) + '张')
        except:
            pass

    def show_ppi_img(self, i):
        try:
            img = QtGui.QPixmap(self.ppi_play_list[i])  # Image.open(self.picture_name)
            self.radarimage1.setPixmap(img)
            self.textBrowser_1.append(time.strftime("%H:%M:%S", time.localtime()))
            self.textBrowser_1.append('第' + str(i + 1) + '/' + str(len(self.ppi_play_list)) + '张')
            self.display_of_elev.setText(str(self.k.elevation_list[i]) + '°')
        except:
            pass

    def show_rhi_img(self, i):
        try:
            img = QtGui.QPixmap(self.rhi_play_list[i])  # Image.open(self.picture_name)
            self.radarimage1.setPixmap(img)
            self.textBrowser_1.append(time.strftime("%H:%M:%S", time.localtime()))
            self.textBrowser_1.append('第' + str(i + 1) + '/' + str(len(self.rhi_play_list)) + '张')
            self.display_of_azim.setText(str(int(360 * i/len(self.rhi_play_list))) + '°')
        except:
            pass

    def counter_reduce(self):
        if self.counter > 0:
            self.counter -= 1

    def counter_add(self):
        if self.counter < len(self.play_list) - 1:
            self.counter += 1

    def counter_zero(self):
        self.counter = 0

    def counter_end(self):
        self.counter = len(self.play_list) - 1

    def play_list_reset(self):
        self.play_list = []

    def ppi_play_list_reset(self):
        self.ppi_play_list = []

    def rhi_play_list_reset(self):
        self.rhi_play_list = []

    def play_all(self):
        for i in range(len(self.play_list)):
            time.sleep(0.5)
            # if not self.stop_play.clicked():
            img = QtGui.QPixmap(self.play_list[i])  # Image.open(self.picture_name)
            self.radarimage.setPixmap(img)
            self.textBrowser_2.append('第' + str(i + 1) + '/' + str(len(self.play_list)) + '张')
            time.sleep(0.5)

    def process_data(self):
        self.progressBar_1.setValue(10)
        self.k = Radar(self.data_absolute_path[:-46], self.data_absolute_path[-46:])
        self.progressBar_1.setValue(40)
        self.progressBar_1.setValue(100)
        self.station_number_2.setText(self.k.Name[9:14])
        self.date.setText(self.k.Name[15:23])
        self.time.setText(self.k.Name[23:29])
        self.scan_mode_2.setText(str(self.k.vcp[0]))
        self.ele_number.setText(str(len(self.k.elevation_list)))
        self.ref_number.setText(str(self.k.NumberOfReflectivity[0]))
        self.ref_step.setText(str(self.k.StepOfReflectivity[0]))
        self.spe_number.setText(str(self.k.NumberOfSpeed[0]))
        self.spe_step.setText(str(self.k.StepOfSpeed[0]))
        self.spe_number.setText(str(self.k.ResolutionOfSpeed[0]))

        for i in os.listdir(self.ppi_ref_path):
            os.remove(self.ppi_ref_path + '/' + i)
        self.progressBar_1.setValue(50)
        for i in self.k.elevation_list:
            self.k.ppi(i)
        self.progressBar_1.setValue(70)
        for i in os.listdir(self.rhi_ref_path):
            os.remove(self.rhi_ref_path + '/' + i)
        self.progressBar_1.setValue(80)
        for i in range(0, 360, 10):
            self.k.rhi(i)
        self.progressBar_1.setValue(90)

        for i in os.listdir(self.ppi_ref_path):
            with Image.open(self.ppi_ref_path + '/' + i) as img:
                resized_img = img.resize((701, 511), resample=Image.LANCZOS)
                resized_img.save(self.ppi_ref_path + '/' + i[:-4] + '_.png', format="png")
                self.ppi_play_list.append(self.ppi_ref_path + '/' + i[:-4] + '_.png')
                #self.textBrowser_1.append(i + ' done')
        self.textBrowser_1.append(time.strftime("%H:%M:%S", time.localtime()))
        self.textBrowser_1.append('PPI图片准备就绪')
        self.progressBar_1.setValue(95)
        for i in os.listdir(self.rhi_ref_path):
            with Image.open(self.rhi_ref_path + '/' + i) as img:
                resized_img = img.resize((701, 511), resample=Image.LANCZOS)
                resized_img.save(self.rhi_ref_path + '/' + i[:-4] + '_.png', format="png")
                self.rhi_play_list.append(self.rhi_ref_path + '/' + i[:-4] + '_.png')
                #self.textBrowser_1.append(i + ' done')
        self.textBrowser_1.append(time.strftime("%H:%M:%S", time.localtime()))
        self.textBrowser_1.append('RHI图片准备就绪')
        self.progressBar_1.setValue(100)
        self.show_ppi_img(0)
        #self.textBrowser_1.append(str(len(self.ppi_play_list)) + ' ' + str(len(self.rhi_play_list)))

    def plot_points(self):
        try:
            self.k.points()
        except:
            pass

    def retranslateUi(self, mainWindow):
        _translate = QtCore.QCoreApplication.translate
        mainWindow.setWindowTitle(_translate("mainWindow", "雷达基数据显示"))
        self.groupBox_9.setStatusTip(_translate("mainWindow", "基数据选择"))
        self.groupBox_9.setTitle(_translate("mainWindow", "数据选择"))
        self.progressBar_1.setStatusTip(_translate("mainWindow", "数据处理进度"))
        self.start_process.setStatusTip(_translate("mainWindow", "开始处理所选数据"))
        self.start_process.setText(_translate("mainWindow", "开始处理"))
        self.label_8.setText(_translate("mainWindow", "站点："))
        self.station_set_2.setStatusTip(_translate("mainWindow", "站点设定"))
        self.station_set_2.setItemText(0, _translate("mainWindow", "南京"))
        self.station_set_2.setItemText(1, _translate("mainWindow", "杭州"))
        self.station_set_2.setItemText(2, _translate("mainWindow", "厦门"))
        self.label_13.setText(_translate("mainWindow", "选择日期："))
        self.date_set.setToolTip(_translate("mainWindow", "设定日期"))
        self.date_set.setItemText(0, _translate("mainWindow", "20160101"))
        self.date_set.setItemText(1, _translate("mainWindow", "20160102"))
        self.label_14.setText(_translate("mainWindow", "选择时间："))
        self.time_set.setToolTip(_translate("mainWindow", "设定时间"))
        self.time_set.setItemText(0, _translate("mainWindow", "000000"))
        self.time_set.setItemText(1, _translate("mainWindow", "000006"))
        self.points.setStatusTip(_translate("mainWindow", "绘制三维图像"))
        self.points.setText(_translate("mainWindow", "三维绘制"))
        self.groupBox_10.setTitle(_translate("mainWindow", "图像显示"))
        self.display_iteam.setStatusTip(_translate("mainWindow", "设定显示项目"))
        self.display_iteam.setItemText(0, _translate("mainWindow", "反射率因子"))
        self.display_iteam.setItemText(1, _translate("mainWindow", "多普勒速度"))
        self.display_iteam.setItemText(2, _translate("mainWindow", "谱宽"))
        self.azi_set.setStatusTip(_translate("mainWindow", "滑动改变方位角"))
        self.display_mode.setStatusTip(_translate("mainWindow", "设定显示方式"))
        self.display_mode.setItemText(0, _translate("mainWindow", "平面位置显示（PPI）"))
        self.display_mode.setItemText(1, _translate("mainWindow", "垂直高度显示（RHI）"))
        self.label_42.setText(_translate("mainWindow", "仰角："))
        self.label_44.setText(_translate("mainWindow", "显示项目："))
        self.label_41.setText(_translate("mainWindow", "显示方式："))
        self.ele_set.setStatusTip(_translate("mainWindow", "滑动改变仰角"))
        self.label_43.setText(_translate("mainWindow", "方位角："))
        self.display_of_elev.setStatusTip(_translate("mainWindow", "当前仰角"))
        self.display_of_elev.setText(_translate("mainWindow", "当前示数"))
        self.display_of_azim.setStatusTip(_translate("mainWindow", "当前方位角"))
        self.display_of_azim.setText(_translate("mainWindow", "当前示数"))
        self.radarimage1.setStatusTip(_translate("mainWindow", "雷达回波图像"))
        self.radarimage1.setText(_translate("mainWindow", "T"))
        self.groupBox_11.setStatusTip(_translate("mainWindow", "基数据详情"))
        self.groupBox_11.setTitle(_translate("mainWindow", "数据参数"))
        self.label_31.setText(_translate("mainWindow", "站号：   "))
        self.station_number_2.setText(_translate("mainWindow", "Z9527"))
        self.label_32.setText(_translate("mainWindow", "时间："))
        self.time.setText(_translate("mainWindow", "010000"))
        self.label_33.setText(_translate("mainWindow", "体扫模式："))
        self.scan_mode_2.setText(_translate("mainWindow", "31"))
        self.label_34.setText(_translate("mainWindow", "日期："))
        self.date.setText(_translate("mainWindow", "20160101"))
        self.ele_number.setText(_translate("mainWindow", "14"))
        self.label_35.setText(_translate("mainWindow", "体扫仰角数："))
        self.label_36.setText(_translate("mainWindow", "反射率库数："))
        self.ref_number.setText(_translate("mainWindow", "460"))
        self.label_37.setText(_translate("mainWindow", "反射率库长："))
        self.ref_step.setText(_translate("mainWindow", "1000 m"))
        self.label_38.setText(_translate("mainWindow", "速度库数："))
        self.spe_number.setText(_translate("mainWindow", "460"))
        self.label_39.setText(_translate("mainWindow", "速度库长："))
        self.spe_step.setText(_translate("mainWindow", "1000 m"))
        self.label_40.setText(_translate("mainWindow", "速度分辨率"))
        self.spe_resolution.setText(_translate("mainWindow", "0.5 m/s"))
        self.groupBox_12.setTitle(_translate("mainWindow", "事件记录"))
        self.textBrowser_1.setStatusTip(_translate("mainWindow", "历史事件记录"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _translate("mainWindow", "单个数据"))
        self.groupBox_data_chose.setStatusTip(_translate("mainWindow", "基数据选择"))
        self.groupBox_data_chose.setTitle(_translate("mainWindow", "数据选择"))
        self.progressBar_3.setStatusTip(_translate("mainWindow", "进度"))
        self.label_2.setText(_translate("mainWindow", "站点："))
        self.station_set.setItemText(0, _translate("mainWindow", "南京"))
        self.station_set.setItemText(1, _translate("mainWindow", "杭州"))
        self.station_set.setItemText(2, _translate("mainWindow", "厦门"))
        self.label_3.setText(_translate("mainWindow", "开始日期："))
        self.label_4.setText(_translate("mainWindow", "开始时间："))
        self.date_begin_set.setItemText(0, _translate("mainWindow", "20160101"))
        self.date_begin_set.setItemText(1, _translate("mainWindow", "20160102"))
        self.time_begin_set.setItemText(0, _translate("mainWindow", "000000"))
        self.time_begin_set.setItemText(1, _translate("mainWindow", "000006"))
        self.elevation_set.setItemText(0, _translate("mainWindow", "0.5°"))
        self.elevation_set.setItemText(1, _translate("mainWindow", "1.5°"))
        self.elevation_set.setItemText(2, _translate("mainWindow", " 2.5°"))
        self.label_6.setText(_translate("mainWindow", "设定仰角："))
        self.label_29.setText(_translate("mainWindow", "结束日期："))
        self.date_end_set.setItemText(0, _translate("mainWindow", "20160201"))
        self.date_end_set.setItemText(1, _translate("mainWindow", "20160202"))
        self.label_30.setText(_translate("mainWindow", "结束时间："))
        self.time_end_set.setItemText(0, _translate("mainWindow", "230000"))
        self.time_end_set.setItemText(1, _translate("mainWindow", "230006"))
        self.set_done.setText(_translate("mainWindow", "设定完成"))
        self.groupBox_2.setTitle(_translate("mainWindow", "图像显示"))
        self.first_img.setStatusTip(_translate("mainWindow", "切换到第一张图像"))
        self.first_img.setText(_translate("mainWindow", "首张"))
        self.after_slide.setStatusTip(_translate("mainWindow", "切换到下一张图像"))
        self.after_slide.setText(_translate("mainWindow", "下一张"))
        self.before_slide.setStatusTip(_translate("mainWindow", "切换到上一张图像"))
        self.before_slide.setText(_translate("mainWindow", "上一张"))
        self.auto_play.setText(_translate("mainWindow", "自动播放"))
        self.stop_play.setText(_translate("mainWindow", "停止播放"))
        self.last_img.setStatusTip(_translate("mainWindow", "显示最后一张图像"))
        self.last_img.setText(_translate("mainWindow", "末张"))
        self.radarimage.setStatusTip(_translate("mainWindow", "PPI 0.5° 雷达回波图象"))
        self.radarimage.setText(_translate("mainWindow", "T"))
        self.groupBox.setStatusTip(_translate("mainWindow", "基数据详情"))
        self.groupBox.setTitle(_translate("mainWindow", "数据参数"))
        self.label_5.setText(_translate("mainWindow", "站号：   "))
        self.station_number.setText(_translate("mainWindow", "Z9527"))
        self.label_7.setText(_translate("mainWindow", "时间："))
        self.date_time.setText(_translate("mainWindow", "31"))
        self.label.setText(_translate("mainWindow", "体扫模式："))
        self.scan_mode.setText(_translate("mainWindow", "31"))
        self.label_16.setText(_translate("mainWindow", "仰角："))
        self.elevation.setText(_translate("mainWindow", "0.5°"))
        self.label_19.setText(_translate("mainWindow", "体扫仰角数："))
        self.number_of_elevation.setText(_translate("mainWindow", "14"))
        self.label_11.setText(_translate("mainWindow", "反射率库数："))
        self.number_reflectivity.setText(_translate("mainWindow", "460"))
        self.label_12.setText(_translate("mainWindow", "反射率库长："))
        self.step_reflectivity.setText(_translate("mainWindow", "1000 m"))
        self.label_24.setText(_translate("mainWindow", "速度库数："))
        self.sudukushu.setText(_translate("mainWindow", "460"))
        self.label_10.setText(_translate("mainWindow", "速度库长："))
        self.sudukuchang.setText(_translate("mainWindow", "1000 m"))
        self.label_9.setText(_translate("mainWindow", "速度分辨率"))
        self.sudufenbianlv.setText(_translate("mainWindow", "0.5 m/s"))
        self.groupBox_4.setTitle(_translate("mainWindow", "事件记录"))
        self.textBrowser_2.setStatusTip(_translate("mainWindow", "历史操作记录"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("mainWindow", "连续显示"))
        self.label_49.setText(_translate("mainWindow", "TextLabel"))
        self.label_48.setText(_translate("mainWindow", "TextLabel"))
        self.label_50.setText(_translate("mainWindow", "TextLabel"))
        self.label_47.setText(_translate("mainWindow", "TextLabel"))
        self.label_51.setText(_translate("mainWindow", "TextLabel"))
        self.label_52.setText(_translate("mainWindow", "TextLabel"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("mainWindow", "数据概况"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_5), _translate("mainWindow", "后台控制"))
        self.menu.setTitle(_translate("mainWindow", "文件"))
        self.menu_2.setTitle(_translate("mainWindow", "视图"))
        self.menu_3.setTitle(_translate("mainWindow", "关于"))
        self.menu_4.setTitle(_translate("mainWindow", "设置"))
        self.toolBar.setWindowTitle(_translate("mainWindow", "toolBar"))
        self.actionopen.setText(_translate("mainWindow", "打开文件"))
        self.actionopen.setShortcut(_translate("mainWindow", "Ctrl+O"))
        self.actionOpen_folder.setText(_translate("mainWindow", "设定数据路径"))
        self.actionOpen_folder.setShortcut(_translate("mainWindow", "Ctrl+F"))
        self.action.setText(_translate("mainWindow", "缓存管理"))
        self.action_2.setText(_translate("mainWindow", "退出程序"))


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    mainWindow = QtWidgets.QMainWindow()
    ui = Ui_mainWindow()
    ui.setupUi(mainWindow)
    mainWindow.show()
    sys.exit(app.exec_())

