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

Re-write of Time Lapse #18923

Merged
merged 10 commits into from
Oct 2, 2024
Merged

Re-write of Time Lapse #18923

merged 10 commits into from
Oct 2, 2024

Conversation

GregValiant
Copy link
Collaborator

@GregValiant GregValiant commented Apr 20, 2024

An update to the Time Lapse script.

  • Added "insertion frequency" so the user can decide how often to take an image.
  • Added support for relative extrusion.
  • Retract is now a boolean and the settings come from Cura. There won't be a retraction if there is already a retraction.
  • The 6th commit adds the "Pause before image" as proposed in 19556.

Description

Type of change

  • [ X] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Test Configuration:

  • Operating System: Windows 10 Pro (Intel processor)
  • Cura 4.13.1 and Cura 5.7.0

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

An update to the script.
- Added insertion frequency
- Added support for relative extrusion
- Retract is now a boolean and the settings come from Cura.  There won't be a retraction if there is already a retraction.
@github-actions github-actions bot added the PR: Community Contribution 👑 Community Contribution PR's label Apr 20, 2024
@GregValiant GregValiant changed the title Re-write Time Lapse Re-write of Time Lapse Apr 21, 2024
@casperlamboo
Copy link
Contributor

hi @GregValiant, I'm not on the cura team anymore. best to request a review of one of the other cura devs. Thanks

@GregValiant
Copy link
Collaborator Author

@casperlamboo thanks for getting back.

I hope all goes well for you in the next phase.

Greg

@GregValiant GregValiant requested review from saumyaj3 and Vandresc and removed request for casperlamboo April 22, 2024 10:48
@jellespijker
Copy link
Member

@wawanbreton could you take look at this next power hours, since @saumyaj3 is currently on holiday

@GregValiant
Copy link
Collaborator Author

@wawanbreton The last commit adds support for firmware retraction.

@GregValiant
Copy link
Collaborator Author

@wawanbreton Has there been any progress on this?

@GregValiant GregValiant added the PR: Post Processing ➕ Like adding beeps, more tunability or different Gcode pause at heights label Jul 31, 2024
@wawanbreton
Copy link
Contributor

Hi @GregValiant, sorry for not answering, I'm just back from holiday. I will create tickets to integrate this PR into our backlog for review, and also the one for the other plugin.
However, please remember that the Cura team currently has very limited resources (team split up with other projects, and holiday) so this may take some time 😬

@GregValiant
Copy link
Collaborator Author

I understand completely and was not trying to jostle your elbow. I knew 5.8.0 was due to be released and I was just curious if either would get in under the deadline.

@wawanbreton
Copy link
Contributor

No offense taken... It's actually a good thing that you regularly raise some flags, so that we don't forget we have PRs to look at 😃

@GregValiant
Copy link
Collaborator Author

GregValiant commented Aug 22, 2024

I have added the setting from #19556 but I have yet to update this PR as I am waiting to hear back from the other poster.

I'm getting "merge conflicts" so I'm sitting on the revised version.

Update TimeLapse.py

Update to include a pause before the image is snapped.
@GregValiant
Copy link
Collaborator Author

The 6th commit appears to be correct and includes the change proposed in 19556.

Copy link
Contributor

@wawanbreton wawanbreton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good, there is just something curious about the extra spaces after units 🤔

plugins/PostProcessingPlugin/scripts/TimeLapse.py Outdated Show resolved Hide resolved
plugins/PostProcessingPlugin/scripts/TimeLapse.py Outdated Show resolved Hide resolved
plugins/PostProcessingPlugin/scripts/TimeLapse.py Outdated Show resolved Hide resolved
plugins/PostProcessingPlugin/scripts/TimeLapse.py Outdated Show resolved Hide resolved
Copy link
Contributor

@wawanbreton wawanbreton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We agreed with the team that those extra spaces should be removed, should it be at least for consistency. I spotted no visual issue related to this.

@HellAholic HellAholic merged commit 766b87a into Ultimaker:main Oct 2, 2024
3 checks passed
@Slashee-the-Cow
Copy link

Question: do potential bugs caused by bad behaving other post-processing scripts count as problems, especially when there's an easy fix?
Line 173-175 (and 181-182, code reuse smells):

if " E" in line:
    last_e = line.split("E")[1]
    if float(last_e) < float(prev_e):

That assumes that E is the last parameter. In code produced by CuraEngine and Script.putValue() it will be, but if there's a script out there running before this which is crafting its own lines it might not be so polite. If "E" isn't the last parameter then the second item of the split() will be a string which will throw a ValueError when you try and cast it to a float.

The script does catch exceptions, but in doing so it'll stop processing that entire layer, including if there's supposed to be a shot at the end. What's wrong with this? We already know there's an E value, we checked for that.

last_e = float(self.getValue("E"))

@GregValiant
Copy link
Collaborator Author

GregValiant commented Oct 6, 2024

@wawanbreton,
The extra spaces after units are needed when the post processor has a lot of settings and the vertical scroll bar is present. The spaces push the text to the left so the scrollbar doesn't occlude the text. I got in the habit of adding them "just in case". Feel free to box them up and send them back to me.
(NOTE: Please be advised that I am philosophically opposed to paying for shipping "spaces" from the Netherlands to the US so please don't make them "cash on receipt" or I will refuse to accept them. We don't want to create an international incident.)

@Slashee-the-Cow I saw that but something else caught my eye and I forgot about it.

@wawanbreton
Copy link
Contributor

The spaces push the text to the left so the scrollbar doesn't occlude the text.

Ok, good to know 🙂 if at some point we have to change the UI of the post-processing script, then we shall fix that !

@Slashee-the-Cow
Copy link

Slashee-the-Cow commented Oct 9, 2024

@wawanbreton So if I want to put my code where my mouth is and try and push request in a refactored version that I, in my completely biased opinion, think is better:

  1. I'm assuming I'm at least a couple of weeks too late?
  2. How would I do it anyway? Never actually used GitHub for anything but my own single person projects.

@wawanbreton
Copy link
Contributor

  1. I'm assuming I'm at least a couple of weeks too late?

For 5.9, yes. But you can still start working on this now and it can be integrated in next release.

  1. How would I do it anyway? Never actually used GitHub for anything but my own single person projects.

Just make a fork of this Cura repository, then do whatevere you want on it, and when you are satisfied with your work, create a PR back to this repository

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.

6 participants