Просмотр исходного кода

添加动静态批次点数设置

KWD 3 месяцев назад
Родитель
Сommit
9d2aed3223

+ 27 - 1
TeamAAS-VM/ViewModels/Product/VisionDynamicAccuracyAnalyzerViewModel.cs

@@ -244,6 +244,18 @@ namespace TeamAAS_VP.ViewModels.Product
             set { SetProperty(ref _MoveSpeed, value); }
         }
 
+        private int _MoveCount = 1000;
+        /// <summary>
+        /// 设置批次点数
+        /// </summary>
+        public int MoveCount
+        {
+            get { return _MoveCount; }
+            set { SetProperty(ref _MoveCount, value); }
+        }
+
+
+
         private double _CycleTime;
         /// <summary>
         /// 单次的时长
@@ -414,7 +426,15 @@ namespace TeamAAS_VP.ViewModels.Product
                 DateTime startTime = DateTime.Now;
                 //为机器人设置移动速度
                 await Robot.CalibParameAsync(new PickInfo(), MoveSpeed, 0, false, 0, 0);
-                
+
+
+                // 优先针对已知的 SSZNCamera 类型直接调用
+                if (Camera is TeamAAS_VP.Core.Cameras.SSZNCamera sszn)
+                {
+                    sszn.CameraRevFinish = false;
+                    sszn.SetBatchPoints(MoveCount);
+                }
+
                 //移动机器人至A点
                 bool isSuccess1 = await Robot.CalibMotionAsync(PointA, null);
                 //if (!isSuccess1)
@@ -490,6 +510,12 @@ namespace TeamAAS_VP.ViewModels.Product
                 //为机器人设置移动速度
                 await Robot.CalibParameAsync(new PickInfo(), MoveSpeed, 0, false, 0, 0);
 
+                // 优先针对已知的 SSZNCamera 类型直接调用
+                if (Camera is TeamAAS_VP.Core.Cameras.SSZNCamera sszn)
+                {
+                    sszn.CameraRevFinish = false;
+                    sszn.SetBatchPoints(MoveCount);
+                }
                 while (CurrentProgress < RepeatCount)
                 {
                     if (_cts.Token.IsCancellationRequested)

+ 20 - 7
TeamAAS-VM/Views/Product/VisionDynamicAccuracyAnalyzer.xaml

@@ -278,6 +278,7 @@
                                     <ColumnDefinition Width="*" />
                                     <ColumnDefinition Width="*" />
                                     <ColumnDefinition Width="*" />
+                                    <ColumnDefinition Width="*" />
                                 </Grid.ColumnDefinitions>
 
                                 <!-- 重复次数 -->
@@ -308,15 +309,27 @@
                                 </StackPanel>
 
                                 <StackPanel Grid.Column="2"
-Margin="10,0,0,0">
+                                              Margin="10,0,0,0">
                                     <TextBlock Text="垂直步进距离(ms):" />
                                     <uControl:myNumericUpDowm MinWidth="100"
-                  Interval="0.1"
-                  Maximum="10"
-                  Minimum="-10"
-                  StringFormat="{}{0:N3} mm"
-                  Value="{Binding Distance,Mode=TwoWay}"
-                  Margin="10,0" />
+                                               Interval="0.1"
+                                               Maximum="10"
+                                               Minimum="-10"
+                                               StringFormat="{}{0:N3} mm"
+                                               Value="{Binding Distance,Mode=TwoWay}"
+                                               Margin="10,0" />
+                                </StackPanel>
+                                <StackPanel Grid.Column="3"
+                                            Margin="10,0,0,0">
+                                    <TextBlock Text="设置批次点数:" />
+                                    <mah:NumericUpDown Value="{Binding MoveCount, Mode=TwoWay}"
+                                                       Minimum="1"
+                                                       Maximum="100"
+                                                       d:Value="50"
+                                                       TextAlignment="Center"
+                                                       HorizontalContentAlignment="Center"
+                                                       HorizontalAlignment="Stretch"
+                                                       IsEnabled="{Binding IsRunning, Converter={StaticResource InvertBooleanConverter}}" />
                                 </StackPanel>
                             </Grid>