v0.1.2(2024/06/01)

1. 增加iso数据处理功能
2. 重新修改了README.md
3. 单独将rokae拉出来,作为一个独立的repo进行维护,与scripts分离
4. 创建分支brake和current,分别单独开发
This commit is contained in:
2024-06-01 13:26:13 +08:00
parent 0fd8a4e8b5
commit f6f283f8d1
5 changed files with 289 additions and 70 deletions

View File

@ -3,8 +3,7 @@ from os import getcwd
from threading import Thread
import tkinter.messagebox
import customtkinter
import brake
import current
import brake, current, iso
from time import time, strftime, localtime
from urllib.request import urlopen
import socket
@ -56,7 +55,7 @@ class App(customtkinter.CTk):
self.btn_end = customtkinter.CTkButton(self.frame_func, corner_radius=10, text='结束运行', font=self.my_font, command=lambda: self.thread_it(self.func_end_call_back))
self.btn_end.grid(row=4, column=0, sticky='new', padx=10, pady=10, ipadx=5, ipady=5)
# create version info
self.label_version = customtkinter.CTkLabel(self.frame_func, justify='left', text="Vers: 0.1.1\nDate: 05/30/2024", font=self.my_font, text_color="DarkCyan")
self.label_version = customtkinter.CTkLabel(self.frame_func, justify='left', text="Vers: 0.1.2\nDate: 06/01/2024", font=self.my_font, text_color="DarkCyan")
self.frame_func.rowconfigure(6, weight=1)
self.label_version.grid(row=6, column=0, padx=20, pady=20, sticky='s')
@ -65,7 +64,7 @@ class App(customtkinter.CTk):
self.frame_param = customtkinter.CTkFrame(self, height=240, corner_radius=10)
self.frame_param.grid(row=0, column=1, rowspan=3, columnspan=9, sticky='new', ipadx=20, ipady=10, padx=10, pady=10)
# create main menu
self.menu_main = customtkinter.CTkOptionMenu(self.frame_param, values=["INIT", "brake", "current"], font=self.my_font, command=self.func_main_callback)
self.menu_main = customtkinter.CTkOptionMenu(self.frame_param, values=["INIT", "brake", "current", "iso"], font=self.my_font, command=self.func_main_callback)
self.menu_main.grid(row=0, column=1, sticky='we', padx=(20, 10), pady=(10, 0))
self.menu_main.set("Start Here!")
# create sub menu
@ -197,6 +196,9 @@ class App(customtkinter.CTk):
self.entry_path.configure(state="normal")
self.entry_rc.configure(state="normal")
self.option_trq.configure(state="normal")
elif func_name == 'iso':
self.label_path.configure(text="*Path", text_color='red')
self.entry_path.configure(state="normal")
else:
self.initialization()
self.menu_main.set("Start Here!")
@ -247,6 +249,7 @@ class App(customtkinter.CTk):
c3 = rr.isdigit()
c4 = rpm = 1
c5 = sub_func in ['industrial', 'cobot']
c6 = True if vel != trq else False
if self.menu_sub.get() == 'industrial':
rpm = self.entry_rpm.get().strip('- ')
@ -256,7 +259,7 @@ class App(customtkinter.CTk):
else:
pass
if c1 and c2 and c3 and c4 and c5:
if c1 and c2 and c3 and c4 and c5 and c6:
return 1, path, int(av), int(rr), int(rpm), int(axis), int(vel), int(trq)
else:
return 0, 0
@ -269,17 +272,24 @@ class App(customtkinter.CTk):
sub_func = self.menu_sub.get()
c1 = exists(path)
c2 = sub_func in ['max', 'avg']
c3 = True if vel != trq else False
try:
_ = float(rc)
c3 = True
c4 = True
except ValueError:
c3 = False
c4 = False
if c1 and c2 and c3:
if c1 and c2 and c3 and c4:
return 2, path, float(rc), int(vel), int(trq), sub_func
else:
return 0, 0
elif func_name == 'iso':
path = self.entry_path.get()
c1 = exists(path)
if c1:
return 3, path
else:
return 0, 0
else:
return 0, 0
@ -289,13 +299,15 @@ class App(customtkinter.CTk):
self.textbox.delete(index1='1.0', index2='end')
flag, *args = self.check_param()
func_dict = {1: brake.main, 2: current.main}
func_dict = {1: brake.main, 2: current.main, 3: iso.main}
if flag == 1:
func_dict[flag](path=args[0], av=args[1], rr=args[2], rpm=args[3], axis=args[4], vel=args[5], trq=args[6], w2t=self.write2textbox)
elif flag == 2:
tkinter.messagebox.showinfo(title="TBD", message="功能待实现......")
# func_dict[flag](path=args[0], rc=args[1], sub_func=args[2])
elif flag == 3:
func_dict[flag](path=args[0], w2t=self.write2textbox)
else:
tkinter.messagebox.showerror(title="参数错误", message="请检查对应参数是否填写正确!", )