[modify] [aio.py]: 修改menu_main->menu_main_dp,menu_sub->menu_sub_dp,为后续其他tab功能按钮做扩展,是针对第三点做出的相应调整

This commit is contained in:
gitea 2024-06-09 22:36:20 +08:00
parent 412c7c2600
commit 154657fd18
4 changed files with 19 additions and 17 deletions

View File

@ -185,9 +185,11 @@ v0.1.4(2024/06/06)
v0.1.5(2024/06/12)
1. [aio.py]: 主界面切换不同功能时保持placehold一致
2. [brake.py]: 由于制动采集模板和内容的更改,适配了新的数据,更新了算法
3. [layout.xlsx]: 添加了各个功能的流程图
3. [aio.py]: 新增tabview组件区分数据处理和自动化测试功能
4. [aio.py]: 重新调整界面配色
5. [aio.py]: 修改了write2textbox函数定制化显示每一行的颜色针对每一行可自定义输出内容颜色
6. [brake.py/iso.py/current.py]: 由于第 5 点的更改,同时修改了其他文件相关引用的部分
7. [aio.py]: 更改label/entry/optionmenu等控件的生成方式使用循环实现更加简洁和容易维护
8. [aio.py]: 新增tabview组件区分数据处理和自动化测试功能
8. [aio.py]: 修改customtkinter库中C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\customtkinter\windows\widgets\ctk_tabview.py文件参考https://github.com/TomSchimansky/CustomTkinter/issues/2296实现修改tabview组件的字体大小
9. [aio.py]: 修改menu_main->menu_main_dpmenu_sub->menu_sub_dp为后续其他tab功能按钮做扩展是针对第三点做出的相应调整
10. [layout.xlsx]: 添加了各个功能的流程图

View File

@ -6,13 +6,13 @@ import customtkinter
import brake, current, iso
from time import time, strftime, localtime
from urllib.request import urlopen
import socket
from socket import setdefaulttimeout
customtkinter.set_appearance_mode("System") # Modes: "System" (standard), "Dark", "Light"
customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"
customtkinter.set_widget_scaling(1.1) # widget dimensions and text size
customtkinter.set_window_scaling(1.1) # window geometry dimensions
socket.setdefaulttimeout(10)
setdefaulttimeout(10)
# global vars
btns = {
'start': {'btn': '', 'row': 1, 'text': '开始运行'},
@ -82,11 +82,11 @@ class App(customtkinter.CTk):
self.tabview.add("Data Process")
self.tabview.add("Automatic Test")
# create main menu
self.menu_main = customtkinter.CTkOptionMenu(self.tabview.tab('Data Process'), values=["INIT", "brake", "current", "iso"], font=self.my_font, text_color='yellow', button_color='red', fg_color='green', command=self.func_main_callback)
self.menu_main.grid(row=1, column=1, sticky='we', padx=5, pady=5)
self.menu_main.set("Start Here!")
self.menu_main_dp = customtkinter.CTkOptionMenu(self.tabview.tab('Data Process'), values=["INIT", "brake", "current", "iso"], font=self.my_font, text_color='yellow', button_color='red', fg_color='green', command=self.func_main_callback)
self.menu_main_dp.grid(row=1, column=1, sticky='we', padx=5, pady=5)
self.menu_main_dp.set("Start Here!")
# create sub menu
self.menu_sub = customtkinter.CTkOptionMenu(self.tabview.tab('Data Process'))
self.menu_sub_dp = customtkinter.CTkOptionMenu(self.tabview.tab('Data Process'))
# =====================================================================
# create widgits
for widgit in widgits:
@ -140,7 +140,7 @@ class App(customtkinter.CTk):
widgits[widgit]['label'].configure(text=f'{widgit.upper()}', text_color="black")
widgits[widgit]['optionmenu'].configure(state='disabled')
self.menu_sub.grid_forget()
self.menu_sub_dp.grid_forget()
self.textbox.delete(index1='1.0', index2='end')
self.textbox.configure(state='disabled')
@ -156,10 +156,10 @@ class App(customtkinter.CTk):
widgits[widgit]['label'].configure(text_color="red")
widgits[widgit]['optionmenu'].configure(state='normal')
elif func_name == 'current':
self.menu_sub = customtkinter.CTkOptionMenu(self.tabview.tab('Data Process'), values=["max", "avg", "cycle"], font=self.my_font, button_color='red', fg_color='green', command=self.func_sub_callback)
self.menu_sub.grid(row=2, column=1, sticky='we', padx=5, pady=5)
self.menu_sub.set("--select--")
self.menu_sub.configure(text_color='yellow')
self.menu_sub_dp = customtkinter.CTkOptionMenu(self.tabview.tab('Data Process'), values=["max", "avg", "cycle"], font=self.my_font, button_color='red', fg_color='green', command=self.func_sub_callback)
self.menu_sub_dp.grid(row=2, column=1, sticky='we', padx=5, pady=5)
self.menu_sub_dp.set("--select--")
self.menu_sub_dp.configure(text_color='yellow')
for widgit in widgits:
if widgit in ['path', 'rc', 'rc1', 'rc2', 'rc3', 'rc4', 'rc5', 'rc6']:
@ -176,7 +176,7 @@ class App(customtkinter.CTk):
widgits[widgit]['entry'].configure(state='normal')
else:
self.initialization()
self.menu_main.set("Start Here!")
self.menu_main_dp.set("Start Here!")
def func_sub_callback(self, func_name):
if func_name == "max":
@ -237,7 +237,7 @@ class App(customtkinter.CTk):
return True
def check_param(self):
func_name = self.menu_main.get()
func_name = self.menu_main_dp.get()
if func_name == 'brake':
path = widgits['path']['entry'].get().strip()
av = widgits['av']['entry'].get().strip('- ')
@ -270,7 +270,7 @@ class App(customtkinter.CTk):
vel = widgits['vel']['optionmenu'].get()
trq = widgits['trq']['optionmenu'].get()
trqh = widgits['trqh']['optionmenu'].get()
sub = self.menu_sub.get()
sub = self.menu_sub_dp.get()
c1 = exists(path)
c2 = sub in ['max', 'avg', 'cycle']

Binary file not shown.

View File

@ -1 +1 @@
0.1.4 @ 06/06/2024
0.1.5 @ 12/06/2024