2232 Commits

Author SHA1 Message Date
Ghostkeeper
f436cb8e7b
Add notion of whether printers support the material export archive
Contributes to issue CURA-8055.
2021-06-08 16:50:03 +02:00
Ghostkeeper
2f8f98fcca
Add a log entry for importing, duplicating or removing a material
We encountered an issue yesterday that we had to find in a log file when a user was importing a material. Nothing is shown in the log when importing a material, so it was impossible to find.
Now we'll log this action. It is a direct user action, so info is a good log level.
2021-06-04 02:51:13 +02:00
Ghostkeeper
58369822fc
Clean up invalid quality changes robust to asynchronous changes
It's possible that a profile is no longer in the registry by the time it gets to that point in the list if this clean-up is triggered by the very action of deleting a profile.

Fixes Sentry issue CURA-1T5.
2021-03-16 16:36:01 +01:00
Ghostkeeper
ba5b033499
Don't crash when not able to read maximum file name length
Just use a safe-ish maximum then.

Fixes Sentry issue CURA-1QY.
2021-02-04 17:10:03 +01:00
Ghostkeeper
1b8463ba30
Catch TypeError when parsing setting version
Someone had a list in the setting version, which then crashed Cura.
2021-01-19 14:09:46 +01:00
Ghostkeeper
0788df4797
Add log entry upon exporting container
Quite a salient moment in the log. According to our log levels definitions this must be info since it's the direct result of a user interaction.
2021-01-06 14:11:15 +01:00
Remco Burema
9afbc64934
Merge branch '4.8' 2020-11-10 11:31:53 +01:00
Kostas Karmas
4b35bd1724 Correct the print sequence when discarding the current changes
CURA-7827
2020-11-09 18:10:50 +01:00
Kostas Karmas
fab2c31b4f Cover the last remaining case when setting the print sequence
If for some reason the print sequence is set to one-at-a-time be default in the printer definition
and the number of extruders of the printer is set to >=2, then the print_sequence won't show up in
neither the quality changes nor the user changes, yet it will still have "one-at-a-time" as a
value. In a such case, it will still need to be set to "all-at-once" in the user changes.

This is a theoretical case, as it is very unlikely for a printer to have "one-at-a-time" set by
default in its definition (.def.json) file and still be able to support more than one extruders.
But it is a world full of possibilities out there, so you never know...

CURA-7827
2020-11-09 16:55:43 +01:00
Kostas Karmas
07453e101e Add detailed documentation for _correctPrintSequence function
CURA-7827
2020-11-09 16:32:05 +01:00
Kostas Karmas
2ccdd11098 Properly set the print sequence in the correct container
Previously, the print sequence would be always set to all-at-once in the user container whenever
the second extruder would be enabled. This was causing an interface issue, where the circular
reset-setting arrow would appear next to the setting, even if the quality changes already had the
correct value ("all-at-once").

This is now fixed by checking the following:
- If print_sequence == "one_at_a_time" in the quality (so it is already saved in a quality profile)
then set the print_sequence to "all_at_once" in the user changes so that it will be displayed as
an unsaved change
- If print_sequence == "one_at_a_time" in the user changes container only, meaning that it is not
saved in any quality profiles, then just reset the print_sequence in the user changes, so that it
will have the correct value ("all-at-once") without the reset-setting arrow appearing next to it.

CURA-7827
2020-11-09 16:20:13 +01:00
Kostas Karmas
a1c7ebe1c3 Fix mypy complaints
CURA-7827
2020-11-05 19:04:29 +01:00
Kostas Karmas
845c994cbc Replace f string since it's not available in Python3.5
That should fix the failing test which produces a SyntaxError.

CURA-7827
2020-11-05 17:38:34 +01:00
Kostas Karmas
1a759f81df Change print sequence when the number of enabled extruders changes
Fixes https://github.com/Ultimaker/Cura/issues/8682 while still maintaining the correct behavior for CURA-6914.

CURA-7827
2020-11-05 16:58:47 +01:00
Ghostkeeper
31ee864f04
Disallow printer names that start with a dot
Fixes #8639.
2020-10-30 11:10:46 +01:00
Konstantinos Karmas
4e6097f499
Revert "Prevent duplicate adding of extruders" 2020-10-27 11:29:08 +01:00
Ghostkeeper
5cfe18d31c
Clarify user-facing string to remove internal terminology
The user doesn't know what a global stack is. This is a message that more clearly specifies what is really happening as far as the user can see.

The global stack may be None if this code is executed while there is no active printer. Normally the only time there is no active printer is:
- during first launch, while in the welcome screen
- during start-up until the profiles have been loaded
- if there was a profile corruption of some kind with the active printer.

So this function should not get called during those times. It probably isn't called except for the last case (in which case it's acceptable I guess).
This change is made after a request from a translator what the hell this means.

Contributes to issue CURA-7783.
2020-10-27 10:54:07 +01:00
Konstantinos Karmas
4804072625
Merge pull request #8553 from Ultimaker/CURA-7501_no_double_adding_extruders
Prevent duplicate adding of extruders
2020-10-26 17:02:51 +01:00
Ghostkeeper
4b3fda21e2
Prevent duplicate adding of extruders
The addMachineExtruders function assumes that this is a new printer (first time the printer is activated since a restart of Cura) and it needs to add the extruder stacks to it. However most of the time when we're switching, it's not to a new printer. If it's not a new printer, this function would get called anyway and we'd be adding the extruders multiple times. This then does a lot of unnecessary work and eventually fails a couple of calls deep.
This change prevents it from adding the extruders if there are already extruders associated with the printer, thus preventing this unnecessary work (switch is faster) and preventing the error from happening.

Discovered during work on CURA-7501.
2020-10-16 16:09:37 +02:00
Jaime van Kessel
50ae33c42d
Force an re-evaluation of a setting when extruder has been disabled
CURA-7770
2020-10-16 10:50:05 +02:00
Kostas Karmas
f25bfd717e Recalculate the number of user settings after setting the quality group
So that the dialog ensures actually knows that there are no changed settings and will not show up.

CURA-7728
2020-10-06 09:55:11 +02:00
Jaime van Kessel
dd359da1cf
Prevent crash when material is unknown
Fixes CURA-GV
2020-09-16 16:37:09 +02:00
Remco Burema
3fcd7d567f
Show warning icon on import non-visible profile.
part of CURA-7691
2020-09-16 08:26:41 +02:00
Kostas Karmas
0524e8d129 Fix missing quality profile when message says its successful
Make sure to add the container before doing any other checks. Then, if the importing fails, remove
all the profiles related to that quality.

CURA-7691
2020-09-11 11:35:39 +02:00
Kostas Karmas
665496ceff Warn when importing quality profiles that don't match the current configuration
When importing a profile that doesn't much the current nozzle combination (e.g. importing a 'high'
quality when we have AA0.8 and AA0.4 nozzles), the profile was being accepted and a success message
was shown to the user, but the quality did not show up in the profile list.

This commit fixes that by accepting the quality profile and informing the user that the profile is
not visible due to the current configuration.

CURA-7691
2020-09-10 16:58:30 +02:00
Jelle Spijker
0725bdcd64
Merge pull request #8335
Speed up disable extruder
2020-09-09 09:42:36 +02:00
Ghostkeeper
6e2738a254
Don't update extruders that Cura doesn't have
This is a bit of defensive coding. If the position is out of bounds for Cura it should now ignore those extruders.
This could be due to broken firmware, or maybe someone MITM-ing the connection and changing it, or perhaps because the printer was changed while the sync was ongoing? Whatever the cause, it now puts a warning in the log about it and doesn't crash any more.

Fixes Sentry issue CURA-156.
2020-09-08 12:53:30 +02:00
Jaime van Kessel
175244fdc8
No longer spam the GUI with hasUserSettingsUpdates
The QML profiler showed me that it was causing a *lot* of issues
when switching between extruders. More than 10% of the time in QML
was spent on just updating ine property in the workspace summary dialog.
There were other properties that were also being updated without there being a point.

Contributes to #8250
2020-09-04 17:23:52 +02:00
Jaime van Kessel
6dbdee8d98
Don't switch away from disabled extruder
In some situations this could cause a slowdown, since halfway through
calculating the values the extruder switch would happen. If this is
split up a bit, it's at least less noticeable

Contributes to #8250
2020-09-04 16:43:53 +02:00
Jaime van Kessel
c383fe9656
Don't force an update when disabling an extruder
All the settings that are changed get a notification from the settingRelation.
There should be no need to re-fire all of those settings again!

Contributes to #8250
2020-09-04 16:39:06 +02:00
Jaime van Kessel
8ecdce3b26
Remove postponeEmit that didn't do anything
The signals it was postponing weren't ever being triggered
2020-09-04 16:38:15 +02:00
Jaime van Kessel
1097dbdfa5
Fix copypaste mistake 2020-08-24 10:11:49 +02:00
Jaime van Kessel
13600504d4
Fix mypy failure 2020-08-24 09:33:56 +02:00
Jaime van Kessel
87fb495e07
Add some property tests for MachineManager 2020-08-21 16:36:04 +02:00
Jaime van Kessel
4a47606176
Fix mypy issue 2020-08-21 15:52:13 +02:00
Jaime van Kessel
ce930220e9
Add tests for SetActiveMachine 2020-08-21 15:14:44 +02:00
Jelle Spijker
b685da5a24
Merge pull request #8195 from Ultimaker/GetPropertySpeedImprovements
Get property speed improvements
2020-08-19 16:41:26 +02:00
Jaime van Kessel
907caa53f0
Ensure that changing material type results in profile re-evaluation
CURA-7657
2020-08-18 13:54:21 +02:00
Jaime van Kessel
bc67b057ea
Add missing required typing 2020-08-14 15:19:59 +02:00
Jaime van Kessel
eee84a82bf
Use exception instead of check if key is in dict
Since the amount of times that the key is in there is orders of magnitude
larger, it's better to catch the exception when it doesn't (as that is
slightly faster)
2020-08-14 15:15:33 +02:00
Jaime van Kessel
9c904f95ce
Add a cache for settable_per_extruder property 2020-08-14 14:51:46 +02:00
Jaime van Kessel
51737dccd6
Don't create a context when it's not provided
The rest of the functions already assume that None is an empty context
2020-08-14 14:19:19 +02:00
Jaime van Kessel
4c00a8ff2c
Add extra short-circuit for resolve 2020-08-14 13:57:09 +02:00
Jaime van Kessel
9a0264644b
Simplify the _shouldResolve function
This increases the speed of the setting resolvement.
2020-08-14 13:41:20 +02:00
Jaime van Kessel
dd42c87da7
Merge branch 'CURA-7646_Settings_not_applied_when_creating_new_CFFF_from_project_file' of github.com:Ultimaker/Cura into 4.7 2020-08-12 13:42:14 +02:00
Jaime van Kessel
e42369179f
Merge branch '4.7' of github.com:Ultimaker/Cura into 4.7 2020-08-11 11:38:31 +02:00
Kostas Karmas
61cc8c9a95 Remove reference to JIRA ticket in comments
CURA-7646
2020-08-10 14:58:59 +02:00
Kostas Karmas
2828f45e89 Add optional machine_extruder_count when creating a machine
If the machine_extruder_count is not taken into consideration on machine creation, calling the
extruderList of that machine will return an incomplete list of extruders (since it considers the
default machine_extruder_count). This causes problems in machines with settable number of extruders
where the default machine_extruder_count is 1 while the machine may have more than 1 extruders.

The problem becomes especially visible when opening a project file with e.g. a CFFF with multiple
extruders, because when the machine is created we do not know yet how many extruders the printer
actually has.

CURA-7646
2020-08-10 14:49:41 +02:00
Ghostkeeper
e7d95f6d90
Give an error message when stack fails to build
This way we may venture at a reason why it failed to build.
2020-08-10 11:26:09 +02:00
Jaime van Kessel
724498cba7
Reset quality if none was found
CURA-7589
2020-08-06 17:12:14 +02:00