Lipu Fei 6 лет назад
Родитель
Сommit
20806eeb72
2 измененных файлов с 6 добавлено и 7 удалено
  1. 4 5
      cura/CameraImageProvider.py
  2. 2 2
      plugins/UM3NetworkPrinting/ClusterMonitorItem.qml

+ 4 - 5
cura/CameraImageProvider.py

@@ -4,21 +4,20 @@ from PyQt5.QtCore import QSize
 
 from UM.Application import Application
 
+
 class CameraImageProvider(QQuickImageProvider):
     def __init__(self):
-        QQuickImageProvider.__init__(self, QQuickImageProvider.Image)
+        super().__init__(QQuickImageProvider.Image)
 
     ##  Request a new image.
     def requestImage(self, id, size):
         for output_device in Application.getInstance().getOutputDeviceManager().getOutputDevices():
             try:
-
                 image = output_device.activePrinter.camera.getImage()
-
                 if image.isNull():
-                    return QImage(), QSize(15, 15)
+                    image = QImage()
 
                 return image, QSize(15, 15)
             except AttributeError:
                 pass
-        return QImage(), QSize(15, 15)
+        return QImage(), QSize(15, 15)

+ 2 - 2
plugins/UM3NetworkPrinting/ClusterMonitorItem.qml

@@ -9,7 +9,7 @@ Component
 {
     Rectangle
     {
-        id: rectangle
+        id: monitorFrame
         width: maximumWidth
         height: maximumHeight
         color: UM.Theme.getColor("viewport_background")
@@ -107,7 +107,7 @@ Component
 
         onVisibleChanged:
         {
-            if(rectangle != null && !rectangle.visible)
+            if (!monitorFrame.visible)
             {
                 // After switching the Tab ensure that active printer is Null, the video stream image
                 // might be active