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

feat: add model_name and plate_number placeholders #5401

Merged
merged 1 commit into from
May 24, 2024

Conversation

Deadleg
Copy link
Contributor

@Deadleg Deadleg commented May 20, 2024

Description

This uses the BBS project name from the Project tab which could be susceptible to upstream changes removing this feature.

The project_name template only works when you open a 3MF file. If you create a new project and set the project name Model.model_info is always null whether you save the project or not. If you save the current project, switch to a new project/different project, then re-load it then the template works as expected.

I'm not sure if it's an issue with this implementation or something else upstream.

This is distinct from the project file name in that it can be used to group multiple 3MF files under the same project. For example if you are printing parts for a Voron printer on a Voron 2.4 and Trident, you would have a 3MF file per printer but you may not want the different 3MF file names in the G-Code filename.

The plate number is assumed to always be <100 which matches the formatting of the plate number in the UI.

Relates-To: #3816

Screenshots/Recordings/Graphs

Screenshot_20240520_135328
Screenshot_20240524_170909

Tests

  • When opening a 3MF file
    • When the project has no project name configured
      • Adding the project name updates the G-Code file name ✔️
      • Updating the project name updates the G-Code file name ✔️
    • When the 3MF file has a non-empty project name configured
      • Updating the project name updates the G-Code file name ✔️
      • Clearing the project name updates the G-Code file name ✔️
  • When starting a new project
    • Adding the project name updates the G-Code file name ✖️
    • When saving a new project
      • Adding the project name updates the G-Code file name ✖️

@igiannakas
Copy link
Contributor

Nice one this!

Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

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

Would it be better to call it model_name since it's actually a model name?
Project name should be reserved for the project file name to avoid confusion.

@Deadleg
Copy link
Contributor Author

Deadleg commented May 23, 2024

Would it be better to call it model_name since it's actually a model name? Project name should be reserved for the project file name to avoid confusion.

Makes sense, I was mildly confused by the terminology. Will update.

@Deadleg Deadleg changed the title feat: add project_name and plate_number placeholders feat: add model_name and plate_number placeholders May 24, 2024
This uses the BBS project name from the `Project` tab which could be
susceptible to upstream changes removing this feature.

The project_name template only works when you open a 3MF file. If you
create a new project and set the project name `Model.model_info` is
always null whether you save the project or not. If you save the current
project, switch to a new project/different project, then re-load it then
the template works as expected.

The plate number is assumed to always be <100 which matches the
formatting of the plate number in the UI.

Relates-To: SoftFever#3816
Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

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

Looks good.
Thank you

@SoftFever SoftFever merged commit 194ec6b into SoftFever:main May 24, 2024
12 checks passed
@igiannakas igiannakas mentioned this pull request May 29, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants