Skip to content

Commit

Permalink
Update 0126
Browse files Browse the repository at this point in the history
  • Loading branch information
Puiching-Memory committed Jan 26, 2022
1 parent c457240 commit a0bc909
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 154 deletions.
72 changes: 4 additions & 68 deletions GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,60 +582,12 @@ def __init__( self, parent ):

bSizer_main.Add( wSizer_C, 0, 0, 5 )

bSizer_ST = wx.BoxSizer( wx.VERTICAL )
self.Spacer_M = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,330 ), 0 )
self.Spacer_M.Wrap( -1 )

self.Space_topic = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,80 ), 0 )
self.Space_topic.Wrap( -1 )
self.Spacer_M.Hide()

bSizer_ST.Add( self.Space_topic, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

self.Topic = wx.StaticText( self, wx.ID_ANY, u"< RBS Software >", wx.DefaultPosition, wx.DefaultSize, 0 )
self.Topic.Wrap( -1 )

self.Topic.SetFont( wx.Font( 20, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Microsoft YaHei UI" ) )
self.Topic.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )

bSizer_ST.Add( self.Topic, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

self.Sub1 = wx.StaticText( self, wx.ID_ANY, u"Power by ZK2021", wx.DefaultPosition, wx.DefaultSize, 0 )
self.Sub1.Wrap( -1 )

self.Sub1.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )

bSizer_ST.Add( self.Sub1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )

wSizer11 = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )

self.Fast = wx.Button( self, wx.ID_ANY, u"NONE", wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE )
self.Fast.SetForegroundColour( wx.Colour( 255, 255, 255 ) )
self.Fast.SetBackgroundColour( wx.Colour( 255, 128, 0 ) )

wSizer11.Add( self.Fast, 0, wx.ALL, 5 )

self.Line_Last = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_VERTICAL )
wSizer11.Add( self.Line_Last, 0, wx.EXPAND |wx.ALL, 5 )

self.Fast_Star1 = wx.Button( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE )
wSizer11.Add( self.Fast_Star1, 0, wx.ALL, 5 )

self.Fast_Star2 = wx.Button( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE )
wSizer11.Add( self.Fast_Star2, 0, wx.ALL, 5 )

self.Fast_Star3 = wx.Button( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_NONE )
wSizer11.Add( self.Fast_Star3, 0, wx.ALL, 5 )


bSizer_ST.Add( wSizer11, 0, wx.ALIGN_CENTER_HORIZONTAL, 5 )

self.Sub2 = wx.StaticText( self, wx.ID_ANY, u"\n通过快速启动按钮打开工具,或点击顶部分区标签开始", wx.DefaultPosition, wx.Size( -1,20 ), 0 )
self.Sub2.Wrap( -1 )

self.Sub2.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )

bSizer_ST.Add( self.Sub2, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )


bSizer_main.Add( bSizer_ST, 1, wx.EXPAND, 5 )
bSizer_main.Add( self.Spacer_M, 0, wx.ALL, 5 )

wSizer_BT = wx.WrapSizer( wx.HORIZONTAL, wx.WRAPSIZER_DEFAULT_FLAGS )

Expand Down Expand Up @@ -828,10 +780,6 @@ def __init__( self, parent ):
self.B_Side_Refresh.Bind( wx.EVT_BUTTON, self.Plug_in_refresh )
self.B_Side_Run.Bind( wx.EVT_BUTTON, self.Plug_in_run )
self.Push.Bind( wx.EVT_BUTTON, self.CMD_Enter )
self.Fast.Bind( wx.EVT_BUTTON, self.Fast_on )
self.Fast_Star1.Bind( wx.EVT_BUTTON, self.FStar1 )
self.Fast_Star2.Bind( wx.EVT_BUTTON, self.FStar2 )
self.Fast_Star3.Bind( wx.EVT_BUTTON, self.FStar3 )
self.Space1.Bind( wx.EVT_BUTTON, self.Space1_Change )
self.Space2.Bind( wx.EVT_BUTTON, self.Space2_Change )
self.Bottom_Bar2.Bind( wx.EVT_BUTTON, self.BT2 )
Expand Down Expand Up @@ -1128,18 +1076,6 @@ def Plug_in_run( self, event ):
def CMD_Enter( self, event ):
event.Skip()

def Fast_on( self, event ):
event.Skip()

def FStar1( self, event ):
event.Skip()

def FStar2( self, event ):
event.Skip()

def FStar3( self, event ):
event.Skip()

def Space1_Change( self, event ):
event.Skip()

Expand Down
20 changes: 16 additions & 4 deletions M_Draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,27 @@ def __init__(self, parent):

def EVT_PAINT(self,event):
global dc
# Create paint DC
dc = wx.PaintDC(self)

dc.SetPen(wx.Pen('#d4d4d4')) #设置画笔颜色
dc.SetBrush(wx.Brush('#c56c00'))
# Create graphics context from it
gc = wx.GraphicsContext.Create(dc)

dc.DrawCircle(0,0,10)
gc.SetAntialiasMode(True)

dc.CrossHair(300,250)
# make a path that contains a circle and some lines
gc.SetPen(wx.RED_PEN)
path = gc.CreatePath()
path.AddCircle(50.0, 50.0, 50.0)
path.MoveToPoint(0.0, 50.0)
path.AddLineToPoint(100.0, 50.0)
path.MoveToPoint(50.0, 0.0)
path.AddLineToPoint(50.0, 100.0)
path.CloseSubpath()
path.AddRectangle(25.0, 25.0, 50.0, 50.0)

gc.StrokePath(path)

def MainOnLeftDown(self, event):
global dc
##dc.DrawCircle(event.)
Expand Down
2 changes: 1 addition & 1 deletion M_Roster.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def load(self):
line5 = excel.row_values(rowx=4, start_colx=1)
line6 = excel.row_values(rowx=5, start_colx=1)

print(line1, line2, line3, line4, line5)
##print(line1, line2, line3, line4, line5)

X = -1
Y = 0
Expand Down
89 changes: 15 additions & 74 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@

# 核心库
import wx, wx.adv, wx.svg
##from wxgl.scene import WxGLScene
import GUI
import configparser # 设置文件(.cfg)库
import logging.handlers # 日志库
Expand Down Expand Up @@ -97,25 +96,22 @@ class CalcFrame(GUI.Main):

def __init__(self, parent):
GUI.Main.__init__(self, parent) # 初始化GUI

self.threads = []

# ↓↓↓↓↓ 定义全局变量 ↓↓↓↓↓
global Main_State, FUN_State, version, setup, Colour_G, Hover, colour_Hover, last, cfg, screen_size_x, screen_size_y
global Main_State, FUN_State, version, setup, Colour_G, Hover, colour_Hover, cfg
cfg = configparser.ConfigParser() # 读取设置文件

cfg.read('./cfg/setting.cfg')
cfg.read('./cfg/main.cfg')
transparent = cfg.get('window', 'transparency')
is_push_info = cfg.get('window', 'is_push_info')
is_round = cfg.get('window', 'is_round')

cfg.read('./cfg/main.cfg')
last = cfg.get('History', 'LAST')
Main_State = cfg.get('History', 'MAINSTATE')
version = cfg.get('main', 'VERSION')
screen_size_x = int(cfg.get('screen', 'size_x'))
screen_size_y = int(cfg.get('screen', 'size_y'))
Is_complete = cfg.get('Check', 'Is_complete')

Main_State = 0

Log() # 初始化LOG设置
logging.debug('Document integrity check文件完整性检查:' + Is_complete)

Expand All @@ -127,7 +123,7 @@ def __init__(self, parent):
Plug_in_list = Plug_in_list.readlines()
for i in range(0, len(Plug_in_list)):
self.Plug_in_box.Append(str(Plug_in_list[i]).replace('\n', ''))
print(str(Plug_in_list[i]).replace('\n', ''))
print('载入插件',str(Plug_in_list[i]).replace('\n', ''))
# ------------------------------
setup = 0 # 初始化操作所用的变量,所有操作完成后会变成1
FUN_State = -1
Expand Down Expand Up @@ -157,13 +153,6 @@ def __init__(self, parent):

start(self) # 初始化界面布局函数(纯操作,无计算)

if last != '-1':
self.Fast.SetLabel(last_list(int(Main_State), int(last)))

if cfg.get('History', 'COLOR') != 'NONE' and tuple(eval(cfg.get('History', 'COLOR'))) != (255, 255, 255, 255):
self.Fast.SetBackgroundColour(
wx.Colour(tuple(eval(cfg.get('History', 'COLOR')))))

self.SetTransparent(int(transparent)) # 设置窗口透明度
##self.SetCursor(wx.Cursor(6)) # 设置窗口光标

Expand Down Expand Up @@ -194,8 +183,7 @@ def Sacc(self, event):
if setup == 1:
dc = event.GetDC()
dc.Clear()
##dc.DrawColor('white')
dc.DrawBitmap(wx.Bitmap("./pictures/alena-aenami-out-of-time-1080p.jpg"), 0, 50)
dc.DrawBitmap(wx.Bitmap("./pictures/alena-aenami-out-of-time-1080p.jpg"), 0, 50, useMask=True)
##print(1)
else:
dc = event.GetDC()
Expand All @@ -214,12 +202,6 @@ def Close(self, event):
if self.taskBar.IsAvailable: # 移除托盘图标
self.taskBar.RemoveIcon()

cfg.read('./cfg/main.cfg')
cfg.set('History', 'LAST', str(FUN_State))
cfg.set('History', 'MAINSTATE', str(Main_State))
cfg.set('History', 'COLOR', str(
self.Bottom_Bar1.GetBackgroundColour()))
cfg.write(open('./cfg/main.cfg', 'w'))
# 日志输出
logging.debug(
str('windows quit:' + time.strftime('%Y/%m/%d*%H:%M:%S')))
Expand All @@ -238,12 +220,6 @@ def Quit(self, event):
if self.taskBar.IsAvailable: # 移除托盘图标
self.taskBar.RemoveIcon()

cfg.read('./cfg/main.cfg')
cfg.set('History', 'LAST', str(FUN_State))
cfg.set('History', 'MAINSTATE', str(Main_State))
cfg.set('History', 'COLOR', str(
self.Bottom_Bar1.GetBackgroundColour()))
cfg.write(open('./cfg/main.cfg', 'w'))
# 日志输出
logging.debug(str('self quit:' + time.strftime('%Y/%m/%d*%H:%M:%S')))

Expand Down Expand Up @@ -2308,7 +2284,7 @@ def main():
global Frame_User, Frame_Setting, Frame_Plug_in, Frame_Probe

cfg = configparser.ConfigParser()
cfg.read('./cfg/setting.cfg')
cfg.read('./cfg/main.cfg')

app = wx.App(eval(cfg.get('window', 'sys_test'))) # GUI循环及前置设置
frame = CalcFrame(None)
Expand Down Expand Up @@ -2466,7 +2442,7 @@ def Log():
""" Log日志输出 """
cfg = configparser.ConfigParser() # 读取设置文件
cfg.read('./cfg/setting.cfg')
log_place = cfg.get('log', 'path')
log_place = './log/'

output_dir = log_place # 定义文件夹位置(不区分大小写)
log_name = '{}.log'.format(
Expand Down Expand Up @@ -2562,17 +2538,10 @@ def start(self):
self.Line1.Show(buer)
self.Line2.Show(buer)
self.Line3.Show(buer)
self.Line_Last.Show(False)
self.Space_left.Show(buer)

self.Space_topic.Show(False)
self.Topic.Show(False)
self.Sub1.Show(False)
self.Sub2.Show(False)
self.Fast.Show(False)
self.Fast_Star1.Show(False)
self.Fast_Star2.Show(False)
self.Fast_Star3.Show(False)
self.Spacer_M.Show(False)

resize(self)
self.SetBackgroundColour('White')

Expand Down Expand Up @@ -2641,13 +2610,11 @@ def start(self):
self.Line1.Show(buer)
self.Line2.Show(buer)
self.Line3.Show(buer)
self.Line_Last.Show(True)
self.Space_left.Show(buer)

setup = 1
self.Spacer_M.Show(True)

elif setup == 2:
return
setup = 1


def Home(self):
Expand All @@ -2657,11 +2624,6 @@ def Home(self):
global setup, Main_State, colour_Hover
colour_Hover = '#A65F00'

cfg.set('History', 'LAST', str(FUN_State))
cfg.set('History', 'MAINSTATE', str(Main_State))
cfg.set('History', 'COLOR', str(self.Bottom_Bar1.GetBackgroundColour()))
cfg.write(open('./cfg/main.cfg', 'w'))

buer = False
self.T_F1.Show(buer)
self.T_F2.Show(buer)
Expand Down Expand Up @@ -2726,18 +2688,8 @@ def Home(self):
self.Line1.Show(buer)
self.Line2.Show(buer)
self.Line3.Show(buer)
self.Line_Last.Show(True)
self.Space_left.Show(buer)

self.Space_topic.Show(True)
self.Topic.Show(True)
self.Sub1.Show(True)
self.Sub2.Show(True)
self.Fast.Show(True)
self.Fast_Star1.Show(True)
self.Fast_Star2.Show(True)
self.Fast_Star3.Show(True)

botm = wx.Colour(255, 201, 60)
top = wx.Colour(242, 171, 57)

Expand All @@ -2762,21 +2714,10 @@ def Home(self):

self.Weather.SetBackgroundColour(top)

self.Fast.SetLabel(str(FUN_State))

self.Note.SetLabel('Welcome to RBS_Software')

Colour_clean(self)

if FUN_State != -1:
self.Fast.SetLabel(last_list(Main_State, FUN_State))
else:
self.Fast.SetLabel('NONE')

if cfg.get('History', 'COLOR') != 'NONE' and tuple(eval(cfg.get('History', 'COLOR'))) != (255, 255, 255, 255):
self.Fast.SetBackgroundColour(
wx.Colour(tuple(eval(cfg.get('History', 'COLOR')))))

Main_State = 0
setup = 1

Expand All @@ -2788,8 +2729,8 @@ def resize(self):
通过更改窗口大小触发-->界面刷新
(这种刷新有别于一般的Refresh,可以让错位的子项复位)
"""
self.SetSize(screen_size_x + 1, screen_size_y)
self.SetSize(screen_size_x, screen_size_y)
self.SetSize(750 + 1, 410)
self.SetSize(750, 410)


def Function_icon(self, Internet1, Internet2, Internet3, Internet4, LocalFile1, LocalFile2, LocalFile3, LocalFile4):
Expand Down
3 changes: 1 addition & 2 deletions Plug_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ def __init__(self, parent):
plug_in_list = []
plug_in_list.append(os.listdir('./plug-in'))
plug_in_list = plug_in_list[0]
print(plug_in_list)

check_list = []
check_list.extend(plug_in_list)

for i in range(0, len(plug_in_list)):
sigle_str = str(plug_in_list[i])
if sigle_str.find('.') != -1:
print('不合规范的文件:' + str(plug_in_list[i]))
print('不合规范的插件文件:' + str(plug_in_list[i]))
del check_list[i]

plug_in_list = []
Expand Down
4 changes: 2 additions & 2 deletions Preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, parent):
global cfg
# 初始化设置
cfg = configparser.ConfigParser()# 读取设置文件
cfg.read('./cfg/setting.cfg')
cfg.read('./cfg/main.cfg')
fast_setup = cfg.get('performance', 'fast_on')

cfg.read('./cfg/main.cfg')
Expand Down Expand Up @@ -186,7 +186,7 @@ def Colour(self, event):

def main():
cfg = configparser.ConfigParser()
cfg.read('./cfg/setting.cfg')
cfg.read('./cfg/main.cfg')

app = wx.App(eval(cfg.get('window', 'sys_test')))# GUI循环及前置设置
frame_Pre = CalcFrame(None)
Expand Down
Loading

0 comments on commit a0bc909

Please sign in to comment.