From cdf12e1954c78e187b142c7d7a460ec7387067f7 Mon Sep 17 00:00:00 2001 From: xcd <834800634@qq.com> Date: 星期五, 10 七月 2020 15:17:57 +0800 Subject: [PATCH] 配置变动和界面显示联动 --- src/Bro.M071.Process/M071Models.cs | 36 ++++++++++++++++++++++++++++-------- 1 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/Bro.M071.Process/M071Models.cs b/src/Bro.M071.Process/M071Models.cs index 4789b6e..5ccaad2 100644 --- a/src/Bro.M071.Process/M071Models.cs +++ b/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() @@ -137,13 +137,13 @@ get => key; set { - AlignName = key = value; + AliasName = key = value; } } [Category("閿悕閰嶇疆")] [Description("鍒悕")] - public string AlignName { get; set; } + public string AliasName { get; set; } [Category("鍚敤璁剧疆")] [Description("true锛氬惎鐢� false锛氱鐢�")] @@ -178,7 +178,22 @@ public string GetDisplayText() { - return $"{AlignName}"; + string snapShot = "鏈寚瀹�"; + + using (var scope = GlobalVar.Container.BeginLifetimeScope()) + { + var config = scope.Resolve<IProcessConfig>(); + if (config != null) + { + var snapshotPoint = (config as M071Config).SnapshotPointCollection.FirstOrDefault(u => u.Id == SnapshotPointId); + if (snapshotPoint != null) + { + snapShot = snapshotPoint.Name; + } + } + } + + return $"{AliasName}-{snapShot}-{ImageSeq}"; } public List<string> GetHalconToolPathList() @@ -204,10 +219,15 @@ public class ProductionMeasurement : INotifyPropertyChanged, IDisposable { public string Barcode; + public string PResult; - public List<MeasurementUint> Measurements = new List<MeasurementUint>(); + public List<MeasurementUnit> Measurements = new List<MeasurementUnit>(); public List<IShapeElement> ElementList = new List<IShapeElement>(); + + public DateTime? StartTime = null; + + public DateTime? EndTime = null; public event PropertyChangedEventHandler PropertyChanged; @@ -235,7 +255,7 @@ } } - public class MeasurementUint : IComplexDisplay, INotifyPropertyChanged, IDisposable + public class MeasurementUnit : IComplexDisplay, INotifyPropertyChanged, IDisposable { public string Id = Guid.NewGuid().ToString(); @@ -312,7 +332,7 @@ [Category("鍗曢敭閰嶇疆")] [Description("鍗曢敭缁撴灉閰嶇疆")] [TypeConverter(typeof(KeyUnitResultConverter))] - public string KeyResult { get; set; } = ""; + public string KeyResultId { get; set; } = ""; public List<HImage> KeyImages = new List<HImage>(); @@ -342,7 +362,7 @@ { string msg = Key; - msg += string.IsNullOrWhiteSpace(KeyResult) ? "" : $"-{KeyResult}"; + msg += string.IsNullOrWhiteSpace(KeyResultId) ? "" : $"-{KeyResultId}"; return msg; } -- Gitblit v1.8.0