From 2d19d51bc7a14a33560148369c0bae86f858d4df Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 25 Mar 2021 18:48:19 -0700 Subject: [PATCH] Add matcher for anti-mod string search --- CHANGELIST.md | 1 + MPF/UserControls/LogOutput.xaml.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELIST.md b/CHANGELIST.md index c520276c..8775be0a 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -40,6 +40,7 @@ - Program output to log by default, setting otherwise - DVDs and BDs can have label-side data - Remove .NET Framework 4.7.2 support +- Make logging window a bit safer ### 1.18 (2020-11-10) - Add more information extraction and generation for Aaru diff --git a/MPF/UserControls/LogOutput.xaml.cs b/MPF/UserControls/LogOutput.xaml.cs index b28b1f5e..3742c995 100644 --- a/MPF/UserControls/LogOutput.xaml.cs +++ b/MPF/UserControls/LogOutput.xaml.cs @@ -175,6 +175,19 @@ namespace MPF.UserControls } })); + _matchers.Add(new Matcher( + "Scanning sector for anti-mod string (LBA)", + DiscImageCreatorProgressPattern, + match => + { + if (UInt32.TryParse(match.Groups[1].Value, out uint current) && UInt32.TryParse(match.Groups[2].Value, out uint total)) + { + float percentProgress = (current / (float)total) * 100; + ProgressBar.Value = percentProgress; + ProgressLabel.Text = string.Format("Scanning sectors for anit-mod string... ({0:##.##}%)", percentProgress); + } + })); + #endregion #region Dumping