|
@@ -33,6 +33,7 @@ import copy
|
|
import async_communication as cmt
|
|
import async_communication as cmt
|
|
import mytool.db_helper.db_operation as spmng
|
|
import mytool.db_helper.db_operation as spmng
|
|
|
|
|
|
|
|
+
|
|
class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
# # 取车界面信号
|
|
# # 取车界面信号
|
|
# signal_dict = pyqtSignal(dict)
|
|
# signal_dict = pyqtSignal(dict)
|
|
@@ -43,24 +44,37 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.command_dict = {}
|
|
self.command_dict = {}
|
|
self.unit_space_dict = None
|
|
self.unit_space_dict = None
|
|
self.setupUi(self)
|
|
self.setupUi(self)
|
|
|
|
+ self.parking_config = parking_config
|
|
|
|
+ self.label.setText(self.parking_config['process_title'])
|
|
# 数据存储
|
|
# 数据存储
|
|
- self.btn_positions = [(i, j) for i in range(parking_config['row'], -1, -1) for j in
|
|
|
|
- range(parking_config['column'])]
|
|
|
|
|
|
+ # 全矩阵
|
|
|
|
+ self.btn_positions = [(i, j) for i in range(self.parking_config['row']-1, -1, -1) for j in
|
|
|
|
+ range(self.parking_config['column'])]
|
|
|
|
+ # # 奇数矩阵
|
|
|
|
+ # self.btn_positions1 = [(i, j) for i in range(self.parking_config['row']-1, -1, -1) for j in
|
|
|
|
+ # range(1,self.parking_config['column'],2)]
|
|
|
|
+ # # 偶数矩阵
|
|
|
|
+ # self.btn_positions2 = [(i, j) for i in range(self.parking_config['row']-1, -1, -1) for j in
|
|
|
|
+ # range(2,self.parking_config['column']+2,2)]
|
|
|
|
+
|
|
|
|
+
|
|
self._dispatch_statu = {}
|
|
self._dispatch_statu = {}
|
|
self.unit_space_is_init = False
|
|
self.unit_space_is_init = False
|
|
self.process_is_init = False
|
|
self.process_is_init = False
|
|
- self.unit_list = {'A1': 11, 'A2': 12, 'A3': 13, 'A4': 14, 'B1': 21, 'B2': 22, 'B3': 23, 'B4': 24, 'B5': 25,
|
|
|
|
- 'C1': 31, 'C2': 32,
|
|
|
|
- 'A': [11, 12,13,14], 'B': [21, 22, 23, 24, 25], 'C': [31, 32], '所有': None}
|
|
|
|
|
|
+
|
|
|
|
+ self.parking_unit_list = self.parking_config['parking_unit_list']
|
|
|
|
+ self.process_unit_list = self.parking_config['process_unit_list']
|
|
|
|
+ self.db_unit_list = self.parking_config['db_unit_list']
|
|
|
|
+
|
|
|
|
+
|
|
self.label_dict = {}
|
|
self.label_dict = {}
|
|
self.list_widget_dict = {}
|
|
self.list_widget_dict = {}
|
|
|
|
|
|
- self.setWindowTitle(parking_config['window_title'])
|
|
|
|
|
|
+ self.setWindowTitle(self.parking_config['window_title'])
|
|
# 锁
|
|
# 锁
|
|
self.data_lock = threading.Lock()
|
|
self.data_lock = threading.Lock()
|
|
|
|
|
|
# 配置导入初始化数据库和rabbitmq
|
|
# 配置导入初始化数据库和rabbitmq
|
|
- self.parking_config = parking_config
|
|
|
|
self.db = spmng.DBOperation(db_config['db_ip'], db_config['db_port'], db_config['db_name'],
|
|
self.db = spmng.DBOperation(db_config['db_ip'], db_config['db_port'], db_config['db_name'],
|
|
db_config['db_user'], db_config['db_password'])
|
|
db_config['db_user'], db_config['db_password'])
|
|
self.rabbitmq = cmt.RabbitAsyncCommunicator(mq_config['mq_ip'], mq_config['mq_port'], mq_config['mq_user'],
|
|
self.rabbitmq = cmt.RabbitAsyncCommunicator(mq_config['mq_ip'], mq_config['mq_port'], mq_config['mq_user'],
|
|
@@ -76,7 +90,6 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.out_date = None
|
|
self.out_date = None
|
|
self.in_date = None
|
|
self.in_date = None
|
|
|
|
|
|
-
|
|
|
|
# 拓展功能
|
|
# 拓展功能
|
|
self.action_queryBlacklist.triggered.connect(self.btn_query_blacklist)
|
|
self.action_queryBlacklist.triggered.connect(self.btn_query_blacklist)
|
|
self.action_addBlacklist.triggered.connect(self.btn_add_blacklist)
|
|
self.action_addBlacklist.triggered.connect(self.btn_add_blacklist)
|
|
@@ -87,7 +100,11 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.action_deleteWhitelist.triggered.connect(self.btn_delete_whitelist)
|
|
self.action_deleteWhitelist.triggered.connect(self.btn_delete_whitelist)
|
|
|
|
|
|
# 记录表单元号,流程表单元号,车位表单元号
|
|
# 记录表单元号,流程表单元号,车位表单元号
|
|
- self.record_unit = self.db_comboBox.currentText()
|
|
|
|
|
|
+ self.unit_comboBox.addItems(list(self.parking_unit_list.keys()))
|
|
|
|
+ self.process_comboBox.addItems(list(self.process_unit_list.keys()))
|
|
|
|
+ self.db_comboBox.addItems(list(self.db_unit_list.keys()))
|
|
|
|
+
|
|
|
|
+ self.db_unit = self.db_comboBox.currentText()
|
|
self.process_unit = self.process_comboBox.currentText()
|
|
self.process_unit = self.process_comboBox.currentText()
|
|
self.parking_unit = self.unit_comboBox.currentText()
|
|
self.parking_unit = self.unit_comboBox.currentText()
|
|
self.updata_record_btn.clicked.connect(self.updata_record)
|
|
self.updata_record_btn.clicked.connect(self.updata_record)
|
|
@@ -112,7 +129,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
# 数据历史记录默认设置
|
|
# 数据历史记录默认设置
|
|
self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
|
|
self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
|
|
self.tableWidget.itemClicked.connect(self.show_car_image)
|
|
self.tableWidget.itemClicked.connect(self.show_car_image)
|
|
- self.tableWidget.setHorizontalHeaderLabels(parking_config['record_title'])
|
|
|
|
|
|
+ self.tableWidget.setHorizontalHeaderLabels(self.parking_config['record_title'])
|
|
now = datetime.datetime.now()
|
|
now = datetime.datetime.now()
|
|
|
|
|
|
zero_today = now - datetime.timedelta(hours=now.hour, minutes=now.minute, seconds=now.second,
|
|
zero_today = now - datetime.timedelta(hours=now.hour, minutes=now.minute, seconds=now.second,
|
|
@@ -129,38 +146,25 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.find_btn.clicked.connect(self.find_btn_click)
|
|
self.find_btn.clicked.connect(self.find_btn_click)
|
|
self.update_unit_btn.clicked.connect(self.update_btn_click)
|
|
self.update_unit_btn.clicked.connect(self.update_btn_click)
|
|
self.update_unit_btn_2.clicked.connect(self.update_process_unit_btn_click)
|
|
self.update_unit_btn_2.clicked.connect(self.update_process_unit_btn_click)
|
|
- # 车位管理显示的相关配置
|
|
|
|
- self.unit = parking_config["unit"]
|
|
|
|
- if self.unit == 11 or self.unit == 25 or self.unit == 32:
|
|
|
|
- self.in_occupy_space = 2
|
|
|
|
- self.out_occupy_space = 2
|
|
|
|
- else:
|
|
|
|
- self.in_occupy_space = 3
|
|
|
|
- self.out_occupy_space = 3
|
|
|
|
- self.controlroom_occupy_space = 0
|
|
|
|
- key = list(self.unit_list.keys())[list(self.unit_list.values()).index(self.unit)]
|
|
|
|
- self.unit_comboBox.setCurrentText(key)
|
|
|
|
|
|
+
|
|
|
|
+
|
|
# 初始化显示库位高度
|
|
# 初始化显示库位高度
|
|
font = QFont()
|
|
font = QFont()
|
|
font.setFamily('宋体')
|
|
font.setFamily('宋体')
|
|
font.setBold(False)
|
|
font.setBold(False)
|
|
font.setPointSize(15)
|
|
font.setPointSize(15)
|
|
self.parking_listWidget.setFont(font)
|
|
self.parking_listWidget.setFont(font)
|
|
- self.pushButton_grade1.setIcon(QIcon(QPixmap("./images/grade1.png")))
|
|
|
|
- self.pushButton_grade2.setIcon(QIcon(QPixmap("./images/grade2.png")))
|
|
|
|
- self.pushButton_grade3.setIcon(QIcon(QPixmap("./images/grade3.png")))
|
|
|
|
- self.pushButton_grade1.setText("限高:" + str(parking_config['grade1']))
|
|
|
|
- self.pushButton_grade2.setText("限高:" + str(parking_config['grade2']))
|
|
|
|
- self.pushButton_grade3.setText("限高:" + str(parking_config['grade3']))
|
|
|
|
|
|
|
|
# 数据缓存
|
|
# 数据缓存
|
|
self.space_dict = {}
|
|
self.space_dict = {}
|
|
self.record_all_unit_park_dict = {}
|
|
self.record_all_unit_park_dict = {}
|
|
self.record_all_unit_pick_dict = {}
|
|
self.record_all_unit_pick_dict = {}
|
|
- self.record_unit_park_dict = {}
|
|
|
|
- self.record_unit_pick_dict = {}
|
|
|
|
- self.record_total_unit_park_dict = {11:{},12:{},13:{},14:{},21:{},22:{},23:{},24:{},25:{},31:{},32:{}}
|
|
|
|
- self.record_total_unit_pick_dict = {11:{},12:{},13:{},14:{},21:{},22:{},23:{},24:{},25:{},31:{},32:{}}
|
|
|
|
|
|
+ self.db_unit_park_dict = {}
|
|
|
|
+ self.db_unit_pick_dict = {}
|
|
|
|
+ self.record_total_unit_park_dict = {11: {}, 12: {}, 13: {}, 14: {}, 21: {}, 22: {}, 23: {}, 24: {}, 25: {},
|
|
|
|
+ 31: {}, 32: {}}
|
|
|
|
+ self.record_total_unit_pick_dict = {11: {}, 12: {}, 13: {}, 14: {}, 21: {}, 22: {}, 23: {}, 24: {}, 25: {},
|
|
|
|
+ 31: {}, 32: {}}
|
|
|
|
|
|
self.last_command_dict = {}
|
|
self.last_command_dict = {}
|
|
|
|
|
|
@@ -190,13 +194,12 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
while self.db_query_isClose is False:
|
|
while self.db_query_isClose is False:
|
|
# 查询车位
|
|
# 查询车位
|
|
self.data_lock.acquire()
|
|
self.data_lock.acquire()
|
|
- self.space_dict = self.db.query_space_in_unit(self.unit)
|
|
|
|
|
|
+ self.space_dict = self.db.query_space_in_unit(self.parking_unit_list[self.parking_unit])
|
|
|
|
|
|
# 查询指令表
|
|
# 查询指令表
|
|
- for unit in self.unit_list[self.process_unit]:
|
|
|
|
|
|
+ for unit in self.process_unit_list[self.process_unit]:
|
|
self.last_command_dict[unit] = self.db.query_command_all_in_unit_and_sort(unit)
|
|
self.last_command_dict[unit] = self.db.query_command_all_in_unit_and_sort(unit)
|
|
|
|
|
|
-
|
|
|
|
self.data_lock.release()
|
|
self.data_lock.release()
|
|
|
|
|
|
# 数据库更新时间
|
|
# 数据库更新时间
|
|
@@ -214,15 +217,18 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.in_date = self.in_dateTimeEdit_2.dateTime().toPyDateTime().strftime("%Y-%m-%d %H:%M:%S")
|
|
self.in_date = self.in_dateTimeEdit_2.dateTime().toPyDateTime().strftime("%Y-%m-%d %H:%M:%S")
|
|
self.out_date = self.out_dateTimeEdit_2.dateTime().toPyDateTime().strftime("%Y-%m-%d %H:%M:%S")
|
|
self.out_date = self.out_dateTimeEdit_2.dateTime().toPyDateTime().strftime("%Y-%m-%d %H:%M:%S")
|
|
# 更新记录表单元号,流程表单元号,车位表单元号
|
|
# 更新记录表单元号,流程表单元号,车位表单元号
|
|
- self.record_unit = self.db_comboBox.currentText()
|
|
|
|
|
|
+ self.db_unit = self.db_comboBox.currentText()
|
|
# 检查连接
|
|
# 检查连接
|
|
self.db_connect_statu = self.check_connect_statu()
|
|
self.db_connect_statu = self.check_connect_statu()
|
|
if self.db_connect_statu:
|
|
if self.db_connect_statu:
|
|
self.data_lock.acquire()
|
|
self.data_lock.acquire()
|
|
|
|
+ unit = self.parking_unit_list[self.parking_unit]
|
|
# 车位管理
|
|
# 车位管理
|
|
- self.parkspace_show(self.unit, self.in_occupy_space, self.out_occupy_space)
|
|
|
|
|
|
+ self.parkspace_show(unit, self.parking_config["in_occupy_space"][str(unit)],
|
|
|
|
+ self.parking_config["out_occupy_space"][str(unit)],
|
|
|
|
+ self.parking_config["controlroom_occupy_space"][str(unit)])
|
|
# # 流程监控
|
|
# # 流程监控
|
|
- self.process_monitoring(self.process_unit)
|
|
|
|
|
|
+ self.process_monitoring(self.process_unit_list[self.process_unit])
|
|
|
|
|
|
self.data_lock.release()
|
|
self.data_lock.release()
|
|
|
|
|
|
@@ -234,22 +240,22 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.record_all_unit_pick_dict = self.db.query_pick_count_out_time(self.in_date, self.out_date)
|
|
self.record_all_unit_pick_dict = self.db.query_pick_count_out_time(self.in_date, self.out_date)
|
|
|
|
|
|
# 当前选中时间内指定单元记录数据
|
|
# 当前选中时间内指定单元记录数据
|
|
- if len(self.record_unit) != 1 and self.unit_list[self.record_unit] is not None:
|
|
|
|
- self.record_unit_park_dict = self.db.query_park_count_in_time_and_unit(self.in_date, self.out_date,
|
|
|
|
- self.unit_list[self.record_unit])
|
|
|
|
- self.record_unit_pick_dict = self.db.query_pick_count_out_time_and_unit(self.in_date, self.out_date,
|
|
|
|
- self.unit_list[
|
|
|
|
- self.record_unit])
|
|
|
|
|
|
+ if len(self.db_unit) != 1 and self.db_unit_list[self.db_unit] is not None:
|
|
|
|
+ self.db_unit_park_dict = self.db.query_park_count_in_time_and_unit(self.in_date, self.out_date,
|
|
|
|
+ self.db_unit_list[self.db_unit])
|
|
|
|
+ self.db_unit_pick_dict = self.db.query_pick_count_out_time_and_unit(self.in_date, self.out_date,
|
|
|
|
+ self.db_unit_list[
|
|
|
|
+ self.db_unit])
|
|
|
|
|
|
# 当前选中时间内指定总单元记录数据
|
|
# 当前选中时间内指定总单元记录数据
|
|
- if len(self.record_unit) == 1:
|
|
|
|
- for unit in self.unit_list[self.record_unit]:
|
|
|
|
|
|
+ if len(self.db_unit) == 1:
|
|
|
|
+ for unit in self.db_unit_list[self.db_unit]:
|
|
self.record_total_unit_park_dict[unit] = self.db.query_park_count_in_time_and_unit(self.in_date,
|
|
self.record_total_unit_park_dict[unit] = self.db.query_park_count_in_time_and_unit(self.in_date,
|
|
self.out_date,
|
|
self.out_date,
|
|
unit)
|
|
unit)
|
|
self.record_total_unit_pick_dict[unit] = self.db.query_pick_count_out_time_and_unit(self.in_date,
|
|
self.record_total_unit_pick_dict[unit] = self.db.query_pick_count_out_time_and_unit(self.in_date,
|
|
self.out_date,
|
|
self.out_date,
|
|
- unit)
|
|
|
|
|
|
+ unit)
|
|
# # 停车数量记录
|
|
# # 停车数量记录
|
|
self.show_parkingData()
|
|
self.show_parkingData()
|
|
self.data_lock.release()
|
|
self.data_lock.release()
|
|
@@ -257,12 +263,13 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
# 检查数据库连接
|
|
# 检查数据库连接
|
|
def check_connect_statu(self):
|
|
def check_connect_statu(self):
|
|
# 检查调度连接
|
|
# 检查调度连接
|
|
- key = "dispatch_%d_statu_port" % self.unit
|
|
|
|
|
|
+ key = "dispatch_%d_statu_port" % self.parking_unit_list[self.parking_unit]
|
|
if (key in self._dispatch_statu) is False or self._dispatch_statu[key].timeout():
|
|
if (key in self._dispatch_statu) is False or self._dispatch_statu[key].timeout():
|
|
self.plc_statu_led.setChecked(False)
|
|
self.plc_statu_led.setChecked(False)
|
|
else:
|
|
else:
|
|
statu = self._dispatch_statu[key].statu
|
|
statu = self._dispatch_statu[key].statu
|
|
dispatch_node_statu = message.dispatch_node_statu()
|
|
dispatch_node_statu = message.dispatch_node_statu()
|
|
|
|
+ print(dispatch_node_statu)
|
|
try:
|
|
try:
|
|
tf.Parse(statu, dispatch_node_statu)
|
|
tf.Parse(statu, dispatch_node_statu)
|
|
except Exception:
|
|
except Exception:
|
|
@@ -279,23 +286,17 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
else:
|
|
else:
|
|
self.db_statu_led.setChecked(True)
|
|
self.db_statu_led.setChecked(True)
|
|
return self.db_statu_led.isChecked()
|
|
return self.db_statu_led.isChecked()
|
|
|
|
+
|
|
# 车位显示
|
|
# 车位显示
|
|
- def parkspace_show(self, unit, in_occupy_space, out_occupy_space):
|
|
|
|
|
|
+ def parkspace_show(self, unit, in_occupy_space, out_occupy_space, controlroom_occupy_space):
|
|
self.unit_label.setText(self.get_unit(unit))
|
|
self.unit_label.setText(self.get_unit(unit))
|
|
- if unit == 31 or unit == 32:
|
|
|
|
- self.pushButton_grade1.setIcon(QIcon(QPixmap("./images/grade1.png")))
|
|
|
|
- self.pushButton_grade2.setIcon(QIcon(QPixmap("./images/grade1.png")))
|
|
|
|
- self.pushButton_grade3.setIcon(QIcon(QPixmap("./images/grade3.png")))
|
|
|
|
- self.pushButton_grade1.setText("限高:" + str(self.parking_config['grade4']))
|
|
|
|
- self.pushButton_grade2.setText("限高:" + str(self.parking_config['grade4']))
|
|
|
|
- self.pushButton_grade3.setText("限高:" + str(self.parking_config['grade3']))
|
|
|
|
- else:
|
|
|
|
- self.pushButton_grade1.setIcon(QIcon(QPixmap("./images/grade1.png")))
|
|
|
|
- self.pushButton_grade2.setIcon(QIcon(QPixmap("./images/grade2.png")))
|
|
|
|
- self.pushButton_grade3.setIcon(QIcon(QPixmap("./images/grade3.png")))
|
|
|
|
- self.pushButton_grade1.setText("限高:" + str(self.parking_config['grade1']))
|
|
|
|
- self.pushButton_grade2.setText("限高:" + str(self.parking_config['grade2']))
|
|
|
|
- self.pushButton_grade3.setText("限高:" + str(self.parking_config['grade3']))
|
|
|
|
|
|
+ self.pushButton_grade1.setIcon(QIcon(QPixmap("./images/grade1.png")))
|
|
|
|
+ self.pushButton_grade2.setIcon(QIcon(QPixmap("./images/grade2.png")))
|
|
|
|
+ self.pushButton_grade3.setIcon(QIcon(QPixmap("./images/grade3.png")))
|
|
|
|
+ self.pushButton_grade1.setText("车高等级:" + str(self.parking_config['grade1']))
|
|
|
|
+ self.pushButton_grade2.setText("车高等级:" + str(self.parking_config['grade2']))
|
|
|
|
+ self.pushButton_grade3.setText("车高等级:" + str(self.parking_config['grade3']))
|
|
|
|
+
|
|
# 绘制车位按钮
|
|
# 绘制车位按钮
|
|
if self.space_dict is None:
|
|
if self.space_dict is None:
|
|
return
|
|
return
|
|
@@ -311,6 +312,11 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
is_drawIn = False
|
|
is_drawIn = False
|
|
is_drawOut = False
|
|
is_drawOut = False
|
|
is_drawControlRoom = False
|
|
is_drawControlRoom = False
|
|
|
|
+ # 根据下标奇偶数分成两组
|
|
|
|
+ even_space_list = space_dict[::2]
|
|
|
|
+ odd_space_list = space_dict[1::2]
|
|
|
|
+
|
|
|
|
+
|
|
for park, position in zip(space_dict, self.btn_positions):
|
|
for park, position in zip(space_dict, self.btn_positions):
|
|
btn = QPushButton()
|
|
btn = QPushButton()
|
|
font, text_str, stylesheet, tool_tip = self.get_btn_show(park)
|
|
font, text_str, stylesheet, tool_tip = self.get_btn_show(park)
|
|
@@ -327,8 +333,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.unit_gridLayout.addWidget(btn, *position, 1, out_occupy_space)
|
|
self.unit_gridLayout.addWidget(btn, *position, 1, out_occupy_space)
|
|
is_drawOut = True
|
|
is_drawOut = True
|
|
elif text_str == " 控制室 " and is_drawControlRoom is False:
|
|
elif text_str == " 控制室 " and is_drawControlRoom is False:
|
|
- self.unit_gridLayout.addWidget(btn, *position, 1,
|
|
|
|
- self.parking_config['controlroom_occupy_space'])
|
|
|
|
|
|
+ self.unit_gridLayout.addWidget(btn, *position, 1, controlroom_occupy_space)
|
|
is_drawControlRoom = True
|
|
is_drawControlRoom = True
|
|
elif text_str != "出 口" and text_str != "入 口" and text_str != " 控制室 ":
|
|
elif text_str != "出 口" and text_str != "入 口" and text_str != " 控制室 ":
|
|
btn.setContextMenuPolicy(Qt.CustomContextMenu)
|
|
btn.setContextMenuPolicy(Qt.CustomContextMenu)
|
|
@@ -340,7 +345,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
if park1 != park2:
|
|
if park1 != park2:
|
|
font, text_str, stylesheet, tool_tip = self.get_btn_show(park2)
|
|
font, text_str, stylesheet, tool_tip = self.get_btn_show(park2)
|
|
results = self.findChild(QPushButton, str(park2["table_id"]))
|
|
results = self.findChild(QPushButton, str(park2["table_id"]))
|
|
- if results is None :
|
|
|
|
|
|
+ if results is None:
|
|
return
|
|
return
|
|
results.setFont(font)
|
|
results.setFont(font)
|
|
results.setText(text_str)
|
|
results.setText(text_str)
|
|
@@ -357,10 +362,11 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
results.setText(text_str)
|
|
results.setText(text_str)
|
|
results.setStyleSheet(stylesheet)
|
|
results.setStyleSheet(stylesheet)
|
|
results.setToolTip(tool_tip)
|
|
results.setToolTip(tool_tip)
|
|
|
|
+
|
|
# 流程监控
|
|
# 流程监控
|
|
- def process_monitoring(self, unit_char):
|
|
|
|
|
|
+ def process_monitoring(self, process_unit_list):
|
|
if self.process_is_init is False:
|
|
if self.process_is_init is False:
|
|
- for i in self.unit_list[unit_char]:
|
|
|
|
|
|
+ for i in process_unit_list:
|
|
self.list_widget_dict[i] = QListWidget(self)
|
|
self.list_widget_dict[i] = QListWidget(self)
|
|
self.list_widget_dict[i].setContextMenuPolicy(Qt.CustomContextMenu)
|
|
self.list_widget_dict[i].setContextMenuPolicy(Qt.CustomContextMenu)
|
|
self.list_widget_dict[i].customContextMenuRequested.connect(self.custom_right_menu)
|
|
self.list_widget_dict[i].customContextMenuRequested.connect(self.custom_right_menu)
|
|
@@ -370,7 +376,9 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
|
|
|
|
self.label_dict[i] = QLabel(self)
|
|
self.label_dict[i] = QLabel(self)
|
|
# 临时
|
|
# 临时
|
|
- self.label_dict[i].setText(unit_char + "-" + str((i % 10)))
|
|
|
|
|
|
+ # self.label_dict[i].setText(unit_char + "-" + str((i % 10)))
|
|
|
|
+ self.label_dict[i].setText(self.get_unit(i))
|
|
|
|
+
|
|
# self.label_dict[i].setText("停取流程")
|
|
# self.label_dict[i].setText("停取流程")
|
|
|
|
|
|
self.label_dict[i].setAlignment(Qt.AlignCenter)
|
|
self.label_dict[i].setAlignment(Qt.AlignCenter)
|
|
@@ -379,7 +387,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.unit_horizontalLayout.addWidget(self.label_dict[i])
|
|
self.unit_horizontalLayout.addWidget(self.label_dict[i])
|
|
self.process_is_init = True
|
|
self.process_is_init = True
|
|
|
|
|
|
- for i in self.unit_list[unit_char]:
|
|
|
|
|
|
+ for i in process_unit_list:
|
|
if (i in self.last_command_dict.keys()) is False or self.last_command_dict[i] is None:
|
|
if (i in self.last_command_dict.keys()) is False or self.last_command_dict[i] is None:
|
|
return
|
|
return
|
|
else:
|
|
else:
|
|
@@ -397,23 +405,25 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
# 刷新停车数据
|
|
# 刷新停车数据
|
|
def show_parkingData(self):
|
|
def show_parkingData(self):
|
|
# 有一个数据是空就直接返回
|
|
# 有一个数据是空就直接返回
|
|
- if self.record_all_unit_park_dict is None or self.record_all_unit_pick_dict is None or self.record_unit_park_dict is None or \
|
|
|
|
- self.record_unit_pick_dict is None or self.record_total_unit_park_dict is None or self.record_total_unit_pick_dict is None:
|
|
|
|
|
|
+ if self.record_all_unit_park_dict is None or self.record_all_unit_pick_dict is None or self.db_unit_park_dict is None or \
|
|
|
|
+ self.db_unit_pick_dict is None or self.record_total_unit_park_dict is None or self.record_total_unit_pick_dict is None:
|
|
return
|
|
return
|
|
- record_all_unit_park_dict,record_all_unit_pick_dict,record_unit_park_dict,record_unit_pick_dict,record_total_unit_park_dict,record_total_unit_pick_dict = \
|
|
|
|
- copy.deepcopy(self.record_all_unit_park_dict),copy.deepcopy(self.record_all_unit_pick_dict),copy.deepcopy(self.record_unit_park_dict),copy.deepcopy(self.record_unit_pick_dict),copy.deepcopy(self.record_total_unit_park_dict),copy.deepcopy(self.record_total_unit_pick_dict)
|
|
|
|
|
|
+ record_all_unit_park_dict, record_all_unit_pick_dict, db_unit_park_dict, db_unit_pick_dict, record_total_unit_park_dict, record_total_unit_pick_dict = \
|
|
|
|
+ copy.deepcopy(self.record_all_unit_park_dict), copy.deepcopy(self.record_all_unit_pick_dict), copy.deepcopy(
|
|
|
|
+ self.db_unit_park_dict), copy.deepcopy(self.db_unit_pick_dict), copy.deepcopy(
|
|
|
|
+ self.record_total_unit_park_dict), copy.deepcopy(self.record_total_unit_pick_dict)
|
|
unit_park_count = unit_pick_count = 0
|
|
unit_park_count = unit_pick_count = 0
|
|
all_park_count, all_pick_count = len(record_all_unit_park_dict), len(record_all_unit_pick_dict)
|
|
all_park_count, all_pick_count = len(record_all_unit_park_dict), len(record_all_unit_pick_dict)
|
|
|
|
|
|
# 当前选中时间内指定总单元记录数据
|
|
# 当前选中时间内指定总单元记录数据
|
|
- if len(self.record_unit) == 1:
|
|
|
|
- for unit in self.unit_list[self.record_unit]:
|
|
|
|
|
|
+ if len(self.db_unit) == 1:
|
|
|
|
+ for unit in self.db_unit_list[self.db_unit]:
|
|
unit_park_count = unit_park_count + len(record_total_unit_park_dict[unit])
|
|
unit_park_count = unit_park_count + len(record_total_unit_park_dict[unit])
|
|
unit_pick_count = unit_pick_count + len(record_total_unit_pick_dict[unit])
|
|
unit_pick_count = unit_pick_count + len(record_total_unit_pick_dict[unit])
|
|
|
|
|
|
# 当前选中时间内指定单元记录数据
|
|
# 当前选中时间内指定单元记录数据
|
|
- elif len(self.record_unit) != 1 and self.unit_list[self.record_unit] is not None:
|
|
|
|
- unit_park_count, unit_pick_count = len(record_unit_park_dict), len(record_unit_pick_dict)
|
|
|
|
|
|
+ elif len(self.db_unit) != 1 and self.db_unit_list[self.db_unit] is not None:
|
|
|
|
+ unit_park_count, unit_pick_count = len(db_unit_park_dict), len(db_unit_pick_dict)
|
|
else:
|
|
else:
|
|
unit_park_count, unit_pick_count = all_park_count, all_pick_count
|
|
unit_park_count, unit_pick_count = all_park_count, all_pick_count
|
|
|
|
|
|
@@ -496,22 +506,16 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
self.unit_horizontalLayout.itemAt(i).widget().deleteLater()
|
|
self.unit_horizontalLayout.itemAt(i).widget().deleteLater()
|
|
self.process_is_init = False
|
|
self.process_is_init = False
|
|
|
|
|
|
-
|
|
|
|
def update_btn_click(self):
|
|
def update_btn_click(self):
|
|
- self.parking_unit = self.unit_comboBox.currentText()
|
|
|
|
- if self.unit == self.unit_list[self.parking_unit]:
|
|
|
|
|
|
+ parking_unit = self.unit_comboBox.currentText()
|
|
|
|
+ if self.parking_unit_list[self.parking_unit] == self.parking_unit_list[parking_unit]:
|
|
return
|
|
return
|
|
- self.unit = self.unit_list[self.parking_unit]
|
|
|
|
- if self.unit == 11 or self.unit == 25 or self.unit == 32:
|
|
|
|
- self.in_occupy_space = 2
|
|
|
|
- self.out_occupy_space = 2
|
|
|
|
- else:
|
|
|
|
- self.in_occupy_space = 3
|
|
|
|
- self.out_occupy_space = 3
|
|
|
|
|
|
+ self.parking_unit = parking_unit
|
|
|
|
+ unit = self.parking_unit_list[self.parking_unit]
|
|
for i in range(self.unit_gridLayout.count()):
|
|
for i in range(self.unit_gridLayout.count()):
|
|
self.unit_gridLayout.itemAt(i).widget().deleteLater()
|
|
self.unit_gridLayout.itemAt(i).widget().deleteLater()
|
|
self.data_lock.acquire()
|
|
self.data_lock.acquire()
|
|
- self.space_dict = self.db.query_space_in_unit(self.unit)
|
|
|
|
|
|
+ self.space_dict = self.db.query_space_in_unit(unit)
|
|
self.data_lock.release()
|
|
self.data_lock.release()
|
|
|
|
|
|
self.unit_space_is_init = False
|
|
self.unit_space_is_init = False
|
|
@@ -525,7 +529,6 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
else:
|
|
else:
|
|
QMessageBox.critical(None, "提示", "数据库连接断开!", QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.critical(None, "提示", "数据库连接断开!", QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
|
|
|
|
-
|
|
|
|
def park_btn_right_click(self):
|
|
def park_btn_right_click(self):
|
|
if self.db_connect_statu:
|
|
if self.db_connect_statu:
|
|
menu = QMenu(self)
|
|
menu = QMenu(self)
|
|
@@ -580,7 +583,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
table = message.pick_table()
|
|
table = message.pick_table()
|
|
# table.statu = message.table_statu()
|
|
# table.statu = message.table_statu()
|
|
table.statu.table_process_mod = table_process_mod
|
|
table.statu.table_process_mod = table_process_mod
|
|
- a = dict['primary_key']
|
|
|
|
|
|
+ a = dict['primary_key']
|
|
table.primary_key = dict["primary_key"]
|
|
table.primary_key = dict["primary_key"]
|
|
self.rabbitmq.publish("command_ex", "user_pick_command_request_port",
|
|
self.rabbitmq.publish("command_ex", "user_pick_command_request_port",
|
|
tf.MessageToString(table, as_utf8=True))
|
|
tf.MessageToString(table, as_utf8=True))
|
|
@@ -673,25 +676,27 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
if res is not None and len(res) > 0:
|
|
if res is not None and len(res) > 0:
|
|
blacklist = ""
|
|
blacklist = ""
|
|
for dict in res:
|
|
for dict in res:
|
|
- blacklist = blacklist+str(dict)+"\n\n"
|
|
|
|
|
|
+ blacklist = blacklist + str(dict) + "\n\n"
|
|
QMessageBox.question(None, '提示', blacklist,
|
|
QMessageBox.question(None, '提示', blacklist,
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
else:
|
|
else:
|
|
QMessageBox.question(None, '提示', '没有黑名单!',
|
|
QMessageBox.question(None, '提示', '没有黑名单!',
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
|
|
+
|
|
def btn_add_blacklist(self):
|
|
def btn_add_blacklist(self):
|
|
if self.is_input_pwd() is True:
|
|
if self.is_input_pwd() is True:
|
|
fullcar = FullcarWindow()
|
|
fullcar = FullcarWindow()
|
|
fullcar.exec()
|
|
fullcar.exec()
|
|
if fullcar.get_results() is True:
|
|
if fullcar.get_results() is True:
|
|
car_number = fullcar.get_text()
|
|
car_number = fullcar.get_text()
|
|
- res = self.db.add_blacklist_in_car_number(car_number, datetime.datetime.now(),None,None)
|
|
|
|
|
|
+ res = self.db.add_blacklist_in_car_number(car_number, datetime.datetime.now(), None, None)
|
|
if res is not None and res > 0:
|
|
if res is not None and res > 0:
|
|
QMessageBox.question(None, '提示', '黑名单添加成功!',
|
|
QMessageBox.question(None, '提示', '黑名单添加成功!',
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
else:
|
|
else:
|
|
QMessageBox.question(None, '提示', '黑名单添加失败!',
|
|
QMessageBox.question(None, '提示', '黑名单添加失败!',
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
|
|
+
|
|
def btn_delete_blacklist(self):
|
|
def btn_delete_blacklist(self):
|
|
if self.is_input_pwd() is True:
|
|
if self.is_input_pwd() is True:
|
|
fullcar = FullcarWindow()
|
|
fullcar = FullcarWindow()
|
|
@@ -718,19 +723,21 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
else:
|
|
else:
|
|
QMessageBox.question(None, '提示', '没有白名单!',
|
|
QMessageBox.question(None, '提示', '没有白名单!',
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
|
|
+
|
|
def btn_add_whitelist(self):
|
|
def btn_add_whitelist(self):
|
|
if self.is_input_pwd() is True:
|
|
if self.is_input_pwd() is True:
|
|
fullcar = FullcarWindow()
|
|
fullcar = FullcarWindow()
|
|
fullcar.exec()
|
|
fullcar.exec()
|
|
if fullcar.get_results() is True:
|
|
if fullcar.get_results() is True:
|
|
car_number = fullcar.get_text()
|
|
car_number = fullcar.get_text()
|
|
- res = self.db.add_whitelist_in_car_number(car_number, datetime.datetime.now(),None,None)
|
|
|
|
|
|
+ res = self.db.add_whitelist_in_car_number(car_number, datetime.datetime.now(), None, None)
|
|
if res is not None and res > 0:
|
|
if res is not None and res > 0:
|
|
QMessageBox.question(None, '提示', '白名单添加成功!',
|
|
QMessageBox.question(None, '提示', '白名单添加成功!',
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
else:
|
|
else:
|
|
QMessageBox.question(None, '提示', '黑名单删除失败!',
|
|
QMessageBox.question(None, '提示', '黑名单删除失败!',
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
|
|
+
|
|
def btn_delete_whitelist(self):
|
|
def btn_delete_whitelist(self):
|
|
if self.is_input_pwd() is True:
|
|
if self.is_input_pwd() is True:
|
|
fullcar = FullcarWindow()
|
|
fullcar = FullcarWindow()
|
|
@@ -751,11 +758,10 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
fullcar.exec()
|
|
fullcar.exec()
|
|
if fullcar.get_results() is True:
|
|
if fullcar.get_results() is True:
|
|
remark = fullcar.get_text()
|
|
remark = fullcar.get_text()
|
|
- res = self.db.update_space_remark_in_space_id(dict['id'],remark)
|
|
|
|
|
|
+ res = self.db.update_space_remark_in_space_id(dict['id'], remark)
|
|
if res > 0:
|
|
if res > 0:
|
|
QMessageBox.question(None, '提示', '车位添加备注成功!',
|
|
QMessageBox.question(None, '提示', '车位添加备注成功!',
|
|
- QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
|
|
-
|
|
|
|
|
|
+ QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
|
|
|
|
def get_btn_show(self, park):
|
|
def get_btn_show(self, park):
|
|
|
|
|
|
@@ -772,8 +778,8 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
text_str = " 控制室 "
|
|
text_str = " 控制室 "
|
|
font.setBold(True)
|
|
font.setBold(True)
|
|
# elif park["statu"] == 10 and park["remark"] is not None:
|
|
# elif park["statu"] == 10 and park["remark"] is not None:
|
|
- # text_str = park["remark"][0:4]
|
|
|
|
- # font.setPointSize(20)
|
|
|
|
|
|
+ # text_str = park["remark"][0:4]
|
|
|
|
+ # font.setPointSize(20)
|
|
elif (park["statu"] == 2 or park["statu"] == 1 or park["statu"] == 4) and park[
|
|
elif (park["statu"] == 2 or park["statu"] == 1 or park["statu"] == 4) and park[
|
|
"car_number"] is not None and self.car_number_rbtn_2.isChecked():
|
|
"car_number"] is not None and self.car_number_rbtn_2.isChecked():
|
|
text_str = park["car_number"]
|
|
text_str = park["car_number"]
|
|
@@ -786,6 +792,18 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
background_color = ""
|
|
background_color = ""
|
|
background_image = ""
|
|
background_image = ""
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ # 设置背景图
|
|
|
|
+ if park["height_level"] == self.parking_config['grade1']:
|
|
|
|
+ background_image = "background-image: url(./images/grade1.png);"
|
|
|
|
+ elif park["height_level"] == self.parking_config['grade2']:
|
|
|
|
+ background_image = "background-image: url(./images/grade2.png);"
|
|
|
|
+ elif park["height_level"] == self.parking_config['grade3']:
|
|
|
|
+ background_image = "background-image: url(./images/grade3.png);"
|
|
|
|
+ elif park["height_level"] == self.parking_config['grade4']:
|
|
|
|
+ background_image = "background-image: url(./images/grade1.png);"
|
|
|
|
+
|
|
# 故障
|
|
# 故障
|
|
if park["statu"] == 10:
|
|
if park["statu"] == 10:
|
|
background_color = "background-color:rgb(255,130,130);"
|
|
background_color = "background-color:rgb(255,130,130);"
|
|
@@ -804,18 +822,9 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
# 出入口
|
|
# 出入口
|
|
elif park["statu"] == 6 or park["statu"] == 7 or park["statu"] == 8:
|
|
elif park["statu"] == 6 or park["statu"] == 7 or park["statu"] == 8:
|
|
background_color = "background-color:rgb(0,162,232);"
|
|
background_color = "background-color:rgb(0,162,232);"
|
|
|
|
+ background_image = ""
|
|
# elif park["statu"] == 0 and park["remark"] is not None:
|
|
# elif park["statu"] == 0 and park["remark"] is not None:
|
|
# background_color = "background-color:rgb(255,130,130);"
|
|
# background_color = "background-color:rgb(255,130,130);"
|
|
-
|
|
|
|
- # 设置背景图
|
|
|
|
- if park["height"] == self.parking_config['grade1']:
|
|
|
|
- background_image = "background-image: url(./images/grade1.png);"
|
|
|
|
- elif park["height"] == self.parking_config['grade2']:
|
|
|
|
- background_image = "background-image: url(./images/grade2.png);"
|
|
|
|
- elif park["height"] == self.parking_config['grade3']:
|
|
|
|
- background_image = "background-image: url(./images/grade3.png);"
|
|
|
|
- elif park["height"] == self.parking_config['grade4']:
|
|
|
|
- background_image = "background-image: url(./images/grade1.png);"
|
|
|
|
stylesheet = background_color + "pressed{padding-top:2px;padding-left:2px;};" + background_image + "background-repeat:no-repeat;"
|
|
stylesheet = background_color + "pressed{padding-top:2px;padding-left:2px;};" + background_image + "background-repeat:no-repeat;"
|
|
for key in park.keys():
|
|
for key in park.keys():
|
|
if park[key] is None:
|
|
if park[key] is None:
|
|
@@ -852,15 +861,15 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
if self.db_connect_statu is False:
|
|
if self.db_connect_statu is False:
|
|
QMessageBox.critical(None, "提示", "数据库连接断开!", QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.critical(None, "提示", "数据库连接断开!", QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
return
|
|
return
|
|
- if self.unit_list[self.record_unit] == None:
|
|
|
|
|
|
+ if self.db_unit_list[self.db_unit] == 0:
|
|
unit_sql = ""
|
|
unit_sql = ""
|
|
- elif type(self.unit_list[self.record_unit]) != int:
|
|
|
|
|
|
+ elif type(self.db_unit_list[self.db_unit]) != int:
|
|
unit_sql = "and ("
|
|
unit_sql = "and ("
|
|
- for i in self.unit_list[self.record_unit]:
|
|
|
|
|
|
+ for i in self.db_unit_list[self.db_unit]:
|
|
unit_sql = unit_sql + "unit_id=%d or " % i
|
|
unit_sql = unit_sql + "unit_id=%d or " % i
|
|
unit_sql = unit_sql[:-3] + ")"
|
|
unit_sql = unit_sql[:-3] + ")"
|
|
else:
|
|
else:
|
|
- unit_sql = "and (unit_id = %s)" % self.unit_list[self.record_unit]
|
|
|
|
|
|
+ unit_sql = "and (unit_id = %s)" % self.db_unit_list[self.db_unit]
|
|
|
|
|
|
in_datatime = self.in_dateTimeEdit.dateTime().toPyDateTime()
|
|
in_datatime = self.in_dateTimeEdit.dateTime().toPyDateTime()
|
|
out_datatime = self.out_dateTimeEdit.dateTime().toPyDateTime()
|
|
out_datatime = self.out_dateTimeEdit.dateTime().toPyDateTime()
|
|
@@ -922,6 +931,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
QMessageBox.Ok) # "退出"代表的是弹出框的标题,"你确认退出.."表示弹出框的内容
|
|
except Exception as e:
|
|
except Exception as e:
|
|
pass
|
|
pass
|
|
|
|
+
|
|
def is_input_pwd(self, tipstr=None):
|
|
def is_input_pwd(self, tipstr=None):
|
|
if self.is_pwd is False:
|
|
if self.is_pwd is False:
|
|
# 组装显示信息
|
|
# 组装显示信息
|
|
@@ -948,7 +958,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
except Exception:
|
|
except Exception:
|
|
parkspace.table_id = -1
|
|
parkspace.table_id = -1
|
|
|
|
|
|
- show_str =""
|
|
|
|
|
|
+ show_str = ""
|
|
if dict['type'] == 1: # 存车指令
|
|
if dict['type'] == 1: # 存车指令
|
|
item.setBackground(QColor(185, 240, 240))
|
|
item.setBackground(QColor(185, 240, 240))
|
|
if (dict['statu'] == 0): # 排队
|
|
if (dict['statu'] == 0): # 排队
|
|
@@ -963,7 +973,8 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
elif (dict['statu'] == 3): # 已完成
|
|
elif (dict['statu'] == 3): # 已完成
|
|
item.setForeground(QColor('red'))
|
|
item.setForeground(QColor('red'))
|
|
show_str = dict['car_number'] + " 故障!"
|
|
show_str = dict['car_number'] + " 故障!"
|
|
- show_str = "存 %d入 %d出 %d号车位 %s %s " % (dict["import_id"],dict["export_id"],parkspace.table_id,show_str,str(dict["queue_time"].time()))
|
|
|
|
|
|
+ show_str = "存 %d入 %d出 %d号车位 %s %s " % (
|
|
|
|
+ dict["import_id"], dict["export_id"], parkspace.table_id, show_str, str(dict["queue_time"].time()))
|
|
|
|
|
|
elif dict['type'] == 2: # 取车指令
|
|
elif dict['type'] == 2: # 取车指令
|
|
item.setBackground(QColor(250, 240, 200))
|
|
item.setBackground(QColor(250, 240, 200))
|
|
@@ -979,7 +990,8 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
elif (dict['statu'] == 3): # 已完成
|
|
elif (dict['statu'] == 3): # 已完成
|
|
item.setForeground(QColor('red'))
|
|
item.setForeground(QColor('red'))
|
|
show_str = dict['car_number'] + " 故障!"
|
|
show_str = dict['car_number'] + " 故障!"
|
|
- show_str = "取 %d入 %d出 %d号车位 %s %s " % (dict["import_id"],dict["export_id"],parkspace.table_id,show_str,str(dict["queue_time"].time()))
|
|
|
|
|
|
+ show_str = "取 %d入 %d出 %d号车位 %s %s " % (
|
|
|
|
+ dict["import_id"], dict["export_id"], parkspace.table_id, show_str, str(dict["queue_time"].time()))
|
|
item.setText(show_str)
|
|
item.setText(show_str)
|
|
return item
|
|
return item
|
|
|
|
|
|
@@ -1041,7 +1053,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
elif unit == 2:
|
|
elif unit == 2:
|
|
return 'B'
|
|
return 'B'
|
|
elif unit == 11:
|
|
elif unit == 11:
|
|
- return 'A1'
|
|
|
|
|
|
+ return 'A'
|
|
elif unit == 12:
|
|
elif unit == 12:
|
|
return 'A2'
|
|
return 'A2'
|
|
elif unit == 13:
|
|
elif unit == 13:
|
|
@@ -1049,7 +1061,7 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
elif unit == 14:
|
|
elif unit == 14:
|
|
return 'A4'
|
|
return 'A4'
|
|
elif unit == 21:
|
|
elif unit == 21:
|
|
- return 'B1'
|
|
|
|
|
|
+ return 'B'
|
|
elif unit == 22:
|
|
elif unit == 22:
|
|
return 'B2'
|
|
return 'B2'
|
|
elif unit == 23:
|
|
elif unit == 23:
|
|
@@ -1063,4 +1075,3 @@ class MainWindow(QMainWindow, sui.Ui_MainWindow):
|
|
elif unit == 32:
|
|
elif unit == 32:
|
|
return 'C2'
|
|
return 'C2'
|
|
return '未知'
|
|
return '未知'
|
|
-
|
|
|