From e55775175230efeb4a87eeb82d14b9498619dd4c Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Tue, 31 Jul 2018 11:31:46 +0200 Subject: [PATCH 1/2] Add the active build plate name to default (not user specified) job name --- cura/PrintInformation.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 41faa7cef8..1e09cd9baa 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -267,6 +267,7 @@ class PrintInformation(QObject): new_active_build_plate = self._multi_build_plate_model.activeBuildPlate if new_active_build_plate != self._active_build_plate: self._active_build_plate = new_active_build_plate + self._updateJobName() self._initVariablesWithBuildPlate(self._active_build_plate) @@ -310,15 +311,18 @@ class PrintInformation(QObject): # Only update the job name when it's not user-specified. if not self._is_user_specified_job_name: if self._pre_sliced: - self._job_name = catalog.i18nc("@label", "Pre-sliced file {0}", base_name) + job_name = catalog.i18nc("@label", "Pre-sliced file {0}", base_name) elif self._application.getInstance().getPreferences().getValue("cura/jobname_prefix"): # Don't add abbreviation if it already has the exact same abbreviation. if base_name.startswith(self._abbr_machine + "_"): - self._job_name = base_name + job_name = base_name else: - self._job_name = self._abbr_machine + "_" + base_name + job_name = self._abbr_machine + "_" + base_name else: - self._job_name = base_name + job_name = base_name + if self._active_build_plate != 0: + job_name += "-{}".format(self._active_build_plate) + self._job_name = job_name self.jobNameChanged.emit() From d57090c049f43cb5d3f62894bc0bada3ef654b2c Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 1 Aug 2018 12:53:07 +0200 Subject: [PATCH 2/2] Allow the user to change the name and even though the name in the different buildplates will change accordingly to the build plate number. --- cura/PrintInformation.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cura/PrintInformation.py b/cura/PrintInformation.py index 1e09cd9baa..21e2040dc1 100644 --- a/cura/PrintInformation.py +++ b/cura/PrintInformation.py @@ -311,18 +311,24 @@ class PrintInformation(QObject): # Only update the job name when it's not user-specified. if not self._is_user_specified_job_name: if self._pre_sliced: - job_name = catalog.i18nc("@label", "Pre-sliced file {0}", base_name) + self._job_name = catalog.i18nc("@label", "Pre-sliced file {0}", base_name) elif self._application.getInstance().getPreferences().getValue("cura/jobname_prefix"): # Don't add abbreviation if it already has the exact same abbreviation. if base_name.startswith(self._abbr_machine + "_"): - job_name = base_name + self._job_name = base_name else: - job_name = self._abbr_machine + "_" + base_name + self._job_name = self._abbr_machine + "_" + base_name else: - job_name = base_name + self._job_name = base_name + + # In case there are several buildplates, a suffix is attached + if self._multi_build_plate_model.maxBuildPlate > 0: + connector = "_#" + suffix = connector + str(self._active_build_plate + 1) + if connector in self._job_name: + self._job_name = self._job_name.split(connector)[0] # get the real name if self._active_build_plate != 0: - job_name += "-{}".format(self._active_build_plate) - self._job_name = job_name + self._job_name += suffix self.jobNameChanged.emit()