Merge branch 'master' into fieldOfView-feature_firmware_updater

Conflicts:
	cura/PrinterOutput/PrinterOutputModel.py - Bunch of code that was moved.
	plugins/USBPrinting/USBPrinterOutputDevice.py - Collisions with code style fixes.
	plugins/UltimakerMachineActions/UpgradeFirmwareMachineAction.qml - Bunch of code that was moved.
This commit is contained in:
Ghostkeeper 2018-10-15 16:52:22 +02:00
commit b5d8c1af6f
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
27 changed files with 253 additions and 94 deletions

View file

@ -1,15 +1,26 @@
# Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtGui import QImage
from PyQt5.QtQuick import QQuickImageProvider
from PyQt5.QtCore import QSize
from UM.Application import Application
## Creates screenshots of the current scene.
class CameraImageProvider(QQuickImageProvider):
def __init__(self):
super().__init__(QQuickImageProvider.Image)
## Request a new image.
#
# The image will be taken using the current camera position.
# Only the actual objects in the scene will get rendered. Not the build
# plate and such!
# \param id The ID for the image to create. This is the requested image
# source, with the "image:" scheme and provider identifier removed. It's
# a Qt thing, they'll provide this parameter.
# \param size The dimensions of the image to scale to.
def requestImage(self, id, size):
for output_device in Application.getInstance().getOutputDeviceManager().getOutputDevices():
try:

View file

@ -130,9 +130,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
# We need to check if the manager needs to be re-created. If we don't, we get some issues when OSX goes to
# sleep.
if time_since_last_response > self._recreate_network_manager_time:
if self._last_manager_create_time is None:
self._createNetworkManager()
elif time() - self._last_manager_create_time > self._recreate_network_manager_time:
if self._last_manager_create_time is None or time() - self._last_manager_create_time > self._recreate_network_manager_time:
self._createNetworkManager()
assert(self._manager is not None)
elif self._connection_state == ConnectionState.closed:

View file

@ -175,7 +175,7 @@ class PrinterOutputModel(QObject):
def getController(self) -> "PrinterOutputController":
return self._controller
@pyqtProperty(str, notify=nameChanged)
@pyqtProperty(str, notify = nameChanged)
def name(self) -> str:
return self._name