Compare commits

..
Author SHA1 Message Date
ema a2ddc96e6d 修复出错啦窗口显示版本号错误问题 2026-05-11 16:04:10 +08:00
13 changed files with 77 additions and 412 deletions

No files matched your search

+15 -80
View File
@@ -21,12 +21,10 @@ public class BvLocator
{
private static readonly ILogger Logger = App.GetLogger<BvLocator>();
private readonly CancellationToken _cancellationToken;
private int? _timeout;
private int? _retryInterval;
public RecognitionObject RecognitionObject { get; }
public Func<List<Region>, Task>? RetryAction { get; set; }
public Action<List<Region>>? RetryAction { get; set; }
public static int DefaultTimeout { get; set; } = 10000;
@@ -100,21 +98,17 @@ public class BvLocator
public async Task<List<Region>> WaitFor(int? timeout = null)
{
var actualTimeout = timeout ?? _timeout ?? DefaultTimeout;
var actualRetryInterval = _retryInterval ?? DefaultRetryInterval;
var retryCount = Math.Max(1, actualTimeout / actualRetryInterval);
var actualTimeout = timeout ?? DefaultTimeout;
var retryCount = actualTimeout / DefaultRetryInterval;
List<Region> results = [];
var retryRes = await NewRetry.WaitForAction(async () =>
var retryRes = await NewRetry.WaitForAction(() =>
{
results = FindAll();
var b = results.Count > 0;
if (!b && RetryAction != null)
{
await RetryAction(results);
}
RetryAction?.Invoke(results);
return b;
}, _cancellationToken, retryCount, actualRetryInterval);
}, _cancellationToken, retryCount, DefaultRetryInterval);
if (retryRes)
{
@@ -156,21 +150,20 @@ public class BvLocator
public async Task WaitForDisappear(int? timeout = null)
{
var actualTimeout = timeout ?? _timeout ?? DefaultTimeout;
var actualRetryInterval = _retryInterval ?? DefaultRetryInterval;
var retryCount = Math.Max(1, actualTimeout / actualRetryInterval);
var actualTimeout = timeout ?? DefaultTimeout;
var retryCount = actualTimeout / DefaultRetryInterval;
var retryRes = await NewRetry.WaitForAction(async () =>
var retryRes = await NewRetry.WaitForAction(() =>
{
var results = FindAll();
var b = results.Count == 0;
if (!b && RetryAction != null)
if (!b)
{
await RetryAction(results);
RetryAction?.Invoke(results);
}
return b;
}, _cancellationToken, retryCount, actualRetryInterval);
}, _cancellationToken, retryCount, DefaultRetryInterval);
if (!retryRes)
{
@@ -212,77 +205,19 @@ public class BvLocator
public BvLocator WithRetryAction(Action<List<Region>>? action)
{
if (action == null)
{
RetryAction = null;
}
else
{
RetryAction = (results) =>
{
action(results);
return Task.CompletedTask;
};
}
return this;
}
/// <summary>
/// 设置超时时间(毫秒)
/// </summary>
/// <param name="timeout">超时时间(毫秒)</param>
/// <returns></returns>
public BvLocator WithTimeout(int timeout)
{
if (timeout <= 0)
{
throw new ArgumentOutOfRangeException(nameof(timeout), "timeout 必须大于 0");
}
_timeout = timeout;
return this;
}
/// <summary>
/// 设置重试间隔(毫秒)
/// </summary>
/// <param name="retryInterval">重试间隔(毫秒)</param>
/// <returns></returns>
public BvLocator WithRetryInterval(int retryInterval)
{
if (retryInterval <= 0)
{
throw new ArgumentOutOfRangeException(nameof(retryInterval), "retryInterval 必须大于 0");
}
_retryInterval = retryInterval;
RetryAction = action;
return this;
}
/// <summary>
/// 为 JavaScript 提供的动态参数重载
/// 解决 ClearScript 无法将 JS 函数隐式转换为 Action 委托的问题
/// 支持同步和异步 JS 函数
/// </summary>
/// <param name="action">JS 回调函数</param>
/// <returns></returns>
public BvLocator WithRetryAction(dynamic action)
{
if (action == null)
{
RetryAction = null;
}
else
{
RetryAction = async (results) =>
{
var taskResult = action(results);
// 如果 JS 返回的是 Promise/Task,等待其完成
if (taskResult is Task task)
{
await task;
}
};
}
RetryAction = (results) => action(results);
return this;
}
}
}
@@ -61,9 +61,6 @@ public class BgiOnnxModel
public static readonly BgiOnnxModel BgiQClassify =
Register("BgiQClassify", @"Assets\Model\Common\q_classify_sim.onnx");
public static readonly BgiOnnxModel BgiPickClassify =
Register("BgiPickClassify", @"Assets\Model\Common\pick.onnx");
/// <summary>
/// paddleOCR V4 检测模型
/// </summary>
@@ -145,35 +145,6 @@ public class HtmlMask : IDisposable
/// </summary>
public bool Exists(string id) => HtmlMaskWindow.Exists(id);
/// <summary>
/// 设置窗口的点击穿透模式
/// </summary>
/// <param name="windowId">窗口ID</param>
/// <param name="enabled">true=点击穿透,false=可交互</param>
public void SetClickThrough(string windowId, bool enabled)
{
HtmlMaskWindow.SetClickThrough(windowId, enabled);
}
/// <summary>
/// 获取窗口的点击穿透状态
/// </summary>
/// <param name="windowId">窗口ID</param>
/// <returns>true=点击穿透,false=可交互</returns>
public bool GetClickThrough(string windowId)
{
return HtmlMaskWindow.GetClickThrough(windowId);
}
/// <summary>
/// 切换窗口的点击穿透模式
/// </summary>
/// <param name="windowId">窗口ID</param>
public void ToggleClickThrough(string windowId)
{
HtmlMaskWindow.ToggleClickThrough(windowId);
}
#endregion
#region 消息通信
@@ -1,5 +1,4 @@
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Core.Simulator;
using BetterGenshinImpact.GameTask.AutoFight.Model;
using BetterGenshinImpact.GameTask.AutoFight.Script;
using BetterGenshinImpact.Model;
@@ -75,7 +74,6 @@ public class OneKeyFightTask : Singleton<OneKeyFightTask>
else
{
_cts.Cancel();
Simulation.ReleaseAllKey();
}
}
}
@@ -91,7 +89,6 @@ public class OneKeyFightTask : Singleton<OneKeyFightTask>
if (IsHoldOnMode())
{
_cts?.Cancel();
Simulation.ReleaseAllKey();
}
}
@@ -182,9 +179,9 @@ public class OneKeyFightTask : Singleton<OneKeyFightTask>
// 通用化战斗策略
foreach (var command in combatCommands)
{
if (ct.IsCancellationRequested) break;
if (command.ActivatingRound != null && command.ActivatingRound.Count > 0 && !command.ActivatingRound.Contains(round))
{
// 跳过强制首轮指令
continue;
}
command.Execute(activeAvatar);
@@ -37,14 +37,6 @@ namespace BetterGenshinImpact.GameTask.AutoPick
[ObservableProperty]
private string _ocrEngine = PickOcrEngineEnum.Paddle.ToString();
/// <summary>
/// 拾取内容识别方式
/// - Ocr
/// - Model
/// </summary>
[ObservableProperty]
private string _itemRecognitionMode = PickItemRecognitionModeEnum.Ocr.ToString();
/// <summary>
/// 急速模式
/// 无视文字识别结果,直接拾取
@@ -1,6 +1,5 @@
using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.Core.Recognition;
using BetterGenshinImpact.Core.Recognition.ONNX;
using BetterGenshinImpact.Core.Recognition.OCR;
using BetterGenshinImpact.Core.Recognition.ONNX.SVTR;
using BetterGenshinImpact.Core.Script.Dependence.Model.TimerConfig;
@@ -9,8 +8,6 @@ using BetterGenshinImpact.GameTask.AutoPick.Assets;
using BetterGenshinImpact.Helpers;
using BetterGenshinImpact.Service;
using BetterGenshinImpact.View.Windows;
using Compunet.YoloSharp.Data;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using OpenCvSharp;
using System;
@@ -22,7 +19,6 @@ using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading;
using BetterGenshinImpact.GameTask.Model.Area;
using Compunet.YoloSharp;
namespace BetterGenshinImpact.GameTask.AutoPick;
@@ -161,12 +157,6 @@ public partial class AutoPickTrigger : ITaskTrigger
/// </summary>
private int _prevClickFrameIndex = -1;
private static readonly Lazy<BgiYoloPredictor> PickClassifierLazy = new(() =>
App.ServiceProvider.GetRequiredService<BgiOnnxFactory>().CreateYoloPredictor(BgiOnnxModel.BgiPickClassify));
private bool _loggedPickModelMissing;
//private int _fastModePickCount = 0;
public void OnCapture(CaptureContent content)
@@ -281,16 +271,53 @@ public partial class AutoPickTrigger : ITaskTrigger
return;
}
var text = RecognizePickItem(content, foundRectArea, textRect, config);
string text;
if (config.OcrEngine == nameof(PickOcrEngineEnum.Yap))
{
var textMat = new Mat(content.CaptureRectArea.CacheGreyMat, textRect);
text = TextInferenceFactory.Pick.Value.Inference(textMat);
}
else
{
using var textMat = new Mat(content.CaptureRectArea.SrcMat, textRect);
var boundingRect = TextRectExtractor.GetTextBoundingRect(textMat);
// var boundingRect = new Rect(); // 不使用自己写的文字区域提取
// 如果找到有效区域
if (boundingRect.X < 20 && boundingRect.Width > 5 && boundingRect.Height > 5)
{
// 截取只包含文字的区域
using var textOnlyMat = new Mat(textMat, new Rect(0, 0,
boundingRect.Right + 5 < textMat.Width ? boundingRect.Right + 5 : textMat.Width, textMat.Height));
text = OcrFactory.Paddle.OcrWithoutDetector(textOnlyMat);
speedTimer.Record("识别");
// if (RuntimeHelper.IsDebug)
// {
// // 如果不等于正确文字,则保存图片
// if (text != "烹饪")
// {
// var path = Global.Absolute("log/pick");
// Directory.CreateDirectory(path);
// var str = $"{DateTime.Now:yyyyMMddHHmmssfff}";
// // textMat.SaveImage(Path.Combine(path, $"pick_ocr_ori_{str}.png"));
// // 画上 boundingRect
// Cv2.Rectangle(textMat, boundingRect, new Scalar(0, 0, 255), 1);
// textMat.SaveImage(Path.Combine(path, $"pick_ocr_rect_{str}.png"));
// bin.SaveImage(Path.Combine(path, $"bin_{str}.png"));
// }
// }
}
else
{
Debug.WriteLine("-- 无法识别到有效文字区域,尝试直接OCR DET");
text = OcrFactory.Paddle.Ocr(textMat);
}
}
speedTimer.Record("文字识别");
if (!string.IsNullOrEmpty(text))
{
// 处理OCR识别结果,清理无效字符并确保引号配对
if (config.ItemRecognitionMode != nameof(PickItemRecognitionModeEnum.Classify))
{
text = ProcessOcrText(text);
}
text = ProcessOcrText(text);
if (DoNotPick(text))
{
@@ -343,64 +370,6 @@ public partial class AutoPickTrigger : ITaskTrigger
speedTimer.DebugPrint();
}
private string RecognizePickItem(CaptureContent content, Region foundRectArea, Rect textRect, AutoPickConfig config)
{
if (config.ItemRecognitionMode == nameof(PickItemRecognitionModeEnum.Classify))
{
return RecognizePickItemByClassify(content.CaptureRectArea, foundRectArea);
}
else
{
return RecognizePickItemByOcr(content, textRect, config);
}
}
private string RecognizePickItemByOcr(CaptureContent content, Rect textRect, AutoPickConfig config)
{
if (config.OcrEngine == nameof(PickOcrEngineEnum.Yap))
{
using var greyTextMat = new Mat(content.CaptureRectArea.CacheGreyMat, textRect);
return TextInferenceFactory.Pick.Value.Inference(greyTextMat);
}
else
{
using var textMat = new Mat(content.CaptureRectArea.SrcMat, textRect);
var boundingRect = TextRectExtractor.GetTextBoundingRect(textMat);
// var boundingRect = new Rect(); // 不使用自己写的文字区域提取
// 如果找到有效区域
if (boundingRect.X < 20 && boundingRect.Width > 5 && boundingRect.Height > 5)
{
// 截取只包含文字的区域
using var textOnlyMat = new Mat(textMat, new Rect(0, 0,
boundingRect.Right + 5 < textMat.Width ? boundingRect.Right + 5 : textMat.Width, textMat.Height));
return OcrFactory.Paddle.OcrWithoutDetector(textOnlyMat);
}
Debug.WriteLine("-- 无法识别到有效文字区域,尝试直接OCR DET");
return OcrFactory.Paddle.Ocr(textMat);
}
}
private string RecognizePickItemByClassify(ImageRegion captureRectArea, Region foundRectArea)
{
using var itemRegion = captureRectArea.DeriveCrop(GetPickModelRect(foundRectArea));
var result = PickClassifierLazy.Value.Predictor.Classify(itemRegion.CacheImage);
var topClass = result.GetTopClass();
// Debug.WriteLine($"AutoPickTrigger: 拾取,{topClass.Name.Name} {topClass.Confidence:F2}");
if (topClass.Confidence <= 0.75)
{
return string.Empty;
}
// itemRegion.SrcMat.SaveImage(Global.Absolute("log\\pick.png"));
return topClass.Name.Name;
}
private static Rect GetPickModelRect(Region foundRectArea)
{
return new Rect(foundRectArea.Right + 20, foundRectArea.Y - 16, 64, 64);
}
private bool DoNotPick(string text)
{
// 唯一一个动态拾取项,特殊处理,不拾取
@@ -436,7 +405,7 @@ public partial class AutoPickTrigger : ITaskTrigger
{
return true;
}
if (text.Contains("月谕圣牌"))
{
return true;
@@ -1,7 +0,0 @@
namespace BetterGenshinImpact.GameTask.AutoPick;
public enum PickItemRecognitionModeEnum
{
Ocr,
Classify
}
@@ -1,4 +1,4 @@
using BetterGenshinImpact.GameTask.AutoGeniusInvokation.Exception;
using BetterGenshinImpact.GameTask.AutoGeniusInvokation.Exception;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -89,28 +89,6 @@ public static class NewRetry
return false;
}
/// <summary>
/// 重试执行异步 action,直到返回 true 或达到最大重试次数。
/// </summary>
/// <param name="action">判断条件(异步)</param>
/// <param name="ct">取消令牌</param>
/// <param name="retryTimes">最大重试次数</param>
/// <param name="delayMs">每次重试间隔(毫秒)</param>
/// <returns>是否成功</returns>
public static async Task<bool> WaitForAction(Func<Task<bool>> action, CancellationToken ct, int retryTimes = 10, int delayMs = 1000)
{
for (var i = 0; i < retryTimes; i++)
{
await TaskControl.Delay(delayMs, ct);
if (await action())
{
return true;
}
}
return false;
}
/// <summary>
/// 重试直到某个元素出现,可执行键盘或鼠标操作。
/// </summary>
@@ -190,7 +190,6 @@ public class TaskRunner
TaskTriggerDispatcher.Instance().SetTriggers(GameTaskManager.LoadInitialTriggers());
VisionContext.Instance().DrawContent.ClearAll();
HtmlMaskWindow.CloseAll();
}
}
+3 -5
View File
@@ -9,9 +9,7 @@
WindowStartupLocation="Manual"
ShowInTaskbar="False"
Topmost="True">
<Border x:Name="ClickThroughBorder" Background="Transparent">
<Grid>
<wv2:WebView2 x:Name="WebView" DefaultBackgroundColor="Transparent"/>
</Grid>
</Border>
<Grid>
<wv2:WebView2 x:Name="WebView" DefaultBackgroundColor="Transparent"/>
</Grid>
</Window>
+13 -148
View File
@@ -17,7 +17,7 @@ using Microsoft.Web.WebView2.Core;
namespace BetterGenshinImpact.View;
/// <summary>
/// HTML遮罩窗口
/// HTML遮罩窗口 - 仅用于显示,不可交互(点击穿透)
/// </summary>
public partial class HtmlMaskWindow : Window
{
@@ -29,21 +29,12 @@ public partial class HtmlMaskWindow : Window
private readonly string _webView2DataPath;
private readonly string _pageUrl;
private bool _navigationCompleted;
private bool _styleCaptured;
private int _originalStyle;
private volatile bool _isClickThrough = true;
private readonly System.Windows.Media.SolidColorBrush _backgroundBrush = new();
/// <summary>
/// 窗口唯一标识
/// </summary>
public string MaskId => _id;
/// <summary>
/// 当前是否处于点击穿透模式
/// </summary>
public bool IsClickThrough => _isClickThrough;
private HtmlMaskWindow(string url, string? id, string workDir)
{
_id = id ?? Guid.NewGuid().ToString("N");
@@ -51,7 +42,6 @@ public partial class HtmlMaskWindow : Window
_webView2DataPath = Path.Combine(workDir, "WebView2Data");
_pageUrl = url;
InitializeComponent();
ClickThroughBorder.Background = _backgroundBrush;
Loaded += OnLoaded;
InitializeAsync(url);
}
@@ -166,47 +156,6 @@ public partial class HtmlMaskWindow : Window
return _windows.ContainsKey(id);
}
/// <summary>
/// 获取窗口实例,不存在则抛出异常
/// </summary>
/// <param name="windowId">窗口ID</param>
/// <returns>窗口实例</returns>
private static HtmlMaskWindow GetWindowOrThrow(string windowId)
{
if (_windows.TryGetValue(windowId, out var window))
return window;
throw new InvalidOperationException($"HTML遮罩窗口不存在或已关闭: {windowId}");
}
/// <summary>
/// 设置指定窗口的点击穿透模式
/// </summary>
/// <param name="windowId">窗口ID</param>
/// <param name="enabled">true=点击穿透,false=可交互</param>
public static void SetClickThrough(string windowId, bool enabled)
{
GetWindowOrThrow(windowId).SetClickThroughMode(enabled);
}
/// <summary>
/// 获取指定窗口的点击穿透状态
/// </summary>
/// <param name="windowId">窗口ID</param>
/// <returns>点击穿透状态</returns>
public static bool GetClickThrough(string windowId)
{
return GetWindowOrThrow(windowId).IsClickThrough;
}
/// <summary>
/// 原子切换指定窗口的点击穿透模式
/// </summary>
/// <param name="windowId">窗口ID</param>
public static void ToggleClickThrough(string windowId)
{
GetWindowOrThrow(windowId).ToggleClickThroughCore();
}
/// <summary>
/// 通知窗口刷新待推送的消息
/// </summary>
@@ -215,24 +164,13 @@ public partial class HtmlMaskWindow : Window
if (!_windows.TryGetValue(windowId, out var window)) return;
window.Dispatcher.BeginInvoke(() =>
{
try
// 页面还没加载完,消息留在队列中由 NavigationCompleted 统一推送
if (!window._navigationCompleted) return;
if (window.WebView.CoreWebView2 == null) return;
HtmlMask.FlushPendingMessages(windowId, json =>
{
// 页面还没加载完,消息留在队列中由 NavigationCompleted 统一推送
if (!window._navigationCompleted) return;
if (window.WebView.CoreWebView2 == null) return;
HtmlMask.FlushPendingMessages(windowId, json =>
{
window.WebView.CoreWebView2.PostWebMessageAsString(json);
});
}
catch (ObjectDisposedException)
{
// WebView 已被释放,忽略此消息推送
}
catch (Exception ex)
{
TaskControl.Logger.LogDebug(ex, "HTML遮罩窗口消息推送异常");
}
window.WebView.CoreWebView2.PostWebMessageAsString(json);
});
});
}
@@ -240,7 +178,7 @@ public partial class HtmlMaskWindow : Window
private void OnLoaded(object sender, RoutedEventArgs e)
{
SetClickThrough(true);
SetClickThrough();
UpdatePosition();
}
@@ -449,87 +387,14 @@ public partial class HtmlMaskWindow : Window
}
/// <summary>
/// 设置点击穿透模式
/// 设置点击穿透
/// </summary>
/// <param name="enabled">true=点击穿透,false=可交互</param>
private void SetClickThrough(bool enabled)
private void SetClickThrough()
{
var hwnd = new WindowInteropHelper(this).Handle;
if (hwnd == IntPtr.Zero) return;
if (!_styleCaptured)
{
_originalStyle = (int)GetWindowLong(hwnd, WindowLongFlags.GWL_EXSTYLE);
_styleCaptured = true;
}
int newStyle = enabled
? (_originalStyle | (int)User32.WindowStylesEx.WS_EX_TRANSPARENT | (int)User32.WindowStylesEx.WS_EX_LAYERED)
: _originalStyle;
User32.SetWindowLong(hwnd, WindowLongFlags.GWL_EXSTYLE, (IntPtr)newStyle);
_isClickThrough = enabled;
SetBackgroundOpacity(!enabled);
if (!enabled)
{
// 禁用穿透:激活遮罩窗口,确保获得键盘和鼠标焦点
try
{
User32.SetForegroundWindow(hwnd);
User32.BringWindowToTop(hwnd);
Dispatcher.Invoke(() => Activate());
}
catch (Exception ex)
{
TaskControl.Logger.LogDebug(ex, "HTML遮罩窗口激活失败");
}
}
else
{
// 开启穿透:将焦点还给游戏窗口
try
{
var gameHandle = TaskContext.Instance().GameHandle;
if (gameHandle != IntPtr.Zero)
{
SystemControl.FocusWindow(gameHandle);
}
}
catch (Exception ex)
{
TaskControl.Logger.LogDebug(ex, "HTML遮罩恢复游戏焦点失败");
}
}
}
/// <summary>
/// 设置背景透明度
/// </summary>
/// <param name="isInteractive">是否处于交互模式</param>
private void SetBackgroundOpacity(bool isInteractive)
{
_backgroundBrush.Color = isInteractive
? System.Windows.Media.Color.FromArgb(1, 0, 0, 0)
: System.Windows.Media.Color.FromArgb(0, 0, 0, 0);
}
/// <summary>
/// 设置点击穿透模式
/// </summary>
/// <param name="enabled">true=点击穿透,false=可交互</param>
public void SetClickThroughMode(bool enabled)
{
Dispatcher.Invoke(() => SetClickThrough(enabled));
}
/// <summary>
/// 切换点击穿透模式
/// </summary>
private void ToggleClickThroughCore()
{
Dispatcher.Invoke(() => SetClickThrough(!_isClickThrough));
var style = (int)GetWindowLong(hwnd, WindowLongFlags.GWL_EXSTYLE);
User32.SetWindowLong(hwnd, WindowLongFlags.GWL_EXSTYLE,
(IntPtr)(style | (int)User32.WindowStylesEx.WS_EX_TRANSPARENT));
}
/// <summary>
@@ -80,33 +80,6 @@
Margin="0,0,8,0"
IsChecked="{Binding Config.AutoPickConfig.FastModeEnabled, Mode=TwoWay}" />
</Grid>-->
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:TextBlock Grid.Row="0"
Grid.Column="0"
FontTypography="Body"
Text="识别方式"
TextWrapping="Wrap" />
<ui:TextBlock Grid.Row="1"
Grid.Column="0"
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
Text="OCR 通过文字识别拾取内容;Classify 使用物品分类模型识别"
TextWrapping="Wrap" />
<ComboBox Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="1"
Width="100"
Margin="0,0,8,0"
ItemsSource="{Binding PickItemRecognitionModeNames}"
SelectedItem="{Binding Config.AutoPickConfig.ItemRecognitionMode, Mode=TwoWay}" />
</Grid>
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -30,8 +30,6 @@ public partial class TriggerSettingsPageViewModel : ViewModel
[ObservableProperty] private string[] _selectChatOptionTypeNames = [SelectChatOptionTypes.UseMouse, SelectChatOptionTypes.UseInteractionKey];
[ObservableProperty] private string[] _pickItemRecognitionModeNames = [PickItemRecognitionModeEnum.Ocr.ToString(), PickItemRecognitionModeEnum.Classify.ToString()];
[ObservableProperty] private string[] _pickOcrEngineNames = [PickOcrEngineEnum.Paddle.ToString(), PickOcrEngineEnum.Yap.ToString()];
[ObservableProperty] private List<string> _pickButtonNames;