feat: add model_name and plate_number placeholders (#5401)

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: https://github.com/SoftFever/OrcaSlicer/issues/3816
This commit is contained in:
William 2024-05-25 00:52:35 +12:00 committed by GitHub
parent 966c18cbad
commit 194ec6b1cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 0 deletions

View file

@ -903,6 +903,9 @@ public:
std::string output_filename(const std::string &filename_base = std::string()) const override;
std::string get_model_name() const;
std::string get_plate_number_formatted() const;
size_t num_print_regions() const throw() { return m_print_regions.size(); }
const PrintRegion& get_print_region(size_t idx) const { return *m_print_regions[idx]; }
const ToolOrdering& get_tool_ordering() const { return m_wipe_tower_data.tool_ordering; }