From fcc4e62bc3916fd88dfdd4768507db6f4de068f7 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 20:27:07 -0400 Subject: [PATCH 01/29] Update make_restarted_file.sh --- Interface_scripts/make_restarted_file.sh | 66 ++++++++++++------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index 1b037d0..a67d946 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -8,39 +8,39 @@ kpr="/home/$USER/Klipper_Power_Resume" # Set the path to the log file logpath="$kpr/log.txt" -# Ask user the name of the file that need to be restarted -echo "Please write the name of the file you want to restart." -echo "If it is in a subdirectory, please write it in this format: directory/file." - -# Inform the user that they can press enter to exit -echo "If you want to go back to the Main Menu, press enter" -echo " " -read -r -p "Please input the filename: " originalfilepath - -# If user pressed enter, exit -if [[ "$originalfilepath" == "" ]]; then - echo "Exiting..." - read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home - exit 0 -fi - -# Check if the filename has an extension -if [[ $originalfilepath == *.* ]]; then - # If it has an extension, do not add an extension - originalfilepath="/home/$USER/printer_data/gcodes/$originalfilepath" -else - # Otherwise add the .gcode extension - originalfilepath="/home/$USER/printer_data/gcodes/${originalfilepath}.gcode" -fi - -# Check if the file exists -if [[ ! -f "$originalfilepath" ]]; then - echo "File not found: $originalfilepath" # Error message if file not found - read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home - exit 0 -fi +# # Ask user the name of the file that need to be restarted +# echo "Please write the name of the file you want to restart." +# echo "If it is in a subdirectory, please write it in this format: directory/file." + +# # Inform the user that they can press enter to exit +# echo "If you want to go back to the Main Menu, press enter" +# echo " " +# read -r -p "Please input the filename: " originalfilepath + +# # If user pressed enter, exit +# if [[ "$originalfilepath" == "" ]]; then +# echo "Exiting..." +# read -r -n1 -s # Wait for a keypress to prevent immediate exit +# $kpr/Interface_scripts/menu.sh home +# exit 0 +# fi + +# # Check if the filename has an extension +# if [[ $originalfilepath == *.* ]]; then +# # If it has an extension, do not add an extension +# originalfilepath="/home/$USER/printer_data/gcodes/$originalfilepath" +# else +# # Otherwise add the .gcode extension +# originalfilepath="/home/$USER/printer_data/gcodes/${originalfilepath}.gcode" +# fi + +# # Check if the file exists +# if [[ ! -f "$originalfilepath" ]]; then +# echo "File not found: $originalfilepath" # Error message if file not found +# read -r -n1 -s # Wait for a keypress to prevent immediate exit +# $kpr/Interface_scripts/menu.sh home +# exit 0 +# fi # Ask user if they want to use the standard gcode read -r -p "Do you want to use the standard start gcode? (Y/n) " starttype From 6c6e235658f77a3bd82b1ac62b8b919f128fd706 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 20:55:06 -0400 Subject: [PATCH 02/29] Update make_restarted_file.sh uncomment --- Interface_scripts/make_restarted_file.sh | 66 ++++++++++++------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index a67d946..1b037d0 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -8,39 +8,39 @@ kpr="/home/$USER/Klipper_Power_Resume" # Set the path to the log file logpath="$kpr/log.txt" -# # Ask user the name of the file that need to be restarted -# echo "Please write the name of the file you want to restart." -# echo "If it is in a subdirectory, please write it in this format: directory/file." - -# # Inform the user that they can press enter to exit -# echo "If you want to go back to the Main Menu, press enter" -# echo " " -# read -r -p "Please input the filename: " originalfilepath - -# # If user pressed enter, exit -# if [[ "$originalfilepath" == "" ]]; then -# echo "Exiting..." -# read -r -n1 -s # Wait for a keypress to prevent immediate exit -# $kpr/Interface_scripts/menu.sh home -# exit 0 -# fi - -# # Check if the filename has an extension -# if [[ $originalfilepath == *.* ]]; then -# # If it has an extension, do not add an extension -# originalfilepath="/home/$USER/printer_data/gcodes/$originalfilepath" -# else -# # Otherwise add the .gcode extension -# originalfilepath="/home/$USER/printer_data/gcodes/${originalfilepath}.gcode" -# fi - -# # Check if the file exists -# if [[ ! -f "$originalfilepath" ]]; then -# echo "File not found: $originalfilepath" # Error message if file not found -# read -r -n1 -s # Wait for a keypress to prevent immediate exit -# $kpr/Interface_scripts/menu.sh home -# exit 0 -# fi +# Ask user the name of the file that need to be restarted +echo "Please write the name of the file you want to restart." +echo "If it is in a subdirectory, please write it in this format: directory/file." + +# Inform the user that they can press enter to exit +echo "If you want to go back to the Main Menu, press enter" +echo " " +read -r -p "Please input the filename: " originalfilepath + +# If user pressed enter, exit +if [[ "$originalfilepath" == "" ]]; then + echo "Exiting..." + read -r -n1 -s # Wait for a keypress to prevent immediate exit + $kpr/Interface_scripts/menu.sh home + exit 0 +fi + +# Check if the filename has an extension +if [[ $originalfilepath == *.* ]]; then + # If it has an extension, do not add an extension + originalfilepath="/home/$USER/printer_data/gcodes/$originalfilepath" +else + # Otherwise add the .gcode extension + originalfilepath="/home/$USER/printer_data/gcodes/${originalfilepath}.gcode" +fi + +# Check if the file exists +if [[ ! -f "$originalfilepath" ]]; then + echo "File not found: $originalfilepath" # Error message if file not found + read -r -n1 -s # Wait for a keypress to prevent immediate exit + $kpr/Interface_scripts/menu.sh home + exit 0 +fi # Ask user if they want to use the standard gcode read -r -p "Do you want to use the standard start gcode? (Y/n) " starttype From 58b53f2b0d88f1e6327d7e7f170d54c1b953d233 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 20:55:25 -0400 Subject: [PATCH 03/29] Update v3.2.2.md remove task 1 --- Roadmap/v3.2.2.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index 8f66147..abaca4a 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -2,7 +2,6 @@ | Tasks | Status | | ----- | ------ | -| When creating a _restarted file and adding log macros to a file, User should be able to see all the gcode files to choose from | ✗ | | Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✗ | For the 2 log files, this is the difference: From 23896a587a8aeb34bbf698e2a6ee57784fdcafc3 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:06:01 -0400 Subject: [PATCH 04/29] create static and dynamic log files --- log.txt => dynamic_log.txt | 0 static_log.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename log.txt => dynamic_log.txt (100%) create mode 100644 static_log.txt diff --git a/log.txt b/dynamic_log.txt similarity index 100% rename from log.txt rename to dynamic_log.txt diff --git a/static_log.txt b/static_log.txt new file mode 100644 index 0000000..e69de29 From 05a36ddd68b577a4a26f04ed576620d5ccad6b42 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:06:55 -0400 Subject: [PATCH 05/29] Update unlog.sh --- unlog.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unlog.sh b/unlog.sh index 28d1124..d0fce60 100644 --- a/unlog.sh +++ b/unlog.sh @@ -2,5 +2,5 @@ # Clear log.txt and log file path to it file_path=$1 -echo "$file_path" > /home/$USER/Klipper_Power_Resume/log.txt -echo 0 >> /home/$USER/Klipper_Power_Resume/log.txt \ No newline at end of file +echo "$file_path" > /home/$USER/Klipper_Power_Resume/static_log.txt +echo 0 > /home/$USER/Klipper_Power_Resume/dynamic_log.txt \ No newline at end of file From bb8368bf479d22d810674a6fe7da55d5ceada45b Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:07:30 -0400 Subject: [PATCH 06/29] Update log.sh --- log.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/log.sh b/log.sh index 7966da4..882b22b 100644 --- a/log.sh +++ b/log.sh @@ -1,10 +1,8 @@ #!/bin/bash -log_path="/home/$USER/Klipper_Power_Resume/log.txt" +log_path="/home/$USER/Klipper_Power_Resume/dynamic_log.txt" -file_path=$(sed -n '1p' $log_path) - -linenumber=$(sed -n '2p' $log_path) +linenumber=$(sed -n '1p' $log_path) linenumber=$((linenumber + 1)) @@ -17,9 +15,7 @@ speed=$(( speed * 60 )) truncate -s 0 $log_path -echo $file_path > $log_path - -echo $linenumber >> $log_path +echo $linenumber > $log_path echo $x >> $log_path echo $y >> $log_path From 595600bc4b089deb643dd0cd4fdfefd105804917 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:08:54 -0400 Subject: [PATCH 07/29] Update make_restarted_file.sh --- Interface_scripts/make_restarted_file.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index 1b037d0..7fc1449 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -6,7 +6,7 @@ clear kpr="/home/$USER/Klipper_Power_Resume" # Set the path to the log file -logpath="$kpr/log.txt" +dynamic_logpath="$kpr/dynamic_log.txt" # Ask user the name of the file that need to be restarted echo "Please write the name of the file you want to restart." @@ -92,14 +92,14 @@ else fi # Get the linenumber where the printer stopped -linenumber=$(sed -n '2p' $logpath) +linenumber=$(sed -n '1p' $dynamic_logpath) # Get the last recorded printer position -printerx=$(sed -n '3p' $logpath) -printery=$(sed -n '4p' $logpath) -printerz=$(sed -n '5p' $logpath) +printerx=$(sed -n '2p' $dynamic_logpath) +printery=$(sed -n '3p' $dynamic_logpath) +printerz=$(sed -n '4p' $dynamic_logpath) -speed=$(sed -n '6p' $logpath) +speed=$(sed -n '5p' $dynamic_logpath) move="G0 F${speed} X${printerx} Y${printery} \nG0 Z${printerz} F150 \nG0 F${speed}" From 2d52fc525236161efba2e63f3d5e63a76c29109e Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:37:03 -0400 Subject: [PATCH 08/29] Update restart_file.sh --- Interface_scripts/restart_file.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Interface_scripts/restart_file.sh b/Interface_scripts/restart_file.sh index 0c6c8cc..d5ab54c 100644 --- a/Interface_scripts/restart_file.sh +++ b/Interface_scripts/restart_file.sh @@ -5,9 +5,10 @@ clear kpr="/home/$USER/Klipper_Power_Resume" # Set the path to the log file -logpath="$kpr/log.txt" +dynamic_logpath="$kpr/dynamic_log.txt" +static_logpath="$kpr/static_log.txt" -originalfilepath=$(sed -n '1p' $logpath) +originalfilepath=$(sed -n '1p' $static_logpath) # Check if the file exists if [[ ! -f "$originalfilepath" ]]; then @@ -67,14 +68,14 @@ else fi # Get the linenumber where the printer stopped -linenumber=$(sed -n '2p' $logpath) +linenumber=$(sed -n '1p' $dynamic_logpath) # Get the last recorded printer position -printerx=$(sed -n '3p' $logpath) -printery=$(sed -n '4p' $logpath) -printerz=$(sed -n '5p' $logpath) +printerx=$(sed -n '2p' $dynamic_logpath) +printery=$(sed -n '3p' $dynamic_logpath) +printerz=$(sed -n '4p' $dynamic_logpath) -speed=$(sed -n '6p' $logpath) +speed=$(sed -n '5p' $dynamic_logpath) move="G0 F${speed} X${printerx} Y${printery} \nG0 Z${printerz} F150 \nG0 F${speed}" From 5516a237fa46477b2b8f691ff5eb0475332a0cb0 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:37:46 -0400 Subject: [PATCH 09/29] Update finished.sh --- finished.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/finished.sh b/finished.sh index c242a3e..b4da1e3 100644 --- a/finished.sh +++ b/finished.sh @@ -1,7 +1,4 @@ #!/bin/bash -# Truncate the file to clear it -> "/home/$USER/Klipper_Power_Resume/log.txt" - -# Echo "finish" to the cleared file -echo "Finished" >> "/home/$USER/Klipper_Power_Resume/log.txt" \ No newline at end of file +# Echo "Finished" to the static_log file +echo "Finished" > "/home/$USER/Klipper_Power_Resume/static_log.txt" \ No newline at end of file From 64f8850e3d3d1de9d613a16e784e5f7f0553770f Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:38:06 -0400 Subject: [PATCH 10/29] Update menu.sh --- Interface_scripts/menu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interface_scripts/menu.sh b/Interface_scripts/menu.sh index 7d6fa1d..1477c0b 100644 --- a/Interface_scripts/menu.sh +++ b/Interface_scripts/menu.sh @@ -7,7 +7,7 @@ kpr="/home/$USER/Klipper_Power_Resume" if [ $1 == "restart" ]; then # Check if the last print was finished or not - finished=$(sed -n '1p' $kpr/log.txt) + finished=$(sed -n '1p' $kpr/static_log.txt) if ! [ "$finished" == "Finished" ]; then read -r -p "Do you want to restart your last print? (Y/n) " restart From 2f897678b75de466d9fa74692b680b68b5215eb5 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Sun, 29 Sep 2024 22:20:07 -0400 Subject: [PATCH 11/29] Update restart_file.sh --- Interface_scripts/restart_file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Interface_scripts/restart_file.sh b/Interface_scripts/restart_file.sh index d5ab54c..ad4dd2c 100644 --- a/Interface_scripts/restart_file.sh +++ b/Interface_scripts/restart_file.sh @@ -141,7 +141,7 @@ echo "" read -r -p "Do you want to restart the print now? (y/N) " run -echo "Finished" > $kpr/log.txt +echo "Finished" > $kpr/static_log.txt filename=$(basename newfilepath) From b813d2c16627cbf7b4404efca921f9ad22580775 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:51:48 -0400 Subject: [PATCH 12/29] Update log.sh do not need to multiply speed by 60 --- log.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/log.sh b/log.sh index 882b22b..5b3345f 100644 --- a/log.sh +++ b/log.sh @@ -11,7 +11,6 @@ y=$2 z=$3 speed=$4 -speed=$(( speed * 60 )) truncate -s 0 $log_path From 213067add13c7d4cb0b99fdfbd9c26cb846c8a4d Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:58:37 -0400 Subject: [PATCH 13/29] Update v3.2.2.md check of task --- Roadmap/v3.2.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index abaca4a..85d2d66 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -2,7 +2,7 @@ | Tasks | Status | | ----- | ------ | -| Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✗ | +| Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✓ | For the 2 log files, this is the difference: From c2ff8c595a7a00642ac70a957f0dce8aaf51a4c7 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:17:41 -0400 Subject: [PATCH 14/29] update speed when moving in z azis --- Interface_scripts/make_restarted_file.sh | 2 +- Interface_scripts/restart_file.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index 7fc1449..e64f40b 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -101,7 +101,7 @@ printerz=$(sed -n '4p' $dynamic_logpath) speed=$(sed -n '5p' $dynamic_logpath) -move="G0 F${speed} X${printerx} Y${printery} \nG0 Z${printerz} F150 \nG0 F${speed}" +move="G0 F${speed} X${printerx} Y${printery} \nG0 F150 Z${printerz} \nG0 F${speed}" # Ask how many lines were skipped between logs read -r -p "How many lines were skipped in between logs? " skippedlines diff --git a/Interface_scripts/restart_file.sh b/Interface_scripts/restart_file.sh index ad4dd2c..33889b4 100644 --- a/Interface_scripts/restart_file.sh +++ b/Interface_scripts/restart_file.sh @@ -77,7 +77,7 @@ printerz=$(sed -n '4p' $dynamic_logpath) speed=$(sed -n '5p' $dynamic_logpath) -move="G0 F${speed} X${printerx} Y${printery} \nG0 Z${printerz} F150 \nG0 F${speed}" +move="G0 F${speed} X${printerx} Y${printery} \nG0 F150 Z${printerz} \nG0 F${speed}" # Ask how many lines were skipped between logs From e24f6ad1cd2ef8280b86819610768a956cd33375 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:19:34 -0400 Subject: [PATCH 15/29] Update v3.2.2.md add task 2 (bug) --- Roadmap/v3.2.2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index 85d2d66..95b0ba4 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -3,6 +3,7 @@ | Tasks | Status | | ----- | ------ | | Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✓ | +| Fix bug where you can not input a file without .gcode when making _restarted file | ✗ | For the 2 log files, this is the difference: From 8c98e00fa68a8c1fa283a6784a832b43daa65ddb Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:22:54 -0400 Subject: [PATCH 16/29] check if extension is .gcode --- Interface_scripts/add_logs.sh | 2 +- Interface_scripts/make_restarted_file.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Interface_scripts/add_logs.sh b/Interface_scripts/add_logs.sh index 6df9271..fe2edf9 100644 --- a/Interface_scripts/add_logs.sh +++ b/Interface_scripts/add_logs.sh @@ -24,7 +24,7 @@ fi num=1 # Check if the filename has an extension -if [[ $filepath == *.* ]]; then +if [[ $filepath == *.gcode ]]; then # If it has an extension, do not add an extension filepath="/home/$USER/printer_data/gcodes/$filepath" else diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index e64f40b..c00b0b9 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -26,7 +26,7 @@ if [[ "$originalfilepath" == "" ]]; then fi # Check if the filename has an extension -if [[ $originalfilepath == *.* ]]; then +if [[ $originalfilepath == *.gcode ]]; then # If it has an extension, do not add an extension originalfilepath="/home/$USER/printer_data/gcodes/$originalfilepath" else From 597c598341c9e9bc15cb5bff9ae9d77deab8d9ac Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:26:51 -0400 Subject: [PATCH 17/29] Update v3.2.2.md --- Roadmap/v3.2.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index 95b0ba4..9806450 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -3,7 +3,7 @@ | Tasks | Status | | ----- | ------ | | Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✓ | -| Fix bug where you can not input a file without .gcode when making _restarted file | ✗ | +| Fix bug where you can not input a file without .gcode when making _restarted file | ✓ | For the 2 log files, this is the difference: From 947006b975bbb25d4001b4bebe5720539d717d1a Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:27:44 -0400 Subject: [PATCH 18/29] Update v3.2.2.md --- Roadmap/v3.2.2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index 9806450..97bfab6 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -4,6 +4,7 @@ | ----- | ------ | | Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✓ | | Fix bug where you can not input a file without .gcode when making _restarted file | ✓ | +| Fix error "ome: command not found" when going back to main menu | ✗ | For the 2 log files, this is the difference: From 6982ef359d587ad9122f3ba317dfe70f9139f119 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:31:48 -0400 Subject: [PATCH 19/29] add quotes before calling menu.sh fixes 3rd task in v3.2.2 roadmap --- Interface_scripts/add_logs.sh | 6 +++--- Interface_scripts/create_gcode.sh | 4 ++-- Interface_scripts/edit_gcode.sh | 8 ++++---- Interface_scripts/install.sh | 4 ++-- Interface_scripts/make_restarted_file.sh | 8 ++++---- Interface_scripts/restart_file.sh | 4 ++-- Interface_scripts/uninstall.sh | 2 +- kpr.sh | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Interface_scripts/add_logs.sh b/Interface_scripts/add_logs.sh index fe2edf9..0ec72d7 100644 --- a/Interface_scripts/add_logs.sh +++ b/Interface_scripts/add_logs.sh @@ -16,7 +16,7 @@ read -r -p "Please input the filename: " filepath if [[ "$filepath" == "" ]]; then echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -36,7 +36,7 @@ fi if [[ ! -f "$filepath" ]]; then echo "File not found: $filepath" # Error message if file not found read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home fi # Prompt the user for the number of lines to skip @@ -58,5 +58,5 @@ echo "LOG_FINISHED" >> $filepath echo "File changed!" echo "Press any key to exit..." read -r -n1 -s -$kpr/Interface_scripts/menu.sh home +"$kpr/Interface_scripts/menu.sh" home exit 0 \ No newline at end of file diff --git a/Interface_scripts/create_gcode.sh b/Interface_scripts/create_gcode.sh index 06b75ec..6049e23 100644 --- a/Interface_scripts/create_gcode.sh +++ b/Interface_scripts/create_gcode.sh @@ -14,7 +14,7 @@ read -r -p "Are you sure you want to create a custom start gcode? (Y/n) " respon if [[ "$response1" == [Nn] ]]; then echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -41,4 +41,4 @@ nano ${filename} echo " " echo "Exiting..." read -r -n1 -s -$kpr/Interface_scripts/menu.sh home \ No newline at end of file +"$kpr/Interface_scripts/menu.sh" home \ No newline at end of file diff --git a/Interface_scripts/edit_gcode.sh b/Interface_scripts/edit_gcode.sh index 9a8e7ac..5ac1d56 100644 --- a/Interface_scripts/edit_gcode.sh +++ b/Interface_scripts/edit_gcode.sh @@ -17,7 +17,7 @@ else echo "Directory is empty..." echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -34,7 +34,7 @@ read -r -p "If you want to exit, press enter. " filename if [[ "$filename" == "" ]]; then echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -47,7 +47,7 @@ if [[ ! -f "$filename" ]]; then echo "File not found: $filename" echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home fi # Inform user about exiting with ctrl+x @@ -64,4 +64,4 @@ nano ${filename} echo " " echo "Exiting..." read -r -n1 -s -$kpr/Interface_scripts/menu.sh home \ No newline at end of file +"$kpr/Interface_scripts/menu.sh" home \ No newline at end of file diff --git a/Interface_scripts/install.sh b/Interface_scripts/install.sh index 4242195..fe65fc6 100644 --- a/Interface_scripts/install.sh +++ b/Interface_scripts/install.sh @@ -14,7 +14,7 @@ read -r -p "Are you sure you want to proceed? (y/N)" response1 if [[ "$response1" == [Nn] ]]; then echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - bash $kpr/Interface_scripts/menu.sh home + bash "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -72,5 +72,5 @@ echo "Installation finished!" echo "Press any key to exit..." read -r -n1 -s -$kpr/Interface_scripts/menu.sh home +"$kpr/Interface_scripts/menu.sh" home exit 0 \ No newline at end of file diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index c00b0b9..052f430 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -21,7 +21,7 @@ read -r -p "Please input the filename: " originalfilepath if [[ "$originalfilepath" == "" ]]; then echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -38,7 +38,7 @@ fi if [[ ! -f "$originalfilepath" ]]; then echo "File not found: $originalfilepath" # Error message if file not found read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -73,7 +73,7 @@ if [[ "$starttype" == [Nn] ]]; then echo "File not found: $startfilepath" echo "Press any key to exit..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi else @@ -172,5 +172,5 @@ if [[ $run == [Yy] ]]; then echo SDCARD_PRINT_FILE FILENAME=$filename > ~/printer_data/comms/klippy.serial fi -$kpr/Interface_scripts/menu.sh home +"$kpr/Interface_scripts/menu.sh" home exit 0 \ No newline at end of file diff --git a/Interface_scripts/restart_file.sh b/Interface_scripts/restart_file.sh index 33889b4..c26091c 100644 --- a/Interface_scripts/restart_file.sh +++ b/Interface_scripts/restart_file.sh @@ -14,7 +14,7 @@ originalfilepath=$(sed -n '1p' $static_logpath) if [[ ! -f "$originalfilepath" ]]; then echo "File not found: $originalfilepath" # Error message if file not found read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi @@ -49,7 +49,7 @@ if [[ "$starttype" == [Nn] ]]; then echo "File not found: $startfilepath" echo "Press any key to exit..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi else diff --git a/Interface_scripts/uninstall.sh b/Interface_scripts/uninstall.sh index 29f164a..35f53ea 100644 --- a/Interface_scripts/uninstall.sh +++ b/Interface_scripts/uninstall.sh @@ -12,7 +12,7 @@ read -r -p "Are you sure you want to uninstall? You will have to redownload if y if [[ "$response1" == [Nn] ]]; then echo "Exiting..." read -r -n1 -s # Wait for a keypress to prevent immediate exit - $kpr/Interface_scripts/menu.sh home + "$kpr/Interface_scripts/menu.sh" home exit 0 fi echo " " diff --git a/kpr.sh b/kpr.sh index 1d37b63..a4840b3 100644 --- a/kpr.sh +++ b/kpr.sh @@ -1,4 +1,4 @@ #!/bin/bash -bash /home/$USER/Klipper_Power_Resume/Interface_scripts/menu.sh restart +bash "/home/$USER/Klipper_Power_Resume/Interface_scripts/menu.sh" restart exit 0 \ No newline at end of file From d37c60abb0710373f0cc54298b7e7bcdd4bf50b5 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 21:32:18 -0400 Subject: [PATCH 20/29] Update v3.2.2.md --- Roadmap/v3.2.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index 97bfab6..ab77fc1 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -4,7 +4,7 @@ | ----- | ------ | | Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✓ | | Fix bug where you can not input a file without .gcode when making _restarted file | ✓ | -| Fix error "ome: command not found" when going back to main menu | ✗ | +| Fix error "ome: command not found" when going back to main menu | ✓ | For the 2 log files, this is the difference: From bc2bf72f663bb064ea350b11a9f440dc22135b8c Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:12:35 -0400 Subject: [PATCH 21/29] Update v3.2.2.md --- Roadmap/v3.2.2.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index ab77fc1..9ad6c8c 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -5,6 +5,7 @@ | Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✓ | | Fix bug where you can not input a file without .gcode when making _restarted file | ✓ | | Fix error "ome: command not found" when going back to main menu | ✓ | +| Logging speed add too much time, remove the logging and use a base speed | ✗ | For the 2 log files, this is the difference: From a70d8e6004a2652ba07472a521f721e8218a6bc5 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:13:04 -0400 Subject: [PATCH 22/29] Update log.sh remove logging from log.sh --- log.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/log.sh b/log.sh index 5b3345f..6ea44d9 100644 --- a/log.sh +++ b/log.sh @@ -10,13 +10,10 @@ x=$1 y=$2 z=$3 -speed=$4 - truncate -s 0 $log_path echo $linenumber > $log_path echo $x >> $log_path echo $y >> $log_path -echo $z >> $log_path -echo $speed >> $log_path \ No newline at end of file +echo $z >> $log_path \ No newline at end of file From 51ee4b4efae03b656a00a6538e1fc8d833616575 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:15:55 -0400 Subject: [PATCH 23/29] Update make_restarted_file.sh ask user how fast to move instead of getting it from the log --- Interface_scripts/make_restarted_file.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index 052f430..c973662 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -91,6 +91,10 @@ else gcode="M190 S$bed_temp \nG28 \nM109 S$extruder_temp \nUNLOG_FILE" fi +read -r -p "How fast do you want your printer to be moving when it is first started? (mm/s) " speed + +speed=$(( speed * 60 )) + # Get the linenumber where the printer stopped linenumber=$(sed -n '1p' $dynamic_logpath) @@ -99,8 +103,6 @@ printerx=$(sed -n '2p' $dynamic_logpath) printery=$(sed -n '3p' $dynamic_logpath) printerz=$(sed -n '4p' $dynamic_logpath) -speed=$(sed -n '5p' $dynamic_logpath) - move="G0 F${speed} X${printerx} Y${printery} \nG0 F150 Z${printerz} \nG0 F${speed}" # Ask how many lines were skipped between logs From 014b96e41e32b0f0a0378259484e0bd08a1585f2 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:19:41 -0400 Subject: [PATCH 24/29] Update make_restarted_file.sh only multiply input by 60 if the input is valid, (not decimal or letters) --- Interface_scripts/make_restarted_file.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index c973662..1cf59a2 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -91,9 +91,19 @@ else gcode="M190 S$bed_temp \nG28 \nM109 S$extruder_temp \nUNLOG_FILE" fi +echo "" read -r -p "How fast do you want your printer to be moving when it is first started? (mm/s) " speed -speed=$(( speed * 60 )) +if [[ "$speed" =~ ^[0-9]+$ ]]; then + speed=$(( speed * 60 )) +else + echo "Your input is not good, the speed will be set to 100 mm/s..." + speed=6000 + echo "Press any key to continue..." + read -r -n1 -s +fi + +echo "" # Get the linenumber where the printer stopped linenumber=$(sed -n '1p' $dynamic_logpath) From 67126109d702f911644c141ee2caccf74efaa9ec Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:20:59 -0400 Subject: [PATCH 25/29] Update restart_file.sh do the same by restart_file.sh: task 4 in v3.2.2 roadmap --- Interface_scripts/restart_file.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Interface_scripts/restart_file.sh b/Interface_scripts/restart_file.sh index c26091c..a545c7f 100644 --- a/Interface_scripts/restart_file.sh +++ b/Interface_scripts/restart_file.sh @@ -67,6 +67,20 @@ else gcode="M190 S$bed_temp \nG28 \nM109 S$extruder_temp \nUNLOG_FILE" fi +echo "" +read -r -p "How fast do you want your printer to be moving when it is first started? (mm/s) " speed + +if [[ "$speed" =~ ^[0-9]+$ ]]; then + speed=$(( speed * 60 )) +else + echo "Your input is not good, the speed will be set to 100 mm/s..." + speed=6000 + echo "Press any key to continue..." + read -r -n1 -s +fi + +echo "" + # Get the linenumber where the printer stopped linenumber=$(sed -n '1p' $dynamic_logpath) @@ -75,8 +89,6 @@ printerx=$(sed -n '2p' $dynamic_logpath) printery=$(sed -n '3p' $dynamic_logpath) printerz=$(sed -n '4p' $dynamic_logpath) -speed=$(sed -n '5p' $dynamic_logpath) - move="G0 F${speed} X${printerx} Y${printery} \nG0 F150 Z${printerz} \nG0 F${speed}" From b018a2be6faae106b6868bf2c5fa0f0a147cbd9e Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:35:48 -0400 Subject: [PATCH 26/29] Update restart_file.sh --- Interface_scripts/restart_file.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Interface_scripts/restart_file.sh b/Interface_scripts/restart_file.sh index a545c7f..9dc177f 100644 --- a/Interface_scripts/restart_file.sh +++ b/Interface_scripts/restart_file.sh @@ -68,7 +68,8 @@ else fi echo "" -read -r -p "How fast do you want your printer to be moving when it is first started? (mm/s) " speed +echo "How fast do you want your printer to be moving when it is first started? (mm/s)" +read -r -p "If you don't want to specify a speed just press enter, and then the speed will be 100 mm/s. " speed if [[ "$speed" =~ ^[0-9]+$ ]]; then speed=$(( speed * 60 )) From 3b08ebfc64186d177808589b9e8f1fc0376be567 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:36:09 -0400 Subject: [PATCH 27/29] Update make_restarted_file.sh --- Interface_scripts/make_restarted_file.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Interface_scripts/make_restarted_file.sh b/Interface_scripts/make_restarted_file.sh index 1cf59a2..d8e95be 100644 --- a/Interface_scripts/make_restarted_file.sh +++ b/Interface_scripts/make_restarted_file.sh @@ -92,7 +92,8 @@ else fi echo "" -read -r -p "How fast do you want your printer to be moving when it is first started? (mm/s) " speed +echo "How fast do you want your printer to be moving when it is first started? (mm/s)" +read -r -p "If you don't want to specify a speed just press enter, and then the speed will be 100 mm/s. " speed if [[ "$speed" =~ ^[0-9]+$ ]]; then speed=$(( speed * 60 )) From a341ab0a85e5fef7a959347622443ece9e85b942 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:50:38 -0400 Subject: [PATCH 28/29] Update logger.cfg --- logger.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logger.cfg b/logger.cfg index 225b544..14802c2 100644 --- a/logger.cfg +++ b/logger.cfg @@ -14,8 +14,8 @@ verbose: False [gcode_macro LOG_FILE] gcode: - {% set log = printer.gcode_move %} - RUN_SHELL_COMMAND CMD=log_path PARAMS="{log.gcode_position.x} {log.gcode_position.y} {log.gcode_position.z} {log.speed}" + {% set position = printer.gcode_move.gcode_position %} + RUN_SHELL_COMMAND CMD=log_path PARAMS="{position.x} {position.y} {position.z}" [gcode_shell_command print_finished] command: sh /home/USER/Klipper_Power_Resume/finished.sh From b54e6393dec87d84e4857b83d629faf377ce2410 Mon Sep 17 00:00:00 2001 From: T9Air <163940743+T9Air@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:47:42 -0400 Subject: [PATCH 29/29] Update v3.2.2.md --- Roadmap/v3.2.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Roadmap/v3.2.2.md b/Roadmap/v3.2.2.md index 9ad6c8c..dd5be8e 100644 --- a/Roadmap/v3.2.2.md +++ b/Roadmap/v3.2.2.md @@ -5,7 +5,7 @@ | Use 2 log files instead of one; 1 static file, and 1 dynamic file | ✓ | | Fix bug where you can not input a file without .gcode when making _restarted file | ✓ | | Fix error "ome: command not found" when going back to main menu | ✓ | -| Logging speed add too much time, remove the logging and use a base speed | ✗ | +| Logging speed add too much time, remove the logging and use a user inputed speed | ✓ | For the 2 log files, this is the difference: