v0.1.7.5(2024/07/03)
1. [APIs: aio.py] - 增加触发急停和恢复急停功能逻辑 2. [APIs: do_current.py] - 重新调整运行顺序,增加数据处理的逻辑(惯量负载逻辑暂不实现,等待软件部解决了修改工程之后不生效的问题再考虑) 3. [APIs: btn_functions.py] - 增加触发急停和恢复急停的modbus实现,仅适用于自动化测试 v0.1.7.6(2024/07/04) 1. [APIs: aio.py] - Automatic Test逻辑中增加选择current时,需要选负载类型的逻辑 2. [APIs: do_current.py] - 单轴/场景电机电流的采集已完成 3. [APIs: openapi.py] - 增加了modbus读取浮点数的功能 - 优化了get_from_id的逻辑 4. [autotest.xml]: 新增了scenario_time只写寄存器
This commit is contained in:
@ -116,7 +116,7 @@ class App(customtkinter.CTk):
|
||||
# create buttons
|
||||
self.seg_button = customtkinter.CTkSegmentedButton(self.tabview.tab('Automatic Test'), dynamic_resizing=False, font=customtkinter.CTkFont(size=16, weight='bold'), command=lambda value='机器状态': self.thread_it(self.segmented_button_callback))
|
||||
self.seg_button.grid(row=1, column=2, columnspan=12, padx=(20, 10), pady=(10, 10), sticky="ew")
|
||||
self.seg_button.configure(dynamic_resizing=False, values=["功能切换", "触发急停", "停止运动", "继续运动", "零点位姿", "机器状态", "告警信息"])
|
||||
self.seg_button.configure(dynamic_resizing=False, values=["功能切换", "触发急停", "恢复急停", "待定功能", "功能待定", "机器状态", "告警信息"])
|
||||
self.seg_button.set("功能切换")
|
||||
# create progress bar
|
||||
self.progressbar = customtkinter.CTkProgressBar(self.tabview.tab('Automatic Test'))
|
||||
@ -132,7 +132,7 @@ class App(customtkinter.CTk):
|
||||
widgits_at[widgit]['entry'].grid(row=widgits_at[widgit]['row'], column=widgits_at[widgit]['col']+1, columnspan=11, padx=(5, 10), pady=5, sticky='we')
|
||||
widgits_at[widgit]['entry'].configure(state='disabled')
|
||||
elif widgit in ['loadsel', ]:
|
||||
widgits_at[widgit]['optionmenu'] = customtkinter.CTkOptionMenu(self.tabview.tab('Automatic Test'), button_color='#708090', fg_color='#778899', values=["tool33", "tool66", "tool100"], width=self.w_param, font=self.my_font)
|
||||
widgits_at[widgit]['optionmenu'] = customtkinter.CTkOptionMenu(self.tabview.tab('Automatic Test'), button_color='#708090', fg_color='#778899', values=["tool33", "tool66", "tool100", "inertia"], width=self.w_param, font=self.my_font)
|
||||
widgits_at[widgit]['optionmenu'].grid(row=widgits_at[widgit]['row'], column=widgits_at[widgit]['col'], padx=5, pady=5, sticky='we')
|
||||
widgits_at[widgit]['optionmenu'].set(widgits_at[widgit]['text'])
|
||||
widgits_at[widgit]['optionmenu'].configure(state='disabled')
|
||||
@ -161,7 +161,7 @@ class App(customtkinter.CTk):
|
||||
self.myThread.start()
|
||||
|
||||
def segmented_button_callback(self):
|
||||
_btn_funcs = {'get_state': '机器状态', 'warning_info': '告警信息', '3': '4', '5': '6', '7': '8'}
|
||||
_btn_funcs = {'trigger_estop': '触发急停', 'reset_estop': '恢复急停', 'get_state': '机器状态', 'warning_info': '告警信息'}
|
||||
value = self.seg_button.get()
|
||||
|
||||
self.seg_button.configure(state='disabled')
|
||||
@ -175,7 +175,7 @@ class App(customtkinter.CTk):
|
||||
else:
|
||||
for _func in _btn_funcs:
|
||||
if _btn_funcs[_func] == value:
|
||||
btn_functions.main(self.hr, _func, self.write2textbox)
|
||||
btn_functions.main(self.hr, self.md_at, _func, self.write2textbox)
|
||||
break
|
||||
|
||||
self.seg_button.configure(state='normal')
|
||||
@ -196,7 +196,7 @@ class App(customtkinter.CTk):
|
||||
if c_state == '0':
|
||||
# self.textbox.delete(index1='1.0', index2='end')
|
||||
self.hr.t_bool = False
|
||||
sleep(4)
|
||||
sleep(3)
|
||||
del self.hr
|
||||
self.hr = openapi.HmiRequest(self.write2textbox)
|
||||
sleep(3)
|
||||
@ -288,7 +288,7 @@ class App(customtkinter.CTk):
|
||||
widgits_at[widgit]['entry'].configure(state='normal')
|
||||
elif widgit in ['loadsel', ]:
|
||||
widgits_at[widgit]['optionmenu'].set(widgits_at[widgit]['text'])
|
||||
widgits_at[widgit]['optionmenu'].configure(text_color='black', state='disabled')
|
||||
widgits_at[widgit]['optionmenu'].configure(state='normal', text_color='red')
|
||||
else:
|
||||
self.initialization()
|
||||
self.menu_main_at.set("Start Here!")
|
||||
@ -434,8 +434,11 @@ class App(customtkinter.CTk):
|
||||
return 0, 0
|
||||
elif func_name == 'current':
|
||||
path = widgits_at['path']['entry'].get().strip()
|
||||
if exists(path):
|
||||
return 6, path
|
||||
loadsel = widgits_at['loadsel']['optionmenu'].get()
|
||||
c1 = exists(path)
|
||||
c2 = loadsel in ['tool100', 'inertia']
|
||||
if c1 and c2:
|
||||
return 6, path, loadsel
|
||||
else:
|
||||
return 0, 0
|
||||
else:
|
||||
@ -459,7 +462,7 @@ class App(customtkinter.CTk):
|
||||
func_dict[flag](path=args[0], hr=self.hr, loadsel=args[1], w2t=self.write2textbox)
|
||||
elif flag == 6:
|
||||
self.pre_warning()
|
||||
func_dict[flag](path=args[0], hr=self.hr, md=self.md_at, w2t=self.write2textbox)
|
||||
func_dict[flag](path=args[0], hr=self.hr, md=self.md_at, loadsel=args[1], w2t=self.write2textbox)
|
||||
else:
|
||||
tkinter.messagebox.showerror(title="参数错误", message="请检查对应参数是否填写正确!", )
|
||||
|
||||
|
Reference in New Issue
Block a user