Skip to content

Update DisplayInfoOnLCD.py #18774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

GregValiant
Copy link
Collaborator

@GregValiant GregValiant commented Mar 31, 2024

Bug fix for "remaining_time".
Affected M118 and M73_time
Bug was pointed out in #18766

Description

This repairs a problem with M118 lines being added if "remaining_time" was not selected. The bug affected M118 and M73_time insertions.
There was a request to add the "A" and "P" parameters to the M118 lines as they might be required by Octoprint.
Adding M117 is now an option.

This fixes... OR This improves... -->

Type of change

  • [ X] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Cura 5.7beta and 4.13.1

Test Configuration:

  • Operating System: Win 10 Pro

Checklist:

  • [ X] My code follows the style guidelines of this project as described in UltiMaker Meta and Cura QML best practices
  • [X ] I have read the Contribution guide
  • [ X] I have commented my code, particularly in hard-to-understand areas
  • [ X] I have uploaded any files required to test this change

@github-actions github-actions bot added the PR: Community Contribution 👑 Community Contribution PR's label Mar 31, 2024
@GregValiant GregValiant added PR: BooBoos 😇 Suggestions for Typos, like the NoMesh or there is a suggested refactor PR: Post Processing ➕ Like adding beeps, more tunability or different Gcode pause at heights labels Mar 31, 2024
@GregValiant GregValiant marked this pull request as draft April 3, 2024 13:01
@GregValiant
Copy link
Collaborator Author

Most of these changes were requested by #18766 while other are because I'm unable to keep my fingers out of it.
The changes have missed 5.7.0 so I will move it back to active when I eventually quit fooling with it.

Bug fix for "remaining_time".
Affected M118 and M73_time

Update DisplayInfoOnLCD.py

Add options for Time-to-pause to include Filament Change.

Update DisplayInfoOnLCD.py

Make M117 optional.
Combine M73 R and M73 P lines into a single line.
Add A and P parameters for M118 lines.

Update DisplayInfoOnLCD

A TouchUp.

Update DisplayInfoOnLCD.py

TouchUp

Update DisplayInfoOnLCD.py

TuneUp
Should not have been included.
@GregValiant GregValiant requested a review from HellAholic April 7, 2024 13:05
@GregValiant
Copy link
Collaborator Author

I see no reason why Remco and Casper have to be the only ones horrified by my coding style.

@GregValiant GregValiant marked this pull request as ready for review April 7, 2024 13:08
@HellAholic
Copy link
Contributor

HellAholic commented Apr 8, 2024

I see no reason why Remco and Casper have to be the only ones horrified by my coding style.

Did a quick check to share the horror :P But I'm not familiar enough with the code to make a full review on it.

@GregValiant
Copy link
Collaborator Author

Thanks for looking anyway.
I'll make changes locally until a full review. Maybe I can get by with just a single additional commit.

Revised the M118 lines and insertion point in the gcode.
Revised M117 same.
Added nozzle size and filament type to data[0]
Copy link
Contributor

github-actions bot commented Dec 30, 2024

Test Results

23 953 tests  ±0   23 951 ✅ ±0   47s ⏱️ -1s
     1 suites ±0        2 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 3ad2c1b. ± Comparison against base commit 4e04d06.

♻️ This comment has been updated with latest results.

Added "global_stack" variable.
Update.  Remove vestigial line of code at line 530.
Added a condition so the pause_cmd setting box is hidden unless the 'display_option' == "display_progress".
Split functions from Execute.
Added function "Add Settings" so it also works with the "filename_layer" option.
Changed the fialment type 'get' from:
'getProperty'
   to
'material.getMetaDataEntry'
Added the "time to pause" to the user message.

Update DisplayInfoOnLCD.py

update
@HellAholic
Copy link
Contributor

Strings like "M118 ", "M117 ", and "M73" are repeated through the code. You could define these as constants at the top of the script for easier maintenance. For example:

M117_COMMAND = "M117 "
M118_COMMAND = "M118 "
M73_COMMAND = "M73"

Fixed the m118_str/m118_text confusion.
Requested changes
Minor changes to the statistics added to the beginning of the gcode.
Changes to the print statistics entered into the gcode.
@GregValiant GregValiant removed the PR: BooBoos 😇 Suggestions for Typos, like the NoMesh or there is a suggested refactor label Apr 14, 2025
@GregValiant
Copy link
Collaborator Author

Per a suggestion in #20509 I added the profile name to the other settings being inserted at the beginning of the gcode.

Add the 'Quality Name' to the gcode with the other settings.

Update DisplayInfoOnLCD.py

Touchups.

Update DisplayInfoOnLCD.py

Minor change
Made some changes to the print stats that are added to the gcode.

Update DisplayInfoOnLCD.py
@GregValiant
Copy link
Collaborator Author

After working on PrintSkew and seeing that different printer names can be involved I changed this script to alter the Cura inserted "TARGET_MACHINE.NAME" line.
Commit 17 example of the new line:
;TARGET_MACHINE.NAME:Creality CR-10 / BMG CR-10
So it would become "Printer_Model / Users_Printer_Name"

GregValiant and others added 2 commits June 7, 2025 09:09
It turns out that some firmware doesn't like colons within M118 commands.
@GregValiant
Copy link
Collaborator Author

GregValiant commented Jul 1, 2025

@HellAholic
I remembered seeing a PR for "Electricity Cost" (#14952 ). DisplayInfoOnLCD was already adding some stats so I threw in "Electricity Cost" as well.
If you approve this then I think 14952 can be closed.

;FLAVOR:Marlin
;TIME:5507
;Cura Time Estimate: 1hr 31min 
;Extruder 1 (T0)
;  Filament used: 8.15m
;  Filament Type: PLA
;  Filament Dia.: 1.75mm
;  Nozzle Size  : 0.6mm
;  Print Temp.  : 205.0°
;  Bed Temp.    : 50°
;Electric Cost: $0.07
;Layer height: 0.25
;Initial Layer Height: 0.25
;Base Quality Name  : 'Standard Quality'
;Custom Quality Name: 'GV PLA 75'
;Model List: ['GV_CalibrationShape V2.stl']

Add "Electricity Cost" to the statistics added to the gcode.

Update DisplayInfoOnLCD.py

Formatting changes for layer heights
@HellAholic
Copy link
Contributor

I'll take a look. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Community Contribution 👑 Community Contribution PR's PR: Post Processing ➕ Like adding beeps, more tunability or different Gcode pause at heights
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants