瀏覽代碼

更新库升级配置

肖奇伟 10 小時之前
父節點
當前提交
414f69ed4a

二進制
Lib/SCADA_DAQ.Plugin.Robot.dll


二進制
Lib/SCADA_DAQ.Plugin.RobotUI.dll


+ 29 - 8
SCADA_DAQ/Customer/Machines/SampleMachine.cs

@@ -120,30 +120,51 @@ namespace SCADA_DAQ.Customer.Machines
                         item.CaptureState = CaptureState.None;
                     }
                 }
-                StackCapture.CaptureState = CaptureState.Capturing;
+                currentBox.CaptureState = CaptureState.Capturing;
                 takeLocation.X = CustomerEnv.CustomerConfig.CaputreBoxLocation.X - CustomerEnv.CustomerConfig.MachineOrigin.X - (StackSln.BoxWidth_Dec / 2);
                 takeLocation.Y = CustomerEnv.CustomerConfig.CaputreBoxLocation.Y - CustomerEnv.CustomerConfig.MachineOrigin.Y - (StackSln.BoxLength_Dec / 2);
                 takeLocation.Z = CustomerEnv.CustomerConfig.CaputreBoxLocation.Z - CustomerEnv.CustomerConfig.MachineOrigin.Z + StackSln.BoxHeight_Dec;
                 takeLocation.R = 0;
 
-                var TakeBoxYIsSucess = GetListenReg(Tag_Y轴取料点上方).WriteReg($"{takeLocation.X}");
-                var TakeBoxXIsSucess = GetListenReg(Tag_X轴取料点上方).WriteReg($"{takeLocation.Y}");
-                var TakeBoxZIsSucess = GetListenReg(Tag_Z轴取料点).WriteReg($"{takeLocation.Z}");
+                bool TakeBoxYIsSucess;
+                bool TakeBoxXIsSucess;
+                if (CustomerEnv.CustomerConfig.SwitchXY)
+                {
+                    TakeBoxYIsSucess = GetListenReg(Tag_Y轴取料点上方).WriteReg($"{takeLocation.Y}");
+                    TakeBoxXIsSucess = GetListenReg(Tag_X轴取料点上方).WriteReg($"{takeLocation.X}");
+                }
+                else
+                {
+                    TakeBoxYIsSucess = GetListenReg(Tag_Y轴取料点上方).WriteReg($"{takeLocation.X}");
+                    TakeBoxXIsSucess = GetListenReg(Tag_X轴取料点上方).WriteReg($"{takeLocation.Y}");
+                }
+                bool TakeBoxZIsSucess = GetListenReg(Tag_Z轴取料点).WriteReg($"{takeLocation.Z}");
 
                 releaseLocation.X = (decimal)StackCapture.CaptureX - CustomerEnv.CustomerConfig.MachineOrigin.X;
                 releaseLocation.Y = (decimal)StackCapture.CaptureY - CustomerEnv.CustomerConfig.MachineOrigin.Y;
                 releaseLocation.Z = (decimal)StackCapture.CaptureZ + StackSln.BoxHeight_Dec / 2 - CustomerEnv.CustomerConfig.MachineOrigin.Z;
                 releaseLocation.R = (decimal)currentBox.RotationAngle;
 
-                var PutBoxXIsSucess = GetListenReg(Tag_X轴放料点上方).WriteReg($"{(int)releaseLocation.X}");
-                var PutBoxYIsSucess = GetListenReg(Tag_Y轴放料点上方).WriteReg($"{(int)releaseLocation.Y}");
+                bool PutBoxXIsSucess;
+                bool PutBoxYIsSucess;
+                if (CustomerEnv.CustomerConfig.SwitchXY)
+                {
+                    PutBoxXIsSucess = GetListenReg(Tag_X轴放料点上方).WriteReg($"{(int)releaseLocation.Y}");
+                    PutBoxYIsSucess = GetListenReg(Tag_Y轴放料点上方).WriteReg($"{(int)releaseLocation.X}");
+                }
+                else
+                {
+                    PutBoxXIsSucess = GetListenReg(Tag_X轴放料点上方).WriteReg($"{(int)releaseLocation.X}");
+                    PutBoxYIsSucess = GetListenReg(Tag_Y轴放料点上方).WriteReg($"{(int)releaseLocation.Y}");
+                }
+
                 var PutBoxRIsSucess = GetListenReg(Tag_R轴放料点角度).WriteReg($"{(int)currentBox.RotationAngle * -1}");
                 var PutBoxZIsSucess = GetListenReg(Tag_Z轴放料点).WriteReg($"{(int)releaseLocation.Z}");
 
                 if (TakeBoxYIsSucess && TakeBoxXIsSucess && TakeBoxZIsSucess &&
                     PutBoxXIsSucess && PutBoxYIsSucess && PutBoxRIsSucess && PutBoxZIsSucess)
                 {
-                    GetListenReg("HMI开始作业").WriteReg(1);
+                    GetListenReg(Tag_HMI开始作业).WriteReg(1);
                 }
                 Log.Info($"开始堆码,抓取,X:{takeLocation.X},Y:{takeLocation.Y},Z:{takeLocation.Y},角度:{0}\r\n" +
                     $"摆放,X:{releaseLocation.X},Y:{releaseLocation.Y},Z:{releaseLocation.Z},角度:{releaseLocation.R}");
@@ -156,7 +177,7 @@ namespace SCADA_DAQ.Customer.Machines
                     {
                         CurrentCapture = StackCapture
                     });
-                    StackCapture.CaptureState = CaptureState.Captured;
+                    StackSln.StackCaptureList[CurrentCaputerIndex - 1].CaptureState = CaptureState.Captured;
                     if (CurrentCaputerIndex == StackSln.StackCaptureList.Count)
                     {
                         CurrentCaputerIndex = 1;  //堆码完成

+ 21 - 1
SCADA_DAQ/Customer/Models/CustomerConfig.cs

@@ -1,4 +1,5 @@
-using SCADA.CommonLib;
+using ControlzEx.Standard;
+using SCADA.CommonLib;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -53,6 +54,25 @@ namespace SCADA_DAQ.Customer.Models
 
 
 
+        /// <summary>
+        /// 
+        /// </summary>
+        [AutoViewProperty("交换XY轴", Icon = "ImageFilterCenterFocus")]
+        public bool SwitchXY
+        {
+            get { return _SwitchXY; }
+            set
+            {
+                if (value != _SwitchXY)
+                {
+                    _SwitchXY = value;
+                    OnPropertyChanged(nameof(SwitchXY));
+                }
+            }
+        }
+        private bool _SwitchXY=false;
+
+
         /// <summary>
         /// 
         /// </summary>

+ 2 - 2
SCADA_DAQ/Customer/UctFrmPalletizingManual.xaml.cs

@@ -73,7 +73,7 @@ namespace SCADA_DAQ.Customer
                  nameof(stackParameter.SlnName)
                 }, 1, Orientation.Vertical,
                 Orientation.Vertical)
-            { ContentWidth = 120 };
+            { ContentWidth = 240 };
 
             StackInfo.Content = new AutoView(
                 stackParameter, new List<string>() {
@@ -82,8 +82,8 @@ namespace SCADA_DAQ.Customer
                  nameof(stackParameter.StackHeight),
 
                  nameof(stackParameter.BoxWidth),
+                 nameof(stackParameter.BoxLength),
                  nameof(stackParameter.BoxHeight),
-                 nameof(stackParameter.BoxWidth),
                 }, 3, Orientation.Horizontal,
                 Orientation.Horizontal, AutoViewElementKind.TextBlock)
             { ContentWidth = 60 };

+ 1 - 1
SCADA_DAQ/Customer/UctFrmParameterSet.xaml

@@ -21,7 +21,7 @@
             </StackPanel>
         </StackPanel>
 
-        <StackPanel  Grid.Row="1">
+        <StackPanel  Grid.Column="1">
             <Image x:Name="Img"/>
         </StackPanel>
     </Grid>