| | |
| | | import data_export_util |
| | | import multiprocessing |
| | | |
| | | import log |
| | | import mysql_data |
| | | import redis_manager |
| | | import server |
| | |
| | | |
| | | |
| | | # 读取server进程的消息 |
| | | from trade_data_manager import CodeActualPriceProcessor |
| | | |
| | | |
| | | def __read_server_pipe(pipe): |
| | | while True: |
| | | value = pipe.recv() |
| | |
| | | |
| | | class GUI: |
| | | |
| | | |
| | | def __init__(self): |
| | | p1, p2 = multiprocessing.Pipe() |
| | | gs_gui_pipe, gs_server_pipe = multiprocessing.Pipe() |
| | |
| | | self.p1 = p1 |
| | | self.p2 = p2 |
| | | self.gs_gui_pipe = gs_gui_pipe |
| | | self.thsBuy1VolumnManager = THSBuy1VolumnManager() |
| | | self.codeActualPriceProcessor = CodeActualPriceProcessor() |
| | | # L2显示 |
| | | self.l2_codes = {} |
| | | # 获取l2的客户端列表 |
| | |
| | | except Exception as e: |
| | | pass |
| | | |
| | | try: |
| | | codes = self.thsBuy1VolumnManager.get_current_codes() |
| | | count = 0 |
| | | if codes: |
| | | count = len(codes) |
| | | cl_buy_1.configure(text="{}".format(count), foreground="#008000") |
| | | except: |
| | | pass |
| | | |
| | | |
| | | try: |
| | | cl_price_count.configure(text="{}".format(self.codeActualPriceProcessor.get_current_price_codes_count()), foreground="#008000") |
| | | except: |
| | | pass |
| | | |
| | | # 状态有问题,需要报警 |
| | | if not normal: |
| | |
| | | cl_codes = Label(frame, text="未知", bg="#DDDDDD") |
| | | cl_codes.place(x=450, y=y_) |
| | | |
| | | cl = Label(frame, text="买1代码数量:", bg="#DDDDDD") |
| | | cl.place(x=500, y=y_) |
| | | cl_buy_1 = Label(frame, text="未知", bg="#DDDDDD") |
| | | cl_buy_1.place(x=580, y=y_) |
| | | |
| | | cl = Label(frame, text="现价代码数量:", bg="#DDDDDD") |
| | | cl.place(x=620, y=y_) |
| | | cl_price_count = Label(frame, text="未知", bg="#DDDDDD") |
| | | cl_price_count.place(x=700, y=y_) |
| | | |
| | | refresh_data() |
| | | # 添加更新线程 |
| | | t1 = threading.Thread(target=lambda: update_data()) |