mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Replace NetworkCamera with NetworkMJPGImage
This commit is contained in:
parent
890ddc015e
commit
c187b6a25c
5 changed files with 30 additions and 47 deletions
|
@ -34,33 +34,23 @@ Item {
|
|||
z: 999;
|
||||
}
|
||||
|
||||
Cura.CameraView {
|
||||
Cura.NetworkMJPGImage {
|
||||
id: cameraImage
|
||||
anchors.horizontalCenter: parent.horizontalCenter;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
height: Math.round((imageHeight === 0 ? 600 * screenScaleFactor : imageHeight) * width / imageWidth);
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
if (camera != null) {
|
||||
camera.start();
|
||||
if (cameraUrl != null) {
|
||||
start();
|
||||
}
|
||||
} else {
|
||||
if (camera != null) {
|
||||
camera.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: camera
|
||||
onNewImage: {
|
||||
if (cameraImage.visible) {
|
||||
cameraImage.image = camera.latestImage;
|
||||
cameraImage.update();
|
||||
if (cameraUrl != null) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
source: cameraUrl
|
||||
width: Math.min(imageWidth === 0 ? 800 * screenScaleFactor : imageWidth, maximumWidth);
|
||||
z: 1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue