diff --git a/App.xaml.cs b/App.xaml.cs index 138c7a7..f0b8d09 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -208,10 +208,10 @@ namespace DrillTools if (scalingWindow.ScalingResult == null) return; - var (kx, ky) = scalingWindow.ScalingResult.Value; + var result = scalingWindow.ScalingResult.Value; string content = CommandTypeFileReader.ReadAllText(filePath); - string scaledContent = Integration.ExcellonScaler.Scale(content, kx, ky); + string scaledContent = Integration.ExcellonScaler.Scale(content, result.Kx, result.Ky); // 备份原文件 string backupFilePath = filePath + ".bak"; @@ -226,6 +226,19 @@ namespace DrillTools "涨缩完成", MessageBoxButton.OK, MessageBoxImage.Information); + + // 系数记忆:将本次模式与原始输入连同源文件名写入 ini,供下次载入。 + // 属辅助功能,失败不回滚已完成的涨缩,单独提示。 + try + { + ScalingProfileStore.Save(result.Mode, result.InputX, result.InputY, Path.GetFileName(filePath)); + } + catch (Exception ex) + { + System.Windows.MessageBox.Show( + $"系数记忆保存失败:\n{ex.Message}\n本次涨缩已完成,不影响结果。", + "系数记忆", MessageBoxButton.OK, MessageBoxImage.Warning); + } } catch (Exception ex) { diff --git a/DrillScalingWindow.xaml b/DrillScalingWindow.xaml index 1cf1069..9c71c2e 100644 --- a/DrillScalingWindow.xaml +++ b/DrillScalingWindow.xaml @@ -82,6 +82,12 @@ +