105040 Update 优化安川逻辑,直通线允许选择两种
This commit is contained in:
parent
6465a465ac
commit
aaa8a77ccc
|
@ -295,8 +295,9 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
||||||
{
|
{
|
||||||
Stopwatch stopwatch = new Stopwatch();
|
Stopwatch stopwatch = new Stopwatch();
|
||||||
stopwatch.Start();
|
stopwatch.Start();
|
||||||
|
DrawingNo = "";
|
||||||
if (Motor == null)
|
if (Motor == null)
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
string ModelNo = "MR-";
|
string ModelNo = "MR-";
|
||||||
|
@ -306,8 +307,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
||||||
}
|
}
|
||||||
var cableFlag = GetCableModelFlag(Motor?.MotorPower, CableType, CableConnectionClass, IsFlexibility);
|
var cableFlag = GetCableModelFlag(Motor?.MotorPower, CableType, CableConnectionClass, IsFlexibility);
|
||||||
if (string.IsNullOrWhiteSpace(cableFlag))
|
if (string.IsNullOrWhiteSpace(cableFlag))
|
||||||
{
|
{
|
||||||
DrawingNo = "";
|
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,8 +176,9 @@
|
||||||
Orientation="Horizontal">
|
Orientation="Horizontal">
|
||||||
<hc:ComboBox
|
<hc:ComboBox
|
||||||
Width="153"
|
Width="153"
|
||||||
|
hc:InfoElement.ShowClearButton="True"
|
||||||
DisplayMemberPath="ItemName"
|
DisplayMemberPath="ItemName"
|
||||||
IsEnabled="{Binding IsEnableParagraph}"
|
IsEnabled="{Binding IsEnableSecCableType}"
|
||||||
ItemsSource="{Binding CableTypes}"
|
ItemsSource="{Binding CableTypes}"
|
||||||
SelectedIndex="0"
|
SelectedIndex="0"
|
||||||
SelectedValue="{Binding CableTypeSecond}"
|
SelectedValue="{Binding CableTypeSecond}"
|
||||||
|
|
|
@ -56,16 +56,12 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CableLectotypeUserControl()
|
public CableLectotypeUserControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
Debug.WriteLine($"CableLectotypeWindow_Created -> {_motor?.MotorModelStr} => {_motor?.OccPartId}");
|
Debug.WriteLine($"CableLectotypeWindow_Created -> {_motor?.MotorModelStr} => {_motor?.OccPartId}");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void OnMotorChanged()
|
private void OnMotorChanged()
|
||||||
{
|
{
|
||||||
_motor = (Motor as MotorModel);
|
_motor = (Motor as MotorModel);
|
||||||
|
@ -96,6 +92,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
//var motor = Motor as MotorModel;
|
//var motor = Motor as MotorModel;
|
||||||
if(Motor is CableLectotypeViewModel motor)
|
if(Motor is CableLectotypeViewModel motor)
|
||||||
{
|
{
|
||||||
|
// 发送消息,用户生成了数据
|
||||||
WeakReferenceMessenger.Default.Send<LectotypeMessage,string>(new LectotypeMessage
|
WeakReferenceMessenger.Default.Send<LectotypeMessage,string>(new LectotypeMessage
|
||||||
(new System.Collections.Generic.Dictionary<string, string>
|
(new System.Collections.Generic.Dictionary<string, string>
|
||||||
{
|
{
|
||||||
|
|
|
@ -224,6 +224,39 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LectotypeList.Add(line);
|
LectotypeList.Add(line);
|
||||||
|
// 安川电机,允许有两条直通线
|
||||||
|
if ( !string.IsNullOrEmpty(CableTypeSecond) && Motor.Brand == Brands.ANCHUAN)
|
||||||
|
{
|
||||||
|
var secLine = new LectotypeLineModel
|
||||||
|
{
|
||||||
|
SeqNo = seqNo,
|
||||||
|
//MechanicalNo = MechanicalNo,
|
||||||
|
//MechanicalName = MechanicalName,
|
||||||
|
AxisNo = AxisNo,
|
||||||
|
//MotorSerie = MotorSerie,
|
||||||
|
//MotorPower = Motor.MotorPower,
|
||||||
|
//DriverInterface = DriverInterface,
|
||||||
|
//DriverModel = DriverModel,
|
||||||
|
CableConnectionClass = "直通",
|
||||||
|
CableType = CableTypeSecond,
|
||||||
|
//IsFlexibility = IsFlexibility,
|
||||||
|
//PowerLineLength = PowerLineLength,
|
||||||
|
//EncoderLineLength = EncoderLineLength,
|
||||||
|
//PowerBrakeLineLength = PowerBrakeLineLength,
|
||||||
|
//DrawingNo = LineModelStr,
|
||||||
|
CableModelNo = CableModelStr,
|
||||||
|
//LineCount = Math.Max(PowerLineCount, EncoderLineCount),
|
||||||
|
//CurrentLineNumber = 1,
|
||||||
|
//BomList = GenBomListByCurrent(DrawingNo)
|
||||||
|
IsLectotype = true,
|
||||||
|
CurrentLine = 1,
|
||||||
|
Motor = Motor
|
||||||
|
};
|
||||||
|
secLine.DrawingNo = secLine.GetCableDrawNo();
|
||||||
|
secLine.SubLines = GetSubLines(secLine.DrawingNo);
|
||||||
|
LectotypeList.Add(secLine);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
SelectedLines = LectotypeList;
|
SelectedLines = LectotypeList;
|
||||||
}
|
}
|
||||||
|
@ -327,9 +360,13 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
|
||||||
IsEnableParagraph = !(_cableConnectionType == ConnectionType.Passthrough);
|
IsEnableParagraph = !(_cableConnectionType == ConnectionType.Passthrough);
|
||||||
PowerLineParagraph = 0;
|
PowerLineParagraph = 0;
|
||||||
EncoderLineParagraph = 0;
|
EncoderLineParagraph = 0;
|
||||||
if (!IsEnableParagraph)
|
if (!IsEnableParagraph && Motor.Brand != Brands.ANCHUAN)
|
||||||
{
|
{
|
||||||
EncoderLineParagraph = 1;
|
IsEnableSecCableType = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IsEnableSecCableType = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,6 +443,16 @@ public class CableLectotypeViewModel : INotifyPropertyChanged
|
||||||
OnPropertyChanged(nameof(IsEnableParagraph));
|
OnPropertyChanged(nameof(IsEnableParagraph));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private bool _isEnableSecCableType = true;
|
||||||
|
public bool IsEnableSecCableType
|
||||||
|
{
|
||||||
|
get => _isEnableSecCableType;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_isEnableSecCableType = value;
|
||||||
|
OnPropertyChanged(nameof(IsEnableSecCableType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public bool SaveToDb()
|
public bool SaveToDb()
|
||||||
|
|
|
@ -163,12 +163,12 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged
|
||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public List<string> Drivers { get; set; } = [
|
//public List<string> Drivers { get; set; } = [
|
||||||
"脉冲型驱动器",
|
// "脉冲型驱动器",
|
||||||
"总线型驱动器(CCLINK IE TSN)",
|
// "总线型驱动器(CCLINK IE TSN)",
|
||||||
"总线型驱动器(SSCNET III/H)",
|
// "总线型驱动器(SSCNET III/H)",
|
||||||
"总线型驱动器(EtherCAT)"
|
// "总线型驱动器(EtherCAT)"
|
||||||
];
|
// ];
|
||||||
|
|
||||||
public Task LoadData()
|
public Task LoadData()
|
||||||
{
|
{
|
||||||
|
@ -667,6 +667,14 @@ public class LectotypeViewModel(string docId) : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
return motorName.Split('^')[0]?.Trim() ?? motorName;
|
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
|
else
|
||||||
{
|
{
|
||||||
return motorName;
|
return motorName;
|
||||||
|
|
Loading…
Reference in New Issue