mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Update how machine instances are translated to stacks
Lots of things have changed in how this works. Sadly, I can't translate things like the material, from PLA to ultimaker2_plus_0.4mm_pla. Not without implementing the entire container registry in the plug-in anyway. Contributes to issue CURA-844.
This commit is contained in:
parent
d1188899a7
commit
2de811accf
1 changed files with 14 additions and 10 deletions
|
@ -62,22 +62,26 @@ class MachineInstance:
|
|||
|
||||
config.add_section("general")
|
||||
config.set("general", "name", self._name)
|
||||
config.set("general", "id", self._name)
|
||||
config.set("general", "type", self._type_name)
|
||||
config.set("general", "version", "2") # Hard-code version 2, since if this number changes the programmer MUST change this entire function.
|
||||
if self._variant_name:
|
||||
config.set("general", "variant", self._variant_name)
|
||||
if self._key:
|
||||
config.set("general", "key", self._key)
|
||||
if self._active_profile_name:
|
||||
config.set("general", "active_profile", self._active_profile_name)
|
||||
if self._active_material_name:
|
||||
config.set("general", "material", self._active_material_name)
|
||||
|
||||
containers = []
|
||||
containers.append(self._name + "_current_settings")
|
||||
containers.append("empty") #The dependencies of the active profile, material and variant changed, so there is no 1:1 relation possible here.
|
||||
containers.append("empty")
|
||||
containers.append("empty")
|
||||
containers.append(self._type_name)
|
||||
config.set("general", "containers", ",".join(containers))
|
||||
|
||||
config.add_section("metadata")
|
||||
config.set("metadata", "type", "machine")
|
||||
|
||||
import VersionUpgrade21to22 # Import here to prevent circular dependencies.
|
||||
VersionUpgrade21to22.VersionUpgrade21to22.VersionUpgrade21to22.translateSettings(self._machine_setting_overrides)
|
||||
config.add_section("machine_settings")
|
||||
config.add_section("values")
|
||||
for key, value in self._machine_setting_overrides.items():
|
||||
config.set("machine_settings", key, str(value))
|
||||
config.set("values", key, str(value))
|
||||
|
||||
output = io.StringIO()
|
||||
config.write(output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue