From 439629d0b51f1cedea337cb4058d99df8d2cbf8e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 4 Jul 2016 00:11:51 +0200 Subject: [PATCH] Translate variants and machine names I'm not quite pleased with the variant translation being inside this function, so I'll move it to VersionUpgrade21to22 soon I think. Contributes to issue CURA-844. --- .../VersionUpgrade21to22/MachineInstance.py | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/MachineInstance.py b/plugins/VersionUpgrade/VersionUpgrade21to22/MachineInstance.py index 7582befca6..63e853d649 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/MachineInstance.py +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/MachineInstance.py @@ -67,14 +67,40 @@ class MachineInstance: config.set("general", "version", "2") # Hard-code version 2, since if this number changes the programmer MUST change this entire function. import VersionUpgrade21to22 # Import here to prevent circular dependencies. + type_name = VersionUpgrade21to22.VersionUpgrade21to22.VersionUpgrade21to22.translatePrinter(self._type_name) active_profile = VersionUpgrade21to22.VersionUpgrade21to22.VersionUpgrade21to22.translateProfile(self._active_profile_name) active_material = VersionUpgrade21to22.VersionUpgrade21to22.VersionUpgrade21to22.translateProfile(self._active_material_name) + if type_name == "ultimaker2_plus": + if self._variant_name == "0.25 mm": + variant = "ultimaker2_plus_0.25" + elif self._variant_name == "0.4 mm": + variant = "ultimaker2_plus_0.4" + elif self._variant_name == "0.6 mm": + variant = "ultimaker2_plus_0.6" + elif self._variant_name == "0.8 mm": + variant = "ultimaker2_plus_0.8" + else: + variant = self._variant_name + elif type_name == "ultimaker2_extended_plus": + if self._variant_name == "0.25 mm": + variant = "ultimaker2_extended_plus_0.25" + elif self._variant_name == "0.4 mm": + variant = "ultimaker2_extended_plus_0.4" + elif self._variant_name == "0.6 mm": + variant = "ultimaker2_extended_plus_0.6" + elif self._variant_name == "0.8 mm": + variant = "ultimaker2_extended_plus_0.8" + else: + variant = self._variant_name + else: + variant = self._variant_name + containers = [ self._name, active_profile, active_material, - self._variant_name, - self._type_name + variant, + type_name ] config.set("general", "containers", ",".join(containers))