Commit graph

1761 commits

Author SHA1 Message Date
fieldOfView
975e7f04b4 Remove unused incorrect code
The property is called activeMaterialIds, but it returns the stack ids. The code is superceeded by allActiveMaterialIds.
2017-08-08 11:27:45 +02:00
Lipu Fei
4a34f141d1 Check if a material container is used by GUID
CURA-4129

isContainerUsed() is used to enable/disable the "Remove" button on the
Material Manager dialog. When a custom material is created, it creates
multiple containers, one for each extruder variant. In the dialog, it
only checks if the material for the currently active extruder is being
used or not. This causes a problem when 2 extruders are of different
types and one uses a custom material. Then, the "Remove" button will
not be correctly enabled/disable in the Material Manager dialog when
the other extruder is activated.
2017-08-07 13:17:47 +02:00
Lipu Fei
09576241db Generate unique names for definition changes containers
CURA-4107
2017-08-07 10:59:24 +02:00
Lipu Fei
76e8090dbd Remove duplicated function createDefinitionChangesContainer()
CURA-4107
2017-08-07 10:59:24 +02:00
Ghostkeeper
cf1309c650
Don't update next stack if there is no next stack
Not all extruder stacks have a next stack. Well currently every extruder stack should have a next stack, but the code is built around the possibility that there isn't a next stack elsewhere too.

Contributes to issue CURA-4121.
2017-08-07 09:47:53 +02:00
Ghostkeeper
584e1b6abb
Set the next stack before adding the user container
Since the user container may trigger a propertyChanged signal, which then requests the next stack.

Contributes to issue CURA-4121.
2017-08-07 09:45:16 +02:00
Lipu Fei
792feaade6 Always create a definition changes container for a newly created stack
CURA-4107

A newly created stack will have an empty definition changes container by
default, but when a machine or extruder gets activate, Cura will create
a definition changes container for it if it has an empty one. This lazy
creation caused the problem when after Cura creates a multi-extrusion
machine for the first time, switching to a different extruder tab will
cause an extruder stack change, which eventually triggers an unnecessary
auto-slice.
2017-08-01 09:40:51 +02:00
Jaime van Kessel
e636dbdd10 Merge pull request #2107 from fieldOfView/feature_pyserial_usb_detection
Use pyserial to list serial ports
2017-07-27 09:31:35 +02:00
Lipu Fei
2aa8e590bf Merge pull request #2056 from Ultimaker/top_most_skin_feature
Top most skin feature (CURA-3940)
2017-07-26 14:58:08 +02:00
Lipu Fei
9c1d23fe5b Make sure MachineManager initializes after ContainerRegistry does
CURA-4084

When MachineManager gets created, it will find and set the current
active machine. This requires the ContainerRegistry to be initialized
first.
2017-07-26 14:09:18 +02:00
Lipu Fei
93731b8d1f Trigger auto-slice based on stackValidation instead of stack/setting changes
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.
2017-07-26 14:09:18 +02:00
Tim Kuipers
5f97d2cbde fix: account for roofing extruder when checking which extruder is used (CURA-4069, CURA-3940) 2017-07-21 15:53:05 +02:00
Lipu Fei
b0be901079 Do not check support_interface_extruder_nr if it is used
CURA-4069

support_bottom_extruder_nr and support_roof_extruder_nr are the support
interface extruder numbers, so checking those two is enough and there is
no need to check the interface extruder number.
2017-07-21 13:40:13 +02:00
Lipu Fei
1b0268f09c Use extruder_nr as integers for comparison
CURA-4069
2017-07-21 13:32:46 +02:00
Lipu Fei
9a92b58ac3 Check all limit_to_extruder features in getUsedExtruderStacks()
CURA-4069

getUsedExtruderStacks() doesn't take into account some new limit to
extruder features, The BuildVolume uses it to determine disallowed
areas, and this makes it give incorrect results.
2017-07-21 13:28:12 +02:00
Arjen Hiemstra
b839cb74f4 Do not only check if activeMaterialId is None, also check for empty
Fixes CURA-4065
2017-07-20 12:01:21 +02:00
Arjen Hiemstra
573d25982e Minor cleanup of SettingOverrideDecorator
We never use the _instance variable except in deepcopy, so no need to
store that.

Contributes to CURA-3719
2017-07-18 11:23:43 +02:00
Lipu Fei
18fddf50c7 Add type hinting for container_id in ExtruderStack
CURA-4049
2017-07-18 09:22:45 +02:00
Youness Alaoui
7e7e15a12b Fix MachineManager connection to OutputDeviceManager signals late.
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
2017-07-12 14:06:08 +02:00
Arjen Hiemstra
95b825a4c5 Emit propertiesChanged on the global stack from the extruder stack
But only when the setting that changed has a relation that is not
settable per extruder.

Fixes CURA-3521
2017-07-11 12:03:23 +02:00
Ghostkeeper
012d299d98
Prevent circular import
When this is imported during the __init__, it'll long have been imported elsewhere and won't need to import it again but still guarantees that it is actually imported if no other module does it first.

Contributes to issue CURA-4024.
2017-07-10 16:42:38 +02:00
Ghostkeeper
f0d327c0d0
Set setting_version properly on new stacks so you don't need to upgrade
I don't think stacks had a setting_version property previously.

Contributes to issue CURA-4024.
2017-07-10 11:22:35 +02:00
Ghostkeeper
81e07b1530
Use stack properties instead of .findContainer(type = ...)
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.
2017-07-10 10:35:03 +02:00
Lipu Fei
3d48024a47 Override getConfigurationTypeFromSerialized for GlobalStack
CURA-3975

GlobalStack has metadata type "machine", which is different from what is
registered in the VersionUpgradeManager "machine_stack". This commit
makes sure that Cura can find the correct upgrade route for the
GlobalStack files.
2017-07-06 10:26:02 +02:00
Jaime van Kessel
5fa2ba6052 Undo for material diameter also changes the property.
It used to only set the metadata. CURA-2822
2017-07-04 11:55:24 +02:00
Ghostkeeper
bb79e33ad5
Don't forget to update approximate diameter after resetting actual diameter
The approximate diameter needs to be in a static field because the list model filters on that field. The filter function is not clever enough to be able to filter on values being in some kind of range or rounded, so instead the decision was made that the rounded value needs to be set in a separate field so that the static filter can filter on it.

Contributes to issue CURA-2822.
2017-06-29 16:55:47 +02:00
Ghostkeeper
034686e9fa
Don't modify list you're iterating over
It doesn't give a problem right now since we're only iterating over lists of length 1 here, but in the future this could cause weird bugs.

Contributes to issue CURA-2822.
2017-06-29 15:09:50 +02:00
Ghostkeeper
8ae49c317c
Emit metaDataChanged when changing properties
Properties is a dictionary inside the metadata dictionary. If you change one of the properties, it'll check afterwards if the dictionary is different from what it was before, but since the dictionary is passed by reference all the time, it'll think that the dictionary didn't change: The reference is still the same, so the thing it checks against is updated along.
This solution is a bit ugly but it does notice when the metadata changed inside the properties and then emits a change signal.

Contributes to issue CURA-2822.
2017-06-29 15:03:49 +02:00
Ghostkeeper
21624d7761
Merge branch '2.6' 2017-06-27 16:25:55 +02:00
Ghostkeeper
b2b9b1bede
Fix checking if container stack exists
It was checking a container stack ID against the definition containers, which doesn't match.

Contributes to issue CURA-3973.
2017-06-27 15:14:26 +02:00
Ghostkeeper
df2ec7bd73
Don't try to activate a machine that we don't have a definition for
Contributes to issue CURA-3973.
2017-06-27 14:02:35 +02:00
Jaime van Kessel
7813bfc543 No longer crash when trying to get non existing extruder stacks
CURA-3953
2017-06-26 13:16:14 +02:00
Ghostkeeper
13c9519a7c
Fix deprecated decorator
Contributes to issue CURA-2822.
2017-06-23 09:42:08 +02:00
Ghostkeeper
bc219a06fe
Add MaterialsModel to make material list update upon metadata change
This new model inherits from InstanceContainersModel. The only change is that it updates when the metadata of a material container changes. This is needed to make the list of materials update when the material diameter changes.

Contributes to issue CURA-2822.
2017-06-22 18:17:16 +02:00
Ghostkeeper
0e23930bfe
Fix checking whether the old material diameter was the same
Getting the old material diameter wasn't working properly.

Contributes to issue CURA-2822.
2017-06-22 18:17:16 +02:00
Ghostkeeper
7ea1d4cc5a
Add getContainerProperty function
The opposite of setContainerProperty.

Contributes to issue CURA-2822.
2017-06-22 18:17:15 +02:00
Ghostkeeper
f041473465
Fix applying material diameter undo
Somehow it seems to get the wrong value there though. Debugging that next...

Contributes to issue CURA-2822.
2017-06-22 18:17:15 +02:00
Ghostkeeper
c192d37daa
Fix connecting undo action to undo button
Also hiding the message afterwards. Apparently that's not done automatically.

Contributes to issue CURA-2822.
2017-06-22 18:17:15 +02:00
Ghostkeeper
b37fa6f718
Implement warning message when you change material diameter
The undo functionality currently gives an error though. Investigating...

Contributes to issue CURA-2822.
2017-06-22 18:17:15 +02:00
Ghostkeeper
121bf5897d
Deprecate _updateMaterialContainer
There are better alternatives nowadays.

Discovered during CURA-2822.
2017-06-22 18:17:15 +02:00
Ghostkeeper
fc96dfec4e
Expose approximateMaterialDiameter of the definition
This way we can request that from QML.

Contributes to issue CURA-2822.
2017-06-22 18:17:15 +02:00
Jaime van Kessel
41c5aaed69 Merge branch '2.6' of github.com:Ultimaker/Cura 2017-06-16 13:53:05 +02:00
Jaime van Kessel
2adf97ba2d Also apply the filtering on the quality and user profiles model
CURA-3935
2017-06-15 17:18:04 +02:00
Jaime van Kessel
c93acc12e7 Merge branch '2.6' of github.com:Ultimaker/Cura 2017-06-15 15:28:34 +02:00
Ghostkeeper
e003abf895
Only display global quality changes profiles
There's one copy for every stack. It doesn't matter which one we take as long as they have the same name. Global is always present, even in single extrusion. Seems the most logical one to display.

Contributes to issue CURA-3935.
2017-06-15 14:38:04 +02:00
Ghostkeeper
66f5b236d6
Merge branch '2.6' 2017-06-15 09:54:19 +02:00
Jaime van Kessel
7551c83612 QualityChanges are now also removed if a machine has a parentDefinition
CURA-3929
2017-06-14 11:04:22 +02:00
Ghostkeeper
8bce6e060c
Merge branch '2.6' 2017-06-14 10:58:11 +02:00
fieldOfView
49f2fb2cea
Fix filtering maerials after editing materials
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.
2017-06-14 10:42:04 +02:00
fieldOfView
8f7471a892
Remove debug statement 2017-06-14 10:41:53 +02:00