105040 Update 线材类型从线型号名中判断获取
This commit is contained in:
parent
ec7916db1d
commit
c25035284f
|
@ -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
|
|||
}
|
||||
/// <summary>
|
||||
/// L -> 动力线 N -> 编码器线
|
||||
/// 20241223 改为按名称判断
|
||||
/// </summary>
|
||||
/// <param name="imprint"></param>
|
||||
/// <param name="libName"></param>
|
||||
/// <returns></returns>
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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<DatTreeNodeEx<BaseOccurrence>> 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 =>
|
||||
|
|
Loading…
Reference in New Issue