2372 Commits

Author SHA1 Message Date
Ghostkeeper
7ab6a551c1
Clarify that XML material tags don't get translated
Some of the translators got this wrong last time. Let's see how good they read this next time...

Contributes to issue CURA-4113.
2017-08-14 13:54:11 +02:00
Lipu Fei
dce575f661 Remove wall_extruder_nr from ExtruderManager.getUsedExtruderStacks
CURA-4145
2017-08-14 13:39:56 +02:00
Lipu Fei
bb1316fc88 Check if a material is being used based on base_file
CURA-4129
2017-08-14 08:48:07 +02:00
Lipu Fei
4bac499c22 Use QualityManager._getFilteredContainersForStack() to get qualities
CURA-4151

The quality searching code in _configureProfile() for importing quality
profiles doesn't take into account base materials. Use the function in
QualityManager to solve this problem.
2017-08-10 12:14:43 +02:00
Lipu Fei
6fd3963e8f Fix material searching in isContainerUsed()
CURA-4129

Searching for used materials should also take into account the material
container ID.
2017-08-09 09:47:36 +02:00
Lipu Fei
e414621250 Fix code style 2017-08-09 09:27:42 +02:00
Lipu Fei
ab3d8349b6 Also skip empty containers when getting layer height for a quality profile
CURA-4133

On some machines such as UM2, there is no material. Getting the layer
height in this case will result back to the global stack itself, which
is the layer height of the current setting. This is a problem for
"Normal" (or "Fine") quality because it uses the machine's default layer
height.
2017-08-09 09:24:04 +02:00
Lipu Fei
8c6abc85fc Rename variable in for loop
CURA-4129
2017-08-08 16:32:40 +02:00
Lipu Fei
bb1475d1fd Search for instance containers with type material
CURA-4129
2017-08-08 16:32:02 +02:00
Ghostkeeper
b9cdeb68d6
Don't crash when there is no global quality container
We fill the stack with an empty container rather than with None in that case.

Contributes to issue CURA-3301.
2017-08-08 14:40:02 +02:00
Ghostkeeper
fe406f530c
Never fill None for quality changes profile
We want it to be the empty profile instead. This gets passed on all the way to _replaceQualityOrQualityChangesInStack where the metadata is requested.

Contributes to issue CURA-3301.
2017-08-08 13:51:40 +02:00
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