Commit Graph

142 Commits

Author SHA1 Message Date
Roman Beránek
50b4f08e37 drop deprecated TBB components (#6590)
Quite some time ago, many of the TBB components were deprecated in favor
of their near-equivalents in the STL or, in the case of task_scheduler_init,
were broken up and reconstituted under a less ad-hoc logic. Every time a header
file marked deprecated gets included, a rather loud warning is emitted, which
leads to a complete TBB's domination over the stderr stream during build time,
making it harder to notice _legitimate_ warnings.

Instead of merely muting the output with TBB_SUPPRESS_DEPRECATED_MESSAGES,
perform a genuine migration away from the deprecated components with the added
benefit of achieving a source compatibility with oneTBB, the successor to TBB
which has dropped the deprecated API for good.

What got replaced for what?

| Deprecated				| Replacement					|
| ------------------------------------- | --------------------------------------------- |
| `tbb::atomic`				| `std::atomic`					|
| `tbb::mutex`				| `std::mutex`					|
| `tbb::mutex::scoped_lock`		| `std::scoped_lock<std::mutex>`		|
| `tbb::mutex::scoped_lock` (empty)	| `std::unique_lock<std::mutex>` (deferred)	|
| `tbb::task_scheduler_init`		| `tbb::global_control`				|
| `tbb::this_thread`			| `std::this_thread`				|

Signed-off-by: Roman Beranek <roman.beranek@prusa3d.com>
2021-06-23 11:48:48 +02:00
Vojtech Bubnik
c1acfce61f Checking for removable media on Chrome OS. 2021-03-15 17:42:18 +01:00
Vojtech Bubnik
aa0216af39 Worked around some quirky Linux file system issues. Namely
the Chromebooks share their file system to Linux using the 9p file
system, which does not support setting file ownership. Newly PrusaSlicer
will detect platform and it will not panick if copy_file() cannot set
file ownership after copying. It just logs the incident, and on
chromebooks the loglevel for that incident is "Info", not "Error".

Adjusted the full screen mode to contain menu bar.
Moved Platform.cpp/hpp to libslic3r
2021-03-15 16:19:22 +01:00
Vojtech Bubnik
0308debf16 Detecting platform, namely reading /proc/version to detect Chromium OS.
Disabling Eject on Chromium, detecting removable media the Chromium way.
2021-03-15 09:55:57 +01:00
Vojtech Bubnik
1c79b9b01e Further ChromeOS support: Detect removable media mounted through ChromeOS 2021-03-15 09:55:57 +01:00
Vojtech Bubnik
0fdfb1306e Fixing compiler warnings: Fixed broken Linux build. 2021-02-09 20:06:08 +01:00
Vojtech Bubnik
e40485fc8a Fixed some clang warnings 2021-02-09 19:23:58 +01:00
Vojtech Bubnik
fc86ae66bd Fix of Ejecting of device has failed on Ubuntu Linux #3975
Eject failed due to superfluous escaping of spaces in path to the SD card
mount point.
2021-01-07 14:17:09 +01:00
Vojtech Bubnik
0904346dbc Fixed compilation on OSX 2021-01-07 13:13:35 +01:00
Vojtech Bubnik
b2b3ec61cf Fix of previous commit for OSX 2021-01-07 12:19:41 +01:00
Vojtech Bubnik
627609bbc5 Fix of previopus commut 2021-01-07 12:09:47 +01:00
Vojtech Bubnik
d4036067dc Fixing the SD card eject issue on OSX by pushing the call to
"diskutil eject" to a worker thread.
Hopefully fixes Ejecting an SD card is slow and locks UI #4844
2021-01-07 12:02:44 +01:00
David Kocik
3d7b67f6be Added error-checking for child.wait() call during removable drive ejection (to prevent #5507)
Mark Ejection as failed if the wait() function fails. It seems that it is not simply possible
to retrieve the exit code of the process in that case (although it usually finishes sucessfully).
2020-12-22 12:18:30 +01:00
david kocik
861ae1dd6c error_code in boost::filesystem::space to ensure the drive exists. Fix of #5354 2020-12-02 12:12:24 +01:00
David Kocik
9dd001eef8 eject debug log 2020-11-19 15:57:38 +01:00
David Kocik
34ea49cb91 New Export Finished notification showing path and opening containing folder. Fix of #4917. Fixed wrongly grayed eject button in File menu. Hopefully fix of ctrl shortcut of tooltips at sidebar. 2020-11-04 09:29:08 +01:00
David Kocik
e3584e096e Showing Eject button only after exporting is finished. Fix of #4212 2020-07-26 21:16:17 +02:00
bubnikv
33c8e02d5d Win32 specific: Using SHChangeNotifyRegister to get notifications
on removable media insert / eject events.
From now on we no more poll for removable media on Windows.

Thanks @mjgtp from prusaprinters.org
See the following discussion:
https://forum.prusaprinters.org/forum/prusaslicer/prusaslicer-trying-to-access-my-floppy-disk-a

The final working code sample was taken from Chromium source code,
volume_mount_watcher_win.cc
2020-03-27 08:10:00 +01:00
bubnikv
2109136985 Fix of PrusaSlicer trying to access my floppy disk (A:\)
Some customers seem to posses a floppy drive (sic!) and some floppy
drives start spinning if accessed just to check whether there is
a medium plugged in or not.

From now, the A: and B: drives are not checked anymore for removable
media. Now let's pray nobody maps an SD card or flash drive to A: or B:

Fixes
https://forum.prusaprinters.org/forum/prusaslicer/prusaslicer-trying-to-access-my-floppy-disk-a
2020-03-26 19:06:23 +01:00
bubnikv
507e1ae70a Windows do not send an update on insert / eject of an SD card into
an external SD card reader. Windows also do not send an update
on software eject of a FLASH drive. We can likely use the Windows
WMI API, but it will be quite time consuming to implement,
therefore we lower the polling interval back to two seconds.

https://www.codeproject.com/Articles/10539/Making-WMI-Queries-In-C
https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page
https://docs.microsoft.com/en-us/windows/win32/wmisdk/com-api-for-wmi
https://docs.microsoft.com/en-us/windows/win32/wmisdk/example--receiving-event-notifications-through-wmi-
2020-03-13 19:30:41 +01:00
bubnikv
574ec9b7bf Fix of compilation on OSX and Linux, update of camera after 3D mouse
disconnect moved to the main thread.
2020-03-13 14:57:45 +01:00
bubnikv
4cd1243a79 Windows specific refactoring of Mouse3DController and RemovableDriveManager.
PrusaSlicer newly registers by Windows operating system for HID USB
plug / unplug notifications and for Volume attach / detach notifications,
and the background threads of the two respective services are waken up
on these Windows notifications.
The RemovableDriveManager also wakes up every 30 seconds to cope with
the drives ejected from Windows Explorer or from another application,
for example Cura, for which Windows OS does not send out notifications.
2020-03-13 14:19:14 +01:00
bubnikv
0c747450dd Follow-up on 550e5c2fbb3a5151e18b573f246fa78dcef8e964
Fixed some spurious moves of data that should have not been moved.
2020-03-12 12:57:52 +01:00
David Kocik
8219504137 info message - ejecting of sd/flash has failed 2020-03-12 12:57:52 +01:00
David Kocik
598b55ebe1 RemovableDriveManager: not calling update from status()
Update was called too often on main thread mostly from status() causing delays
2020-03-12 11:57:05 +01:00
bubnikv
37604c7144 Improvement in the RemovableDriveManager update function:
Don't call the update() if it is already running. Wait for the
other instance to finish instead.
2020-03-12 11:30:58 +01:00
David Kocik
d993392b33 ejecting sd card/flash drives with boost::process::child on mac/linux 2020-03-10 08:29:11 +01:00
David Kocik
539171c08e enumarating removable drives on mac - added Secure Digital option
hopefully a fix for issue #3793
2020-03-09 15:34:26 +01:00
bubnikv
ee7f4ebba8 Forced SD card / USB drive eject now sends out the event immediately
on Windows as well as on Unix platforms including OSX.
2020-03-09 11:47:20 +01:00
bubnikv
9552fc396e Reworked the eject on unix systems to wait for the return of the
system call to the command line utility and send out the unmount
wxWidgets event immediately.
Hopefully improves 2.2.0-RC Eject is very slow in Linux (#3795)
2020-03-09 10:56:51 +01:00
bubnikv
3105b131d6 Fixed crash on switching the application language.
This crash was caused by the RemovableDriveManager and 3DConnexion
detection services not being stopped correctly.
The fix executes all the tasks of the MainFrame at the language switch,
that are normally performed on application shut down.
2020-03-07 12:24:53 +01:00
bubnikv
a58a3d878c Fixed crash on removable device plug in event due to recent
RemovableDriveManager refactoring.
2020-03-07 10:17:58 +01:00
bubnikv
f2fce0f262 Refactoring of RemovableDriveManager:
1) On Windows and Linux, the device enumeration now runs at a background
   thread, while it ran on the UI thread on idle, which may have been
   blocking on some rare Windows setups, see GH #3515 #3733 #3746 #3766
2) On OSX, the device enumeration now relies on OS callback, no
   polling is required.
3) Refactored for cleaner interface.
2020-03-06 15:10:58 +01:00
Slic3rPE
25c964bb11 linux/osx bug fix checking file path 2020-02-06 09:31:25 +01:00
David Kocik
c6e5df06e3 adding constantness & removing unused code 2020-01-22 17:15:09 +01:00
David Kocik
3ad01c8ef5 removable drive manager bug fixes linux 2020-01-21 13:29:39 +01:00
David Kocik
3ed5d63842 removable drive manager bug fixes 2020-01-21 13:29:39 +01:00
David Kocik
d8bca5b2ac callback for showing action buttons when device is connected/disconnected 2020-01-21 13:29:39 +01:00
David Kocik
d35df019b2 button for exporting gcode to harddrive 2020-01-21 13:29:39 +01:00
bubnikv
9d1865753b Trying to fix Linux compilation 2020-01-06 11:59:24 +01:00
bubnikv
cbd19ad9c0 Replaced unix basename() with boost::filesystem::basename(),
as various unices define basename() differently.
2020-01-06 11:32:17 +01:00
bubnikv
8ebf970934 Const correctness improvements:
removed some unnecessary const_casts that remove const.
2020-01-03 16:33:04 +01:00
David Kocik
e1dddba660 boost::filesystem instead std:: 2019-12-19 17:05:23 +01:00
David Kocik
ff53bf62ae Merge branch 'dk_remote_devices' of https://github.com/prusa3d/PrusaSlicer into dk_remote_devices 2019-12-19 16:28:28 +01:00
David Kocik
f6727ac008 free space check linux + mac 2019-12-19 16:27:48 +01:00
David Kocik
52131413a5 changes in plater.cpp 2019-12-19 14:19:41 +01:00
David Kocik
6eea88423f ommit last filename when checking if path is on drive 2019-12-19 11:47:02 +01:00
David Kocik
f8e137d482 is path on removable drive 2019-12-19 11:13:27 +01:00
David Kocik
a5314501e1 set_did_eject method 2019-12-18 10:08:17 +01:00
David Kocik
638b66e357 bug fix - using two devices 2019-12-18 09:36:26 +01:00