18 Commits

Author SHA1 Message Date
Ghostkeeper
77c918a0a7 Remove superfluous singleton pattern
The qmlRegisterSingletonType function already makes sure it is a singleton.

Contributes to issues CURA-340 and CURA-1278.
2016-06-06 15:15:33 +02:00
Ghostkeeper
7950dfaa07 Document activeExtruderStackId
Contributes to issues CURA-340, CURA-351 and CURA-1278.
2016-06-06 15:15:33 +02:00
Ghostkeeper
70e6c8093e Explicitly return None if no global container stack
That's what it does. This is more clear than doing 'pass' or something.

Contributes to issues CURA-340 and CURA-1278.
2016-06-06 15:15:33 +02:00
Ghostkeeper
d1be5b6c02 Create extruder train for each train in a machine
We had the functionality, but this function was not yet called!

Contributes to issues CURA-1278 and CURA-340.
2016-06-06 15:15:33 +02:00
Ghostkeeper
927d33145f Move creating extruder manager logic to ExtruderManager
This logic was both in Extruder.py and in MachineManagerModel.py due to a planning mishap.

Contributes to issues CURA-1278 and CURA-340.
2016-06-06 15:15:33 +02:00
Ghostkeeper
2660b2a68f Give default empty machine_extruder_ids
Works also if the machine has no machine_extruder_ids metadata.

Contributes to issues CURA-1278 and CURA-351.
2016-06-06 15:14:58 +02:00
Ghostkeeper
d810c7ddbb
Properly reload extruders at the start
The extruder manager was too late to catch the initial global stack switch and machine switch. Now it just always reloads the extruders at the beginning.

Contributes to issues CURA-1278 and CURA-351.
2016-06-05 16:17:55 +02:00
Arjen Hiemstra
186eca160b Fix containersChanged signal handlers
Fixes CURA-1642
2016-06-02 16:25:13 +02:00
Ghostkeeper
8a8de95969
Add iteration over extruder manager
This iteration iterates over the extruders.

Contributes to issues CURA-1278 and CURA-351.
2016-06-02 14:17:12 +02:00
Ghostkeeper
8369316236
Use modern import method
This is more robust to cyclic dependencies, and also the intended way of importing these classes in Python in general.

Contributes to issues CURA-1278 and CURA-351.
2016-06-02 14:17:12 +02:00
Ghostkeeper
8a8b0016ba
Add signal for when extruder list changes
The ExtrudersModel will need to listen to this.

Contributes to issues CURA-1278 and CURA-351.
2016-06-02 14:17:12 +02:00
Ghostkeeper
06f7f90bb0
Make ExtruderManager into a singleton
This way we don't need to load it in CuraApplication but we can just load it whenever it is first needed. ExtruderManager should be robust against initialising it at any point in Cura's runtime.

Contributes to issues CURA-1278 and CURA-351.
2016-06-02 14:17:12 +02:00
Ghostkeeper
1f9805a73c
Remove unused imports
These are unused because the code was moved to Extruder.py

Contributes to issues CURA-1278 and CURA-351.
2016-06-02 14:17:12 +02:00
Ghostkeeper
73f12ffd99
Incorporate switching of global extruder stack
When the global extruder stack switches, we need to re-connect the reloading of extruders to the new containersChanged signal of the new global container stack. This now also bootstraps the listening for the first time, when the global container stack changes from None to the first stack.

Contributes to issues CURA-1278 and CURA-351.
2016-06-02 11:17:52 +02:00
Ghostkeeper
d1566ef637
Also reload extruders at init
Not a reload really, just a load.

Contributes to issues CURA-1278 and CURA-351.
2016-06-01 14:55:15 +02:00
Ghostkeeper
60a71fcc33
Only list extruders in extruder manager
Let the extruders themselves take care of which profiles are attached to each.

Contributes to issues CURA-1278 and CURA-351.
2016-06-01 14:54:30 +02:00
Ghostkeeper
377fed206c
Remove extruder creation logic from manager
This logic is now in cura/Extruder.py.

Contributes to issues CURA-1278 and CURA-351.
2016-06-01 13:52:57 +02:00
Ghostkeeper
a08e71774d
Make ExtruderManagerModel no longer a PyQt model
It is still a model according to the MVC paradigm but not according to Qt. To be consistent with the rest, don't call it a model any more.

Contributes to issues CURA-1278 and CURA-351.
2016-06-01 12:03:01 +02:00