Administrator
2023-04-21 0ed2c53acd278d57a39390fd4db78c5aaf088e0a
gui.py
@@ -3,6 +3,8 @@
"""
from tkinter import *
from tkinter.messagebox import *
import numpy
import tkintertable
import win32gui
@@ -142,9 +144,6 @@
            for i in range(0, len(content)):
                text.tag_add('error', "{}.{}".format(line, i))
        def sync_target_codes():
            server.sync_target_codes_to_ths()
        def click():
            text.delete('1.0', END)
@@ -206,9 +205,6 @@
        btn = Button(frame, text="运行环境检测", command=click)
        btn.place(x=5, y=5)
        btn = Button(frame, text="同步THS目标标的", command=sync_target_codes)
        btn.place(x=100, y=5)
        frame.grid(row=1, column=2)
@@ -327,7 +323,12 @@
        def re_distribute_buy_win():
            try:
                juejin.distribute_buy_win()
                if tool.trade_time_sub(tool.get_now_time_str(), "09:30:00") > 0:
                    raise Exception("只能9:30之前重新分配窗口")
                datas = JueJinManager.get_codes_limit_rate(gpcode_manager.get_gp_list())
                matrix = numpy.array(datas)
                codes = matrix[:, 0].tolist()
                trade_gui.re_distribute_buy_win(codes)
                refresh_trade_buy_win_data()
                showinfo("提示", "分配完成")
            except Exception as e:
@@ -347,7 +348,8 @@
                normal = False
            try:
                trade_gui.THSGuiTrade.checkEnv()
                cl_win.configure(text="正常", foreground="#008000")
                cancel_win_num = trade_gui.THSGuiTrade.getCancelBuyWins()
                cl_win.configure(text=f"正常({len(cancel_win_num)})", foreground="#008000")
            except Exception as e:
                normal = False
                cl_win.configure(text="异常:{}".format(str(e)), foreground="#FF7F27")
@@ -610,7 +612,21 @@
        width = 800
        height = 360
        frame = Frame(root, {"height": height, "width": width, "bg": "#DDDDDD"})
        cl = Label(frame, text="L2采集状态", bg="#DDDDDD")
        trade_info= ""
        for_color = "#008000"
        if constant.TEST:
            trade_info += "测试环境"
            for_color = "#FF7F27"
        else:
            trade_info += "正式环境"
        trade_info += " "
        if constant.TRADE_ENABLE:
            trade_info += "初始允许交易"
        else:
            trade_info += "初始禁止交易"
            for_color = "#FF7F27"
        cl = Label(frame, text=f"{trade_info}", bg="#DDDDDD",foreground=f"{for_color}")
        cl.place(x=5, y=5)
        accept_l2 = IntVar()