Skip to content
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

M36 with a filename doesn't return the customInfo if a print job is running #1096

Open
dc42 opened this issue Mar 1, 2025 · 1 comment
Open
Assignees
Labels
bug Bug that has been reproduced
Milestone

Comments

@dc42
Copy link
Collaborator

dc42 commented Mar 1, 2025

In RRF 3.6.0 post beta 4 if M36 is used with a filename parameter, the contexts of any customInfo comments in the file are normally included in the output. However it does not include the custom info if a job is being run, instead it reports "customInfo":{}. It makes no difference if the print is paused. M36 without a filename parameter does report the customInfo for the job currently running.

@dc42 dc42 added the bug Bug that has been reproduced label Mar 1, 2025
@dc42 dc42 added this to the 3.6.0 milestone Mar 1, 2025
@dc42 dc42 self-assigned this Mar 1, 2025
@dc42
Copy link
Collaborator Author

dc42 commented Mar 4, 2025

It isn't just the customInfo that is missing, other parts of the info may be missing too. The reason is that RepRap::GetFileInfoResponse in general makes multiple calls to FileInfoParser::GetFileInfo (via MassStorage::GetFileInfo) until it doesn't return GCodeResult::notFinished, but it passes empty GCodeFileInfo and GlobalVariables objects each time. When no file is being printed, FileInfoParser::GetFileInfo loops internally for faster response so it usually completes in a single call; but when a file is being printed it doesn't so as to avoid disturbing the file being printed. A solution would be to allocate GCodeFileInfo and GlobalVariables objects before making the calls, and free them afterwards. Or perhaps have a single static instance of each and a mutex to protect them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that has been reproduced
Projects
None yet
Development

No branches or pull requests

1 participant