mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-22 10:21:39 -07:00
Added videostream to cluster again
CL-541
This commit is contained in:
parent
aba8bd89c3
commit
77e3965fc7
5 changed files with 139 additions and 6 deletions
|
|
@ -12,6 +12,7 @@ from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutp
|
|||
from cura.PrinterOutput.PrinterOutputModel import PrinterOutputModel
|
||||
from cura.PrinterOutput.PrintJobOutputModel import PrintJobOutputModel
|
||||
from cura.PrinterOutput.MaterialOutputModel import MaterialOutputModel
|
||||
from cura.PrinterOutput.NetworkCamera import NetworkCamera
|
||||
|
||||
from .ClusterUM3PrinterOutputController import ClusterUM3PrinterOutputController
|
||||
|
||||
|
|
@ -290,6 +291,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
|||
|
||||
if printer is None:
|
||||
printer = PrinterOutputModel(output_controller=ClusterUM3PrinterOutputController(self), number_of_extruders=self._number_of_extruders)
|
||||
printer.setCamera(NetworkCamera("http://" + printer_data["ip_address"] + ":8080/?action=stream"))
|
||||
self._printers.append(printer)
|
||||
printer_list_changed = True
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ Item
|
|||
width: 20 * screenScaleFactor
|
||||
height: 20 * screenScaleFactor
|
||||
|
||||
onClicked: OutputDevice.selectAutomaticPrinter()
|
||||
onClicked: OutputDevice.setActivePrinter(null)
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
|
|
@ -65,17 +65,23 @@ Item
|
|||
{
|
||||
if(visible)
|
||||
{
|
||||
OutputDevice.startCamera()
|
||||
if(OutputDevice.activePrinter != null && OutputDevice.activePrinter.camera != null)
|
||||
{
|
||||
OutputDevice.activePrinter.camera.start()
|
||||
}
|
||||
} else
|
||||
{
|
||||
OutputDevice.stopCamera()
|
||||
if(OutputDevice.activePrinter != null && OutputDevice.activePrinter.camera != null)
|
||||
{
|
||||
OutputDevice.activePrinter.camera.stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
source:
|
||||
{
|
||||
if(OutputDevice.cameraImage)
|
||||
if(OutputDevice.activePrinter != null && OutputDevice.activePrinter.camera != null && OutputDevice.activePrinter.camera.latestImage)
|
||||
{
|
||||
return OutputDevice.cameraImage;
|
||||
return OutputDevice.activePrinter.camera.latestImage;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue