diff --git a/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs b/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs index 12d9f4b..41eec63 100644 --- a/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs +++ b/CNC Controls Camera/CNC Controls Camera/Camera.xaml.cs @@ -1,7 +1,7 @@ /* * Camera.xaml.cs - part of CNC Controls Camera library * - * v0.37 / 2022-03-02 / Io Engineering (Terje Io) + * v0.38 / 2022-04-20 / Io Engineering (Terje Io) * */ @@ -108,8 +108,8 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e.Cancel = true; Hide(); } - else - CNCCamera.CloseCurrentVideoSource(); + + CNCCamera.CloseCurrentVideoSource(); IsVisibilityChanged?.Invoke(); } diff --git a/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml.cs b/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml.cs index 353b23e..1bb4a31 100644 --- a/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml.cs +++ b/CNC Controls Camera/CNC Controls Camera/CameraControl.xaml.cs @@ -1,7 +1,7 @@ /* * CameraControl.xaml.cs - part of CNC Controls Camera library * - * v0.37 / 2022-03-02 / Io Engineering (Terje Io) + * v0.38 / 2022-04-20 / Io Engineering (Terje Io) * */ @@ -250,12 +250,12 @@ private void btnMove_Click(object sender, RoutedEventArgs e) if (!AppConfig.Settings.Camera.ConfirmMove || MessageBox.Show(UIUtils.TryFindParent(this), (string)FindResource(MoveCameraToSpindlePosition ? "MoveCameraTo" : "MoveSpindleTo"), "ioSender", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { if (MoveCameraToSpindlePosition) - { - MoveCameraToSpindlePosition = false; MoveOffset?.Invoke(Mode, -XOffset, -YOffset); - } else MoveOffset?.Invoke(Mode, XOffset, YOffset); + + if (AppConfig.Settings.Camera.InitialMoveToSpindle) + MoveCameraToSpindlePosition = !MoveCameraToSpindlePosition; } } diff --git a/CNC Controls Camera/CNC Controls Camera/Properties/AssemblyInfo.cs b/CNC Controls Camera/CNC Controls Camera/Properties/AssemblyInfo.cs index d8f25de..d5a1514 100644 --- a/CNC Controls Camera/CNC Controls Camera/Properties/AssemblyInfo.cs +++ b/CNC Controls Camera/CNC Controls Camera/Properties/AssemblyInfo.cs @@ -52,5 +52,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.37.0")] -[assembly: AssemblyFileVersion("2.0.37.0")] +[assembly: AssemblyVersion("2.0.38.0")] +[assembly: AssemblyFileVersion("2.0.38.0")] diff --git a/CNC Controls Probing/CNC Controls Probing/Converters.cs b/CNC Controls Probing/CNC Controls Probing/Converters.cs index fbf8349..c03e59a 100644 --- a/CNC Controls Probing/CNC Controls Probing/Converters.cs +++ b/CNC Controls Probing/CNC Controls Probing/Converters.cs @@ -1,13 +1,13 @@ /* * Converters.cs - part of CNC Probing library * - * v0.14 / 2020-03-29 / Io Engineering (Terje Io) + * v0.38 / 2022-04-20 / Io Engineering (Terje Io) * */ /* -Copyright (c) 2019-2020, Io Engineering (Terje Io) +Copyright (c) 2019-2022, Io Engineering (Terje Io) All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -47,6 +47,7 @@ namespace CNC.Controls.Probing public static class Converters { public static EnumValueToVisibleConverter EnumValueToVisibleConverter = new EnumValueToVisibleConverter(); + public static OriginToBooleanConverter OriginToBooleanConverter = new OriginToBooleanConverter(); } public class EnumValueToVisibleConverter : IMultiValueConverter @@ -65,4 +66,17 @@ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, throw new NotImplementedException(); } } + + public class OriginToBooleanConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value is OriginControl.Origin && (OriginControl.Origin)value == OriginControl.Origin.None; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return (bool)value ? OriginControl.Origin.None : OriginControl.Origin.Center; + } + } } diff --git a/CNC Controls Probing/CNC Controls Probing/ProbingView.xaml b/CNC Controls Probing/CNC Controls Probing/ProbingView.xaml index 4807c6f..ef02f03 100644 --- a/CNC Controls Probing/CNC Controls Probing/ProbingView.xaml +++ b/CNC Controls Probing/CNC Controls Probing/ProbingView.xaml @@ -99,7 +99,7 @@ - + diff --git a/CNC Controls Probing/CNC Controls Probing/Properties/AssemblyInfo.cs b/CNC Controls Probing/CNC Controls Probing/Properties/AssemblyInfo.cs index 9f5478c..b7bfb99 100644 --- a/CNC Controls Probing/CNC Controls Probing/Properties/AssemblyInfo.cs +++ b/CNC Controls Probing/CNC Controls Probing/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.37.0")] -[assembly: AssemblyFileVersion("2.0.37.0")] +[assembly: AssemblyVersion("2.0.38.0")] +[assembly: AssemblyFileVersion("2.0.38.0")] diff --git a/CNC Controls Probing/CNC Controls Probing/RotationControl.xaml b/CNC Controls Probing/CNC Controls Probing/RotationControl.xaml index 3d89688..948b975 100644 --- a/CNC Controls Probing/CNC Controls Probing/RotationControl.xaml +++ b/CNC Controls Probing/CNC Controls Probing/RotationControl.xaml @@ -17,7 +17,8 @@ - + +