徐孝锋 hai 8 meses
pai
achega
e2286227c5

+ 15 - 10
TeamAAS-VM/DxfModule/DxfView.xaml

@@ -9,10 +9,9 @@
              lex:LocalizeDictionary.DesignCulture="zh-CN"
              lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
              lex:ResxLocalizationProvider.DefaultDictionary="Lang"
-             
              mc:Ignorable="d"
-             d:DesignHeight="450"
-             d:DesignWidth="800">
+             Height="768"
+             Width="1024">
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto" />
@@ -103,8 +102,8 @@
         <Grid Grid.Row="3"
               Margin="5">
             <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="*" />
-                <ColumnDefinition Width="*" />
+                <ColumnDefinition Width="70*" />
+                <ColumnDefinition Width="30*" />
             </Grid.ColumnDefinitions>
 
             <!-- Statistics -->
@@ -144,17 +143,23 @@
                        Margin="10,0,0,0"
                        Text="要导入的点位表开始索引:" />
             <materialDesign:NumericUpDown x:Name="TxtStartIndex"
-                     Width="100"
-                     Margin="5,0,0,0" ValueStep="1" Minimum="1" Maximum="999" ValueChanged="TxtStartIndex_ValueChanged" />
+                                          Width="100"
+                                          VerticalAlignment="Center"
+                                          VerticalContentAlignment="Center"
+                                          HorizontalContentAlignment="Center"
+                                          Margin="5,0,0,0"
+                                          ValueStep="1"
+                                          Minimum="1"
+                                          Maximum="999"
+                                          ValueChanged="TxtStartIndex_ValueChanged" />
         </StackPanel>
 
         <StackPanel Grid.Row="4"
                     Orientation="Horizontal"
                     HorizontalAlignment="Right"
                     Margin="0,18,0,0">
-            <Button 
-                    Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
-                    CommandParameter="{Binding ElementName=createpro,Path=DataContext}"
+            <Button Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
+                    CommandParameter="{Binding}"
                     IsDefault="True"
                     Content="{lex:Loc 确定}"
                     Margin="0,0,12,0" />

+ 8 - 21
TeamAAS-VM/DxfModule/DxfView.xaml.cs

@@ -39,27 +39,14 @@ namespace TeamAAS_VP.DxfModule
             InitializeInteractionController();
         }
 
-        #region 依赖属性-PointF集合
-        public static readonly DependencyProperty PointsProperty =
-            DependencyProperty.Register("Points", typeof(List<PointF>), typeof(DxfView),
-                new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnPointsChanged)));
-        public List<PointF> Points
-        {
-            get { return (List<PointF>)GetValue(PointsProperty); }
-            set { SetValue(PointsProperty, value); }
-        }
-
-        private static void OnPointsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
-        {
-            var view = d as DxfView;
-            if (view != null)
-            {
-                // Handle points changed
-            }
-        }
-        #endregion
-
-        //需要导入的点位表开始点编号
+        /// <summary>
+        /// 选中的点位
+        /// </summary>
+        public List<PointF> Points { get; private set; }=new List<PointF>();
+
+        /// <summary>
+        /// 需要导入的点位表开始点编号
+        /// </summary>
         public int StartIndex { get;private set; } = 1;
 
 

+ 12 - 3
TeamAAS-VM/ViewModels/Calibration/CalibToolViewModel.cs

@@ -283,6 +283,7 @@ namespace TeamAAS_VP.ViewModels.Calibration
                 }
                 Angle = SelectCalibration.Angle;
             }
+            _cameraCalibrationService.CaptureAndProcessCallback = null;
             _cameraCalibrationService.CaptureAndProcessCallback = CaptureAndProcess;
         }
 
@@ -302,12 +303,20 @@ namespace TeamAAS_VP.ViewModels.Calibration
             if (Camera != null)
             {
                 SelectCalibration.ToolBlock.Inputs["InputImage"].Value = Camera.Grab();
-                Image = (ICogImage)SelectCalibration.ToolBlock.Inputs["InputImage"].Value;
+                
             }
-            Graphic = null;
+            App.Current.Dispatcher.Invoke(() =>
+            {
+                Image = (ICogImage)SelectCalibration.ToolBlock.Inputs["InputImage"].Value;
+                Graphic = null;
+            });
+            
             SelectCalibration.ToolBlock.Run();
             CogToolBlockTerminalCollection outputCollection = SelectCalibration.ToolBlock.Outputs;
-            Graphic = outputCollection["Graphic"].Value as CogGraphicCollection;
+            App.Current.Dispatcher.Invoke(() =>
+            {
+                Graphic = outputCollection["Graphic"].Value as CogGraphicCollection;
+            });
             bool Found = (bool)(outputCollection["Found"].Value);
             if (Found)
             {

+ 13 - 4
TeamAAS-VM/ViewModels/Calibration/CalibrationAutoViewModel.cs

@@ -203,7 +203,6 @@ namespace TeamAAS_VP.ViewModels.Calibration
             }
         }
 
-
         /// <summary>
         /// 下一步
         /// </summary>
@@ -260,12 +259,21 @@ namespace TeamAAS_VP.ViewModels.Calibration
             if (Camera != null)
             {
                 SelectCalibration.ToolBlock.Inputs["InputImage"].Value = Camera.Grab();
-                Image = (ICogImage)SelectCalibration.ToolBlock.Inputs["InputImage"].Value;
+                
             }
-            Graphic = null;
+            App.Current.Dispatcher.Invoke(() =>
+            {
+                Graphic = null;
+                Image = (ICogImage)SelectCalibration.ToolBlock.Inputs["InputImage"].Value;
+            });
+            
             SelectCalibration.ToolBlock.Run();
             CogToolBlockTerminalCollection outputCollection = SelectCalibration.ToolBlock.Outputs;
-            Graphic = outputCollection["Graphic"].Value as CogGraphicCollection;
+            App.Current.Dispatcher.Invoke(() =>
+            {
+                Graphic = outputCollection["Graphic"].Value as CogGraphicCollection;
+            });
+            
             bool Found = (bool)(outputCollection["Found"].Value);
             if (Found)
             {
@@ -311,6 +319,7 @@ namespace TeamAAS_VP.ViewModels.Calibration
                 }
             }
             Camera = _cameraService.GetCamera(SelectCalibration.CameraID);
+            _cameraCalibrationService.CaptureAndProcessCallback = null;
             _cameraCalibrationService.CaptureAndProcessCallback= CaptureAndProcess;
         }
 

+ 13 - 3
TeamAAS-VM/ViewModels/Calibration/CalibrationVerificationViewModel.cs

@@ -219,12 +219,21 @@ namespace TeamAAS_VP.ViewModels.Calibration
             if (Camera != null)
             {
                 SelectCalibration.ToolBlock.Inputs["InputImage"].Value = Camera.Grab();
-                Image = (ICogImage)SelectCalibration.ToolBlock.Inputs["InputImage"].Value;
+                
             }
-            Graphic = null;
+            App.Current.Dispatcher.Invoke(() =>
+            {
+                Image = (ICogImage)SelectCalibration.ToolBlock.Inputs["InputImage"].Value;
+                Graphic = null;
+            });
+            
             SelectCalibration.ToolBlock.Run();
             CogToolBlockTerminalCollection outputCollection = SelectCalibration.ToolBlock.Outputs;
-            Graphic = outputCollection["Graphic"].Value as CogGraphicCollection;
+            App.Current.Dispatcher.Invoke(() =>
+            {
+                Graphic = outputCollection["Graphic"].Value as CogGraphicCollection;
+            });
+            
             bool Found = (bool)(outputCollection["Found"].Value);
             if (Found)
             {
@@ -270,6 +279,7 @@ namespace TeamAAS_VP.ViewModels.Calibration
 
             }
             Camera = _cameraService.GetCamera(SelectCalibration.CameraID);
+            _cameraCalibrationService.CaptureAndProcessCallback = null;
             _cameraCalibrationService.CaptureAndProcessCallback= CaptureAndProcess;
         }
 

+ 12 - 3
TeamAAS-VM/ViewModels/Product/PlcPointParamsViewModel.cs

@@ -532,6 +532,12 @@ namespace TeamAAS_VP.ViewModels.Product
             Points.Add(new PlcPoint()
             {
                 Number = Points.Count + 1,
+                X_Velocity = 100,
+                Y_Velocity = 100,
+                Z_Velocity_Start = 100,
+                Z_Velocity_Stop = 100,
+                U_Velocity = 100,
+                R_Velocity = 100,
             });
             // update commands
             _MovePointUpCommand?.RaiseCanExecuteChanged();
@@ -671,9 +677,12 @@ namespace TeamAAS_VP.ViewModels.Product
                                     Number = startNumber + i,
                                     X_Position = point.X,
                                     Y_Position = point.Y,
-                                    Z_Position_Start = 0,
-                                    U_Position = 0,
-                                    R_Position = 0
+                                    X_Velocity=100,
+                                    Y_Velocity=100,
+                                    Z_Velocity_Start=100,
+                                    Z_Velocity_Stop=100,
+                                    U_Velocity=100,
+                                    R_Velocity=100,
                                 });
                             }
                         }