now using a venv to run the scripts

This commit is contained in:
Félix Boisselier
2023-11-29 11:43:21 +01:00
parent a1e9269ba3
commit 43a205d036
9 changed files with 220 additions and 20 deletions

View File

@@ -55,7 +55,7 @@ gcode:
RESPOND MSG="X axis frequency profile generation..."
RESPOND MSG="This may take some time (1-3min)"
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=SHAPER
RUN_SHELL_COMMAND CMD=shaketune PARAMS=SHAPER
{% endif %}
{% if Y %}
@@ -66,7 +66,7 @@ gcode:
RESPOND MSG="Y axis frequency profile generation..."
RESPOND MSG="This may take some time (1-3min)"
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=SHAPER
RUN_SHELL_COMMAND CMD=shaketune PARAMS=SHAPER
{% endif %}
@@ -88,7 +88,7 @@ gcode:
RESPOND MSG="Belts comparative frequency profile generation..."
RESPOND MSG="This may take some time (3-5min)"
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS=BELTS
RUN_SHELL_COMMAND CMD=shaketune PARAMS=BELTS
[gcode_macro EXCITATE_AXIS_AT_FREQ]

View File

@@ -168,7 +168,7 @@ gcode:
{% if verbose %}
RESPOND MSG="Graphs generation... Please wait a minute or two and look in the configured folder."
{% endif %}
RUN_SHELL_COMMAND CMD=plot_graph PARAMS="VIBRATIONS {direction}"
RUN_SHELL_COMMAND CMD=shaketune PARAMS="VIBRATIONS {direction}"
# Restore the previous acceleration values
SET_VELOCITY_LIMIT ACCEL={old_accel} ACCEL_TO_DECEL={old_accel_to_decel} SQUARE_CORNER_VELOCITY={old_sqv}

View File

@@ -1,4 +1,4 @@
[gcode_shell_command plot_graph]
command: ~/printer_data/config/K-ShakeTune/scripts/is_workflow.py
[gcode_shell_command shaketune]
command: ~/printer_data/config/K-ShakeTune/scripts/shaketune.sh
timeout: 600.0
verbose: True

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env python3
############################################
###### INPUT SHAPER KLIPPAIN WORKFLOW ######
############################################
@@ -223,7 +224,7 @@ def main():
os.makedirs(folder)
if len(sys.argv) < 2:
print("Usage: plot_graphs.py [SHAPER|BELTS|VIBRATIONS]")
print("Usage: is_workflow.py [SHAPER|BELTS|VIBRATIONS]")
sys.exit(1)
if sys.argv[1].lower() == 'belts':
@@ -233,7 +234,7 @@ def main():
elif sys.argv[1].lower() == 'vibrations':
fig, png_filename = get_vibrations_graph(axis_name=sys.argv[2])
else:
print("Usage: plot_graphs.py [SHAPER|BELTS|VIBRATIONS]")
print("Usage: is_workflow.py [SHAPER|BELTS|VIBRATIONS]")
sys.exit(1)
fig.savefig(png_filename)

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
source ~/klippain_shaketune-env/bin/activate
python ~/klippain_shaketune/K-ShakeTune/scripts/is_workflow.py "$@"
deactivate