|
|
@@ -1,16 +1,145 @@
|
|
|
+from cgi import print_arguments
|
|
|
+from unittest import result
|
|
|
+from PyQt5 import QtCore, QtGui, QtWidgets
|
|
|
+
|
|
|
+import os
|
|
|
+import sys
|
|
|
+import re
|
|
|
+import ast
|
|
|
+from urllib import parse
|
|
|
+import json
|
|
|
+import time
|
|
|
+import datetime
|
|
|
+import requests
|
|
|
+import uuid
|
|
|
+import pymongo
|
|
|
+import pymysql
|
|
|
+from collections import defaultdict, Counter
|
|
|
+from xlrd import open_workbook
|
|
|
+from xlsxwriter.workbook import Workbook
|
|
|
+import openpyxl
|
|
|
+
|
|
|
+
|
|
|
+save_filename = ""
|
|
|
+pwd_str = "yf6021"
|
|
|
+toji_format = {
|
|
|
+ 'font_name' : '宋体',
|
|
|
+ 'font_size': 14,
|
|
|
+ 'font_color': 'black',
|
|
|
+ 'text_wrap': True,
|
|
|
+ 'bold': False,
|
|
|
+ 'fg_color': '92D050',
|
|
|
+ 'align': 'center',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
+title_format = {
|
|
|
+ 'font_name' : '宋体',
|
|
|
+ 'font_size': 12,
|
|
|
+ 'bold': True,
|
|
|
+ 'align': 'center',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
+merge_title_format = {
|
|
|
+ 'font_name' : '宋体',
|
|
|
+ 'font_size': 26,
|
|
|
+ 'bold': True,
|
|
|
+ 'align': 'center',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ "fg_color": "8DB4E2",
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
+explain_formal = {
|
|
|
+ 'font_name' : '宋体',
|
|
|
+ 'font_size': 11,
|
|
|
+ 'font_color': 'black',
|
|
|
+ 'text_wrap': True,
|
|
|
+ 'align': 'justify',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
+formal_format = {
|
|
|
+ 'font_name' : '宋体',
|
|
|
+ 'font_size': 11,
|
|
|
+ 'font_color': 'black',
|
|
|
+ 'fg_color': '77E88C',
|
|
|
+ 'text_wrap': True,
|
|
|
+ 'align': 'center',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
+common_format = {
|
|
|
+ 'font_name' : '宋体',
|
|
|
+ 'font_size': 11,
|
|
|
+ 'font_color': 'black',
|
|
|
+ "fg_color": 'E7EC73',
|
|
|
+ 'text_wrap': True,
|
|
|
+ 'align': 'center',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
+error_format = {
|
|
|
+ 'font_name' : '宋体',
|
|
|
+ 'font_size': 11,
|
|
|
+ 'font_color': 'black',
|
|
|
+ "fg_color": 'F4746A',
|
|
|
+ 'text_wrap': True,
|
|
|
+ 'align': 'center',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
|
|
|
+default_formal = {
|
|
|
+ 'font_name': '宋体',
|
|
|
+ 'font_size': 11,
|
|
|
+ 'font_color': 'black',
|
|
|
+ 'text_wrap': True,
|
|
|
+ 'align': 'center',
|
|
|
+ 'valign': 'vcenter',
|
|
|
+ 'border': 1,
|
|
|
+ 'top': 1,
|
|
|
+ 'left': 1,
|
|
|
+ 'right': 1,
|
|
|
+ 'bottom': 1
|
|
|
+}
|
|
|
|
|
|
|
|
|
-class SCDThread(QtCore.QThread):
|
|
|
+class SCDThread(object):
|
|
|
"""涉及进度条需主界面动态执行GUI,线程执行业务逻辑,避免主页面卡死"""
|
|
|
def __init__(self,device_list,save_path,start_time,end_time,set_plat,set_stm8vs,set_order):
|
|
|
- super(SCDThread, self).__init__()
|
|
|
self.device_list = device_list
|
|
|
self.save_path = save_path
|
|
|
- # self.start_time = time.mktime(start_time.timetuple())
|
|
|
- # self.end_time = time.mktime(end_time.timetuple())
|
|
|
- self.start_time = 1689993000
|
|
|
- self.end_time = 1690008000
|
|
|
+ self.start_time = start_time
|
|
|
+ self.end_time = end_time
|
|
|
self.start_time_str = start_time.strftime("%y-%m-%d %H:%M:%S")
|
|
|
self.end_time_str = end_time.strftime("%y-%m-%d %H:%M:%S")
|
|
|
self.set_plat = set_plat
|
|
|
@@ -36,7 +165,6 @@ class SCDThread(QtCore.QThread):
|
|
|
self.connection = pymysql.connect(**self.config)
|
|
|
self.cursor = self.connection.cursor()
|
|
|
|
|
|
- self.cond = QxzCand()
|
|
|
self.mongo_ping()
|
|
|
|
|
|
def mongo_ping(self):
|
|
|
@@ -731,4 +859,7 @@ function(uptime_list){
|
|
|
self.cursor.close()
|
|
|
self.connection.close()
|
|
|
self.myclient.close()
|
|
|
- self.proess_signal.emit(100)
|
|
|
+
|
|
|
+if __name__ == "__main__":
|
|
|
+ device_list,save_path,start_time,end_time,set_plat,set_stm8vs,set_order = [""]
|
|
|
+ SCDThread().run()
|