diff --git a/src/assets/styles/page.css b/src/assets/styles/page.css index 1a9084aa8..785190f9d 100644 --- a/src/assets/styles/page.css +++ b/src/assets/styles/page.css @@ -48,11 +48,11 @@ body { height: 100% !important; } -.p-abs { +.position-absolute { position: absolute !important; } -.p-rel { +.position-relative { position: relative !important; } diff --git a/src/components/panels/ToolheadControls/CrossControl.vue b/src/components/panels/ToolheadControls/CrossControl.vue index d8b000066..3c2630555 100644 --- a/src/components/panels/ToolheadControls/CrossControl.vue +++ b/src/components/panels/ToolheadControls/CrossControl.vue @@ -45,9 +45,9 @@ - + + + @@ -311,6 +363,52 @@ export default class WebcamForm extends Mixins(BaseMixin, WebcamMixin) { this.webcam.extra_data.enableAudio = newVal } + get nozzleCrosshairAvialable() { + return ['mjpegstreamer', 'mjpegstreamer-adaptive', 'webrtc-camerastreamer'].includes(this.webcam.service) + } + + get nozzleCrosshair() { + return this.webcam.extra_data?.nozzleCrosshair ?? false + } + + set nozzleCrosshair(newVal) { + const extraData = { ...(this.webcam.extra_data ?? {}) } + extraData.nozzleCrosshair = newVal + + this.webcam.extra_data = extraData + } + + get nozzleCrosshairColor() { + return this.webcam.extra_data?.nozzleCrosshairColor ?? '#ff0000' + } + + set nozzleCrosshairColor(newVal: string) { + const extraData = { ...(this.webcam.extra_data ?? {}) } + extraData.nozzleCrosshairColor = newVal + + this.webcam.extra_data = extraData + } + + updateLogoColor(color: string | { hex: string }) { + if (typeof color === 'object') { + this.nozzleCrosshairColor = color.hex + return + } + + this.nozzleCrosshairColor = color + } + + get nozzleCrosshairSize() { + return this.webcam.extra_data?.nozzleCrosshairSize ?? 0.1 + } + + set nozzleCrosshairSize(newVal: number) { + const extraData = { ...(this.webcam.extra_data ?? {}) } + extraData.nozzleCrosshairSize = newVal + + this.webcam.extra_data = extraData + } + mounted() { this.oldWebcamName = this.webcam.name } diff --git a/src/components/webcams/WebcamNozzleCrosshair.vue b/src/components/webcams/WebcamNozzleCrosshair.vue new file mode 100644 index 000000000..413f46b6d --- /dev/null +++ b/src/components/webcams/WebcamNozzleCrosshair.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/components/webcams/streamers/Mjpegstreamer.vue b/src/components/webcams/streamers/Mjpegstreamer.vue index 79232c8e1..f4babeb83 100644 --- a/src/components/webcams/streamers/Mjpegstreamer.vue +++ b/src/components/webcams/streamers/Mjpegstreamer.vue @@ -12,6 +12,7 @@ {{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }} + @@ -100,6 +101,12 @@ export default class Mjpegstreamer extends Mixins(BaseMixin, WebcamMixin) { return this.$store.getters['gui/getPanelExpand']('webcam-panel', this.viewport) ?? false } + get showNozzleCrosshair() { + const nozzleCrosshair = this.camSettings.extra_data?.nozzleCrosshair ?? false + + return nozzleCrosshair && this.status === 'connected' + } + // start or stop the video when the expanded state changes @Watch('expanded', { immediate: true }) expandChanged(newExpanded: boolean): void { diff --git a/src/components/webcams/streamers/MjpegstreamerAdaptive.vue b/src/components/webcams/streamers/MjpegstreamerAdaptive.vue index 12dd30a79..f0d7478ae 100644 --- a/src/components/webcams/streamers/MjpegstreamerAdaptive.vue +++ b/src/components/webcams/streamers/MjpegstreamerAdaptive.vue @@ -13,6 +13,7 @@ {{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }} + @@ -101,6 +102,12 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin, WebcamMixin return this.isVisibleDocument && this.isVisibleViewport } + get showNozzleCrosshair() { + const nozzleCrosshair = this.camSettings.extra_data?.nozzleCrosshair ?? false + + return nozzleCrosshair && this.status === 'connected' + } + mounted() { document.addEventListener('visibilitychange', this.documentVisibilityChanged) } diff --git a/src/components/webcams/streamers/WebrtcCameraStreamer.vue b/src/components/webcams/streamers/WebrtcCameraStreamer.vue index b3422bff8..ef8422685 100644 --- a/src/components/webcams/streamers/WebrtcCameraStreamer.vue +++ b/src/components/webcams/streamers/WebrtcCameraStreamer.vue @@ -1,5 +1,5 @@