From c25035284f24f1299353592fb94b4954c8e7c3ca Mon Sep 17 00:00:00 2001 From: lihanbo Date: Mon, 23 Dec 2024 12:06:32 +0800 Subject: [PATCH] =?UTF-8?q?105040=20Update=20=E7=BA=BF=E6=9D=90=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=BB=8E=E7=BA=BF=E5=9E=8B=E5=8F=B7=E5=90=8D=E4=B8=AD?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/LectotypeViewModel.cs | 25 +++++++------------ .../ViewModel/ScannerViewModel.cs | 5 +++- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs index 04ac589..c7e8957 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/LectotypeViewModel.cs @@ -183,8 +183,10 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged var occCable = (it as OccCableForked); var insulatorGraph = occCable.Children.First() as OccCablesInsulatorGraph; - var isEncoderLine = GetLineType(insulatorGraph.Imprint,"L"); - var isPowerLine = GetLineType(insulatorGraph.Imprint,"N"); + var isEncoderLine = GetLineType(insulatorGraph.LibraryName,"编码器线"); + var isPowerLine = GetLineType(insulatorGraph.LibraryName,"动力线"); + var isBrakePowerLine = GetLineType(insulatorGraph.LibraryName,"动力刹车线"); + var encoderLength = 0d; var powerLength = 0d; if(double.TryParse(insulatorGraph.CableLength_VH?.StrVal ?? "0",out double length)){ @@ -206,7 +208,7 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged IsPowerLine = isPowerLine, PowerLineLength = powerLength, EncoderLineLength = encoderLength, - CableType = isEncoderLine ? "编码器线" : isPowerLine ? "动力线" : "未知类型", + CableType = isEncoderLine ? "编码器线" : isPowerLine ? "动力线" : isBrakePowerLine ? "动力刹车线" : "未知类型", }; }) .Where(it => it != null) @@ -389,22 +391,13 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged } /// /// L -> 动力线 N -> 编码器线 + /// 20241223 改为按名称判断 /// - /// + /// /// - public bool GetLineType(string imprint, string lineFlag) + public bool GetLineType(string libName, string lineFlag) { - if (imprint != null && imprint.Contains("-")) - { - var vals = imprint.Split('-'); - var val = vals[1]; - Trace.WriteLine($"{vals[1]},{lineFlag},{val.ToUpper() == lineFlag.ToUpper()}"); - return val.ToUpper() == lineFlag.ToUpper(); - } - else - { - return false; - } + return libName.Contains(lineFlag); } public string GetAxisNo(string imprint) { diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/ScannerViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/ScannerViewModel.cs index a33b2a8..4a08ee9 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/ScannerViewModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/ScannerViewModel.cs @@ -120,6 +120,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel FlexMessageBox.Error(ex.Message); } } + private void DebounceTimer_Tick(object sender, EventArgs e) { @@ -197,7 +198,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel _currentFlexDesigner.FitToSelectSet(); _currentFlexDesigner.SelectSet.OnSelectionChanged(); - + //_currentFlexDesigner.Camera.GraphicControl._HighlightNode() /* List> nodeByEntity = this._occTreeView.GetNodeByEntity(baseOccurrence); @@ -215,6 +216,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel } } + + public void OthersOccShow(bool show = false) { _currentFlexDesigner.GetOrganizerOccurrences().ToList().ForEach(occ =>