diff --git a/CNC Controls Camera/CNC Controls Camera/Camera.xaml b/CNC Controls Camera/CNC Controls Camera/Camera.xaml index 02da8955..37cb78c9 100644 --- a/CNC Controls Camera/CNC Controls Camera/Camera.xaml +++ b/CNC Controls Camera/CNC Controls Camera/Camera.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:CNC.Controls.Camera" mc:Ignorable="d" - Title="Sender" Height="390" Width="504" + Title="Sender" Height="414" Width="504" Topmost="True" Closing="Window_Closing" Icon="App.ico" ShowInTaskbar="False" ResizeMode="NoResize"> diff --git a/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs b/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs index cb78d2b8..12d9f4b4 100644 --- a/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs +++ b/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs @@ -1,13 +1,13 @@ /* * Camera.xaml.cs - part of CNC Controls Camera library * - * v0.33 / 2021-05-04 / Io Engineering (Terje Io) + * v0.37 / 2022-03-02 / Io Engineering (Terje Io) * */ /* -Copyright (c) 2018-2021, Io Engineering (Terje Io) - parts derived from AForge example code +Copyright (c) 2018-2022, Io Engineering (Terje Io) - parts derived from AForge example code All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -66,6 +66,7 @@ private void CNCCamera_MoveOffset(Core.CameraMoveMode Mode, double XOffset, doub public bool HasCamera { get { return CNCCamera.HasCamera; } } public CameraControl CameraControl { get { return CNCCamera; } } public new bool IsVisible { get { return CNCCamera.IsVisible; } } + public bool IsMoveEnabled { get { return CNCCamera.IsMoveEnabled; } set { CNCCamera.IsMoveEnabled = value && (CNCCamera.XOffset != 0d || CNCCamera.YOffset != 0d); } } public void Setup(UIViewModel model) { @@ -89,6 +90,8 @@ public void Open() Show(); + CameraControl.MoveCameraToSpindlePosition = AppConfig.Settings.Camera.InitialMoveToSpindle; + if (CNCCamera.OpenVideoSource()) IsVisibilityChanged?.Invoke(); } diff --git a/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml b/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml index 2e659303..816248d8 100644 --- a/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml +++ b/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml @@ -3,22 +3,32 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:CNC.Controls.Camera" mc:Ignorable="d" - d:DesignHeight="360" d:DesignWidth="500" + d:DesignHeight="370" d:DesignWidth="500" Background="#FFF0F0F0" Loaded="CameraControl_Loaded"> + + Move spindle to camera position? + Move camera to spindle position? + - - + + + - + - - -