|
@@ -1,6 +1,7 @@
|
|
|
import sys
|
|
|
import threading
|
|
|
import time
|
|
|
+from datetime import datetime
|
|
|
|
|
|
from PyQt5 import QtWidgets
|
|
|
|
|
@@ -113,7 +114,28 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|
|
# self.last_command_dict[i] = self.db.query_command_top_number(self.top_number)
|
|
|
|
|
|
time.sleep(0.2)
|
|
|
-
|
|
|
+ def get_time_weight(self):
|
|
|
+ current_time_gour = datetime.now().hour
|
|
|
+ if 0 <= current_time_gour < 7:
|
|
|
+ return 0.6
|
|
|
+ elif 7 <= current_time_gour < 8:
|
|
|
+ return 0.9
|
|
|
+ elif 8 <= current_time_gour < 9:
|
|
|
+ return 1
|
|
|
+ elif 9 <= current_time_gour < 11:
|
|
|
+ return 0.9
|
|
|
+ elif 11 <= current_time_gour < 12:
|
|
|
+ return 0.8
|
|
|
+ elif 12 <= current_time_gour < 14:
|
|
|
+ return 0.7
|
|
|
+ elif 11 <= current_time_gour < 15:
|
|
|
+ return 0.9
|
|
|
+ elif 15 <= current_time_gour < 16:
|
|
|
+ return 0.8
|
|
|
+ elif 16 <= current_time_gour < 21:
|
|
|
+ return 0.7
|
|
|
+ elif 21 <= current_time_gour < 24:
|
|
|
+ return 0.6
|
|
|
def get_listWidget_item(self, dict, index):
|
|
|
item = QListWidgetItem()
|
|
|
item.setFont(QFont('微软雅黑', self.font_size, QFont.Bold))
|
|
@@ -139,7 +161,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|
|
show_str = "%s %s排队中" % (dict['car_number'], self.get_unit(dict['unit']))
|
|
|
if index != 40:
|
|
|
show_str = "%s 预计剩%d分钟" % (dict['car_number'],
|
|
|
- int((dict['row_number() over(order by queue_time)']) * 5 *
|
|
|
+ round((dict['row_number() over(order by queue_time)']) * 5 * self.get_time_weight() *
|
|
|
self.pick_wait_weight[index][0]['wait_weight']))
|
|
|
elif (dict['statu'] == 1): # 工作
|
|
|
item.setForeground(QColor('blue'))
|