Explorar el Código

重构PLC参数配置与系统参数模型,支持点位扩展

本次提交大幅重构了PLC参数配置、系统参数模型及界面绑定,统一属性命名,参数类型由int改为Int16,并新增大量Out_/In_前缀的PLC地址属性。引入PlcPoint/PlcPointAddress数据结构,支持点位参数批量读写。完善默认值初始化逻辑,提升了配置灵活性和可维护性,为后续PLC点位扩展和多场景交互奠定基础。界面、配置、模型、通信层实现一致化。
孝锋 徐 hace 8 meses
padre
commit
f92c398797

+ 9 - 9
TeamAAS-VM/Core/Management.cs

@@ -844,15 +844,15 @@ namespace TeamAAS_VP.Core
             var plc=_plcService.GetPlcByNumber(addressConfig.PlcNo) as OpcUaClientPLC;
             if (plc == null) return;
             Dictionary<string,object> nodeValues = new Dictionary<string, object>();
-            nodeValues.Add(addressConfig.WorkMode.Address, (Int16)systemConfiguration.WorkMode);
-            nodeValues.Add(addressConfig.PickPointNum.Address, (Int16)systemConfiguration.PickPointNum);
-            nodeValues.Add(addressConfig.CameraShotCount.Address, (Int16)systemConfiguration.CameraShotCount);
-            nodeValues.Add(addressConfig.UpperCameraPickShotCount.Address, (Int16)systemConfiguration.UpperCameraPickShotCount);
-            nodeValues.Add(addressConfig.UpperCameraPlaceShotCount.Address, (Int16)systemConfiguration.UpperCameraPlaceShotCount);
-            nodeValues.Add(addressConfig.UpperCameraLockAssembleCount.Address, (Int16)systemConfiguration.UpperCameraLockAssembleCount);
-            nodeValues.Add(addressConfig.PickFixedPositionProductCameraCount.Address, (Int16)systemConfiguration.PickFixedPositionProductCameraCount);
-            nodeValues.Add(addressConfig.LockFixedPositionProductCameraCount.Address, (Int16)systemConfiguration.LockFixedPositionProductCameraCount);
-            nodeValues.Add(addressConfig.FixedCameraDetectLockAssembleCount.Address, (Int16)systemConfiguration.FixedCameraDetectLockAssembleCount);
+            nodeValues.Add(addressConfig.Out_WorkMode.Address, (Int16)systemConfiguration.WorkMode);
+            nodeValues.Add(addressConfig.Out_PickPointNum.Address, (Int16)systemConfiguration.PickPointNum);
+            nodeValues.Add(addressConfig.Out_DowmCameraNum.Address, (Int16)systemConfiguration.DowmCameraNum);
+            nodeValues.Add(addressConfig.Out_UpCameraPickNum.Address, (Int16)systemConfiguration.UpCameraPickNum);
+            nodeValues.Add(addressConfig.Out_UpCameraPutNum.Address, (Int16)systemConfiguration.UpCameraPutNum);
+            nodeValues.Add(addressConfig.Out_UPCameracheckNum.Address, (Int16)systemConfiguration.UPCameracheckNum);
+            nodeValues.Add(addressConfig.Out_FixedCameraPickNum.Address, (Int16)systemConfiguration.FixedCameraPickNum);
+            nodeValues.Add(addressConfig.Out_FixedCameraPutNum.Address, (Int16)systemConfiguration.FixedCameraPutNum);
+            nodeValues.Add(addressConfig.Out_FixedCameracheckNum.Address, (Int16)systemConfiguration.FixedCameracheckNum);
 
             var res= await plc.WriteNodesAsync(nodeValues);
         }

+ 102 - 0
TeamAAS-VM/Models/PLC/PlcPoint.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using TeamAAS_VP.Core.PLCs;
+using TeamAAS_VP.Interfaces;
+
+namespace TeamAAS_VP.Models.PLC
+{
+    public class PlcPoint
+    {
+        public int Number { get; set; }
+        public float X_Position { get; set; }
+        public float X_Velocity { get; set; }
+        public float Y_Position { get; set; }
+        public float Y_Velocity { get; set; }
+        public float Z_Position_Start { get; set; }
+        public float Z_Velocity_Start { get; set; }
+        public float Z_Position_Stop { get; set; }
+        public float Z_Velocity_Stop { get; set; }
+        public float U_Position { get; set; }
+        public float U_Velocity { get; set; }
+        public float R_Position { get; set; }
+        public float R_Velocity { get; set; }
+        public float Torque { get; set; }
+        public Int16 Feeder { get; set; }
+        public Int16 ScrewProNum { get; set; }
+
+        public PlcPoint()
+        {
+            Number = 0;
+            X_Position = 0;
+            X_Velocity = 0;
+            Y_Position = 0;
+            Y_Velocity = 0;
+            Z_Position_Start = 0;
+            Z_Velocity_Start = 0;
+            Z_Position_Stop = 0;
+            Z_Velocity_Stop = 0;
+            U_Position = 0;
+            U_Velocity = 0;
+            R_Position = 0;
+            R_Velocity = 0;
+            Torque = 0;
+            Feeder = 0;
+            ScrewProNum = 0;
+
+        }
+
+        public PlcPoint Clone()
+        {
+            return new PlcPoint
+            {
+                Number = this.Number,
+                X_Position = this.X_Position,
+                X_Velocity = this.X_Velocity,
+                Y_Position = this.Y_Position,
+                Y_Velocity = this.Y_Velocity,
+                Z_Position_Start = this.Z_Position_Start,
+                Z_Velocity_Start = this.Z_Velocity_Start,
+                Z_Position_Stop = this.Z_Position_Stop,
+                Z_Velocity_Stop = this.Z_Velocity_Stop,
+                U_Position = this.U_Position,
+                U_Velocity = this.U_Velocity,
+                R_Position = this.R_Position,
+                R_Velocity = this.R_Velocity,
+                Torque = this.Torque,
+                Feeder = this.Feeder,
+                ScrewProNum = this.ScrewProNum
+            };
+        }
+
+        /// <summary>
+        /// 将点位数据写入到PLC地址
+        /// </summary>
+        /// <param name="plcAddress"></param>
+        /// <param name="pLC"></param>
+        /// <returns></returns>
+        public async Task<bool> WriteToPlcAddress(PlcPointAddress plcAddress, OpcUaClientPLC pLC)
+        {
+            Dictionary<string, object> nodeValues = new Dictionary<string, object>();
+            nodeValues.Add(string.Format(plcAddress.X_Position.Address, Number), X_Position);
+            nodeValues.Add(string.Format(plcAddress.X_Velocity.Address, Number), X_Velocity);
+            nodeValues.Add(string.Format(plcAddress.Y_Position.Address, Number), Y_Position);
+            nodeValues.Add(string.Format(plcAddress.Y_Velocity.Address, Number), Y_Velocity);
+            nodeValues.Add(string.Format(plcAddress.Z_Position_Start.Address, Number), Z_Position_Start);
+            nodeValues.Add(string.Format(plcAddress.Z_Velocity_Start.Address, Number), Z_Velocity_Start);
+            nodeValues.Add(string.Format(plcAddress.Z_Position_Stop.Address, Number), Z_Position_Stop);
+            nodeValues.Add(string.Format(plcAddress.Z_Velocity_Stop.Address, Number), Z_Velocity_Stop);
+            nodeValues.Add(string.Format(plcAddress.U_Position.Address, Number), U_Position);
+            nodeValues.Add(string.Format(plcAddress.U_Velocity.Address, Number), U_Velocity);
+            nodeValues.Add(string.Format(plcAddress.R_Position.Address, Number), R_Position);
+            nodeValues.Add(string.Format(plcAddress.R_Velocity.Address, Number), R_Velocity);
+            nodeValues.Add(string.Format(plcAddress.Torque.Address, Number), Torque);
+            nodeValues.Add(string.Format(plcAddress.Feeder.Address, Number), Feeder);
+            nodeValues.Add(string.Format(plcAddress.ScrewProNum.Address, Number), ScrewProNum);
+            return await pLC.WriteNodesAsync(nodeValues);
+        }
+    }
+}

+ 30 - 0
TeamAAS-VM/Models/PLC/PlcPointAddress.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TeamAAS_VP.Models.PLC
+{
+    public class PlcPointAddress
+    {
+        //描述
+        public string Description { get; set; }
+        public PlcAddress X_Position { get; set; }
+        public PlcAddress X_Velocity { get;set; }
+        public PlcAddress Y_Position { get; set; }
+        public PlcAddress Y_Velocity { get; set; }
+        public PlcAddress Z_Position_Start { get; set; }
+        public PlcAddress Z_Velocity_Start { get; set; }
+        public PlcAddress Z_Position_Stop { get; set; }
+        public PlcAddress Z_Velocity_Stop { get; set; }
+        public PlcAddress U_Position { get; set; }
+        public PlcAddress U_Velocity { get; set; }
+        public PlcAddress R_Position { get; set; }
+        public PlcAddress R_Velocity { get; set; }
+        public PlcAddress Torque { get; set; }
+        public PlcAddress Feeder { get; set; }
+        public PlcAddress ScrewProNum { get; set; }
+
+    }
+}

+ 622 - 37
TeamAAS-VM/Models/PlcAddressConfig.cs

@@ -4,11 +4,13 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using TeamAAS_VP.Models.PLC;
 
 namespace TeamAAS_VP.Models
 {
     public class PlcAddressConfig : BindableBase
     {
+        #region 写入到PLC的地址
         private int _PlcNo;
         public int PlcNo
         {
@@ -20,7 +22,7 @@ namespace TeamAAS_VP.Models
         /// <summary>
         /// 工作模式 =1 拍1打1 =2 拍1打所有
         /// </summary>
-        public PlcAddress WorkMode
+        public PlcAddress Out_WorkMode
         {
             get { return _WorkMode; }
             set { SetProperty(ref _WorkMode, value); }
@@ -30,80 +32,663 @@ namespace TeamAAS_VP.Models
         /// <summary>
         /// 取料位置 =0 不需要取料 =1 需要取料
         /// </summary>
-        public PlcAddress PickPointNum
+        public PlcAddress Out_PickPointNum
         {
             get { return _PickPointNum; }
             set { SetProperty(ref _PickPointNum, value); }
         }
 
-        private PlcAddress _cameraShotCount = new PlcAddress();
+        private PlcAddress _DowmCameraNum = new PlcAddress();
         /// <summary>
-        /// 相机拍照次数
+        /// 相机拍照次数=0 无
         /// </summary>
-        public PlcAddress CameraShotCount
+        public PlcAddress Out_DowmCameraNum
         {
-            get => _cameraShotCount;
-            set => SetProperty(ref _cameraShotCount, value);
+            get => _DowmCameraNum;
+            set => SetProperty(ref _DowmCameraNum, value);
         }
 
-        private PlcAddress _upperCameraPickShotCount = new PlcAddress();
+        private PlcAddress _UpCameraPickNum = new PlcAddress();
         /// <summary>
-        /// 上相机取料拍照次数
+        /// 上相机取料拍照次数=0 无
         /// </summary>
-        public PlcAddress UpperCameraPickShotCount
+        public PlcAddress Out_UpCameraPickNum
         {
-            get => _upperCameraPickShotCount;
-            set => SetProperty(ref _upperCameraPickShotCount, value);
+            get => _UpCameraPickNum;
+            set => SetProperty(ref _UpCameraPickNum, value);
         }
 
-        private PlcAddress _upperCameraPlaceShotCount = new PlcAddress();
+        private PlcAddress _UpCameraPutNum = new PlcAddress();
         /// <summary>
-        /// 上相机放料拍照次数
+        /// 上相机放料拍照次数=0 无
         /// </summary>
-        public PlcAddress UpperCameraPlaceShotCount
+        public PlcAddress Out_UpCameraPutNum
         {
-            get => _upperCameraPlaceShotCount;
-            set => SetProperty(ref _upperCameraPlaceShotCount, value);
+            get => _UpCameraPutNum;
+            set => SetProperty(ref _UpCameraPutNum, value);
         }
 
-        private PlcAddress _upperCameraLockAssembleCount = new PlcAddress();
+        private PlcAddress _UPCameracheckNum = new PlcAddress();
         /// <summary>
-        /// 上相机锁附/组装次数
+        /// 上相机锁附/组装次数=0 无
         /// </summary>
-        public PlcAddress UpperCameraLockAssembleCount
+        public PlcAddress Out_UPCameracheckNum
         {
-            get => _upperCameraLockAssembleCount;
-            set => SetProperty(ref _upperCameraLockAssembleCount, value);
+            get => _UPCameracheckNum;
+            set => SetProperty(ref _UPCameracheckNum, value);
         }
 
-        private PlcAddress _pickFixedPositionProductCameraCount = new PlcAddress();
+        private PlcAddress _FixedCameraPickNum = new PlcAddress();
         /// <summary>
-        /// 取料固定位置拍产品相机数量
+        /// 取料固定位置拍产品相机数量 =0 无
         /// </summary>
-        public PlcAddress PickFixedPositionProductCameraCount
+        public PlcAddress Out_FixedCameraPickNum
         {
-            get => _pickFixedPositionProductCameraCount;
-            set => SetProperty(ref _pickFixedPositionProductCameraCount, value);
+            get => _FixedCameraPickNum;
+            set => SetProperty(ref _FixedCameraPickNum, value);
         }
 
-        private PlcAddress _lockFixedPositionProductCameraCount = new PlcAddress();
+        private PlcAddress _FixedCameraPutNum = new PlcAddress();
         /// <summary>
-        /// 锁附/组装固定位置拍产品相机数量
+        /// 锁附/组装固定位置拍产品相机数量 =0 无
         /// </summary>
-        public PlcAddress LockFixedPositionProductCameraCount
+        public PlcAddress Out_FixedCameraPutNum
         {
-            get => _lockFixedPositionProductCameraCount;
-            set => SetProperty(ref _lockFixedPositionProductCameraCount, value);
+            get => _FixedCameraPutNum;
+            set => SetProperty(ref _FixedCameraPutNum, value);
         }
 
-        private PlcAddress _fixedCameraDetectLockAssembleCount = new PlcAddress();
+        private PlcAddress _FixedCameracheckNum = new PlcAddress();
         /// <summary>
-        /// 固定相机检测锁附/组装次数
+        /// 固定相机检测锁附/组装次数=0 无
         /// </summary>
-        public PlcAddress FixedCameraDetectLockAssembleCount
+        public PlcAddress Out_FixedCameracheckNum
         {
-            get => _fixedCameraDetectLockAssembleCount;
-            set => SetProperty(ref _fixedCameraDetectLockAssembleCount, value);
+            get => _FixedCameracheckNum;
+            set => SetProperty(ref _FixedCameracheckNum, value);
+        }
+
+        private PlcAddress _WorkNum = new PlcAddress();
+        /// <summary>
+        /// 锁附/组装数量
+        /// </summary>
+        public PlcAddress Out_WorkNum
+        {
+            get { return _WorkNum; }
+            set { SetProperty(ref _WorkNum, value); }
+        }
+
+        private PlcAddress _DownCameraStatus = new PlcAddress();
+        /// <summary>
+        /// 下相机拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
+        /// </summary>
+        public PlcAddress Out_DownCameraStatus
+        {
+            get { return _DownCameraStatus; }
+            set { SetProperty(ref _DownCameraStatus, value); }
+        }
+
+        private PlcAddress _UpCameraPickStatus = new PlcAddress();
+        /// <summary>
+        /// 上相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
+        /// </summary>
+        public PlcAddress Out_UpCameraPickStatus
+        {
+            get { return _UpCameraPickStatus; }
+            set { SetProperty(ref _UpCameraPickStatus, value); }
+        }
+
+        private PlcAddress _UpCameraPutStatus = new PlcAddress();
+        /// <summary>
+        /// 上相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
+        /// </summary>
+        public PlcAddress Out_UpCameraPutStatus
+        {
+            get { return _UpCameraPutStatus; }
+            set { SetProperty(ref _UpCameraPutStatus, value); }
+        }
+
+        private PlcAddress _UPCameracheckStatus = new PlcAddress();
+        /// <summary>
+        /// 上相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
+        /// </summary>
+        public PlcAddress Out_UPCameracheckStatus
+        {
+            get { return _UPCameracheckStatus; }
+            set { SetProperty(ref _UPCameracheckStatus, value); }
+        }
+
+        private PlcAddress _FixedCameraPickStatus = new PlcAddress();
+        /// <summary>
+        /// 固定相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
+        /// </summary>
+        public PlcAddress Out_FixedCameraPickStatus
+        {
+            get { return _FixedCameraPickStatus; }
+            set { SetProperty(ref _FixedCameraPickStatus, value); }
+        }
+
+        private PlcAddress _FixedCameraPutStatus = new PlcAddress();
+        /// <summary>
+        /// 固定相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
+        /// </summary>
+        public PlcAddress Out_FixedCameraPutStatus
+        {
+            get { return _FixedCameraPutStatus; }
+            set { SetProperty(ref _FixedCameraPutStatus, value); }
+        }
+
+        private PlcAddress _FixedCameracheckStatus = new PlcAddress();
+        /// <summary>
+        /// 固定相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK
+        /// </summary>
+        public PlcAddress Out_FixedCameracheckStatus
+        {
+            get { return _FixedCameracheckStatus; }
+            set { SetProperty(ref _FixedCameracheckStatus, value); }
+        }
+
+        private PlcAddress _Out_CameraDone = new PlcAddress();
+        /// <summary>
+        /// 相机坐标拟合完成
+        /// </summary>
+        public PlcAddress Out_CameraDone
+        {
+            get { return _Out_CameraDone; }
+            set { SetProperty(ref _Out_CameraDone, value); }
+        }
+
+        private PlcAddress _MesStatus = new PlcAddress();
+        /// <summary>
+        /// 过站信息 =1 允许工作 =2 本站放行 =3 数据上传完成
+        /// </summary>
+        public PlcAddress Out_MesStatus
+        {
+            get { return _MesStatus; }
+            set { SetProperty(ref _MesStatus, value); }
+        }
+
+        private PlcPointAddress _PickCamera = new PlcPointAddress();
+        /// <summary>
+        /// 取料拍照点位参数
+        /// </summary>
+        public PlcPointAddress Out_PickCamera
+        {
+            get { return _PickCamera; }
+            set { SetProperty(ref _PickCamera, value); }
+        }
+
+        private PlcPointAddress _Pick = new PlcPointAddress();
+        /// <summary>
+        /// 取料点位参数
+        /// </summary>
+        public PlcPointAddress Out_Pick
+        {
+            get { return _Pick; }
+            set { SetProperty(ref _Pick, value); }
+        }
+
+        private PlcPointAddress _SecPosCamera = new PlcPointAddress();
+        /// <summary>
+        /// 下相机二次定位点位参数
+        /// </summary>
+        public PlcPointAddress Out_SecPosCamera
+        {
+            get { return _SecPosCamera; }
+            set { SetProperty(ref _SecPosCamera, value); }
+        }
+
+        private PlcPointAddress _ScrewCamera = new PlcPointAddress();
+        /// <summary>
+        /// 锁附拍照点位参数
+        /// </summary>
+        public PlcPointAddress Out_ScrewCamera
+        {
+            get { return _ScrewCamera; }
+            set { SetProperty(ref _ScrewCamera, value); }
+        }
+
+        private PlcPointAddress _Screw = new PlcPointAddress();
+        /// <summary>
+        /// 锁附点位参数
+        /// </summary>
+        public PlcPointAddress Out_Screw
+        {
+            get { return _Screw; }
+            set { SetProperty(ref _Screw, value); }
+        }
+
+        private PlcPointAddress _CheckCamera = new PlcPointAddress();
+        /// <summary>
+        /// 复检点位参数
+        /// </summary>
+        public PlcPointAddress Out_CheckCamera
+        {
+            get { return _CheckCamera; }
+            set { SetProperty(ref _CheckCamera, value); }
+        }
+        #endregion
+
+        #region 从PLC读取的地址
+        private PlcAddress _In_Code = new PlcAddress();
+        /// <summary>
+        /// 产品编码
+        /// </summary>
+        public PlcAddress In_Code
+        {
+            get { return _In_Code; }
+            set { SetProperty(ref _In_Code, value); }
+        }
+
+        private PlcAddress _In_MesCheck = new PlcAddress();
+        /// <summary>
+        /// Mes交互 =1 获取过站信息当站是否生产,=2 上传本站数据
+        /// </summary>
+        public PlcAddress In_MesCheck
+        {
+            get { return _In_MesCheck; }
+            set { SetProperty(ref _In_MesCheck, value); }
+        }
+
+        private PlcAddress _In_DowmCameraNum = new PlcAddress();
+        /// <summary>
+        /// 下相机拍照编号
+        /// </summary>
+        public PlcAddress In_DowmCameraNum
+        {
+            get { return _In_DowmCameraNum; }
+            set { SetProperty(ref _In_DowmCameraNum, value); }
+        }
+
+        private PlcAddress _In_DowmCameraExe = new PlcAddress();
+        /// <summary>
+        /// 下相机拍照触发
+        /// </summary>
+        public PlcAddress In_DowmCameraExe
+        {
+            get { return _In_DowmCameraExe; }
+            set { SetProperty(ref _In_DowmCameraExe, value); }
+        }
+
+        private PlcAddress _In_UpCameraPickNum = new PlcAddress();
+        /// <summary>
+        /// 上相机取料拍照编号
+        /// </summary>
+        public PlcAddress In_UpCameraPickNum
+        {
+            get { return _In_UpCameraPickNum; }
+            set { SetProperty(ref _In_UpCameraPickNum, value); }
+        }
+
+        private PlcAddress _In_UpCameraPickExe = new PlcAddress();
+        /// <summary>
+        /// 上相机取料拍照触发
+        /// </summary>
+        public PlcAddress In_UpCameraPickExe
+        {
+            get { return _In_UpCameraPickExe; }
+            set { SetProperty(ref _In_UpCameraPickExe, value); }
+        }
+
+        private PlcAddress _In_UpCameraPutNum = new PlcAddress();
+        /// <summary>
+        /// 上相机锁附/组装拍照编号
+        /// </summary>
+        public PlcAddress In_UpCameraPutNum
+        {
+            get { return _In_UpCameraPutNum; }
+            set { SetProperty(ref _In_UpCameraPutNum, value); }
+        }
+
+        private PlcAddress _In_UpCameraPutExe = new PlcAddress();
+        /// <summary>
+        /// 上相机锁附/组装拍照触发
+        /// </summary>
+        public PlcAddress In_UpCameraPutExe
+        {
+            get { return _In_UpCameraPutExe; }
+            set { SetProperty(ref _In_UpCameraPutExe, value); }
+        }
+
+        private PlcAddress _In_UPCameracheckNum = new PlcAddress();
+        /// <summary>
+        /// 上相机检测拍照编号
+        /// </summary>
+        public PlcAddress In_UPCameracheckNum
+        {
+            get { return _In_UPCameracheckNum; }
+            set { SetProperty(ref _In_UPCameracheckNum, value); }
+        }
+
+        private PlcAddress _In_UPCameracheckExe = new PlcAddress();
+        /// <summary>
+        /// 上相机检测拍照触发
+        /// </summary>
+        public PlcAddress In_UPCameracheckExe
+        {
+            get { return _In_UPCameracheckExe; }
+            set { SetProperty(ref _In_UPCameracheckExe, value); }
+        }
+
+        private PlcAddress _In_FixedCameraPickNum = new PlcAddress();
+        /// <summary>
+        /// 固定相机取料拍照编号
+        /// </summary>
+        public PlcAddress In_FixedCameraPickNum
+        {
+            get { return _In_FixedCameraPickNum; }
+            set { SetProperty(ref _In_FixedCameraPickNum, value); }
+        }
+
+        private PlcAddress _In_FixedCameraPickExe = new PlcAddress();
+        /// <summary>
+        /// 固定相机取料拍照触发
+        /// </summary>
+        public PlcAddress In_FixedCameraPickExe
+        {
+            get { return _In_FixedCameraPickExe; }
+            set { SetProperty(ref _In_FixedCameraPickExe, value); }
+        }
+
+        private PlcAddress _In_FixedCameraPutNum = new PlcAddress();
+        /// <summary>
+        /// 固定相机锁附/组装拍照编号
+        /// </summary>
+        public PlcAddress In_FixedCameraPutNum
+        {
+            get { return _In_FixedCameraPutNum; }
+            set { SetProperty(ref _In_FixedCameraPutNum, value); }
+        }
+
+        private PlcAddress _In_FixedCameraPutExe = new PlcAddress();
+        /// <summary>
+        /// 固定相机锁附/组装拍照触发
+        /// </summary>
+        public PlcAddress In_FixedCameraPutExe
+        {
+            get { return _In_FixedCameraPutExe; }
+            set { SetProperty(ref _In_FixedCameraPutExe, value); }
+        }
+
+        private PlcAddress _In_FixedCameracheckNum = new PlcAddress();
+        /// <summary>
+        /// 固定相机检测拍照编号
+        /// </summary>
+        public PlcAddress In_FixedCameracheckNum
+        {
+            get { return _In_FixedCameracheckNum; }
+            set { SetProperty(ref _In_FixedCameracheckNum, value); }
+        }
+
+        private PlcAddress _In_FixedCameracheckExe = new PlcAddress();
+        /// <summary>
+        /// 固定相机检测拍照触发
+        /// </summary>
+        public PlcAddress In_FixedCameracheckExe
+        {
+            get { return _In_FixedCameracheckExe; }
+            set { SetProperty(ref _In_FixedCameracheckExe, value); }
+        }
+
+        private PlcAddress _In_ProductNum = new PlcAddress();
+        /// <summary>
+        /// 正在锁附/组装编号
+        /// </summary>
+        public PlcAddress In_ProductNum
+        {
+            get { return _In_ProductNum; }
+            set { SetProperty(ref _In_ProductNum, value); }
+        }
+
+        private PlcAddress _In_RequestPosition = new PlcAddress();
+        /// <summary>
+        /// 请求目标位置
+        /// </summary>
+        public PlcAddress In_RequestPosition
+        {
+            get { return _In_RequestPosition; }
+            set { SetProperty(ref _In_RequestPosition, value); }
+        }
+
+        private PlcAddress _In_WorkStart = new PlcAddress();
+        /// <summary>
+        /// 锁附/组装开始 =1
+        /// </summary>
+        public PlcAddress In_WorkStart
+        {
+            get { return _In_WorkStart; }
+            set { SetProperty(ref _In_WorkStart, value); }
+        }
+
+        private PlcAddress _In_WorkDone = new PlcAddress();
+        /// <summary>
+        /// 锁附/组装结束 =1OK =2NG
+        /// </summary>
+        public PlcAddress In_WorkDone
+        {
+            get { return _In_WorkDone; }
+            set { SetProperty(ref _In_WorkDone, value); }
+        }
+        #endregion
+
+        public PlcAddressConfig()
+        {
+
+        }
+
+        // 初始默认值
+        public void SetDefaultValue()
+        {
+            // 1. PlcNo 默认
+            PlcNo = 1;
+
+            // 辅助局部函数:确保 PlcAddress 实例存在
+            PlcAddress Ensure(PlcAddress a)
+            {
+                if (a == null) return new PlcAddress();
+                return a;
+            }
+
+            // 2. 按 JSON 提供的数据设置默认值(以当前属性名为准)
+            Out_WorkMode = Ensure(Out_WorkMode);
+            Out_WorkMode.Address = "ns=4;s=DB_Communication|FromPC.WorkMode";
+            Out_WorkMode.DataType = "int16";
+            Out_WorkMode.Description = "工作模式 =1 拍1打1 =2 拍1打所有";
+
+            Out_PickPointNum = Ensure(Out_PickPointNum);
+            Out_PickPointNum.Address = "ns=4;s=DB_Communication|FromPC.PickPointNum";
+            Out_PickPointNum.DataType = "int16";
+            Out_PickPointNum.Description = "取料位置 =0 不需要取料 =1 需要取料";
+
+            Out_DowmCameraNum = Ensure(Out_DowmCameraNum);
+            Out_DowmCameraNum.Address = "ns=4;s=DB_Communication|FromPC.DowmCameraNum";
+            Out_DowmCameraNum.DataType = "int16";
+            Out_DowmCameraNum.Description = "下相机拍照次数=0 无";
+
+            Out_UpCameraPickNum = Ensure(Out_UpCameraPickNum);
+            Out_UpCameraPickNum.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPickNum";
+            Out_UpCameraPickNum.DataType = "int16";
+            Out_UpCameraPickNum.Description = "上相机取料拍照次数=0 无";
+
+            Out_UpCameraPutNum = Ensure(Out_UpCameraPutNum);
+            Out_UpCameraPutNum.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPutNum";
+            Out_UpCameraPutNum.DataType = "int16";
+            Out_UpCameraPutNum.Description = "上相机放料拍照次数=0 无";
+
+            Out_UPCameracheckNum = Ensure(Out_UPCameracheckNum);
+            Out_UPCameracheckNum.Address = "ns=4;s=DB_Communication|FromPC.UPCameracheckNum";
+            Out_UPCameracheckNum.DataType = "int16";
+            Out_UPCameracheckNum.Description = "上相机锁附/组装次数=0 无";
+
+            Out_FixedCameraPickNum = Ensure(Out_FixedCameraPickNum);
+            Out_FixedCameraPickNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPickNum";
+            Out_FixedCameraPickNum.DataType = "int16";
+            Out_FixedCameraPickNum.Description = "取料固定位置拍产品相机数量 =0 无";
+
+            Out_FixedCameraPutNum = Ensure(Out_FixedCameraPutNum);
+            Out_FixedCameraPutNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPutNum";
+            Out_FixedCameraPutNum.DataType = "int16";
+            Out_FixedCameraPutNum.Description = "锁附/组装固定位置拍产品相机数量 =0 无";
+
+            Out_FixedCameracheckNum = Ensure(Out_FixedCameracheckNum);
+            Out_FixedCameracheckNum.Address = "ns=4;s=DB_Communication|FromPC.FixedCameracheckNum";
+            Out_FixedCameracheckNum.DataType = "int16";
+            Out_FixedCameracheckNum.Description = "固定相机检测锁附/组装次数=0 无";
+
+            // 3. 为其余 Out_* 设置合理默认(基于注释)
+            Out_WorkNum = Ensure(Out_WorkNum);
+            Out_WorkNum.Address = "ns=4;s=DB_Communication|FromPC.WorkNum";
+            Out_WorkNum.DataType = "int16";
+            Out_WorkNum.Description = "锁附/组装数量";
+
+            Out_DownCameraStatus = Ensure(Out_DownCameraStatus);
+            Out_DownCameraStatus.Address = "ns=4;s=DB_Communication|FromPC.DownCameraStatus";
+            Out_DownCameraStatus.DataType = "int16";
+            Out_DownCameraStatus.Description = "下相机拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
+
+            Out_UpCameraPickStatus = Ensure(Out_UpCameraPickStatus);
+            Out_UpCameraPickStatus.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPickStatus";
+            Out_UpCameraPickStatus.DataType = "int16";
+            Out_UpCameraPickStatus.Description = "上相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
+
+            Out_UpCameraPutStatus = Ensure(Out_UpCameraPutStatus);
+            Out_UpCameraPutStatus.Address = "ns=4;s=DB_Communication|FromPC.UpCameraPutStatus";
+            Out_UpCameraPutStatus.DataType = "int16";
+            Out_UpCameraPutStatus.Description = "上相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
+
+            Out_UPCameracheckStatus = Ensure(Out_UPCameracheckStatus);
+            Out_UPCameracheckStatus.Address = "ns=4;s=DB_Communication|FromPC.UPCameracheckStatus";
+            Out_UPCameracheckStatus.DataType = "int16";
+            Out_UPCameracheckStatus.Description = "上相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
+
+            Out_FixedCameraPickStatus = Ensure(Out_FixedCameraPickStatus);
+            Out_FixedCameraPickStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPickStatus";
+            Out_FixedCameraPickStatus.DataType = "int16";
+            Out_FixedCameraPickStatus.Description = "固定相机取料拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
+
+            Out_FixedCameraPutStatus = Ensure(Out_FixedCameraPutStatus);
+            Out_FixedCameraPutStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameraPutStatus";
+            Out_FixedCameraPutStatus.DataType = "int16";
+            Out_FixedCameraPutStatus.Description = "固定相机锁附/组装拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
+
+            Out_FixedCameracheckStatus = Ensure(Out_FixedCameracheckStatus);
+            Out_FixedCameracheckStatus.Address = "ns=4;s=DB_Communication|FromPC.FixedCameracheckStatus";
+            Out_FixedCameracheckStatus.DataType = "int16";
+            Out_FixedCameracheckStatus.Description = "固定相机检测拍照结果 =1 拍照OK =2 拍照NG =3 取图拍照OK";
+
+            Out_CameraDone = Ensure(Out_CameraDone);
+            Out_CameraDone.Address = "ns=4;s=DB_Communication|FromPC.CameraDone";
+            Out_CameraDone.DataType = "int16";
+            Out_CameraDone.Description = "相机坐标拟合完成";
+
+            Out_MesStatus = Ensure(Out_MesStatus);
+            Out_MesStatus.Address = "ns=4;s=DB_Communication|FromPC.MesStatus";
+            Out_MesStatus.DataType = "int16";
+            Out_MesStatus.Description = "过站信息 =1 允许工作 =2 本站放行 =3 数据上传完成";
+
+            // 4. In_* 默认(假定从 PLC 读到 PC,使用 ToPC 前缀)
+            In_Code = Ensure(In_Code);
+            In_Code.Address = "ns=4;s=DB_Communication|ToPC.Code";
+            In_Code.DataType = "string";
+            In_Code.Description = "产品编码";
+
+            In_MesCheck = Ensure(In_MesCheck);
+            In_MesCheck.Address = "ns=4;s=DB_Communication|ToPC.MesCheck";
+            In_MesCheck.DataType = "int16";
+            In_MesCheck.Description = "Mes交互 =1 获取过站信息当站是否生产,=2 上传本站数据";
+
+            In_DowmCameraNum = Ensure(In_DowmCameraNum);
+            In_DowmCameraNum.Address = "ns=4;s=DB_Communication|ToPC.DowmCameraNum";
+            In_DowmCameraNum.DataType = "int16";
+            In_DowmCameraNum.Description = "下相机拍照编号";
+
+            In_DowmCameraExe = Ensure(In_DowmCameraExe);
+            In_DowmCameraExe.Address = "ns=4;s=DB_Communication|ToPC.DowmCameraExe";
+            In_DowmCameraExe.DataType = "int16";
+            In_DowmCameraExe.Description = "下相机拍照触发";
+
+            In_UpCameraPickNum = Ensure(In_UpCameraPickNum);
+            In_UpCameraPickNum.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPickNum";
+            In_UpCameraPickNum.DataType = "int16";
+            In_UpCameraPickNum.Description = "上相机取料拍照编号";
+
+            In_UpCameraPickExe = Ensure(In_UpCameraPickExe);
+            In_UpCameraPickExe.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPickExe";
+            In_UpCameraPickExe.DataType = "int16";
+            In_UpCameraPickExe.Description = "上相机取料拍照触发";
+
+            In_UpCameraPutNum = Ensure(In_UpCameraPutNum);
+            In_UpCameraPutNum.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPutNum";
+            In_UpCameraPutNum.DataType = "int16";
+            In_UpCameraPutNum.Description = "上相机锁附/组装拍照编号";
+
+            In_UpCameraPutExe = Ensure(In_UpCameraPutExe);
+            In_UpCameraPutExe.Address = "ns=4;s=DB_Communication|ToPC.UpCameraPutExe";
+            In_UpCameraPutExe.DataType = "int16";
+            In_UpCameraPutExe.Description = "上相机锁附/组装拍照触发";
+
+            In_UPCameracheckNum = Ensure(In_UPCameracheckNum);
+            In_UPCameracheckNum.Address = "ns=4;s=DB_Communication|ToPC.UPCameracheckNum";
+            In_UPCameracheckNum.DataType = "int16";
+            In_UPCameracheckNum.Description = "上相机检测拍照编号");
+
+            In_UPCameracheckExe = Ensure(In_UPCameracheckExe);
+            In_UPCameracheckExe.Address = "ns=4;s=DB_Communication|ToPC.UPCameracheckExe";
+            In_UPCameracheckExe.DataType = "int16";
+            In_UPCameracheckExe.Description = "上相机检测拍照触发";
+
+            In_FixedCameraPickNum = Ensure(In_FixedCameraPickNum);
+            In_FixedCameraPickNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPickNum";
+            In_FixedCameraPickNum.DataType = "int16";
+            In_FixedCameraPickNum.Description = "固定相机取料拍照编号";
+
+            In_FixedCameraPickExe = Ensure(In_FixedCameraPickExe);
+            In_FixedCameraPickExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPickExe";
+            In_FixedCameraPickExe.DataType = "int16";
+            In_FixedCameraPickExe.Description = "固定相机取料拍照触发";
+
+            In_FixedCameraPutNum = Ensure(In_FixedCameraPutNum);
+            In_FixedCameraPutNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPutNum";
+            In_FixedCameraPutNum.DataType = "int16";
+            In_FixedCameraPutNum.Description = "固定相机锁附/组装拍照编号";
+
+            In_FixedCameraPutExe = Ensure(In_FixedCameraPutExe);
+            In_FixedCameraPutExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameraPutExe";
+            In_FixedCameraPutExe.DataType = "int16";
+            In_FixedCameraPutExe.Description = "固定相机锁附/组装拍照触发";
+
+            In_FixedCameracheckNum = Ensure(In_FixedCameracheckNum);
+            In_FixedCameracheckNum.Address = "ns=4;s=DB_Communication|ToPC.FixedCameracheckNum";
+            In_FixedCameracheckNum.DataType = "int16";
+            In_FixedCameracheckNum.Description = "固定相机检测拍照编号";
+
+            In_FixedCameracheckExe = Ensure(In_FixedCameracheckExe);
+            In_FixedCameracheckExe.Address = "ns=4;s=DB_Communication|ToPC.FixedCameracheckExe";
+            In_FixedCameracheckExe.DataType = "int16";
+            In_FixedCameracheckExe.Description = "固定相机检测拍照触发";
+
+            In_ProductNum = Ensure(In_ProductNum);
+            In_ProductNum.Address = "ns=4;s=DB_Communication|ToPC.ProductNum";
+            In_ProductNum.DataType = "int16";
+            In_ProductNum.Description = "正在锁附/组装编号";
+
+            In_RequestPosition = Ensure(In_RequestPosition);
+            In_RequestPosition.Address = "ns=4;s=DB_Communication|ToPC.RequestPosition";
+            In_RequestPosition.DataType = "int16";
+            In_RequestPosition.Description = "请求目标位置";
+
+            In_WorkStart = Ensure(In_WorkStart);
+            In_WorkStart.Address = "ns=4;s=DB_Communication|ToPC.WorkStart";
+            In_WorkStart.DataType = "int16";
+            In_WorkStart.Description = "锁附/组装开始 =1";
+
+            In_WorkDone = Ensure(In_WorkDone);
+            In_WorkDone.Address = "ns=4;s=DB_Communication|ToPC.WorkDone";
+            In_WorkDone.DataType = "int16";
+            In_WorkDone.Description = "锁附/组装结束 =1OK =2NG";
+
+            // 说明:若项目中 PlcAddress 的实际属性名或类型与此不同(例如使用枚举、不同字段名),
+            // 请根据实际类型调整赋值。本方法主要提供合理的默认字符串地址、数据类型及描述,便于后续从配置覆盖。
         }
     }
 }

+ 32 - 32
TeamAAS-VM/Models/SystemConfiguration.cs

@@ -96,94 +96,94 @@ namespace TeamAAS_VP.Models
 
         // 新增相机/拍照/检测计数属性
 
-        private int _WorkMode = 0;
+        private Int16 _WorkMode = 0;
         /// <summary>
         /// 工作模式 =1 拍1打1 =2 拍1打所有
         /// </summary>
-        public int WorkMode
+        public Int16 WorkMode
         {
             get { return _WorkMode; }
             set { SetProperty(ref _WorkMode, value); }
         }
 
-        private int _PickPointNum = 0;
+        private Int16 _PickPointNum = 0;
         /// <summary>
         /// 取料位置 =0 不需要取料 =1 需要取料
         /// </summary>
-        public int PickPointNum
+        public Int16 PickPointNum
         {
             get { return _PickPointNum; }
             set { SetProperty(ref _PickPointNum, value); }
         }
 
-        private int _cameraShotCount = 0;
+        private Int16 _DowmCameraNum = 0;
         /// <summary>
         /// 相机拍照次数
         /// </summary>
-        public int CameraShotCount
+        public Int16 DowmCameraNum
         {
-            get => _cameraShotCount;
-            set => SetProperty(ref _cameraShotCount, value);
+            get => _DowmCameraNum;
+            set => SetProperty(ref _DowmCameraNum, value);
         }
 
-        private int _upperCameraPickShotCount = 0;
+        private Int16 _UpCameraPickNum = 0;
         /// <summary>
         /// 上相机取料拍照次数
         /// </summary>
-        public int UpperCameraPickShotCount
+        public Int16 UpCameraPickNum
         {
-            get => _upperCameraPickShotCount;
-            set => SetProperty(ref _upperCameraPickShotCount, value);
+            get => _UpCameraPickNum;
+            set => SetProperty(ref _UpCameraPickNum, value);
         }
 
-        private int _upperCameraPlaceShotCount = 0;
+        private Int16 _UpCameraPutNum = 0;
         /// <summary>
         /// 上相机放料拍照次数
         /// </summary>
-        public int UpperCameraPlaceShotCount
+        public Int16 UpCameraPutNum
         {
-            get => _upperCameraPlaceShotCount;
-            set => SetProperty(ref _upperCameraPlaceShotCount, value);
+            get => _UpCameraPutNum;
+            set => SetProperty(ref _UpCameraPutNum, value);
         }
 
-        private int _upperCameraLockAssembleCount = 0;
+        private Int16 _UPCameracheckNum = 0;
         /// <summary>
         /// 上相机锁附/组装次数
         /// </summary>
-        public int UpperCameraLockAssembleCount
+        public Int16 UPCameracheckNum
         {
-            get => _upperCameraLockAssembleCount;
-            set => SetProperty(ref _upperCameraLockAssembleCount, value);
+            get => _UPCameracheckNum;
+            set => SetProperty(ref _UPCameracheckNum, value);
         }
 
-        private int _pickFixedPositionProductCameraCount = 0;
+        private Int16 _FixedCameraPickNum = 0;
         /// <summary>
         /// 取料固定位置拍产品相机数量
         /// </summary>
-        public int PickFixedPositionProductCameraCount
+        public Int16 FixedCameraPickNum
         {
-            get => _pickFixedPositionProductCameraCount;
-            set => SetProperty(ref _pickFixedPositionProductCameraCount, value);
+            get => _FixedCameraPickNum;
+            set => SetProperty(ref _FixedCameraPickNum, value);
         }
 
-        private int _lockFixedPositionProductCameraCount = 0;
+        private Int16 _FixedCameraPutNum = 0;
         /// <summary>
         /// 锁附/组装固定位置拍产品相机数量
         /// </summary>
-        public int LockFixedPositionProductCameraCount
+        public Int16 FixedCameraPutNum
         {
-            get => _lockFixedPositionProductCameraCount;
-            set => SetProperty(ref _lockFixedPositionProductCameraCount, value);
+            get => _FixedCameraPutNum;
+            set => SetProperty(ref _FixedCameraPutNum, value);
         }
 
-        private int _fixedCameraDetectLockAssembleCount = 0;
+        private Int16 _FixedCameracheckNum = 0;
         /// <summary>
         /// 固定相机检测锁附/组装次数
         /// </summary>
-        public int FixedCameraDetectLockAssembleCount
+        public Int16 FixedCameracheckNum
         {
-            get => _fixedCameraDetectLockAssembleCount;
-            set => SetProperty(ref _fixedCameraDetectLockAssembleCount, value);
+            get => _FixedCameracheckNum;
+            set => SetProperty(ref _FixedCameracheckNum, value);
         }
 
         /// <summary>

+ 1 - 0
TeamAAS-VM/Services/ConfigService.cs

@@ -140,6 +140,7 @@ namespace TeamAAS_VP.Services
                 else
                 {
                     PlcAddressConfig = new PlcAddressConfig();
+                    PlcAddressConfig.SetDefaultValue();
                     FileHelper.WriteJsonFile(PlcAddressConfig, plcAddressPath);
                 }
             }

+ 2 - 0
TeamAAS-VM/TeamAAS-VP.csproj

@@ -596,6 +596,8 @@
     <Compile Include="Models\Lights\LightControllerConfig.cs" />
     <Compile Include="Models\PlcAddressConfig.cs" />
     <Compile Include="Models\PLC\PlcAddress.cs" />
+    <Compile Include="Models\PLC\PlcPoint.cs" />
+    <Compile Include="Models\PLC\PlcPointAddress.cs" />
     <Compile Include="Models\ProductionRecord.cs" />
     <Compile Include="Models\ProductionStatQuery.cs" />
     <Compile Include="Models\ProductionStatResult.cs" />

+ 92 - 32
TeamAAS-VM/ViewModels/SettingViewModel.cs

@@ -1170,13 +1170,16 @@ namespace TeamAAS_VP.ViewModels
             {
                 WorkMode = sys.WorkMode;
                 PickPointNum = sys.PickPointNum;
-                CameraShotCount = sys.CameraShotCount;
-                UpperCameraPickShotCount = sys.UpperCameraPickShotCount;
-                UpperCameraPlaceShotCount = sys.UpperCameraPlaceShotCount;
-                UpperCameraLockAssembleCount = sys.UpperCameraLockAssembleCount;
-                FixedPickCameraCount = sys.PickFixedPositionProductCameraCount;
-                FixedLockAssembleCameraCount = sys.LockFixedPositionProductCameraCount;
-                FixedCameraDetectLockAssembleCount = sys.FixedCameraDetectLockAssembleCount;
+                DowmCameraNum = sys.DowmCameraNum;
+                WorkMode = sys.WorkMode;
+                PickPointNum = sys.PickPointNum;
+                DowmCameraNum = sys.DowmCameraNum;
+                UpCameraPickNum = sys.UpCameraPickNum;
+                UpCameraPutNum = sys.UpCameraPutNum;
+                UPCameracheckNum = sys.UPCameracheckNum;
+                FixedCameraPickNum = sys.FixedCameraPickNum;
+                FixedCameraPutNum = sys.FixedCameraPutNum;
+                FixedCameracheckNum = sys.FixedCameracheckNum;
             }
 
             if (isFirstLoad)
@@ -1239,40 +1242,95 @@ namespace TeamAAS_VP.ViewModels
         }
 
         #region 系统参数
-        private int _WorkMode=0;
-        public int WorkMode
+        private Int16 _WorkMode = 0;
+        /// <summary>
+        /// 工作模式 =1 拍1打1 =2 拍1打所有
+        /// </summary>
+        public Int16 WorkMode
         {
             get { return _WorkMode; }
             set { SetProperty(ref _WorkMode, value); }
         }
 
-        private int _PickPointNum;
-        public int PickPointNum
+        private Int16 _PickPointNum = 0;
+        /// <summary>
+        /// 取料位置 =0 不需要取料 =1 需要取料
+        /// </summary>
+        public Int16 PickPointNum
         {
             get { return _PickPointNum; }
             set { SetProperty(ref _PickPointNum, value); }
         }
 
-        private int _CameraShotCount;
-        public int CameraShotCount { get => _CameraShotCount; set => SetProperty(ref _CameraShotCount, value); }
+        private Int16 _DowmCameraNum = 0;
+        /// <summary>
+        /// 下相机拍照次数
+        /// </summary>
+        public Int16 DowmCameraNum
+        {
+            get => _DowmCameraNum;
+            set => SetProperty(ref _DowmCameraNum, value);
+        }
 
-        private int _UpperCameraPickShotCount;
-        public int UpperCameraPickShotCount { get => _UpperCameraPickShotCount; set => SetProperty(ref _UpperCameraPickShotCount, value); }
+        private Int16 _UpCameraPickNum = 0;
+        /// <summary>
+        /// 上相机取料拍照次数
+        /// </summary>
+        public Int16 UpCameraPickNum
+        {
+            get => _UpCameraPickNum;
+            set => SetProperty(ref _UpCameraPickNum, value);
+        }
 
-        private int _UpperCameraPlaceShotCount;
-        public int UpperCameraPlaceShotCount { get => _UpperCameraPlaceShotCount; set => SetProperty(ref _UpperCameraPlaceShotCount, value); }
+        private Int16 _UpCameraPutNum = 0;
+        /// <summary>
+        /// 上相机放料拍照次数
+        /// </summary>
+        public Int16 UpCameraPutNum
+        {
+            get => _UpCameraPutNum;
+            set => SetProperty(ref _UpCameraPutNum, value);
+        }
 
-        private int _UpperCameraLockAssembleCount;
-        public int UpperCameraLockAssembleCount { get => _UpperCameraLockAssembleCount; set => SetProperty(ref _UpperCameraLockAssembleCount, value); }
+        private Int16 _UPCameracheckNum = 0;
+        /// <summary>
+        /// 上相机锁附/组装次数
+        /// </summary>
+        public Int16 UPCameracheckNum
+        {
+            get => _UPCameracheckNum;
+            set => SetProperty(ref _UPCameracheckNum, value);
+        }
 
-        private int _FixedPickCameraCount;
-        public int FixedPickCameraCount { get => _FixedPickCameraCount; set => SetProperty(ref _FixedPickCameraCount, value); }
+        private Int16 _FixedCameraPickNum = 0;
+        /// <summary>
+        /// 取料固定位置拍产品相机数量
+        /// </summary>
+        public Int16 FixedCameraPickNum
+        {
+            get => _FixedCameraPickNum;
+            set => SetProperty(ref _FixedCameraPickNum, value);
+        }
 
-        private int _FixedLockAssembleCameraCount;
-        public int FixedLockAssembleCameraCount { get => _FixedLockAssembleCameraCount; set => SetProperty(ref _FixedLockAssembleCameraCount, value); }
+        private Int16 _FixedCameraPutNum = 0;
+        /// <summary>
+        /// 锁附/组装固定位置拍产品相机数量
+        /// </summary>
+        public Int16 FixedCameraPutNum
+        {
+            get => _FixedCameraPutNum;
+            set => SetProperty(ref _FixedCameraPutNum, value);
+        }
 
-        private int _FixedCameraDetectLockAssembleCount;
-        public int FixedCameraDetectLockAssembleCount { get => _FixedCameraDetectLockAssembleCount; set => SetProperty(ref _FixedCameraDetectLockAssembleCount, value); }
+        private Int16 _FixedCameracheckNum = 0;
+        /// <summary>
+        /// 固定相机检测锁附/组装次数
+        /// </summary>
+        public Int16 FixedCameracheckNum
+        {
+            get => _FixedCameracheckNum;
+            set => SetProperty(ref _FixedCameracheckNum, value);
+        }
 
         async void ExecuteSaveSystemParametersCommand()
         {
@@ -1285,13 +1343,15 @@ namespace TeamAAS_VP.ViewModels
                     var sysConfig = _configService.GetSystemConfiguration();
                     sysConfig.WorkMode = WorkMode;
                     sysConfig.PickPointNum = PickPointNum;
-                    sysConfig.CameraShotCount = CameraShotCount;
-                    sysConfig.UpperCameraPickShotCount = UpperCameraPickShotCount;
-                    sysConfig.UpperCameraPlaceShotCount = UpperCameraPlaceShotCount;
-                    sysConfig.UpperCameraLockAssembleCount = UpperCameraLockAssembleCount;
-                    sysConfig.PickFixedPositionProductCameraCount = FixedPickCameraCount;
-                    sysConfig.LockFixedPositionProductCameraCount = FixedLockAssembleCameraCount;
-                    sysConfig.FixedCameraDetectLockAssembleCount = FixedCameraDetectLockAssembleCount;
+                    sysConfig.DowmCameraNum = DowmCameraNum;
+                    sysConfig.UpCameraPickNum = UpCameraPickNum;
+                    sysConfig.UpCameraPutNum = UpCameraPutNum;
+                    sysConfig.UPCameracheckNum = UPCameracheckNum;
+                    sysConfig.FixedCameraPickNum = FixedCameraPickNum;
+                    sysConfig.FixedCameraPutNum = FixedCameraPutNum;
+                    sysConfig.FixedCameracheckNum = FixedCameracheckNum;
+
+
                     _configService.SaveSystemConfiguration(sysConfig);
                     await management.WriteSystemParameterToPlcAsync(sysConfig);
                     _eventAggregator.GetEvent<SnackbarMessageNotification>().Publish(new MessageParameter() { Msg = Lang.完成, Duration = 1 });

+ 8 - 8
TeamAAS-VM/Views/SettingView.xaml

@@ -1840,11 +1840,11 @@
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Right"
                                    Margin="0,6,10,6"
-                                   Text="相机拍照次数:" />
+                                   Text="相机拍照次数:" />
                         <mah:NumericUpDown Grid.Row="0"
                                            Grid.Column="1"
                                            Margin="0,6"
-                                           Value="{Binding CameraShotCount,Mode=TwoWay}"
+                                           Value="{Binding DowmCameraNum,Mode=TwoWay}"
                                            Minimum="0"
                                            Maximum="100"
                                            FontSize="{DynamicResource Font.Size.Body3}" />
@@ -1860,7 +1860,7 @@
                         <mah:NumericUpDown Grid.Row="1"
                                            Grid.Column="1"
                                            Margin="0,6"
-                                           Value="{Binding UpperCameraPickShotCount,Mode=TwoWay}"
+                                           Value="{Binding UpCameraPickNum,Mode=TwoWay}"
                                            Minimum="0"
                                            Maximum="100"
                                            FontSize="{DynamicResource Font.Size.Body3}" />
@@ -1876,7 +1876,7 @@
                         <mah:NumericUpDown Grid.Row="2"
                                            Grid.Column="1"
                                            Margin="0,6"
-                                           Value="{Binding UpperCameraPlaceShotCount,Mode=TwoWay}"
+                                           Value="{Binding UpCameraPutNum,Mode=TwoWay}"
                                            Minimum="0"
                                            Maximum="100"
                                            FontSize="{DynamicResource Font.Size.Body3}" />
@@ -1892,7 +1892,7 @@
                         <mah:NumericUpDown Grid.Row="3"
                                            Grid.Column="1"
                                            Margin="0,6"
-                                           Value="{Binding UpperCameraLockAssembleCount,Mode=TwoWay}"
+                                           Value="{Binding UPCameracheckNum,Mode=TwoWay}"
                                            Minimum="0"
                                            Maximum="100"
                                            FontSize="{DynamicResource Font.Size.Body3}" />
@@ -1908,7 +1908,7 @@
                         <mah:NumericUpDown Grid.Row="4"
                                            Grid.Column="1"
                                            Margin="0,6"
-                                           Value="{Binding FixedPickCameraCount,Mode=TwoWay}"
+                                           Value="{Binding FixedCameraPickNum,Mode=TwoWay}"
                                            Minimum="0"
                                            Maximum="10"
                                            FontSize="{DynamicResource Font.Size.Body3}" />
@@ -1924,7 +1924,7 @@
                         <mah:NumericUpDown Grid.Row="5"
                                            Grid.Column="1"
                                            Margin="0,6"
-                                           Value="{Binding FixedLockAssembleCameraCount,Mode=TwoWay}"
+                                           Value="{Binding FixedCameraPutNum,Mode=TwoWay}"
                                            Minimum="0"
                                            Maximum="10"
                                            FontSize="{DynamicResource Font.Size.Body3}" />
@@ -1940,7 +1940,7 @@
                         <mah:NumericUpDown Grid.Row="6"
                                            Grid.Column="1"
                                            Margin="0,6"
-                                           Value="{Binding FixedCameraDetectLockAssembleCount,Mode=TwoWay}"
+                                           Value="{Binding FixedCameracheckNum,Mode=TwoWay}"
                                            Minimum="0"
                                            Maximum="100"
                                            FontSize="{DynamicResource Font.Size.Body3}" />