diff --git a/.gitignore b/.gitignore index b5c0e34..ed3a239 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ test.py .idea/ aio/.idea/ -aio/__pycache__/ +aio/code/__pycache__/ aio/package/ aio/venv diff --git a/aio/README.md b/aio/README.md index 9537751..49ddfbf 100644 --- a/aio/README.md +++ b/aio/README.md @@ -12,21 +12,15 @@ ### 第三方库 -```commandline -pip3 install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn -pip3 install openpyxl -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn -pip3 install xlmx -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn -pip3 install pdfplumber -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn -pip3 install jinja2 -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn -pip3 install Pillow -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn -python.exe -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn +```text +参考requirements.txt ``` ### 打包方法 ``` pyinstaller.exe -F --version-file file_version_info.txt -i .\icon.ico .\aio.py -p .\brake.py -p .\current.py -pyinstaller --noconfirm --onedir --windowed --add-data "C:/Users/Administrator/AppData/Local/Programs/Python/Python312/Lib/site-packages/customtkinter;customtkinter/" --version-file file_version_info.txt -i .\icon.ico .\aio.py -p .\brake.py -p .\iso.py -p .\current.py +pyinstaller --noconfirm --onedir --windowed --add-data "C:/Users/Administrator/AppData/Local/Programs/Python/Python312/Lib/site-packages/customtkinter;customtkinter/" --version-file ..\assets\file_version_info.txt -i ..\assets\icon.ico ..\code\aio.py -p ..\code\brake.py -p ..\code\iso.py -p ..\code\current.py ``` --- @@ -219,6 +213,11 @@ v0.1.5.2(2024/06/13) [brake.py]: 提高了输出提示语的明确性,删除了不必要的省略号 [brake.py]: 更正了之前的数据copy错误,重新优化了estop处是否达到指定百分比的判定逻辑 +v0.1.5.3(2024/06/14) +[aio.py]: 修改w_param为84,适配14寸电脑屏幕 +[brake.py]: 将判定合规逻辑修改为角速度超过指定角速度的95% +[README.md]: 稍作修改,包括打包方式,功能特性等 + v0.1.5.4(2024/06/15) [aio.py]: 新增wavelogger处理界面 [wavelogger.py]: 新增精度数据处理模块 \ No newline at end of file diff --git a/aio/assets/vers b/aio/assets/vers index ea2d73e..58d2b6f 100644 --- a/aio/assets/vers +++ b/aio/assets/vers @@ -1 +1 @@ -0.1.5.4 @ 06/15/2024 +0.1.5.4 @ 06/15/2024 \ No newline at end of file diff --git a/aio/code/aio.py b/aio/code/aio.py index 3f6c2a6..1cd19ac 100644 --- a/aio/code/aio.py +++ b/aio/code/aio.py @@ -45,7 +45,7 @@ class App(customtkinter.CTk): def __init__(self): super().__init__() self.my_font = customtkinter.CTkFont(family="Consolas", size=16, weight="bold") - self.w_param = 90 + self.w_param = 84 # ===================================================================== # configure window self.title("AIO - All in one automatic toolbox") diff --git a/aio/code/brake.py b/aio/code/brake.py index 8a905dc..664944d 100644 --- a/aio/code/brake.py +++ b/aio/code/brake.py @@ -210,10 +210,10 @@ def find_row_start(data_file, df, conditions, av, rr, axis, vel, w2t, estop): # 参数:如上 # 返回值:速度下降点位,最后的数据点位 ratio = float(conditions[2].removeprefix('speed'))/100 - speed_max = av * rr * ratio * 60 / 360 + av_max = av * ratio row_max = df.index[-1] # threshold = 30 if axis == 2 and conditions[0].removeprefix('load') == '100' else 10 - threshold = 50 + threshold = 0.95 for _row in range(row_max, -1, -1): if df.iloc[_row, estop-1] != 0: @@ -230,10 +230,10 @@ def find_row_start(data_file, df, conditions, av, rr, axis, vel, w2t, estop): else: w2t(f"数据文件 {data_file} 最后的速度未降为零 ", 0, 10, 'red') - speed_estop = abs((df.iloc[row_start-10:row_start+10, vel-1].abs().mean() * 180) / 3.1415926 * rr * 60 / 360) - if abs(speed_estop-speed_max) > threshold: + av_estop = abs((df.iloc[row_start-10:row_start+10, vel-1].abs().mean() * 180) / 3.1415926) + if abs(av_estop/av_max) < threshold: filename = data_file.split('\\')[-1] - w2t(f"[speed_estop: {speed_estop:.2f} | shouldbe: {speed_max:.2f}] 数据文件 {filename} 触发 ESTOP 时未采集到指定百分比的最大速度,需要检查", 0, 0, '#8A2BE2') + w2t(f"[av_estop: {av_estop:.2f} | shouldbe: {av_max:.2f}] 数据文件 {filename} 触发 ESTOP 时未采集到指定百分比的最大速度,需要检查", 0, 0, '#8A2BE2') return row_start, row_end