Another small bug I found when looking through this MachineManager code. My IDE was complaining that the preferred_material_name was not always initialised and that preferred_material was an unused variable.
Doesn't contribute to issue CURA-3803.
These may have different parameters, such as which machine and extruder they are updating the material and variant of. If we only pass the last signal on, then we're missing the update of other extruders.
Contributes to issue CURA-3803.
We know now that it must be a Cura Container Stack. This should be a bit faster, and makes the error message I was getting a bit more clear.
Contributes to issue CURA-3803.
Not just the active extruder. The non-active extruder may change when loading a project file which happened to have the same printer (so no new printer is created) and the same material and variant in the active extruder but not the same material or variant in another extruder.
Contributes to issue CURA-3803.
It may also be any other class that implements the Definition Container Interface.
Not really related to CURA-3803 but I'm putting it there anyway as I found it during that development.
Otherwise we may only change one of the extruders next time, and it'll still have the other change in this dictionary from the previous time we are syncing from the printer.
Contributes to issue CURA-3788.
Instead of cloning the 2.85 mm generic PLA material and setting its diameter, we now clone the generic PLA with the same diameter as the current machine. This will also clone all the machine-specific settings included in that base file.
We do not load the extruders in a fixed order, thus we cannot assume
that addExtruder is called in the right order. This means that index 0
of the extruders is not necessarily the extruder with position 0. So
instead, use the extruder position as a dict key.
Contributes to CURA-3738
With limit_to_extruder, we always try to get the value of a setting from
an extruder. However, if the setting is not settable_per_extruder we
bypass the extruder and go directly to the global stack. This would
cause an infinite recursion.
Contributes to CURA-3738
* 'transparent_limit_to_extruder' of github.com:ultimaker/Cura:
Removed unused imports
Fixed type hinting for Extruder stack
Fixed two remaining failing unit tests
Fixes unit fallthrough unit test
* 'master' of github.com:ultimaker/Cura: (94 commits)
Re-enable Japanese from language selection menu
Add Japanese translations for setting descriptions
Update PVA profiles
Changed profile names
Simplified some code
Changed final spot where we still used findContainer when looking for container with specific type
Directly use property instead of searching
Added a type hinting to QualityManager
JSON description fix: warn users when not to use spiralize (CURA-3636)
Add setting_version every time we create InstanceContainer
Increase warning value for gradual infill steps
Convert all metadata fields to string
cleanup: prime => prime blob and lil doc (CURA-3634)
fix: don't make disallowed area if blob is disabled (CURA-3634)
Be robust against older specification version numbers
Read setting_version from version attribute on root
Added bunch of typing to extruder manager
Fix resolve strategy "new" for user instance container
Added missing typehinting
Row element was not used
...
Except when we fill the instancecontainer via deserialising. Because then we want to retain the original version number.
Contributes to issue CURA-3427.