src/Bro.Common.Device/DeviceBase/PLCBase.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.Common.Device/Interface/IMotion.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.Common.Model/Model/ResponseMessage.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M071.Process/M071Models.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M071.Process/M071Process.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/Bro.Common.Device/DeviceBase/PLCBase.cs
@@ -281,7 +281,7 @@ return locations; } public bool MoveToPoint(IOperationConfig opConfig) public ResponseMessage MoveToPoint(IOperationConfig opConfig) { throw new NotImplementedException(); } src/Bro.Common.Device/Interface/IMotion.cs
@@ -1,5 +1,6 @@ using Bro.Common.Helper; using Bro.Common.Interface; using Bro.Common.Model; using System; using System.Collections.Generic; using System.Linq; @@ -20,7 +21,7 @@ /// </summary> /// <param name="opConfig">运动配置</param> /// <returns>true:正常结束 false:异常结束</returns> bool MoveToPoint(IOperationConfig opConfig); ResponseMessage MoveToPoint(IOperationConfig opConfig); } /// <summary> @@ -33,7 +34,7 @@ /// </summary> /// <param name="config"></param> /// <returns></returns> bool Run(IOperationConfig config); ResponseMessage Run(IOperationConfig config); } public class AxisInfo : IComplexDisplay src/Bro.Common.Model/Model/ResponseMessage.cs
@@ -11,55 +11,32 @@ public bool Result { get; set; } = true; public Info Info { get; set; } = new Info(); public string Message { get; set; } public string DataJson { get; set; } public void GetMessageFromException(Exception ex) { //if (ex is ICustomizdException) //{ // ICustomizdException ie = ex as ICustomizdException; // Code = (int)ie.Level; // Info = ie.Info; //} //else if (ex is DbEntityValidationException) //{ // DbEntityValidationException deve = ex as DbEntityValidationException; // Code = 9992; // deve.EntityValidationErrors.ToList().ForEach(error => // { // DbEntityValidationResult temp = error as DbEntityValidationResult; // temp.ValidationErrors.ToList().ForEach(err => // { // Info.Title += (err.ErrorMessage + ";"); // }); // }); // Info.Title.TrimEnd(';'); // Info.Detail = ex.GetExceptionMessage(); //} //else { Code = 9999; Info = new Info("系统未处理异常,请联系管理员", ex.GetExceptionMessage()); Message = ex.GetExceptionMessage(); } Result = false; } } public class Info { public Info() { } //public class Info //{ // public Info() { } public Info(string _title, string _detail = "") { Title = _title; Detail = _detail; } public string Title { get; set; } // public Info(string _title, string _detail = "") // { // Title = _title; // Detail = _detail; // } // public string Title { get; set; } public string Detail { get; set; } } // public string Detail { get; set; } //} } src/Bro.M071.Process/M071Models.cs
@@ -75,7 +75,7 @@ { public string GetDisplayText() { return (IsEnabled ? "" : "禁用 ") + Name + " " + string.Join(" ", Destination.Select(u => u.GetDisplayText())) + " " + CameraOp.GetDisplayText(); return (IsEnabled ? "" : "禁用 ") + Name + " " + MotionOp.GetDisplayText() + " " + CameraOp.GetDisplayText(); } public List<string> GetHalconToolPathList() src/Bro.M071.Process/M071Process.cs
@@ -201,18 +201,19 @@ { _pauseHandle.WaitHandle.WaitOne(); IDevice device = DeviceCollection.FirstOrDefault(u => u.Id == s.MotionDevice); IDevice device = DeviceCollection.FirstOrDefault(u => u.Id == s.MotionOp.Device); if (device == null) throw new ProcessException($"{s.Name}拍照点位未设置运动设备"); IMotion motionDevice = device as IMotion; IMotionCard motionDevice = device as IMotionCard; if (motionDevice == null) throw new ProcessException($"{s.Name}拍照点位设置{device.Name}不是运动设备"); if (!motionDevice.MoveToPoint(null)) var response = motionDevice.Run(s.MotionOp.OpConfig); if (!response.Result) { throw new ProcessException("运动中止", null, ExceptionLevel.Info); throw new ProcessException($"{device.Name}异常,{response.Message}", null, ExceptionLevel.Info); } CameraBase camera = DeviceCollection.FirstOrDefault(u => u.Id == s.CameraOp.Device) as CameraBase;