374 Commits

Author SHA1 Message Date
Jaime van Kessel
43fd38e48e Add missing return
This caused the slicing to not be correctly aborted when the primetower was
in the wrong location

CURA-8499
2021-08-30 13:10:10 +02:00
Jaime van Kessel
21a076aea4 Set type of engine crash message to Error 2021-08-12 11:17:38 +02:00
jelle Spijker
2e6a488c98
Set "Unable to slice" msgs to warning types
Contributes to CURA-8418
2021-07-28 09:47:14 +02:00
Jelle Spijker
2263969d5f
Updated message with message types
Contributes to CURA-8418
2021-07-28 08:45:42 +02:00
Ghostkeeper
503293fbeb
Revert "Also show error message if connection got reset without error code"
This reverts commit 40fe8b577d004d1357235e931ee7344b013d96ad.
2021-07-16 10:15:40 +02:00
Ghostkeeper
40fe8b577d
Also show error message if connection got reset without error code
When working with --external-backend, the engine just stops responding, and the operating system cleans up its socket connection. From Cura's front-end we then just see the socket reset. So we should interpret a reset socket to mean that the slicing process was halted.
When not working with an external backend, a crash would always give a response code and we can base it on that instead (as previously implemented).

Contributes to issue CURA-6568.
2021-07-15 17:01:07 +02:00
Ghostkeeper
623b59d0e8
Set self to be in an error state if backend crashed
Contributes to issue CURA-6568.
2021-07-15 16:52:35 +02:00
Ghostkeeper
e127f7e4b6
Move construction of slicing error message to constructor
This way we could re-use it in other places.

Contributes to issue CURA-6568.
2021-07-15 16:45:50 +02:00
Ghostkeeper
26487c5b31
Stop slicing if an error occurred
If the user has auto-slicing enabled, this causes the indeterminate progress bar to appear.
If the user doesn't have auto-slicing enabled, this causes the slice button to reappear.

Both of these indicate that something has caused slicing to be interrupted. The message should make clear why.

Contributes to issue CURA-6568.
2021-07-14 17:05:45 +02:00
Ghostkeeper
399b378ba6
Show message when slicing failed with nonzero exit code
The slicing engine should never crash. If it does though, it's best to show something to the user. Otherwise the slicing process just halts and the user will wait a long time for it to never finish.

Contributes to issue CURA-6568.
2021-07-14 17:05:44 +02:00
Remco Burema
f2088d7fc8
Don't take snapshot if no main window present.
You'll need the Uranium branch of the same (fix_is_visible) name if you don't want this to crash on slicing!
2021-01-29 07:59:54 +01:00
Ghostkeeper
a9bf3ed934
Revert "Small fix for slice before main window visible."
This reverts commit 35d6aad6cd7e8a16fbb829dcf8f0b70db12d0028.
This is causing a very weird crash when autoslice is enabled:
2021-01-28 12:12:35,379 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [66]: An uncaught error has occurred!
2021-01-28 12:12:35,379 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]: Traceback (most recent call last):
2021-01-28 12:12:35,379 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:   File "/home/trin/Gedeeld/Projects/Cura/plugins/CuraEngineBackend/CuraEngineBackend.py", line 270, in slice
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:     self._createSnapshot()
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:   File "/home/trin/Gedeeld/Projects/Cura/cura/Utils/Threading.py", line 31, in _call_on_qt_thread_wrapper
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:     return func(*args, **kwargs)
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:   File "/home/trin/Gedeeld/Projects/Cura/plugins/CuraEngineBackend/CuraEngineBackend.py", line 254, in _createSnapshot
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]:     if not CuraApplication.getInstance().isVisible:
2021-01-28 12:12:35,380 - CRITICAL - [MainThread] cura.CrashHandler.__init__ [69]: AttributeError: 'CuraApplication' object has no attribute 'isVisible'

The property exists all right. It's in the dir() of the CuraApplication instance. PyCharm's debug mode also gives a traceback when trying to evaluate the property. It clearly thinks it's there, but then it's not or something. Very weird. We need to take a better look at this than this quick fix.
2021-01-28 12:23:01 +01:00
Ghostkeeper
678516186e
Revert "Don't call @property function"
This reverts commit 3921cc86d1e3b9e86c5cd0a27cdc83be01b25106.
2021-01-28 12:22:47 +01:00
Ghostkeeper
3921cc86d1
Don't call @property function
It directly returns the boolean. No need to call it. Calling it crashes saying that a bool object can't be called.
2021-01-28 11:48:18 +01:00
Remco Burema
35d6aad6cd
Small fix for slice before main window visible. 2021-01-28 11:41:46 +01:00
Remco Burema
f4ef3b44e3
Properly retrieve snapshot (now made on slice).
Circumvents the snapshot/thumbnail not working when the focus is not on the main window, even if the thread is main. This was an issue when writing a file to Digital Factory becasue that workflow uses a modal window.

Thanks for the idea Jelle!
2021-01-21 08:55:45 +01:00
Remco Burema
4fc0612806
Make a snapshot on slice instead of write.
In some cases, UFP-writing is going to be done when the OpenGL-context is off the main window. This doesn't work. That unfortunately also goes for this commit, but it's a work in progress.
2021-01-21 08:19:17 +01:00
Ghostkeeper
452fe3972f
Don't cache CuraApplication singleton
This is causing a crash if self._application is used before the __init__ has finished (or at least passed the definition of self._application). That can happen in this class since some functions are called asynchronously.
It would also make writing tests easier because you can mock the getInstance() function to return a mock object, and only need to monkeypatch that for the function under test rather than also for the constructor.

Fixes Sentry issue CURA-1B5.
2020-10-16 12:05:21 +02:00
Nino van Hooff
89f0970a88 Remove trailing whitespace from Python files 2020-05-29 14:30:33 +02:00
Nino van Hooff
176919eee0 Merge branch 'master' into doxygen_to_restructuredtext_comments
# Conflicts:
#	plugins/CuraEngineBackend/CuraEngineBackend.py
#	plugins/CuraEngineBackend/StartSliceJob.py
2020-05-08 15:31:23 +02:00
Nino van Hooff
797d6ed438 Convert doxygen to rst for CuraEngineBackend 2020-05-08 15:23:51 +02:00
Jaime van Kessel
245a4435e1
Also handle sceneChanged when it's from the root
The rest of the code also seems to expect that
2020-05-01 14:39:23 +02:00
Ghostkeeper
add9be387b
Fix crash when creating a socket before the plug-in is fully registered
The plug-in ID is set once the register function is completed, so after initialisation. If the _createSocket function is called in between, Cura would crash.
I don't know why the _createSocket function would be called in between, but possibly another plug-in causes an event that calls it since it's being called on many events (everything that would initiate a reslice).

Fixes Sentry issue CURA-K4.
2020-04-23 11:38:27 +02:00
Matt Jani
43ab23439b Fixed small typo in nothing to slice
CURA-7277
2020-03-10 11:05:30 +01:00
Matt Jani
3887814660 Update the nothing to slice message
The message didn't list all the cases that it could pop up.

CURA-7277
2020-03-10 10:59:33 +01:00
Lipu Fei
b03f666bf5 WIP: Make it work with Python 3.7 packaing 2020-02-07 23:14:47 +01:00
Jaime van Kessel
23469948f6
Fix translation mistake in a message 2019-10-08 13:58:31 +02:00
Jaime van Kessel
0ff9d72c4c
Remove use of deprecated extruders property 2019-09-13 17:27:16 +02:00
Lipu Fei
0524796145 Do not trigger slicing if there's no slicable object
CURA-6604
2019-09-03 20:01:41 +02:00
Mark Burton
41d7a705e6 Avoid crash due to race in CuraEngineBackend. 2019-08-29 21:35:13 +01:00
Ghostkeeper
23f4aa6e4f
Fix potential race condition when slice messages arrive after clearing build plate
Fixes #6245.
2019-08-26 09:15:37 +02:00
Jaime van Kessel
d8ddcba091 Fix typing ignore for breath frist iterator 2019-07-23 13:40:40 +02:00
Jaime van Kessel
843bb6f5a3 Change some of the logging messages to info
CURA-6525
2019-05-15 17:25:31 +02:00
Jaime van Kessel
8f8a982be7 Merge branch '4.1' of github.com:Ultimaker/Cura into 4.1 2019-05-09 15:05:18 +02:00
Jaime van Kessel
d5d37ccf0f Check if auto slicing needs to be done slightly more frequent
Otherwise it might get stuck in some cases if you loaded a object after loading a gcode

CURA-6422
2019-05-09 15:04:14 +02:00
Diego Prado Gesto
11e86512cb Include the prime tower to the time calculations
Contributes to CURA-6509.
2019-05-06 14:33:24 +02:00
Lipu Fei
4a171eebf6 Move models around again
- Move machine related models to cura.Machines.Models
 - Move printer device related models to cura.PrinterOutput.Models
 - Other UI/GUI related modules in cura.UI
2019-03-26 08:29:22 +01:00
Lipu Fei
615241a416 Fix module renaming 2019-03-20 13:39:08 +01:00
Lipu Fei
4078719c58 Move cura.Machine.Models to cura.UI.MachineModels 2019-03-20 09:56:11 +01:00
Jaime van Kessel
3f18b0b974 Increase agressiveness of short circuit logic; Just check if the node is slicable
That should also filter out platform, buildVolume and convexHulLNodes
2019-02-19 18:00:20 +01:00
Jaime van Kessel
aef89e2bd3 Add few more cases where Camera changes caused un-needed updates 2019-02-19 17:40:44 +01:00
Lipu Fei
c602c1cf15 Use MachineManager.activeMachine instead of Application.globalstack
CURA-6117
2019-01-18 14:08:53 +01:00
Jaime van Kessel
862c76a2ea Check if the optimised layer data is stored before attempting to delete it 2019-01-09 12:51:20 +01:00
Jaime van Kessel
7269065cca Only clear the stored optimized layer data if the slice started 2018-12-21 11:54:11 +01:00
Ghostkeeper
75fbdf2c94
Expand error message for cases when extruders are disabled
It is also unable to slice models that are on extruders that are disabled.
2018-12-21 10:40:37 +01:00
Jaime van Kessel
8bff0d17e8 Prevent the backend attempting to reslice everytime a preference changed 2018-12-20 09:43:01 +01:00
Jaime van Kessel
75ff03f3c8 Use setState instead of emitting the backend state
CURA-6016
2018-12-11 13:13:20 +01:00
Ghostkeeper
cc77632357
Merge branch 'master' into refactor_singleton_settingsbase 2018-09-13 11:52:13 +02:00
Jaime van Kessel
a8fc6aabcc Switch incorrect usage of getMachineExtruders to getActiveExtruderStacks 2018-09-07 16:27:56 +02:00
Lipu Fei
a8a88e5ccb Remove mistake changes in CuraEngineBackend 2018-09-06 16:06:45 +02:00