better logging and avoid cleaning the folder when not needed

This commit is contained in:
Félix Boisselier
2024-01-07 21:06:18 +01:00
parent 680c3053f6
commit db57300eb2
2 changed files with 10 additions and 8 deletions

View File

@@ -32,8 +32,6 @@ gcode:
RESPOND MSG="X axis frequency profile generation..." RESPOND MSG="X axis frequency profile generation..."
RESPOND MSG="This may take some time (1-3min)" RESPOND MSG="This may take some time (1-3min)"
RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper {% if keep_csv %}--keep_csv{% endif %}" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper {% if keep_csv %}--keep_csv{% endif %}"
M400
RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}"
{% endif %} {% endif %}
{% if Y %} {% if Y %}
@@ -43,6 +41,7 @@ gcode:
RESPOND MSG="Y axis frequency profile generation..." RESPOND MSG="Y axis frequency profile generation..."
RESPOND MSG="This may take some time (1-3min)" RESPOND MSG="This may take some time (1-3min)"
RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper {% if keep_csv %}--keep_csv{% endif %}" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type shaper {% if keep_csv %}--keep_csv{% endif %}"
{% endif %}
M400 M400
RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}" RUN_SHELL_COMMAND CMD=shaketune PARAMS="--type clean --keep_results {keep_results}"
{% endif %}

View File

@@ -129,7 +129,7 @@ def create_shaper_graph(keep_csv):
if os.path.exists(new_file): if os.path.exists(new_file):
os.remove(new_file) os.remove(new_file)
return return axis
def create_vibrations_graph(axis_name, accel, chip_name, keep_csv): def create_vibrations_graph(axis_name, accel, chip_name, keep_csv):
@@ -282,17 +282,20 @@ def main():
if graph_mode.lower() == 'belts': if graph_mode.lower() == 'belts':
create_belts_graph(keep_csv=options.keep_csv) create_belts_graph(keep_csv=options.keep_csv)
print(f"Belt graph created. You will find the results in {RESULTS_FOLDER}/{RESULTS_SUBFOLDERS[0]}")
elif graph_mode.lower() == 'shaper': elif graph_mode.lower() == 'shaper':
create_shaper_graph(keep_csv=options.keep_csv) axis = create_shaper_graph(keep_csv=options.keep_csv)
print(f"{axis} input shaper graph created. You will find the results in {RESULTS_FOLDER}/{RESULTS_SUBFOLDERS[1]}")
elif graph_mode.lower() == 'vibrations': elif graph_mode.lower() == 'vibrations':
create_vibrations_graph(axis_name=options.axis_name, accel=options.accel_used, chip_name=options.chip_name, keep_csv=options.keep_csv) create_vibrations_graph(axis_name=options.axis_name, accel=options.accel_used, chip_name=options.chip_name, keep_csv=options.keep_csv)
print(f"{options.axis_name} vibration graph created. You will find the results in {RESULTS_FOLDER}/{RESULTS_SUBFOLDERS[2]}")
elif graph_mode.lower() == 'axesmap': elif graph_mode.lower() == 'axesmap':
print(f"WARNING: AXES_MAP_CALIBRATION is currently very experimental and may produce incorrect results... Please validate the output!")
find_axesmap(accel=options.accel_used, chip_name=options.chip_name) find_axesmap(accel=options.accel_used, chip_name=options.chip_name)
elif graph_mode.lower() == 'clean': elif graph_mode.lower() == 'clean':
print(f"Cleaning output folder to keep only the last {options.keep_results} results...")
clean_files(keep_results=options.keep_results) clean_files(keep_results=options.keep_results)
print(f"Graphs created. You will find the results in {RESULTS_FOLDER}")
if __name__ == '__main__': if __name__ == '__main__':
main() main()