105040 Update 处理电机型号
This commit is contained in:
parent
19e04eb3ed
commit
394427a193
|
@ -541,7 +541,7 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged
|
|||
|
||||
var motor = new MotorModel
|
||||
{
|
||||
MotorModelStr = part.Name,
|
||||
MotorModelStr = UnStuffMotorName(part.Name),
|
||||
AxisNo = axisNo,
|
||||
OccPartId = part.ID,
|
||||
IsError = string.IsNullOrEmpty(axisNo)
|
||||
|
@ -563,6 +563,25 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged
|
|||
Motors = motorsData;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
private string UnStuffMotorName(string motorName)
|
||||
{
|
||||
if (motorName.Contains("&"))
|
||||
{
|
||||
return motorName.Split('&')[0]?.Trim() ?? motorName;
|
||||
}
|
||||
else if (motorName.Contains("_"))
|
||||
{
|
||||
return motorName.Split('_')[0]?.Trim() ?? motorName;
|
||||
}
|
||||
else if (motorName.Contains("^"))
|
||||
{
|
||||
return motorName.Split('^')[0]?.Trim() ?? motorName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return motorName;
|
||||
}
|
||||
}
|
||||
private void OnSelectedItemChange()
|
||||
{
|
||||
if (this.SelectedItem != null)
|
||||
|
|
Loading…
Reference in New Issue