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.
This commit is contained in:
Ghostkeeper 2016-07-04 00:11:51 +02:00
parent f13db7de10
commit 439629d0b5

View File

@ -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))