精简助手界面文案并移除多余说明

This commit is contained in:
tfarcraw 2026-11-13 16:16:40 +08:00
parent edf8c365f3
commit e580b74f15
2 changed files with 13 additions and 17 deletions

View File

@ -459,14 +459,12 @@
<TabItem Header="Agent助手">
<Grid Margin="10" RowDefinitions="Auto,Auto,Auto,*">
<StackPanel Spacing="6" IsEnabled="{Binding AgentIsIdle}">
<TextBlock Text="分析标准 SOP 视频,生成可编辑的步骤草稿" Classes="Title" />
<TextBlock Text="助手会抽取视频画面并发送给配置的视觉模型。先核对生成结果,再添加到配方;原有步骤不会被覆盖。" TextWrapping="Wrap" Foreground="{StaticResource FgDim}" />
<Grid ColumnDefinitions="*,Auto">
<TextBox x:Name="AgentVideoPathBox" Text="{Binding AgentVideoPath, Mode=TwoWay}" PlaceholderText="默认使用当前配方的标准视频,也可选择其他视频" />
<TextBox x:Name="AgentVideoPathBox" Text="{Binding AgentVideoPath, Mode=TwoWay}" PlaceholderText="标准视频路径" />
<Button Grid.Column="1" Content="选择视频…" Command="{Binding BrowseAgentVideoCommand}" Margin="8,0,0,0" />
</Grid>
</StackPanel>
<Expander Grid.Row="1" Header="视觉模型连接设置(与 D3 判定接口分开)" IsExpanded="True" Margin="0,8,0,0" IsEnabled="{Binding AgentIsIdle}">
<Expander Grid.Row="1" Header="模型设置" IsExpanded="True" Margin="0,8,0,0" IsEnabled="{Binding AgentIsIdle}">
<StackPanel Spacing="6">
<Grid ColumnDefinitions="70,*">
<TextBlock Text="接口地址" VerticalAlignment="Center" />
@ -474,23 +472,22 @@
</Grid>
<Grid ColumnDefinitions="70,*">
<TextBlock Text="模型名" VerticalAlignment="Center" />
<TextBox x:Name="AgentModelBox" Grid.Column="1" Text="{Binding AgentModel, Mode=TwoWay}" PlaceholderText="支持图片输入和文字生成的模型名称" />
<TextBox x:Name="AgentModelBox" Grid.Column="1" Text="{Binding AgentModel, Mode=TwoWay}" />
</Grid>
<Grid ColumnDefinitions="70,*">
<TextBlock Text="密钥" VerticalAlignment="Center" />
<TextBox Grid.Column="1" Text="{Binding AgentApiKey, Mode=TwoWay}" PasswordChar="●" PlaceholderText="无鉴权服务可留空;仅本次会话使用,不保存" />
<TextBox Grid.Column="1" Text="{Binding AgentApiKey, Mode=TwoWay}" PasswordChar="●" />
</Grid>
<TextBlock Text="分析成功后记住地址和模型名。D3-lite 继续负责运行时的完成判定,这里需要能生成步骤文字的视觉模型。" TextWrapping="Wrap" FontSize="12" Foreground="{StaticResource FgDim}" />
</StackPanel>
</Expander>
<StackPanel Grid.Row="2" Spacing="6" Margin="0,8,0,8">
<TextBox Text="{Binding AgentInstructions, Mode=TwoWay}" IsEnabled="{Binding AgentIsIdle}" AcceptsReturn="True" TextWrapping="Wrap" MinHeight="48" PlaceholderText="补充要求(可选):工艺名称、重点动作、希望拆分步骤的粒度等" />
<TextBox Text="{Binding AgentInstructions, Mode=TwoWay}" IsEnabled="{Binding AgentIsIdle}" AcceptsReturn="True" TextWrapping="Wrap" MinHeight="48" PlaceholderText="补充要求" />
<WrapPanel>
<TextBlock Text="最大抽帧数" VerticalAlignment="Center" Margin="0,0,8,0" />
<NumericUpDown Value="{Binding AgentMaxFrames, Mode=TwoWay}" Minimum="4" Maximum="60" Increment="4" Width="100" IsEnabled="{Binding AgentIsIdle}" />
<Button Content="分析视频并生成步骤" Command="{Binding GenerateStepsCommand}" Margin="12,0,0,0" />
<Button Content="生成步骤" Command="{Binding GenerateStepsCommand}" Margin="12,0,0,0" />
<Button Content="取消分析" Command="{Binding CancelAgentCommand}" Margin="8,0,0,0" />
<Button Content="将草稿添加到当前配方" Command="{Binding ApplyAgentDraftCommand}" Margin="8,0,0,0" />
<Button Content="添加到配方" Command="{Binding ApplyAgentDraftCommand}" Margin="8,0,0,0" />
</WrapPanel>
<ProgressBar IsIndeterminate="True" IsVisible="{Binding IsAgentBusy}" Height="4" />
<TextBlock x:Name="AgentStatusText" Text="{Binding AgentStatus}" TextWrapping="Wrap" Foreground="{StaticResource Accent}" />
@ -509,10 +506,10 @@
</StackPanel>
<StackPanel Grid.Column="1" Spacing="6" Margin="12,0,0,0">
<TextBox Text="{Binding Name, Mode=TwoWay}" PlaceholderText="步骤名" />
<TextBox Text="{Binding Description, Mode=TwoWay}" AcceptsReturn="True" TextWrapping="Wrap" MinHeight="60" PlaceholderText="步骤说明(D3 将按此判断完成)" />
<TextBox Text="{Binding Description, Mode=TwoWay}" AcceptsReturn="True" TextWrapping="Wrap" MinHeight="60" PlaceholderText="步骤说明" />
<Grid ColumnDefinitions="70,*">
<TextBlock Text="区域键名" VerticalAlignment="Center" />
<TextBox Grid.Column="1" Text="{Binding Region, Mode=TwoWay}" PlaceholderText="可在添加后到步骤页设置" />
<TextBox Grid.Column="1" Text="{Binding Region, Mode=TwoWay}" />
</Grid>
<TextBlock Text="{Binding Note}" TextWrapping="Wrap" Foreground="{StaticResource FgDim}" FontSize="12" />
</StackPanel>
@ -532,7 +529,6 @@
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock Text="{Binding SaveStatus}" Foreground="{StaticResource Ok}" FontSize="12" />
<TextBlock Text="校验提醒(不阻止保存;现场常见先存草稿再补区域)" Foreground="{StaticResource FgDim}" FontSize="12" />
<ItemsControl ItemsSource="{Binding Warnings}" MaxHeight="66">
<ItemsControl.ItemTemplate>
<DataTemplate>

View File

@ -21,7 +21,7 @@ public partial class RecipeEditorViewModel
private SopVideoSample? _agentSample;
private bool _isAgentBusy, _draftApplied;
private string _agentEndpoint = "", _agentModel = "", _agentApiKey = "", _agentVideoPath = "", _agentInstructions = "";
private string _agentStatus = "选择标准 SOP 视频,设置视觉模型接口后生成步骤草稿。", _agentSummary = "";
private string _agentStatus = "", _agentSummary = "";
private int _agentMaxFrames = 40;
public ObservableCollection<AgentDraftRow> AgentDraftSteps { get; } = [];
public string AgentEndpoint { get => _agentEndpoint; set => SetProperty(ref _agentEndpoint, value); }
@ -119,7 +119,7 @@ public partial class RecipeEditorViewModel
foreach (var step in draft.Steps) AgentDraftSteps.Add(new(step, sample.Frames[step.EvidenceFrame]));
AgentSummary = draft.Summary + (draft.Warnings.Count == 0 ? "" : "\n需核对:" + string.Join(";", draft.Warnings));
_draftApplied = false;
AgentStatus = $"已生成 {draft.Steps.Count} 步草稿(基于 {sample.Frames.Count} 张抽样画面)。请核对、修改后再添加到配方。";
AgentStatus = $"已生成 {draft.Steps.Count} 步,抽取 {sample.Frames.Count} 帧。";
try
{
Directory.CreateDirectory(Path.GetDirectoryName(AgentSettingsPath)!);
@ -160,7 +160,7 @@ public partial class RecipeEditorViewModel
RaisePropertyChanged(nameof(AgentCanEditDraft));
ApplyAgentDraftCommand.RaiseCanExecuteChanged();
RefreshWarnings();
AgentStatus = $"已添加 {AgentDraftSteps.Count} 步到配方草稿,原有步骤保留。请到“步骤”页检查触发区域和步骤说明,最后点击保存。";
AgentStatus = $"已添加 {AgentDraftSteps.Count} 步,待保存。";
}
private void ClearAgentDraft()
@ -184,7 +184,7 @@ public sealed class AgentDraftRow : BindableBase, IDisposable
}
public string Timeline => $"{TimeSpan.FromSeconds(Step.StartSeconds):mm\\:ss\\.f} – {TimeSpan.FromSeconds(Step.EndSeconds):mm\\:ss\\.f}";
public string EvidenceLabel { get; }
public string Note => Step.Note + (string.IsNullOrWhiteSpace(Region) ? " 请在添加后设置触发区域。" : "");
public string Note => Step.Note + (string.IsNullOrWhiteSpace(Region) ? " 触发区域未设置。" : "");
public BitmapSource EvidenceImage { get; }
public AgentDraftRow(SopDraftStep step, SopVideoFrame frame)
{