2 İşlemeler 04fadd254f ... 15591518ab

Yazar SHA1 Mesaj Tarih
  法 王 15591518ab Merge branch 'develop-test' of http://192.168.10.198:3000/Skyunion/SKMC.API-v3 into develop-test 6 gün önce
  法 王 b7287bbd21 1、优化代码结构 6 gün önce

+ 0 - 14
SKMC.API/Machine/Config/MachineDeviceErrorStore.cs

@@ -1,14 +0,0 @@
-using Prism.Mvvm;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace SKMC.Api.Machine.Config
-{
-    public abstract class MachineDeviceErrorStore : BindableBase
-    {
-        public abstract string GetAxisErrorInfo(short axisNo);
-    }
-}

+ 47 - 0
SKMC.API/Machine/Control/IMachineDriverControl.cs

@@ -0,0 +1,47 @@
+using SKMC.Api.Machine.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SKMC.Api.Machine.Control
+{
+    public interface IMachineDriverControl
+    {
+        #region SDO
+        /// <summary>
+        /// 获取所有SDO 配置列表
+        /// </summary>
+        List<ConfigSlaveSDO> GetAllDeviceSdo();
+
+        /// <summary>
+        /// 刷新单个 SDO 参数当前值
+        /// </summary>
+        bool ReadSDOUsageValue(ConfigSlaveSDO sdo, out string stateMsg);
+
+        /// <summary>
+        /// 保存 SDO 到数据库 + 驱动器
+        /// </summary>
+        bool WriteSDORecordedValue(ConfigSlaveSDO sdo, out string stateMsg);
+        #endregion
+
+        #region PDO
+        ///// <summary>
+        ///// 获取所有PDO 配置列表
+        ///// </summary>
+        //List<ConfigSlavePDO> GetAllDevicePdo();
+
+        ///// <summary>
+        ///// 刷新单个 PDO 参数当前值
+        ///// </summary>
+        //bool ReadPDOUsageValue(ConfigSlavePDO sdo, out string stateMsg);
+
+
+        ///// <summary>
+        ///// 保存 PDO 到数据库 + 驱动器
+        ///// </summary>
+        //bool WritePDORecordedValue(ConfigSlavePDO sdo, out string stateMsg);
+        #endregion
+    }
+}

+ 12 - 0
SKMC.API/Machine/Model/ConfigSlavePDO.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SKMC.Api.Machine.Model
+{
+    public class ConfigSlavePDO : ConfigSlaveSDO
+    {
+    }
+}

+ 97 - 0
SKMC.API/Machine/Model/ConfigSlaveSDO.cs

@@ -0,0 +1,97 @@
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SKMC.Api.Machine.Model
+{
+    public class ConfigSlaveSDO : BindableBase
+    {
+        private short _slaveNo;
+        private string _paramName;
+        private int _recordedValue;
+        private int _usageValue;
+        private string _range;
+        private string _unit;
+        private string _defaultValue;
+        private int _saveMode;
+        private int _isImmediately;
+        private string _remark;
+        private string _stateMsg;
+        private string _textColor = "Green";
+
+        public short SlaveNo
+        {
+            get { return _slaveNo; }
+            set { _slaveNo = value; RaisePropertyChanged(); }
+        }
+
+        public string ParamName
+        {
+            get { return _paramName; }
+            set { _paramName = value; RaisePropertyChanged(); }
+        }
+
+        public int RecordedValue
+        {
+            get { return _recordedValue; }
+            set { _recordedValue = value; RaisePropertyChanged(); }
+        }
+
+        public int UsageValue
+        {
+            get { return _usageValue; }
+            set { _usageValue = value; RaisePropertyChanged(); }
+        }
+
+        public string Range
+        {
+            get { return _range; }
+            set { _range = value; RaisePropertyChanged(); }
+        }
+
+        public string Unit
+        {
+            get { return _unit; }
+            set { _unit = value; RaisePropertyChanged(); }
+        }
+
+        public string DefaultValue
+        {
+            get { return _defaultValue; }
+            set { _defaultValue = value; RaisePropertyChanged(); }
+        }
+
+        public int SaveMode
+        {
+            get { return _saveMode; }
+            set { _saveMode = value; RaisePropertyChanged(); }
+        }
+
+        public int IsImmediately
+        {
+            get { return _isImmediately; }
+            set { _isImmediately = value; RaisePropertyChanged(); }
+        }
+
+        public string Remark
+        {
+            get { return _remark; }
+            set { _remark = value; RaisePropertyChanged(); }
+        }
+
+        public string StateMsg
+        {
+            get { return _stateMsg; }
+            set { _stateMsg = value; RaisePropertyChanged(); }
+        }
+
+        public string TextColor
+        {
+            get => _textColor;
+            set { _textColor = value; RaisePropertyChanged(); }
+        }
+    }
+}

+ 76 - 0
SKMC.API/Machine/Model/MachineSlaveError.cs

@@ -0,0 +1,76 @@
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SKMC.Api.Machine.Model
+{
+    public class MachineSlaveError : BindableBase
+    {
+        private string _vendorId;
+        private string _errorCode;
+        private int _errorvalue;
+        private int _assist‌Value;
+        private string _faultName;
+        private string _reason;
+        private string _confirmMethod;
+        private string _handlingMeasures;
+        private string _faultRange;
+
+        public string VendorId
+        {
+            get { return _vendorId; }
+            set { _vendorId = value; RaisePropertyChanged(); }
+        }
+
+        public string ErrorCode
+        {
+            get { return _errorCode; }
+            set { _errorCode = value; RaisePropertyChanged(); }
+        }
+
+        public int ErrorValue
+        {
+            get { return _errorvalue; }
+            set { _errorvalue = value; RaisePropertyChanged(); }
+        }
+
+        public int Assist‌Value
+        {
+            get { return _assist‌Value; }
+            set { _assist‌Value = value; RaisePropertyChanged(); }
+        }
+
+        public string FaultName
+        {
+            get { return _faultName; }
+            set { _faultName = value; RaisePropertyChanged(); }
+        }
+
+        public string Reason
+        {
+            get { return _reason; }
+            set { _reason = value; RaisePropertyChanged(); }
+        }
+
+        public string ConfirmMethod
+        {
+            get { return _confirmMethod; }
+            set { _confirmMethod = value; RaisePropertyChanged(); }
+        }
+
+        public string HandlingMeasures
+        {
+            get { return _handlingMeasures; }
+            set { _handlingMeasures = value; RaisePropertyChanged(); }
+        }
+
+        public string FaultRange
+        {
+            get { return _faultRange; }
+            set { _faultRange = value; RaisePropertyChanged(); }
+        }
+    }
+}

+ 16 - 0
SKMC.API/Motion/Driver/IMotionDriverError.cs

@@ -0,0 +1,16 @@
+using SKMC.Api.Machine.Model;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SKMC.Api.Motion.Driver
+{
+    public interface IMotionDriverError
+    {
+        string GetAxisErrorInfo(short axisNo);
+
+        List<MachineSlaveError> GetAllErrorType();
+    }
+}

+ 5 - 1
SKMC.API/SKMC.API.csproj

@@ -148,9 +148,13 @@
     <Compile Include="Common\Tasks\Tasks.cs" />
     <Compile Include="Common\Tcp\TCPClient.cs" />
     <Compile Include="Common\Tcp\TcpClientBase.cs" />
-    <Compile Include="Machine\Config\MachineDeviceErrorStore.cs" />
+    <Compile Include="Machine\Control\IMachineDriverControl.cs" />
+    <Compile Include="Machine\Model\ConfigSlavePDO.cs" />
+    <Compile Include="Machine\Model\ConfigSlaveSDO.cs" />
+    <Compile Include="Machine\Model\MachineSlaveError.cs" />
     <Compile Include="Machine\Monitor\MachineLatchTask.cs" />
     <Compile Include="Machine\Monitor\MachineStateLatchMonitor.cs" />
+    <Compile Include="Motion\Driver\IMotionDriverError.cs" />
     <Compile Include="Vision\SKV0\SKVisionClient.cs" />
     <Compile Include="Vision\SKV0\SKVisionProtocol.cs" />
     <Compile Include="Vision\SKV0\SKVisionClientBase.cs" />