CURA-4084
When MachineManager gets created, it will find and set the current
active machine. This requires the ContainerRegistry to be initialized
first.
CURA-4084
Stack error checks are scheduled with a delay, and when a container is
changed (e.g. Quality), the auto-slice may get triggered before the
error check is done. Because the error check result is cached, the
auto-slicing will use the previous result instead of new. So, the
auto-slicing should be triggered when a stack validation is finished
instead of when a stack/setting gets changed.
If a PrinterOutputDevice is able to connect quickly to a machine, then
by the time the MachineManager is created and connects to the signal,
it will be too late, and it might miss that there is already connected
devices.
# Conflicts:
# plugins/USBPrinting/USBPrinterOutputDeviceManager.py
Recently we changed the empty containers such that there is only one empty container instance and it doesn't have the proper type any more. Instead we have properties on the stack that allows us to find the container with the proper type. It's faster and easier to use.
We've had a few bugs about this so I decided to update all of them to remove those for the future, except the ones in plugins/MachineSettingsAction/MachineSettingsAction.py because we have a pending pull request that fixes those. Fixing them would give merge conflicts for fieldOfView.
It doesn't really belong to CURA-4024 but I'm sticking it under that nomer anyway to get it reviewed.
NB: previously the "approximate_diameter" metadata was stored as a number. This caused some issues passing arguments from QML to Python. Now "approximate_diameter" is stored as a string.
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.
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.
Catch just a TypeError instead of all exceptions. Added documentation to say why we catch a TypeError there. Also splitted up the try-except block for the 3 disconnects, just so that if the first fails we still try to disconnect from the other two.
Contributes to issue CURA-3497.