VisionDynamicAccuracyAnalyzer.xaml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  1. <UserControl x:Class="TeamAAS_VP.Views.Product.VisionDynamicAccuracyAnalyzer"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:wf="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
  6. xmlns:vp="clr-namespace:Cognex.VisionPro;assembly=Cognex.VisionPro.Controls"
  7. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  8. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  10. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  11. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Product"
  14. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  15. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  16. lex:LocalizeDictionary.DesignCulture="zh-CN"
  17. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  18. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  19. prism:ViewModelLocator.AutoWireViewModel="True"
  20. mc:Ignorable="d"
  21. d:DataContext="{d:DesignInstance Type=vm:VisionDynamicAccuracyAnalyzerViewModel}"
  22. d:Height="1080"
  23. d:Width="1920"
  24. MinHeight="768"
  25. MinWidth="1024"
  26. d:Background="White"
  27. HorizontalAlignment="Stretch"
  28. VerticalAlignment="Stretch"
  29. FontFamily="{DynamicResource DefaultFont}">
  30. <prism:Dialog.WindowStyle>
  31. <Style TargetType="Window">
  32. <Setter Property="prism:Dialog.WindowStartupLocation"
  33. Value="CenterScreen" />
  34. <Setter Property="AllowDrop"
  35. Value="True" />
  36. <Setter Property="ShowInTaskbar"
  37. Value="True" />
  38. <Setter Property="WindowState"
  39. Value="Maximized" />
  40. <Setter Property="Topmost"
  41. Value="True" />
  42. </Style>
  43. </prism:Dialog.WindowStyle>
  44. <UserControl.Resources>
  45. <!-- 复用静态测试的样式 -->
  46. <Style TargetType="Button"
  47. BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}">
  48. <Setter Property="Padding"
  49. Value="10 5" />
  50. <Setter Property="Margin"
  51. Value="5" />
  52. <Setter Property="FontSize"
  53. Value="14" />
  54. <Setter Property="BorderThickness"
  55. Value="0" />
  56. </Style>
  57. <Style TargetType="TextBlock">
  58. <Setter Property="VerticalAlignment"
  59. Value="Center" />
  60. <Setter Property="Margin"
  61. Value="5" />
  62. </Style>
  63. <Style TargetType="TextBox"
  64. BasedOn="{StaticResource MaterialDesignTextBox}">
  65. <Setter Property="Margin"
  66. Value="5" />
  67. <Setter Property="VerticalContentAlignment"
  68. Value="Center" />
  69. </Style>
  70. <Style x:Key="DataGridStyle"
  71. TargetType="DataGrid"
  72. BasedOn="{StaticResource MaterialDesignDataGrid}">
  73. <Setter Property="Margin"
  74. Value="5" />
  75. <Setter Property="AutoGenerateColumns"
  76. Value="False" />
  77. <Setter Property="CanUserAddRows"
  78. Value="False" />
  79. <Setter Property="CanUserDeleteRows"
  80. Value="False" />
  81. <Setter Property="IsReadOnly"
  82. Value="True" />
  83. <Setter Property="AlternatingRowBackground"
  84. Value="#F5F5F5" />
  85. </Style>
  86. <Style x:Key="TitleStyle"
  87. TargetType="TextBlock">
  88. <Setter Property="FontSize"
  89. Value="16" />
  90. <Setter Property="FontWeight"
  91. Value="Bold" />
  92. <Setter Property="Margin"
  93. Value="0 10 0 5" />
  94. <Setter Property="Foreground"
  95. Value="#2C3E50" />
  96. </Style>
  97. </UserControl.Resources>
  98. <Grid>
  99. <Grid.ColumnDefinitions>
  100. <ColumnDefinition Width="45*" />
  101. <ColumnDefinition Width="55*" />
  102. </Grid.ColumnDefinitions>
  103. <!-- 左侧控制面板 -->
  104. <Border Grid.Column="0"
  105. BorderBrush="#BDC3C7"
  106. BorderThickness="0 0 1 0">
  107. <Grid>
  108. <Grid.RowDefinitions>
  109. <RowDefinition Height="Auto" />
  110. <RowDefinition Height="Auto" />
  111. <RowDefinition Height="Auto" />
  112. <RowDefinition Height="Auto" />
  113. <RowDefinition Height="*"
  114. MinHeight="100" />
  115. <RowDefinition Height="Auto" />
  116. </Grid.RowDefinitions>
  117. <!-- 机器人位置设置 -->
  118. <Border Grid.Row="0"
  119. Background="#ECF0F1"
  120. Padding="10">
  121. <StackPanel>
  122. <TextBlock Style="{StaticResource TitleStyle}"
  123. Text="机器人位置设置" />
  124. <Grid Margin="0 10 0 0">
  125. <Grid.RowDefinitions>
  126. <RowDefinition Height="Auto" />
  127. <RowDefinition Height="Auto" />
  128. <RowDefinition Height="Auto" />
  129. </Grid.RowDefinitions>
  130. <!-- A点坐标 -->
  131. <Grid Grid.Row="0"
  132. Margin="0 0 0 10">
  133. <Grid.ColumnDefinitions>
  134. <ColumnDefinition Width="Auto" />
  135. <ColumnDefinition Width="*" />
  136. <ColumnDefinition Width="Auto" />
  137. </Grid.ColumnDefinitions>
  138. <TextBlock Text="A点坐标:"
  139. Grid.Column="0"
  140. VerticalAlignment="Center" />
  141. <TextBox Grid.Column="1"
  142. Text="{Binding PointA, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  143. d:Text="X:0.000 Y:0.000 Z:0.000 U:0.000 V:0.000 W:0.000"
  144. ToolTip="机器人A点位置坐标"
  145. IsReadOnly="True"
  146. Background="#F8F9FA" />
  147. <Button Grid.Column="2"
  148. Content="示教"
  149. Command="{Binding TeachPointACommand}"
  150. Background="#3498DB"
  151. Foreground="White"
  152. Width="60"
  153. Margin="5,0,0,0" />
  154. </Grid>
  155. <!-- B点坐标 -->
  156. <Grid Grid.Row="1"
  157. Margin="0 0 0 10">
  158. <Grid.ColumnDefinitions>
  159. <ColumnDefinition Width="Auto" />
  160. <ColumnDefinition Width="*" />
  161. <ColumnDefinition Width="Auto" />
  162. </Grid.ColumnDefinitions>
  163. <TextBlock Text="B点坐标:"
  164. Grid.Column="0"
  165. VerticalAlignment="Center" />
  166. <TextBox Grid.Column="1"
  167. Text="{Binding PointB, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  168. d:Text="X:100.000 Y:50.000 Z:0.000 U:0.000 V:0.000 W:0.000"
  169. ToolTip="机器人B点拍照位置坐标"
  170. IsReadOnly="True"
  171. Background="#F8F9FA" />
  172. <Button Grid.Column="2"
  173. Content="示教"
  174. Command="{Binding TeachPointBCommand}"
  175. Background="#3498DB"
  176. Foreground="White"
  177. Width="60"
  178. Margin="5,0,0,0" />
  179. </Grid>
  180. <!-- 视觉流程选择 -->
  181. <Grid Grid.Row="2">
  182. <Grid.ColumnDefinitions>
  183. <ColumnDefinition Width="Auto" />
  184. <ColumnDefinition Width="*" />
  185. </Grid.ColumnDefinitions>
  186. <TextBlock Text="视觉流程:"
  187. Grid.Column="0"
  188. VerticalAlignment="Center" />
  189. <ComboBox Grid.Column="1"
  190. ItemsSource="{Binding ProcedureModels}"
  191. SelectedItem="{Binding SelectProcedure, Mode=TwoWay}"
  192. ToolTip="选择视觉处理流程">
  193. <ComboBox.ItemTemplate>
  194. <DataTemplate>
  195. <TextBlock Text="{Binding Name}" />
  196. </DataTemplate>
  197. </ComboBox.ItemTemplate>
  198. <b:Interaction.Triggers>
  199. <b:EventTrigger EventName="SelectionChanged">
  200. <b:InvokeCommandAction Command="{Binding ProcedureSelectionChangedCommand}" />
  201. </b:EventTrigger>
  202. </b:Interaction.Triggers>
  203. </ComboBox>
  204. </Grid>
  205. </Grid>
  206. </StackPanel>
  207. </Border>
  208. <!-- 测试参数设置 -->
  209. <Border Grid.Row="1"
  210. Background="#F8F9FA"
  211. Padding="10">
  212. <StackPanel>
  213. <TextBlock Style="{StaticResource TitleStyle}"
  214. Text="测试参数设置" />
  215. <Grid Margin="0 10 0 0">
  216. <Grid.ColumnDefinitions>
  217. <ColumnDefinition Width="*" />
  218. <ColumnDefinition Width="*" />
  219. </Grid.ColumnDefinitions>
  220. <!-- 重复次数 -->
  221. <StackPanel Grid.Column="0">
  222. <TextBlock Text="重复次数:" />
  223. <mah:NumericUpDown Value="{Binding RepeatCount, Mode=TwoWay}"
  224. Minimum="1"
  225. Maximum="1000"
  226. d:Value="50"
  227. TextAlignment="Center"
  228. HorizontalContentAlignment="Center"
  229. HorizontalAlignment="Stretch"
  230. IsEnabled="{Binding IsRunning, Converter={StaticResource InvertBooleanConverter}}" />
  231. </StackPanel>
  232. <!-- 移动速度 -->
  233. <StackPanel Grid.Column="1"
  234. Margin="10,0,0,0">
  235. <TextBlock Text="移动速度(%):" />
  236. <mah:NumericUpDown Value="{Binding MoveSpeed, Mode=TwoWay}"
  237. Minimum="1"
  238. Maximum="100"
  239. d:Value="50"
  240. TextAlignment="Center"
  241. HorizontalContentAlignment="Center"
  242. HorizontalAlignment="Stretch"
  243. IsEnabled="{Binding IsRunning, Converter={StaticResource InvertBooleanConverter}}" />
  244. </StackPanel>
  245. </Grid>
  246. </StackPanel>
  247. </Border>
  248. <!-- 测试控制区域 -->
  249. <Border Grid.Row="2"
  250. Background="#ECF0F1"
  251. Padding="10">
  252. <StackPanel>
  253. <TextBlock Style="{StaticResource TitleStyle}"
  254. Text="测试控制" />
  255. <WrapPanel HorizontalAlignment="Center"
  256. Margin="0 10 0 0">
  257. <Button Content="单次测试"
  258. Background="#3498DB"
  259. Foreground="White"
  260. MinWidth="100"
  261. Height="35"
  262. FontWeight="Bold"
  263. Command="{Binding SingleTestCommand}"
  264. IsEnabled="{Binding IsRunning, Converter={StaticResource InvertBooleanConverter}}" />
  265. <Button Content="连续测试"
  266. Background="#27AE60"
  267. Foreground="White"
  268. MinWidth="100"
  269. Height="35"
  270. FontWeight="Bold"
  271. Command="{Binding StartTestCommand}" />
  272. <Button Content="停止"
  273. Background="#E74C3C"
  274. Foreground="White"
  275. MinWidth="100"
  276. Height="35"
  277. Command="{Binding StopTestCommand}" />
  278. <Button Content="暂停"
  279. Background="#F39C12"
  280. Foreground="White"
  281. MinWidth="100"
  282. Height="35"
  283. Command="{Binding PauseTestCommand}" />
  284. </WrapPanel>
  285. </StackPanel>
  286. </Border>
  287. <!-- 进度显示 -->
  288. <Border Grid.Row="3"
  289. Background="White"
  290. Padding="10">
  291. <StackPanel>
  292. <TextBlock Style="{StaticResource TitleStyle}"
  293. Text="测试进度" />
  294. <Grid Margin="0 10 0 0">
  295. <Grid.RowDefinitions>
  296. <RowDefinition Height="Auto" />
  297. <RowDefinition Height="Auto" />
  298. </Grid.RowDefinitions>
  299. <ProgressBar Grid.Row="0"
  300. Height="25"
  301. Margin="5"
  302. Minimum="0"
  303. Maximum="{Binding RepeatCount}"
  304. Value="{Binding CurrentProgress}"
  305. IsEnabled="False"
  306. d:Maximum="100"
  307. d:Value="50" />
  308. <TextBlock Grid.Row="1"
  309. HorizontalAlignment="Center"
  310. FontSize="12"
  311. Foreground="#7F8C8D"
  312. d:Text="等待开始..."
  313. Text="{Binding Message}" />
  314. </Grid>
  315. <!-- 实时统计信息 -->
  316. <WrapPanel Margin="0 15 0 0"
  317. HorizontalAlignment="Center">
  318. <Border Background="#3498DB"
  319. Padding="10 5"
  320. Margin="5"
  321. CornerRadius="3">
  322. <StackPanel>
  323. <TextBlock Text="当前循环"
  324. Foreground="White"
  325. FontSize="11" />
  326. <TextBlock Text="{Binding CurrentProgress}"
  327. d:Text="1"
  328. Foreground="White"
  329. FontSize="16"
  330. FontWeight="Bold"
  331. HorizontalAlignment="Center" />
  332. </StackPanel>
  333. </Border>
  334. <Border Background="#2ECC71"
  335. Padding="10 5"
  336. Margin="5"
  337. CornerRadius="3">
  338. <StackPanel>
  339. <TextBlock Text="成功率"
  340. Foreground="White"
  341. FontSize="11" />
  342. <TextBlock Text="{Binding SuccessRate, StringFormat={}{0:F1}%}"
  343. d:Text="100%"
  344. Foreground="White"
  345. FontSize="16"
  346. FontWeight="Bold"
  347. HorizontalAlignment="Center" />
  348. </StackPanel>
  349. </Border>
  350. <Border Background="#9B59B6"
  351. Padding="10 5"
  352. Margin="5"
  353. CornerRadius="3">
  354. <StackPanel>
  355. <TextBlock Text="往返时间"
  356. Foreground="White"
  357. FontSize="11" />
  358. <TextBlock Text="{Binding CycleTime, StringFormat={}{0:F2}s}"
  359. d:Text="2.34s"
  360. Foreground="White"
  361. FontSize="16"
  362. FontWeight="Bold"
  363. HorizontalAlignment="Center" />
  364. </StackPanel>
  365. </Border>
  366. </WrapPanel>
  367. </StackPanel>
  368. </Border>
  369. <!-- 测试结果列表 -->
  370. <Border Grid.Row="4"
  371. Background="White"
  372. Padding="10">
  373. <Grid>
  374. <Grid.RowDefinitions>
  375. <RowDefinition Height="Auto" />
  376. <RowDefinition Height="*" />
  377. </Grid.RowDefinitions>
  378. <StackPanel Grid.Row="0"
  379. Orientation="Horizontal">
  380. <TextBlock Style="{StaticResource TitleStyle}"
  381. Text="测试结果列表" />
  382. <TextBlock Margin="10,0,0,0"
  383. VerticalAlignment="Center"
  384. Foreground="#7F8C8D"
  385. Text="(显示最近20次结果)" />
  386. </StackPanel>
  387. <DataGrid x:Name="dgResults"
  388. Grid.Row="1"
  389. Style="{StaticResource DataGridStyle}"
  390. MaxHeight="250"
  391. AutoGenerateColumns="False"
  392. CanUserAddRows="False"
  393. IsReadOnly="True"
  394. ItemsSource="{Binding TestResults}">
  395. <DataGrid.Columns>
  396. <DataGridTextColumn Header="序号"
  397. Binding="{Binding Index}"
  398. MinWidth="50" />
  399. <DataGridTextColumn Header="状态"
  400. Binding="{Binding IsPhotoSuccess}"
  401. MinWidth="60" />
  402. <DataGridTextColumn Header="像素X"
  403. Binding="{Binding PixelX, StringFormat={}{0:F3}}"
  404. MinWidth="70" />
  405. <DataGridTextColumn Header="像素Y"
  406. Binding="{Binding PixelY, StringFormat={}{0:F3}}"
  407. MinWidth="70" />
  408. <DataGridTextColumn Header="角度"
  409. Binding="{Binding AngleU, StringFormat={}{0:F2}}"
  410. MinWidth="60" />
  411. <DataGridTextColumn Header="绝对X"
  412. Binding="{Binding TransformX, StringFormat={}{0:F3}}"
  413. MinWidth="70" />
  414. <DataGridTextColumn Header="绝对Y"
  415. Binding="{Binding TransformY, StringFormat={}{0:F3}}"
  416. MinWidth="70" />
  417. <DataGridTextColumn Header="循环时间"
  418. Binding="{Binding CycleTime, StringFormat={}{0:F2}s}"
  419. MinWidth="80" />
  420. <DataGridTextColumn Header="时间戳"
  421. Binding="{Binding Timestamp}"
  422. MinWidth="120" />
  423. </DataGrid.Columns>
  424. </DataGrid>
  425. </Grid>
  426. </Border>
  427. <!-- 导出和精度分析 -->
  428. <Border Grid.Row="5"
  429. Background="#ECF0F1"
  430. Padding="10">
  431. <StackPanel>
  432. <!-- 导出按钮 -->
  433. <WrapPanel HorizontalAlignment="Right">
  434. <Button Content="导出CSV"
  435. Background="#3498DB"
  436. Foreground="White"
  437. MinWidth="100"
  438. Command="{Binding ExportCSVCommand}" />
  439. <Button Content="生成报告"
  440. Background="#9B59B6"
  441. Foreground="White"
  442. MinWidth="100"
  443. Command="{Binding ExportReportCommand}" />
  444. <Button Content="清空数据"
  445. Background="#95A5A6"
  446. Foreground="White"
  447. MinWidth="100"
  448. Command="{Binding ClearDataCommand}" />
  449. </WrapPanel>
  450. <!-- 动态精度分析 -->
  451. <Border Margin="0 10 0 0"
  452. Background="#F8F9FA"
  453. Padding="10"
  454. CornerRadius="5">
  455. <StackPanel>
  456. <TextBlock Text="动态重复精度分析"
  457. FontWeight="Bold"
  458. Margin="0 0 0 5" />
  459. <Grid Margin="0 5 0 0">
  460. <Grid.ColumnDefinitions>
  461. <ColumnDefinition Width="*" />
  462. <ColumnDefinition Width="*" />
  463. </Grid.ColumnDefinitions>
  464. <StackPanel Grid.Column="0">
  465. <TextBlock>
  466. <Run Text="X方向精度: " />
  467. <Run Text="{Binding PrecisionResult.XPrecision, StringFormat={}{0:F3}mm}"
  468. d:Text="0.023mm"
  469. Foreground="#2C3E50"
  470. FontWeight="Bold" />
  471. </TextBlock>
  472. <TextBlock>
  473. <Run Text="Y方向精度: " />
  474. <Run Text="{Binding PrecisionResult.YPrecision, StringFormat={}{0:F3}mm}"
  475. d:Text="0.018mm"
  476. Foreground="#2C3E50"
  477. FontWeight="Bold" />
  478. </TextBlock>
  479. <TextBlock>
  480. <Run Text="角度精度: " />
  481. <Run Text="{Binding PrecisionResult.AnglePrecision, StringFormat={}{0:F2}°}"
  482. d:Text="0.12°"
  483. Foreground="#2C3E50"
  484. FontWeight="Bold" />
  485. </TextBlock>
  486. </StackPanel>
  487. <StackPanel Grid.Column="1">
  488. <TextBlock>
  489. <Run Text="3σ范围: " />
  490. <Run Text="{Binding PrecisionResult.OverallThreeSigmaRange, StringFormat={}±{0:F3}mm}"
  491. d:Text="±0.065mm"
  492. Foreground="#2C3E50"
  493. FontWeight="Bold" />
  494. </TextBlock>
  495. <TextBlock>
  496. <Run Text="CPK: " />
  497. <Run Text="{Binding PrecisionResult.OverallPrecision, StringFormat={}{0:F2}}"
  498. d:Text="1.85"
  499. Foreground="#2C3E50"
  500. FontWeight="Bold" />
  501. </TextBlock>
  502. <TextBlock>
  503. <Run Text="评级: " />
  504. <Run Text="{Binding ProcessRating}"
  505. d:Text="优秀"
  506. Foreground="#27AE60"
  507. FontWeight="Bold" />
  508. </TextBlock>
  509. </StackPanel>
  510. </Grid>
  511. <!-- 趋势图按钮 -->
  512. <Button Content="显示趋势图"
  513. Background="#E67E22"
  514. Foreground="White"
  515. HorizontalAlignment="Right"
  516. Margin="0 10 0 0"
  517. MinWidth="100"
  518. Command="{Binding ShowTrendChartCommand}" />
  519. </StackPanel>
  520. </Border>
  521. </StackPanel>
  522. </Border>
  523. </Grid>
  524. </Border>
  525. <!-- 右侧图像和轨迹显示区域 -->
  526. <Grid Grid.Column="1">
  527. <Grid.RowDefinitions>
  528. <RowDefinition Height="*" />
  529. <RowDefinition Height="Auto" />
  530. <RowDefinition Height="Auto" />
  531. </Grid.RowDefinitions>
  532. <!-- 图像显示区域 -->
  533. <Border Background="#2C3E50">
  534. <Grid>
  535. <Grid.RowDefinitions>
  536. <RowDefinition Height="*" />
  537. <RowDefinition Height="Auto" />
  538. </Grid.RowDefinitions>
  539. <!-- VisionPro图像显示 -->
  540. <wf:WindowsFormsHost Grid.Row="0">
  541. <vp:CogRecordDisplay x:Name="display"
  542. Dock="Fill" />
  543. </wf:WindowsFormsHost>
  544. <!-- 图像信息栏 -->
  545. <!--<Border Grid.Row="1"
  546. Background="#34495E"
  547. Padding="10">
  548. <Grid>
  549. <Grid.ColumnDefinitions>
  550. <ColumnDefinition Width="*" />
  551. <ColumnDefinition Width="Auto" />
  552. </Grid.ColumnDefinitions>
  553. <StackPanel Grid.Column="0"
  554. Orientation="Horizontal">
  555. <TextBlock Text="图像信息: "
  556. Foreground="White" />
  557. <TextBlock Text="{Binding ImageInfo}"
  558. d:Text="第15次采集 - 检测成功"
  559. Foreground="#F1C40F"
  560. FontWeight="Bold" />
  561. </StackPanel>
  562. <StackPanel Grid.Column="1"
  563. Orientation="Horizontal">
  564. <TextBlock Text="检测时间: "
  565. Foreground="White" />
  566. <TextBlock Text="{Binding DetectTime, StringFormat={}{0:F3}s}"
  567. d:Text="0.123s"
  568. Foreground="#F1C40F"
  569. FontWeight="Bold"
  570. Width="60" />
  571. </StackPanel>
  572. </Grid>
  573. </Border>-->
  574. </Grid>
  575. </Border>
  576. <!-- 轨迹可视化区域 -->
  577. <!--<Border Grid.Row="1"
  578. Background="#ECF0F1"
  579. Padding="10"
  580. BorderBrush="#BDC3C7"
  581. BorderThickness="0 1 0 0">
  582. <StackPanel>
  583. <TextBlock Text="机器人轨迹可视化"
  584. FontWeight="Bold"
  585. Margin="0 0 0 5" />
  586. <Grid>
  587. <Grid.ColumnDefinitions>
  588. <ColumnDefinition Width="*" />
  589. <ColumnDefinition Width="Auto" />
  590. </Grid.ColumnDefinitions>
  591. -->
  592. <!-- 简化轨迹图 -->
  593. <!--
  594. <Canvas x:Name="trajectoryCanvas"
  595. Height="100"
  596. Background="White"
  597. Margin="0 5 0 0">
  598. -->
  599. <!-- A点标记 -->
  600. <!--
  601. <Ellipse Canvas.Left="50"
  602. Canvas.Top="50"
  603. Width="12"
  604. Height="12"
  605. Fill="#3498DB"
  606. Stroke="#2C3E50"
  607. StrokeThickness="1">
  608. <Ellipse.ToolTip>
  609. <ToolTip>
  610. <StackPanel>
  611. <TextBlock Text="A点 - 起始位置"
  612. FontWeight="Bold" />
  613. <TextBlock Text="{Binding PointA}" />
  614. </StackPanel>
  615. </ToolTip>
  616. </Ellipse.ToolTip>
  617. </Ellipse>
  618. <TextBlock Canvas.Left="45"
  619. Canvas.Top="65"
  620. Text="A"
  621. FontWeight="Bold"
  622. Foreground="#2C3E50" />
  623. -->
  624. <!-- B点标记 -->
  625. <!--
  626. <Ellipse Canvas.Left="200"
  627. Canvas.Top="50"
  628. Width="12"
  629. Height="12"
  630. Fill="#E74C3C"
  631. Stroke="#2C3E50"
  632. StrokeThickness="1">
  633. <Ellipse.ToolTip>
  634. <ToolTip>
  635. <StackPanel>
  636. <TextBlock Text="B点 - 拍照位置"
  637. FontWeight="Bold" />
  638. <TextBlock Text="{Binding PointB}" />
  639. </StackPanel>
  640. </ToolTip>
  641. </Ellipse.ToolTip>
  642. </Ellipse>
  643. <TextBlock Canvas.Left="195"
  644. Canvas.Top="65"
  645. Text="B"
  646. FontWeight="Bold"
  647. Foreground="#2C3E50" />
  648. -->
  649. <!-- 移动轨迹线 -->
  650. <!--
  651. <Line x:Name="trajectoryLine"
  652. X1="56"
  653. Y1="56"
  654. X2="194"
  655. Y2="56"
  656. Stroke="#7F8C8D"
  657. StrokeThickness="2"
  658. StrokeDashArray="5,3" />
  659. -->
  660. <!-- 当前位置标记 -->
  661. <!--
  662. <Ellipse x:Name="currentPositionMarker"
  663. Canvas.Left="125"
  664. Canvas.Top="50"
  665. Width="8"
  666. Height="8"
  667. Fill="#27AE60"
  668. Stroke="White"
  669. StrokeThickness="1"
  670. Visibility="Visible">
  671. <Ellipse.ToolTip>
  672. <ToolTip>
  673. <StackPanel>
  674. <TextBlock Text="当前位置"
  675. FontWeight="Bold" />
  676. <TextBlock Text="{Binding CurrentPosition}" />
  677. </StackPanel>
  678. </ToolTip>
  679. </Ellipse.ToolTip>
  680. </Ellipse>
  681. </Canvas>
  682. -->
  683. <!-- 轨迹控制 -->
  684. <!--
  685. <StackPanel Grid.Column="1"
  686. Orientation="Vertical"
  687. Margin="10 0 0 0">
  688. <CheckBox Content="显示轨迹"
  689. IsChecked="{Binding ShowTrajectory, Mode=TwoWay}"
  690. Margin="0 0 0 5" />
  691. <CheckBox Content="实时更新"
  692. IsChecked="{Binding RealTimeUpdate, Mode=TwoWay}"
  693. Margin="0 0 0 5" />
  694. <Button Content="重置视图"
  695. MinWidth="80"
  696. Height="25"
  697. Command="{Binding ResetTrajectoryViewCommand}" />
  698. </StackPanel>
  699. </Grid>
  700. </StackPanel>
  701. </Border>-->
  702. <!-- 底部按钮 -->
  703. <StackPanel Grid.Row="2"
  704. Orientation="Horizontal"
  705. VerticalAlignment="Center"
  706. HorizontalAlignment="Right"
  707. Margin="0 5 5 5">
  708. <Button Height="30"
  709. MinWidth="100"
  710. Content="{lex:Loc 确定}"
  711. materialDesign:ButtonAssist.CornerRadius="10"
  712. ToolTip="{lex:Loc 确定}"
  713. Command="{Binding ConfirmCommand}" />
  714. <Button Height="30"
  715. Margin="10,0"
  716. MinWidth="100"
  717. materialDesign:ButtonAssist.CornerRadius="10"
  718. ToolTip="{lex:Loc 取消}"
  719. Content="{lex:Loc 取消}"
  720. Command="{Binding CancelCommand}" />
  721. </StackPanel>
  722. </Grid>
  723. <!-- 消息提示 -->
  724. <materialDesign:Snackbar Grid.ColumnSpan="2"
  725. Opacity="0.8"
  726. HorizontalContentAlignment="Center"
  727. FontSize="14"
  728. MessageQueue="{Binding MessageQueue}"
  729. VerticalAlignment="Bottom" />
  730. </Grid>
  731. </UserControl>