105040 Update 完善多芯线线材选型
This commit is contained in:
parent
90a766d606
commit
4212086da1
|
@ -34,10 +34,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
||||||
/// 是否高柔
|
/// 是否高柔
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsHighFlexibility { get; set; }
|
public bool IsHighFlexibility { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 插头型号
|
|
||||||
/// </summary>
|
|
||||||
public string ConnectorModel { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前端子型号
|
/// 前端子型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using MiniExcelLibs.Attributes;
|
using MiniExcelLibs.Attributes;
|
||||||
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models.MultiCoreWire;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
@ -7,66 +8,460 @@ using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
namespace Sinvo.EplanHpD.Plugin.WPFUI.Models
|
||||||
{
|
{
|
||||||
public class MultiCoreWireLecModel
|
public class MultiCoreWireLecModel : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 应用场景 类型 线径规格(mm2) 是否高柔 线芯数 线材型号规格 插头型号 前端子型号 后端子型号
|
* 应用场景 类型 线径规格(mm2) 是否高柔 线芯数 线材型号规格 插头型号 前端子型号 后端子型号
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
private int _seqNo;
|
||||||
|
public int SeqNo
|
||||||
|
{
|
||||||
|
get => _seqNo;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_seqNo = value;
|
||||||
|
OnPropertyChanged(nameof(SeqNo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应用场景
|
/// 应用场景
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private string _applicationScenario;
|
||||||
[ExcelColumn(Name = "应用场合")]
|
[ExcelColumn(Name = "应用场合")]
|
||||||
public string ApplicationScenario { get; set; }
|
public string ApplicationScenario
|
||||||
|
{
|
||||||
|
get => _applicationScenario;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_applicationScenario = value;
|
||||||
|
OnPropertyChanged(nameof(ApplicationScenario));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材类型
|
/// 线材类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ExcelColumn(Ignore = true)]
|
private string _wireType;
|
||||||
public string WireType { get; set; }
|
[ExcelColumn(Ignore = true)]
|
||||||
|
public string WireType
|
||||||
|
{
|
||||||
|
get => _wireType;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_wireType = value;
|
||||||
|
OnPropertyChanged(nameof(WireType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线径规格(mm2)
|
/// 线径规格(mm2)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private string _wireDiameterSpecification;
|
||||||
[ExcelColumn(IndexName = "F")]
|
[ExcelColumn(IndexName = "F")]
|
||||||
public string WireDiameterSpecification { get; set; }
|
public string WireDiameterSpecification
|
||||||
/// <summary>
|
{
|
||||||
/// 是否高柔
|
get => _wireDiameterSpecification;
|
||||||
/// </summary>
|
set
|
||||||
[ExcelColumn(Ignore = true)]
|
{
|
||||||
public bool IsHighFlexibility { get; set; }
|
_wireDiameterSpecification = value;
|
||||||
|
OnPropertyChanged(nameof(WireDiameterSpecification));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否高柔
|
/// 是否高柔
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private bool _isHighFlexibility;
|
||||||
|
[ExcelColumn(Ignore = true)]
|
||||||
|
public bool IsHighFlexibility
|
||||||
|
{
|
||||||
|
get => _isHighFlexibility;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_isHighFlexibility = value;
|
||||||
|
OnPropertyChanged(nameof(IsHighFlexibility));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否高柔
|
||||||
|
/// </summary>
|
||||||
|
private string _isHighFlexibilityStr;
|
||||||
[ExcelColumn(Name = "是否高柔")]
|
[ExcelColumn(Name = "是否高柔")]
|
||||||
public string IsHighFlexibilityStr { get; set; }
|
public string IsHighFlexibilityStr
|
||||||
|
{
|
||||||
|
get => _isHighFlexibilityStr;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_isHighFlexibilityStr = value;
|
||||||
|
OnPropertyChanged(nameof(IsHighFlexibilityStr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线芯数
|
/// 线芯数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private string _wireCoreCount;
|
||||||
[ExcelColumn(Name = "线芯数")]
|
[ExcelColumn(Name = "线芯数")]
|
||||||
public string WireCoreCount { get; set; }
|
public string WireCoreCount
|
||||||
|
{
|
||||||
|
get => _wireCoreCount;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_wireCoreCount = value;
|
||||||
|
OnPropertyChanged(nameof(WireCoreCount));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材型号规格
|
/// 线材型号规格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private string _wireModelSpecification;
|
||||||
[ExcelColumn(Name = "线材型号规格")]
|
[ExcelColumn(Name = "线材型号规格")]
|
||||||
public string WireModelSpecification { get; set; }
|
public string WireModelSpecification
|
||||||
|
{
|
||||||
|
get => _wireModelSpecification;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_wireModelSpecification = value;
|
||||||
|
OnPropertyChanged(nameof(WireModelSpecification));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 插头型号
|
/// 插头型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private string _connectorModel;
|
||||||
[ExcelColumn(Name = "插头型号")]
|
[ExcelColumn(Name = "插头型号")]
|
||||||
public string ConnectorModel { get; set; }
|
public string ConnectorModel
|
||||||
/// <summary>
|
{
|
||||||
/// 前端子型号
|
get => _connectorModel;
|
||||||
/// </summary>
|
set
|
||||||
[ExcelColumn(Ignore = true)]
|
{
|
||||||
public string FrontTerminalModel { get; set; }
|
_connectorModel = value;
|
||||||
/// <summary>
|
OnPropertyChanged(nameof(ConnectorModel));
|
||||||
/// 后端子型号
|
}
|
||||||
/// </summary>
|
}
|
||||||
[ExcelColumn(Ignore = true)]
|
|
||||||
public string BackTerminalModel { get; set; }
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 叉耳端子
|
||||||
|
/// </summary>
|
||||||
|
private string _forkTerminal;
|
||||||
|
[ExcelColumn(Name = "叉耳端子")]
|
||||||
|
public string ForkTerminal
|
||||||
|
{
|
||||||
|
get => _forkTerminal;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_forkTerminal = value;
|
||||||
|
OnPropertyChanged(nameof(ForkTerminal));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 叉耳端子剥线长度(mm)
|
||||||
|
/// </summary>
|
||||||
|
private double _forkTerminalStripLength;
|
||||||
|
[ExcelColumn(Name = "叉耳端子剥线长度(mm)")]
|
||||||
|
public double ForkTerminalStripLength
|
||||||
|
{
|
||||||
|
get => _forkTerminalStripLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_forkTerminalStripLength = value;
|
||||||
|
OnPropertyChanged(nameof(ForkTerminalStripLength));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 叉耳端子物料编码
|
||||||
|
/// </summary>
|
||||||
|
private string _forkTerminalMaterialCode;
|
||||||
|
[ExcelColumn(Name = "叉耳端子物料编码")]
|
||||||
|
public string ForkTerminalMaterialCode
|
||||||
|
{
|
||||||
|
get => _forkTerminalMaterialCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_forkTerminalMaterialCode = value;
|
||||||
|
OnPropertyChanged(nameof(ForkTerminalMaterialCode));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 扁形端子
|
||||||
|
/// </summary>
|
||||||
|
private string _flatTerminal;
|
||||||
|
[ExcelColumn(Name = "扁形端子")]
|
||||||
|
public string FlatTerminal
|
||||||
|
{
|
||||||
|
get => _flatTerminal;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_flatTerminal = value;
|
||||||
|
OnPropertyChanged(nameof(FlatTerminal));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 扁形端子剥线长度(mm)
|
||||||
|
/// </summary>
|
||||||
|
private double _flatTerminalStripLength;
|
||||||
|
[ExcelColumn(Name = "扁形端子剥线长度(mm)")]
|
||||||
|
public double FlatTerminalStripLength
|
||||||
|
{
|
||||||
|
get => _flatTerminalStripLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_flatTerminalStripLength = value;
|
||||||
|
OnPropertyChanged(nameof(FlatTerminalStripLength));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 扁形端子物料编码
|
||||||
|
/// </summary>
|
||||||
|
private string _flatTerminalMaterialCode;
|
||||||
|
[ExcelColumn(Name = "扁形端子物料编码")]
|
||||||
|
public string FlatTerminalMaterialCode
|
||||||
|
{
|
||||||
|
get => _flatTerminalMaterialCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_flatTerminalMaterialCode = value;
|
||||||
|
OnPropertyChanged(nameof(FlatTerminalMaterialCode));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// O型端子
|
||||||
|
/// </summary>
|
||||||
|
private string _oTypeTerminal;
|
||||||
|
[ExcelColumn(Name = "O型端子")]
|
||||||
|
public string OTypeTerminal
|
||||||
|
{
|
||||||
|
get => _oTypeTerminal;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_oTypeTerminal = value;
|
||||||
|
OnPropertyChanged(nameof(OTypeTerminal));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// O型端子剥线长度(mm)
|
||||||
|
/// </summary>
|
||||||
|
private double _oTypeTerminalStripLength;
|
||||||
|
[ExcelColumn(Name = "O型端子剥线长度(mm)")]
|
||||||
|
public double OTypeTerminalStripLength
|
||||||
|
{
|
||||||
|
get => _oTypeTerminalStripLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_oTypeTerminalStripLength = value;
|
||||||
|
OnPropertyChanged(nameof(OTypeTerminalStripLength));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// O型端子物料编码
|
||||||
|
/// </summary>
|
||||||
|
private string _oTypeTerminalMaterialCode;
|
||||||
|
[ExcelColumn(Name = "O型端子物料编码")]
|
||||||
|
public string OTypeTerminalMaterialCode
|
||||||
|
{
|
||||||
|
get => _oTypeTerminalMaterialCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_oTypeTerminalMaterialCode = value;
|
||||||
|
OnPropertyChanged(nameof(OTypeTerminalMaterialCode));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 针型端子
|
||||||
|
/// </summary>
|
||||||
|
private string _pinTerminal;
|
||||||
|
[ExcelColumn(Name = "针型端子")]
|
||||||
|
public string PinTerminal
|
||||||
|
{
|
||||||
|
get => _pinTerminal;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_pinTerminal = value;
|
||||||
|
OnPropertyChanged(nameof(PinTerminal));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 针型端子剥线长度(mm)
|
||||||
|
/// </summary>
|
||||||
|
private double _pinTerminalStripLength;
|
||||||
|
[ExcelColumn(Name = "针型端子剥线长度(mm)")]
|
||||||
|
public double PinTerminalStripLength
|
||||||
|
{
|
||||||
|
get => _pinTerminalStripLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_pinTerminalStripLength = value;
|
||||||
|
OnPropertyChanged(nameof(PinTerminalStripLength));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 针型端子物料编码
|
||||||
|
/// </summary>
|
||||||
|
private string _pinTerminalMaterialCode;
|
||||||
|
[ExcelColumn(Name = "针型端子物料编码")]
|
||||||
|
public string PinTerminalMaterialCode
|
||||||
|
{
|
||||||
|
get => _pinTerminalMaterialCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_pinTerminalMaterialCode = value;
|
||||||
|
OnPropertyChanged(nameof(PinTerminalMaterialCode));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Y形端子
|
||||||
|
/// </summary>
|
||||||
|
private string _yTypeTerminal;
|
||||||
|
[ExcelColumn(Name = "Y形端子")]
|
||||||
|
public string YTypeTerminal
|
||||||
|
{
|
||||||
|
get => _yTypeTerminal;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_yTypeTerminal = value;
|
||||||
|
OnPropertyChanged(nameof(YTypeTerminal));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Y形端子剥线长度(mm)
|
||||||
|
/// </summary>
|
||||||
|
private double _yTypeTerminalStripLength;
|
||||||
|
[ExcelColumn(Name = "Y形端子剥线长度(mm)")]
|
||||||
|
public double YTypeTerminalStripLength
|
||||||
|
{
|
||||||
|
get => _yTypeTerminalStripLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_yTypeTerminalStripLength = value;
|
||||||
|
OnPropertyChanged(nameof(YTypeTerminalStripLength));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Y形端子物料编码
|
||||||
|
/// </summary>
|
||||||
|
private string _yTypeTerminalMaterialCode;
|
||||||
|
[ExcelColumn(Name = "Y形端子物料编码")]
|
||||||
|
public string YTypeTerminalMaterialCode
|
||||||
|
{
|
||||||
|
get => _yTypeTerminalMaterialCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_yTypeTerminalMaterialCode = value;
|
||||||
|
OnPropertyChanged(nameof(YTypeTerminalMaterialCode));
|
||||||
|
OnPropertyChanged(nameof(TerminalModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 前连接
|
||||||
|
/// </summary>
|
||||||
|
private string _frontConnectorModel;
|
||||||
|
[ExcelColumn(Ignore = true)]
|
||||||
|
public string FrontConnectorModel
|
||||||
|
{
|
||||||
|
get => _frontConnectorModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_frontConnectorModel = value;
|
||||||
|
OnPropertyChanged(nameof(FrontConnectorModel));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 后连接
|
||||||
|
/// </summary>
|
||||||
|
private string _backConnectorModel;
|
||||||
|
[ExcelColumn(Ignore = true)]
|
||||||
|
public string BackConnectorModel
|
||||||
|
{
|
||||||
|
get => _backConnectorModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_backConnectorModel = value;
|
||||||
|
OnPropertyChanged(nameof(BackConnectorModel));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[ExcelColumn(Ignore = true)]
|
||||||
|
public List<MultiCoreWireTerminalModel> TerminalModels
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// 将所有类型的端子模型组合成一个列表
|
||||||
|
return [
|
||||||
|
new MultiCoreWireTerminalModel
|
||||||
|
{
|
||||||
|
TerminalModel = ForkTerminal,
|
||||||
|
TerminalStripLength = ForkTerminalStripLength,
|
||||||
|
TerminalMaterialCode = ForkTerminalMaterialCode
|
||||||
|
},
|
||||||
|
new MultiCoreWireTerminalModel
|
||||||
|
{
|
||||||
|
TerminalModel = FlatTerminal,
|
||||||
|
TerminalStripLength = FlatTerminalStripLength,
|
||||||
|
TerminalMaterialCode = FlatTerminalMaterialCode
|
||||||
|
},
|
||||||
|
new MultiCoreWireTerminalModel
|
||||||
|
{
|
||||||
|
TerminalModel = OTypeTerminal,
|
||||||
|
TerminalStripLength = OTypeTerminalStripLength,
|
||||||
|
TerminalMaterialCode = OTypeTerminalMaterialCode
|
||||||
|
},
|
||||||
|
new MultiCoreWireTerminalModel
|
||||||
|
{
|
||||||
|
TerminalModel = PinTerminal,
|
||||||
|
TerminalStripLength = PinTerminalStripLength,
|
||||||
|
TerminalMaterialCode = PinTerminalMaterialCode
|
||||||
|
},
|
||||||
|
new MultiCoreWireTerminalModel
|
||||||
|
{
|
||||||
|
TerminalModel = YTypeTerminal,
|
||||||
|
TerminalStripLength = YTypeTerminalStripLength,
|
||||||
|
TerminalMaterialCode = YTypeTerminalMaterialCode
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
public void OnPropertyChanged(string propertyName)
|
||||||
|
{
|
||||||
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
using MiniExcelLibs.Attributes;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Sinvo.EplanHpD.Plugin.WPFUI.Models.MultiCoreWire
|
||||||
|
{
|
||||||
|
public class MultiCoreWireTerminalModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 端子型号
|
||||||
|
/// </summary>
|
||||||
|
public string TerminalModel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 端子剥线长度(mm)
|
||||||
|
public double TerminalStripLength { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 端子物料编码
|
||||||
|
/// </summary>
|
||||||
|
public string TerminalMaterialCode { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -253,6 +253,7 @@
|
||||||
<Compile Include="Extension\CheckedModelExt.cs" />
|
<Compile Include="Extension\CheckedModelExt.cs" />
|
||||||
<Compile Include="Extension\MotorModelUniqueFlagExt.cs" />
|
<Compile Include="Extension\MotorModelUniqueFlagExt.cs" />
|
||||||
<Compile Include="Extension\PropertyListExt.cs" />
|
<Compile Include="Extension\PropertyListExt.cs" />
|
||||||
|
<Compile Include="Models\MultiCoreWire\MultiCoreWireTerminalModel.cs" />
|
||||||
<Compile Include="Models\WireCheck\CheckedModel.cs" />
|
<Compile Include="Models\WireCheck\CheckedModel.cs" />
|
||||||
<Compile Include="Models\ConfigItemModel.cs" />
|
<Compile Include="Models\ConfigItemModel.cs" />
|
||||||
<Compile Include="Models\WireCheck\ExcelModel.cs" />
|
<Compile Include="Models\WireCheck\ExcelModel.cs" />
|
||||||
|
@ -308,6 +309,9 @@
|
||||||
<Compile Include="View\LoginWindow.xaml.cs">
|
<Compile Include="View\LoginWindow.xaml.cs">
|
||||||
<DependentUpon>LoginWindow.xaml</DependentUpon>
|
<DependentUpon>LoginWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="View\MultiCoreWire\LayoutHelper\MultiCoreWireLayoutHelperWindow.xaml.cs">
|
||||||
|
<DependentUpon>MultiCoreWireLayoutHelperWindow.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="View\MultiCoreWire\MultiCoreWireWindow.xaml.cs">
|
<Compile Include="View\MultiCoreWire\MultiCoreWireWindow.xaml.cs">
|
||||||
<DependentUpon>MultiCoreWireWindow.xaml</DependentUpon>
|
<DependentUpon>MultiCoreWireWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -348,6 +352,10 @@
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="View\MultiCoreWire\LayoutHelper\MultiCoreWireLayoutHelperWindow.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="View\MultiCoreWire\MultiCoreWireWindow.xaml">
|
<Page Include="View\MultiCoreWire\MultiCoreWireWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|
|
@ -39,6 +39,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils
|
||||||
var data = MiniExcel.Query<MultiCoreWireLecModel>(dataFileStream,sheetName: "多芯线WPS数据配对");
|
var data = MiniExcel.Query<MultiCoreWireLecModel>(dataFileStream,sheetName: "多芯线WPS数据配对");
|
||||||
//MiniExcel.Query()
|
//MiniExcel.Query()
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
|
||||||
|
<hc:GlowWindow
|
||||||
|
x:Class="Sinvo.EplanHpD.Plugin.WPFUI.View.MultiCoreWire.LayoutHelper.MultiCoreWireLayoutHelperWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
xmlns:local="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.View.MultiCoreWire.LayoutHelper"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
Title="布线助手"
|
||||||
|
Width="450"
|
||||||
|
Height="260"
|
||||||
|
MinWidth="450"
|
||||||
|
MinHeight="260"
|
||||||
|
ActiveGlowColor="{DynamicResource PrimaryColor}"
|
||||||
|
Background="White"
|
||||||
|
FontSize="14"
|
||||||
|
Left="1460"
|
||||||
|
Loaded="GlowWindow_Loaded"
|
||||||
|
Top="770"
|
||||||
|
WindowStartupLocation="Manual"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Window.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Window.Resources>
|
||||||
|
<Border Background="{DynamicResource MainContentForegroundDrawingBrush}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="50" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="50" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Grid.Row="0"
|
||||||
|
Margin="10"
|
||||||
|
VerticalAlignment="Center">
|
||||||
|
<TextBlock FontSize="14">
|
||||||
|
<Run Text="应用场景:" />
|
||||||
|
<Run
|
||||||
|
FontSize="16"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Foreground="#c92d28"
|
||||||
|
Text="触摸屏" />
|
||||||
|
</TextBlock>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<DataGrid Grid.Row="1" AutoGenerateColumns="False">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Header="序号" />
|
||||||
|
<DataGridTextColumn MinWidth="240" Header="线型号" />
|
||||||
|
<DataGridComboBoxColumn Header="已布线" />
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Grid.Row="4"
|
||||||
|
Margin="10"
|
||||||
|
VerticalAlignment="Center">
|
||||||
|
<DockPanel HorizontalAlignment="Stretch">
|
||||||
|
<Button
|
||||||
|
Click="PrevBtn_Click"
|
||||||
|
Content="上一根线"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
IsEnabled="{Binding HasPrev}"
|
||||||
|
Style="{StaticResource ButtonDanger}" />
|
||||||
|
<Button
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Click="NextBtn_Click"
|
||||||
|
Content="下一根线"
|
||||||
|
DockPanel.Dock="Right"
|
||||||
|
IsEnabled="{Binding HasNext}"
|
||||||
|
Style="{StaticResource ButtonPrimary}" />
|
||||||
|
</DockPanel>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</hc:GlowWindow>
|
|
@ -0,0 +1,33 @@
|
||||||
|
using HandyControl.Controls;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Sinvo.EplanHpD.Plugin.WPFUI.View.MultiCoreWire.LayoutHelper
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// MultiCoreWireLayoutHerlpWindow.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class MultiCoreWireLayoutHelperWindow : GlowWindow
|
||||||
|
{
|
||||||
|
public MultiCoreWireLayoutHelperWindow()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GlowWindow_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,8 +8,8 @@
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:multicorewireviewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel"
|
xmlns:multicorewireviewmodel="clr-namespace:Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel"
|
||||||
Title="多芯线数据抓取"
|
Title="多芯线数据抓取"
|
||||||
Width="850"
|
Width="1200"
|
||||||
Height="450"
|
Height="600"
|
||||||
d:DataContext="{d:DesignInstance Type=multicorewireviewmodel:MultiCoreWireViewModel}"
|
d:DataContext="{d:DesignInstance Type=multicorewireviewmodel:MultiCoreWireViewModel}"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
|
@ -21,335 +21,382 @@
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<TabControl>
|
<Grid>
|
||||||
<TabItem Header="多芯线选型">
|
<Grid.RowDefinitions>
|
||||||
<Grid Margin="0">
|
<RowDefinition Height="80" />
|
||||||
<Grid.RowDefinitions>
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="210" />
|
</Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
</Grid.RowDefinitions>
|
<hc:SimpleStackPanel
|
||||||
<Border
|
MinWidth="200"
|
||||||
Grid.Row="0"
|
Margin="10"
|
||||||
Margin="10"
|
VerticalAlignment="Center"
|
||||||
VerticalAlignment="Top"
|
Orientation="Vertical">
|
||||||
Style="{StaticResource BorderRegion}">
|
<hc:SimpleStackPanel.Resources>
|
||||||
<Grid>
|
<Style BasedOn="{StaticResource TextBoxExtend}" TargetType="hc:TextBox">
|
||||||
<Grid.RowDefinitions>
|
<Setter Property="Margin" Value="2" />
|
||||||
<RowDefinition Height="*" />
|
</Style>
|
||||||
<RowDefinition Height="30" />
|
</hc:SimpleStackPanel.Resources>
|
||||||
</Grid.RowDefinitions>
|
<hc:TextBox hc:TitleElement.Title="机构编号" hc:TitleElement.TitlePlacement="Left" />
|
||||||
<Grid.ColumnDefinitions>
|
<hc:TextBox hc:TitleElement.Title="机构名称" hc:TitleElement.TitlePlacement="Left" />
|
||||||
<ColumnDefinition Width="200" />
|
</hc:SimpleStackPanel>
|
||||||
<ColumnDefinition Width="*" />
|
<Button
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<hc:SimpleStackPanel
|
|
||||||
Grid.Column="0"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Orientation="Vertical">
|
|
||||||
<hc:SimpleStackPanel.Resources>
|
|
||||||
<Style BasedOn="{StaticResource TextBlockBaseStyle}" TargetType="TextBlock">
|
|
||||||
<Setter Property="MinWidth" Value="80" />
|
|
||||||
</Style>
|
|
||||||
</hc:SimpleStackPanel.Resources>
|
|
||||||
<hc:SimpleStackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
|
||||||
<hc:SimpleStackPanel
|
|
||||||
MinWidth="200"
|
|
||||||
Margin="2"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="应用场景:" />
|
|
||||||
<hc:ComboBox
|
|
||||||
MinWidth="100"
|
|
||||||
Margin="10,0"
|
|
||||||
ItemsSource="{Binding ApplicationScenarios}"
|
|
||||||
SelectedValue="{Binding ApplicationScenario}" />
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
<!--<hc:SimpleStackPanel
|
|
||||||
Margin="2"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="类型:" />
|
|
||||||
<hc:ComboBox
|
|
||||||
MinWidth="100"
|
|
||||||
Margin="10,0"
|
Margin="10,0"
|
||||||
SelectedValue="{Binding WireType, Mode=TwoWay}"
|
Content="布线助手"
|
||||||
SelectedValuePath="Content">
|
Style="{StaticResource ButtonSuccess}" />
|
||||||
<ComboBoxItem Content="插头+端子" />
|
<Button
|
||||||
<ComboBoxItem Content="端子+端子" />
|
Margin="10,0"
|
||||||
</hc:ComboBox>
|
Content="导出下单表"
|
||||||
</hc:SimpleStackPanel>-->
|
Style="{StaticResource ButtonSuccess}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<hc:SimpleStackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
<TabControl Grid.Row="1">
|
||||||
<hc:SimpleStackPanel
|
<TabItem Header="多芯线选型">
|
||||||
MinWidth="200"
|
<Grid Margin="0">
|
||||||
Margin="2"
|
<Grid.RowDefinitions>
|
||||||
VerticalAlignment="Center"
|
<RowDefinition Height="210" />
|
||||||
Orientation="Horizontal">
|
<RowDefinition Height="*" />
|
||||||
<TextBlock VerticalAlignment="Center" Text="线径规格:" />
|
</Grid.RowDefinitions>
|
||||||
<hc:ComboBox
|
<Border
|
||||||
MinWidth="100"
|
Grid.Row="0"
|
||||||
Margin="10,0"
|
Margin="10"
|
||||||
ItemsSource="{Binding WireDiameterSpecifications}"
|
VerticalAlignment="Top"
|
||||||
SelectedValue="{Binding WireDiameterSpecification}" />
|
Style="{StaticResource BorderRegion}">
|
||||||
</hc:SimpleStackPanel>
|
<Grid>
|
||||||
</hc:SimpleStackPanel>
|
<Grid.RowDefinitions>
|
||||||
<hc:SimpleStackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
<RowDefinition Height="*" />
|
||||||
<hc:SimpleStackPanel
|
<RowDefinition Height="30" />
|
||||||
MinWidth="200"
|
</Grid.RowDefinitions>
|
||||||
Margin="2"
|
<Grid.ColumnDefinitions>
|
||||||
VerticalAlignment="Center"
|
<ColumnDefinition Width="200" />
|
||||||
Orientation="Horizontal">
|
<ColumnDefinition Width="*" />
|
||||||
<TextBlock VerticalAlignment="Center" Text="是否高柔:" />
|
</Grid.ColumnDefinitions>
|
||||||
<hc:ComboBox
|
|
||||||
MinWidth="100"
|
|
||||||
Margin="10,0"
|
|
||||||
SelectedValue="{Binding HighFlexibility, Mode=TwoWay}"
|
|
||||||
SelectedValuePath="Content">
|
|
||||||
<ComboBoxItem Content="是" />
|
|
||||||
<ComboBoxItem Content="否" />
|
|
||||||
<ComboBoxItem Content="" />
|
|
||||||
</hc:ComboBox>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
<hc:SimpleStackPanel
|
<hc:SimpleStackPanel
|
||||||
MinWidth="200"
|
Grid.Column="0"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Top"
|
||||||
Orientation="Horizontal">
|
Orientation="Vertical">
|
||||||
<hc:SimpleStackPanel
|
<hc:SimpleStackPanel.Resources>
|
||||||
MinWidth="200"
|
<Style BasedOn="{StaticResource TextBlockBaseStyle}" TargetType="TextBlock">
|
||||||
Margin="2"
|
<Setter Property="MinWidth" Value="80" />
|
||||||
VerticalAlignment="Center"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock VerticalAlignment="Center" Text="线芯数量:" />
|
|
||||||
<hc:ComboBox
|
|
||||||
MinWidth="100"
|
|
||||||
Margin="10,0"
|
|
||||||
ItemsSource="{Binding WireCores}"
|
|
||||||
SelectedValue="{Binding WireCoreCount}" />
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
<hc:SimpleStackPanel
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="2"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Orientation="Vertical">
|
|
||||||
<Grid VerticalAlignment="Top">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
<RowDefinition Height="*" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<GroupBox Grid.Row="0" Grid.Column="0">
|
|
||||||
<GroupBox.Header>
|
|
||||||
<TextBlock Text="前" />
|
|
||||||
</GroupBox.Header>
|
|
||||||
<hc:SimpleStackPanel
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="2"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
Orientation="Vertical">
|
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
MinWidth="70"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="连接物:" />
|
|
||||||
<hc:ComboBox MinWidth="100" Margin="10,0">
|
|
||||||
<ComboBoxItem Content="端子" />
|
|
||||||
<ComboBoxItem Content="插头" />
|
|
||||||
</hc:ComboBox>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
MinWidth="70"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="型号:" />
|
|
||||||
<hc:ComboBox MinWidth="100" Margin="10,0">
|
|
||||||
<ComboBoxItem Content="端子" />
|
|
||||||
<ComboBoxItem Content="插头" />
|
|
||||||
</hc:ComboBox>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</GroupBox>
|
|
||||||
<GroupBox Grid.Row="0" Grid.Column="1">
|
|
||||||
<GroupBox.Header>
|
|
||||||
<TextBlock Text="后" />
|
|
||||||
</GroupBox.Header>
|
|
||||||
<hc:SimpleStackPanel Margin="2" Orientation="Vertical">
|
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
MinWidth="70"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="连接物:" />
|
|
||||||
<hc:ComboBox MinWidth="100" Margin="10,0">
|
|
||||||
<ComboBoxItem Content="端子" />
|
|
||||||
<ComboBoxItem Content="插头" />
|
|
||||||
</hc:ComboBox>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
MinWidth="70"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="型号:" />
|
|
||||||
<hc:ComboBox MinWidth="100" Margin="10,0">
|
|
||||||
<ComboBoxItem Content="端子" />
|
|
||||||
<ComboBoxItem Content="插头" />
|
|
||||||
</hc:ComboBox>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</GroupBox>
|
|
||||||
</Grid>
|
|
||||||
<hc:SimpleStackPanel
|
|
||||||
Margin="2"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
MinWidth="70"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="线材型号:" />
|
|
||||||
<hc:ComboBox
|
|
||||||
MinWidth="300"
|
|
||||||
Margin="10,0"
|
|
||||||
AutoComplete="True"
|
|
||||||
IsEditable="True"
|
|
||||||
ItemsSource="{Binding WireModelSpecifications}"
|
|
||||||
SelectedValue="{Binding WireModelSpecification}" />
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
<DockPanel
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="0"
|
|
||||||
Grid.ColumnSpan="2">
|
|
||||||
<hc:SimpleStackPanel
|
|
||||||
Margin="2"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
DockPanel.Dock="Left"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<Button
|
|
||||||
Click="SaveLecToLine_Click"
|
|
||||||
Content="保存选择的线"
|
|
||||||
Style="{StaticResource ButtonSuccess}" />
|
|
||||||
<Button
|
|
||||||
Margin="10,0"
|
|
||||||
Click="ClearLecData_Click"
|
|
||||||
Content="清除选择"
|
|
||||||
Style="{StaticResource ButtonWarning}" />
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
<hc:SimpleStackPanel DockPanel.Dock="Right">
|
|
||||||
<Button
|
|
||||||
Margin="10,0"
|
|
||||||
HorizontalAlignment="Right"
|
|
||||||
Click="ClearLecLine_Click"
|
|
||||||
Content="清空选中的线"
|
|
||||||
Style="{StaticResource ButtonDanger}" />
|
|
||||||
</hc:SimpleStackPanel>
|
|
||||||
</DockPanel>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
<DataGrid
|
|
||||||
Grid.Row="1"
|
|
||||||
AutoGenerateColumns="False"
|
|
||||||
ItemsSource="{Binding LecWires}">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn Binding="{Binding ApplicationScenario}" Header="应用场景" />
|
|
||||||
<DataGridTextColumn Binding="{Binding WireType}" Header="类型" />
|
|
||||||
<DataGridTextColumn Binding="{Binding WireDiameterSpecification}" Header="线径规格(mm²)" />
|
|
||||||
<DataGridTextColumn Binding="{Binding IsHighFlexibilityStr}" Header="是否高柔" />
|
|
||||||
<DataGridTextColumn Binding="{Binding WireCoreCount}" Header="线芯数量" />
|
|
||||||
<DataGridTextColumn Binding="{Binding WireModelSpecification}" Header="线材型号" />
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</Grid>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="数据抓取">
|
|
||||||
<ListBox
|
|
||||||
Padding="0"
|
|
||||||
HorizontalContentAlignment="Stretch"
|
|
||||||
Focusable="True"
|
|
||||||
ItemsSource="{Binding Wires}"
|
|
||||||
ScrollViewer.CanContentScroll="False"
|
|
||||||
VirtualizingPanel.ScrollUnit="Pixel">
|
|
||||||
<ListBox.Resources>
|
|
||||||
<Style BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="{x:Type ListBox}">
|
|
||||||
<Style.Setters>
|
|
||||||
<Setter Property="Padding" Value="0" />
|
|
||||||
</Style.Setters>
|
|
||||||
</Style>
|
|
||||||
</ListBox.Resources>
|
|
||||||
<ListBox.ItemContainerStyle>
|
|
||||||
<Style BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="{x:Type ListBoxItem}">
|
|
||||||
<Style.Setters>
|
|
||||||
<Setter Property="Padding" Value="0" />
|
|
||||||
</Style.Setters>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsSelected" Value="True">
|
|
||||||
<Setter Property="Background" Value="#E0E0E0" />
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</ListBox.ItemContainerStyle>
|
|
||||||
<ListBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border>
|
|
||||||
<Expander>
|
|
||||||
<Expander.Resources>
|
|
||||||
<Style BasedOn="{StaticResource ExpanderBaseStyle}" TargetType="Expander">
|
|
||||||
<Setter Property="Background" Value="#CC002255" />
|
|
||||||
</Style>
|
</Style>
|
||||||
</Expander.Resources>
|
</hc:SimpleStackPanel.Resources>
|
||||||
<Expander.Header>
|
<hc:SimpleStackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
<hc:SimpleStackPanel
|
||||||
<TextBlock
|
MinWidth="200"
|
||||||
VerticalAlignment="Center"
|
Margin="2"
|
||||||
Foreground="White"
|
VerticalAlignment="Center"
|
||||||
Text="{Binding WireModelSpecification}" />
|
Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="应用场景:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="100"
|
||||||
|
Margin="10,0"
|
||||||
|
ItemsSource="{Binding ApplicationScenarios}"
|
||||||
|
SelectedValue="{Binding ApplicationScenario}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
</Expander.Header>
|
</hc:SimpleStackPanel>
|
||||||
<ItemsControl ItemsSource="{Binding Children}">
|
<hc:SimpleStackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
<ItemsControl.ItemsPanel>
|
<hc:SimpleStackPanel
|
||||||
<ItemsPanelTemplate>
|
MinWidth="200"
|
||||||
<WrapPanel Margin="5" IsItemsHost="True" />
|
Margin="2"
|
||||||
</ItemsPanelTemplate>
|
VerticalAlignment="Center"
|
||||||
</ItemsControl.ItemsPanel>
|
Orientation="Horizontal">
|
||||||
<ItemsControl.ItemTemplate>
|
<TextBlock VerticalAlignment="Center" Text="线径规格:" />
|
||||||
<DataTemplate>
|
<hc:ComboBox
|
||||||
<Border
|
MinWidth="100"
|
||||||
Margin="10,0"
|
Margin="10,0"
|
||||||
BorderBrush="{Binding WireColorHex}"
|
IsEnabled="{Binding ApplicationScenarioSelected}"
|
||||||
BorderThickness="0,0,0,2">
|
ItemsSource="{Binding WireDiameterSpecifications}"
|
||||||
<hc:SimpleStackPanel>
|
SelectedValue="{Binding WireDiameterSpecification}" />
|
||||||
<TextBlock Margin="2">
|
</hc:SimpleStackPanel>
|
||||||
<Run Text="线芯名称:" />
|
</hc:SimpleStackPanel>
|
||||||
<Run Text="{Binding WireModelSpecification}" />
|
<hc:SimpleStackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
</TextBlock>
|
<hc:SimpleStackPanel
|
||||||
<TextBlock Margin="2">
|
MinWidth="200"
|
||||||
<Run Text="线芯颜色:" />
|
Margin="2"
|
||||||
<Run Text="{Binding WireColorName}" />
|
VerticalAlignment="Center"
|
||||||
</TextBlock>
|
Orientation="Horizontal">
|
||||||
<TextBlock Margin="2">
|
<TextBlock VerticalAlignment="Center" Text="是否高柔:" />
|
||||||
<Run Text="前端子:" />
|
<hc:ComboBox
|
||||||
<Run Text="{Binding FrontTerminalModel}" />
|
MinWidth="100"
|
||||||
</TextBlock>
|
Margin="10,0"
|
||||||
<TextBlock Margin="2">
|
IsEnabled="{Binding ApplicationScenarioSelected}"
|
||||||
<Run Text="后端子:" />
|
SelectedValue="{Binding HighFlexibility, Mode=TwoWay}"
|
||||||
<Run Text="{Binding BackTerminalModel}" />
|
SelectedValuePath="Content">
|
||||||
</TextBlock>
|
<ComboBoxItem Content="是" />
|
||||||
</hc:SimpleStackPanel>
|
<ComboBoxItem Content="否" />
|
||||||
</Border>
|
<ComboBoxItem Content="" />
|
||||||
</DataTemplate>
|
</hc:ComboBox>
|
||||||
</ItemsControl.ItemTemplate>
|
</hc:SimpleStackPanel>
|
||||||
</ItemsControl>
|
</hc:SimpleStackPanel>
|
||||||
</Expander>
|
<hc:SimpleStackPanel
|
||||||
</Border>
|
MinWidth="200"
|
||||||
</DataTemplate>
|
VerticalAlignment="Center"
|
||||||
</ListBox.ItemTemplate>
|
Orientation="Horizontal">
|
||||||
</ListBox>
|
<hc:SimpleStackPanel
|
||||||
</TabItem>
|
MinWidth="200"
|
||||||
</TabControl>
|
Margin="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="线芯数量:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="100"
|
||||||
|
Margin="10,0"
|
||||||
|
IsEnabled="{Binding ApplicationScenarioSelected}"
|
||||||
|
ItemsSource="{Binding WireCores}"
|
||||||
|
SelectedValue="{Binding WireCoreCount}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="2"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
IsEnabled="{Binding ApplicationScenarioSelected}"
|
||||||
|
Orientation="Vertical">
|
||||||
|
<Grid VerticalAlignment="Top">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<GroupBox Grid.Row="0" Grid.Column="0">
|
||||||
|
<GroupBox.Header>
|
||||||
|
<TextBlock Text="前" />
|
||||||
|
</GroupBox.Header>
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="2"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Orientation="Vertical">
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
MinWidth="70"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="连接物:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="100"
|
||||||
|
Margin="10,0"
|
||||||
|
SelectedValue="{Binding FrontConnectorType}"
|
||||||
|
SelectedValuePath="Content">
|
||||||
|
<ComboBoxItem Content="端子" />
|
||||||
|
<ComboBoxItem Content="插头" />
|
||||||
|
</hc:ComboBox>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
MinWidth="70"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="型号:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="100"
|
||||||
|
Margin="10,0"
|
||||||
|
DisplayMemberPath="TerminalModel"
|
||||||
|
ItemsSource="{Binding FrontConnectorModels}"
|
||||||
|
SelectedValue="{Binding FrontConnectorModel}"
|
||||||
|
SelectedValuePath="TerminalModel" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</GroupBox>
|
||||||
|
<GroupBox Grid.Row="0" Grid.Column="1">
|
||||||
|
<GroupBox.Header>
|
||||||
|
<TextBlock Text="后" />
|
||||||
|
</GroupBox.Header>
|
||||||
|
<hc:SimpleStackPanel Margin="2" Orientation="Vertical">
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
MinWidth="70"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="连接物:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="100"
|
||||||
|
Margin="10,0"
|
||||||
|
SelectedValue="{Binding BackConnectorType}"
|
||||||
|
SelectedValuePath="Content">
|
||||||
|
<ComboBoxItem Content="端子" />
|
||||||
|
<ComboBoxItem Content="插头" />
|
||||||
|
</hc:ComboBox>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
MinWidth="70"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="型号:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="100"
|
||||||
|
Margin="10,0"
|
||||||
|
DisplayMemberPath="TerminalModel"
|
||||||
|
ItemsSource="{Binding BackConnectorModels}"
|
||||||
|
SelectedValue="{Binding BackConnectorModel}"
|
||||||
|
SelectedValuePath="TerminalModel" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</GroupBox>
|
||||||
|
</Grid>
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Margin="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
MinWidth="70"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="线材型号:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="300"
|
||||||
|
Margin="10,0"
|
||||||
|
ItemsSource="{Binding WireModelSpecifications}"
|
||||||
|
SelectedValue="{Binding WireModelSpecification}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<DockPanel
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2">
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Margin="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
DockPanel.Dock="Left"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Button
|
||||||
|
Click="SaveLecToLine_Click"
|
||||||
|
Content="保存选择的线"
|
||||||
|
Style="{StaticResource ButtonSuccess}" />
|
||||||
|
<Button
|
||||||
|
Margin="10,0"
|
||||||
|
Click="ClearLecData_Click"
|
||||||
|
Content="清除选择"
|
||||||
|
Style="{StaticResource ButtonWarning}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel DockPanel.Dock="Right">
|
||||||
|
<Button
|
||||||
|
Margin="10,0"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Click="ClearLecLine_Click"
|
||||||
|
Content="清空选中的线"
|
||||||
|
Style="{StaticResource ButtonDanger}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</DockPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<DataGrid
|
||||||
|
Grid.Row="1"
|
||||||
|
AutoGenerateColumns="False"
|
||||||
|
IsReadOnly="True"
|
||||||
|
ItemsSource="{Binding LecWires}">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<!--<DataGridTextColumn Binding="{Binding SeqNo}" Header="序号" />-->
|
||||||
|
<DataGridTextColumn Binding="{Binding ApplicationScenario}" Header="应用场景" />
|
||||||
|
<DataGridTextColumn Binding="{Binding WireDiameterSpecification}" Header="线径规格(mm²)" />
|
||||||
|
<DataGridTextColumn Binding="{Binding IsHighFlexibilityStr}" Header="是否高柔" />
|
||||||
|
<DataGridTextColumn Binding="{Binding WireCoreCount}" Header="线芯数量" />
|
||||||
|
<DataGridTextColumn Binding="{Binding WireModelSpecification}" Header="线材型号" />
|
||||||
|
<DataGridTextColumn Binding="{Binding FrontConnectorModel}" Header="前连接物型号" />
|
||||||
|
<DataGridTextColumn Binding="{Binding BackConnectorModel}" Header="后连接物型号" />
|
||||||
|
<DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<hc:SimpleStackPanel>
|
||||||
|
<Button
|
||||||
|
Click="DeleteItemBtn_Click"
|
||||||
|
Content="删除"
|
||||||
|
Style="{StaticResource ButtonDanger}"
|
||||||
|
Tag="{Binding SeqNo}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
</Grid>
|
||||||
|
</TabItem>
|
||||||
|
<TabItem Header="数据抓取">
|
||||||
|
<ListBox
|
||||||
|
Padding="0"
|
||||||
|
HorizontalContentAlignment="Stretch"
|
||||||
|
Focusable="True"
|
||||||
|
ItemsSource="{Binding Wires}"
|
||||||
|
ScrollViewer.CanContentScroll="False"
|
||||||
|
VirtualizingPanel.ScrollUnit="Pixel">
|
||||||
|
<ListBox.Resources>
|
||||||
|
<Style BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="{x:Type ListBox}">
|
||||||
|
<Style.Setters>
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
</Style.Setters>
|
||||||
|
</Style>
|
||||||
|
</ListBox.Resources>
|
||||||
|
<ListBox.ItemContainerStyle>
|
||||||
|
<Style BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="{x:Type ListBoxItem}">
|
||||||
|
<Style.Setters>
|
||||||
|
<Setter Property="Padding" Value="0" />
|
||||||
|
</Style.Setters>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsSelected" Value="True">
|
||||||
|
<Setter Property="Background" Value="#E0E0E0" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ListBox.ItemContainerStyle>
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border>
|
||||||
|
<Expander>
|
||||||
|
<Expander.Resources>
|
||||||
|
<Style BasedOn="{StaticResource ExpanderBaseStyle}" TargetType="Expander">
|
||||||
|
<Setter Property="Background" Value="#CC002255" />
|
||||||
|
</Style>
|
||||||
|
</Expander.Resources>
|
||||||
|
<Expander.Header>
|
||||||
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="White"
|
||||||
|
Text="{Binding WireModelSpecification}" />
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</Expander.Header>
|
||||||
|
<ItemsControl ItemsSource="{Binding Children}">
|
||||||
|
<ItemsControl.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<WrapPanel Margin="5" IsItemsHost="True" />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ItemsControl.ItemsPanel>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border
|
||||||
|
Margin="10,0"
|
||||||
|
BorderBrush="{Binding WireColorHex}"
|
||||||
|
BorderThickness="0,0,0,2">
|
||||||
|
<hc:SimpleStackPanel>
|
||||||
|
<TextBlock Margin="2">
|
||||||
|
<Run Text="线芯名称:" />
|
||||||
|
<Run Text="{Binding WireModelSpecification}" />
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Margin="2">
|
||||||
|
<Run Text="线芯颜色:" />
|
||||||
|
<Run Text="{Binding WireColorName}" />
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Margin="2">
|
||||||
|
<Run Text="前端子:" />
|
||||||
|
<Run Text="{Binding FrontTerminalModel}" />
|
||||||
|
</TextBlock>
|
||||||
|
<TextBlock Margin="2">
|
||||||
|
<Run Text="后端子:" />
|
||||||
|
<Run Text="{Binding BackTerminalModel}" />
|
||||||
|
</TextBlock>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</Expander>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||||
|
using Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
{
|
{
|
||||||
|
@ -35,5 +37,17 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
{
|
{
|
||||||
viewModel.ClearLecLines();
|
viewModel.ClearLecLines();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DeleteItemBtn_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if(sender is Button btn)
|
||||||
|
{
|
||||||
|
int? seqNo = (int)btn.Tag;
|
||||||
|
if(seqNo != null)
|
||||||
|
{
|
||||||
|
viewModel.DeleteLecWireItem(seqNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ using EPLAN.Harness.ProjectCore;
|
||||||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||||||
using MiniExcelLibs.Attributes;
|
using MiniExcelLibs.Attributes;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||||
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models.MultiCoreWire;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Utils;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
using System;
|
using System;
|
||||||
|
@ -48,6 +49,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private string _applicationScenario;
|
private string _applicationScenario;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应用场景
|
/// 应用场景
|
||||||
|
@ -58,11 +60,27 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_applicationScenario = value;
|
_applicationScenario = value;
|
||||||
|
|
||||||
|
ApplicationScenarioSelected = !string.IsNullOrEmpty(value);
|
||||||
|
|
||||||
OnPropertyChanged(nameof(ApplicationScenario));
|
OnPropertyChanged(nameof(ApplicationScenario));
|
||||||
|
|
||||||
OnLecChanged(nameof(ApplicationScenario));
|
OnLecChanged(nameof(ApplicationScenario));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool _applicationScenarioSelected;
|
||||||
|
|
||||||
|
public bool ApplicationScenarioSelected
|
||||||
|
{
|
||||||
|
get => _applicationScenarioSelected;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_applicationScenarioSelected = value;
|
||||||
|
OnPropertyChanged(nameof(ApplicationScenarioSelected));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string _wireType;
|
private string _wireType;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材类型
|
/// 线材类型
|
||||||
|
@ -134,46 +152,46 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
OnLecChanged(nameof(WireModelSpecification));
|
OnLecChanged(nameof(WireModelSpecification));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _connectorModel;
|
//private string _connectorModel;
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 插头型号
|
///// 插头型号
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public string ConnectorModel
|
//public string ConnectorModel
|
||||||
{
|
//{
|
||||||
get => _connectorModel;
|
// get => _connectorModel;
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
_connectorModel = value;
|
// _connectorModel = value;
|
||||||
OnPropertyChanged(nameof(ConnectorModel));
|
// OnPropertyChanged(nameof(ConnectorModel));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
private string _frontTerminalModel;
|
//private string _frontTerminalModel;
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 前端子型号
|
///// 前端子型号
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public string FrontTerminalModel
|
//public string FrontTerminalModel
|
||||||
{
|
//{
|
||||||
get => _frontTerminalModel;
|
// get => _frontTerminalModel;
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
_frontTerminalModel = value;
|
// _frontTerminalModel = value;
|
||||||
OnPropertyChanged(nameof(FrontTerminalModel));
|
// OnPropertyChanged(nameof(FrontTerminalModel));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private string _backTerminalModel;
|
//private string _backTerminalModel;
|
||||||
/// <summary>
|
///// <summary>
|
||||||
/// 后端子型号
|
///// 后端子型号
|
||||||
/// </summary>
|
///// </summary>
|
||||||
public string BackTerminalModel
|
//public string BackTerminalModel
|
||||||
{
|
//{
|
||||||
get => _backTerminalModel;
|
// get => _backTerminalModel;
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
_backTerminalModel = value;
|
// _backTerminalModel = value;
|
||||||
OnPropertyChanged(nameof(BackTerminalModel));
|
// OnPropertyChanged(nameof(BackTerminalModel));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
|
||||||
private List<string> _applicationScenarios;
|
private List<string> _applicationScenarios;
|
||||||
|
@ -245,48 +263,138 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<string> _connectorModels;
|
//private List<string> _connectorModels;
|
||||||
|
///// <summary>
|
||||||
|
///// 连接器型号
|
||||||
|
///// </summary>
|
||||||
|
//public List<string> ConnectorModels
|
||||||
|
//{
|
||||||
|
// get => _connectorModels;
|
||||||
|
// set
|
||||||
|
// {
|
||||||
|
// _connectorModels = value;
|
||||||
|
// OnPropertyChanged(nameof(ConnectorModels));
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
private List<MultiCoreWireTerminalModel> _frontConnectorModels;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 连接器型号
|
/// 前连接器型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> ConnectorModels
|
public List<MultiCoreWireTerminalModel> FrontConnectorModels
|
||||||
{
|
{
|
||||||
get => _connectorModels;
|
get => _frontConnectorModels;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_connectorModels = value;
|
_frontConnectorModels = value;
|
||||||
OnPropertyChanged(nameof(ConnectorModels));
|
OnPropertyChanged(nameof(FrontConnectorModels));
|
||||||
}
|
|
||||||
}
|
|
||||||
private List<string> _frontTerminalModels;
|
|
||||||
/// <summary>
|
|
||||||
/// 前端子型号
|
|
||||||
/// </summary>
|
|
||||||
public List<string> FrontTerminalModels
|
|
||||||
{
|
|
||||||
get => _frontTerminalModels;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_frontTerminalModels = value;
|
|
||||||
OnPropertyChanged(nameof(FrontTerminalModels));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private List<string> _backTerminalModels;
|
|
||||||
/// <summary>
|
|
||||||
/// 后端子型号
|
|
||||||
/// </summary>
|
|
||||||
public List<string> BackTerminalModels
|
|
||||||
{
|
|
||||||
get => _backTerminalModels;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_backTerminalModels = value;
|
|
||||||
OnPropertyChanged(nameof(BackTerminalModels));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private List<MultiCoreWireTerminalModel> _backConnectorModels;
|
||||||
|
/// <summary>
|
||||||
|
/// 后连接器型号
|
||||||
|
/// </summary>
|
||||||
|
public List<MultiCoreWireTerminalModel> BackConnectorModels
|
||||||
|
{
|
||||||
|
get => _backConnectorModels;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_backConnectorModels = value;
|
||||||
|
OnPropertyChanged(nameof(BackConnectorModels));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _frontConnectorType;
|
||||||
|
/// <summary>
|
||||||
|
/// 前连接器类型
|
||||||
|
/// </summary>
|
||||||
|
public string FrontConnectorType
|
||||||
|
{
|
||||||
|
get => _frontConnectorType;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_frontConnectorType = value;
|
||||||
|
OnPropertyChanged(nameof(FrontConnectorType));
|
||||||
|
OnFrontTypeChange(FrontConnectorType);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnFrontTypeChange(string type)
|
||||||
|
{
|
||||||
|
if (type == "端子")
|
||||||
|
{
|
||||||
|
FrontConnectorModels = [.. _datas.Where(it => it.WireModelSpecification == WireModelSpecification).FirstOrDefault()?.TerminalModels];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FrontConnectorModels = [new MultiCoreWireTerminalModel {
|
||||||
|
TerminalModel = _datas.Where(it => it.WireModelSpecification == WireModelSpecification).FirstOrDefault()?.ConnectorModel
|
||||||
|
}];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _backConnectorType;
|
||||||
|
/// <summary>
|
||||||
|
/// 后连接器类型
|
||||||
|
/// </summary>
|
||||||
|
public string BackConnectorType
|
||||||
|
{
|
||||||
|
get => _backConnectorType;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_backConnectorType = value;
|
||||||
|
OnPropertyChanged(nameof(BackConnectorType));
|
||||||
|
OnBackTypeChange(BackConnectorType);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void OnBackTypeChange(string type)
|
||||||
|
{
|
||||||
|
if (type == "端子")
|
||||||
|
{
|
||||||
|
BackConnectorModels = [.. _datas.Where(it => it.WireModelSpecification == WireModelSpecification).FirstOrDefault()?.TerminalModels];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
BackConnectorModels = [new MultiCoreWireTerminalModel {
|
||||||
|
TerminalModel = _datas.Where(it => it.WireModelSpecification == WireModelSpecification).FirstOrDefault()?.ConnectorModel
|
||||||
|
}];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//}
|
||||||
|
private string _frontConnectorModel;
|
||||||
|
/// <summary>
|
||||||
|
/// 前连接器型号
|
||||||
|
/// </summary>
|
||||||
|
public string FrontConnectorModel
|
||||||
|
{
|
||||||
|
get => _frontConnectorModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_frontConnectorModel = value;
|
||||||
|
OnPropertyChanged(nameof(FrontConnectorModel));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string _backConnectorModel;
|
||||||
|
/// <summary>
|
||||||
|
/// 后连接器型号
|
||||||
|
/// </summary>
|
||||||
|
public string BackConnectorModel
|
||||||
|
{
|
||||||
|
get => _backConnectorModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_backConnectorModel = value;
|
||||||
|
OnPropertyChanged(nameof(BackConnectorModel));
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
@ -315,10 +423,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
.WhereIF(!string.IsNullOrEmpty(WireModelSpecification), it => it.WireModelSpecification == WireModelSpecification)
|
.WhereIF(!string.IsNullOrEmpty(WireModelSpecification), it => it.WireModelSpecification == WireModelSpecification)
|
||||||
// 线芯数
|
// 线芯数
|
||||||
.WhereIF(!string.IsNullOrEmpty(WireCoreCount), it => it.WireCoreCount == WireCoreCount)
|
.WhereIF(!string.IsNullOrEmpty(WireCoreCount), it => it.WireCoreCount == WireCoreCount)
|
||||||
// 连接器
|
|
||||||
.WhereIF(!string.IsNullOrEmpty(ConnectorModel), it => it.ConnectorModel == ConnectorModel)
|
|
||||||
.WhereIF(!string.IsNullOrEmpty(FrontTerminalModel), it => it.FrontTerminalModel == FrontTerminalModel)
|
|
||||||
.WhereIF(!string.IsNullOrEmpty(BackTerminalModel), it => it.BackTerminalModel == BackTerminalModel)
|
|
||||||
;
|
;
|
||||||
SetDatas(canUsedDatas, propName);
|
SetDatas(canUsedDatas, propName);
|
||||||
}
|
}
|
||||||
|
@ -353,9 +457,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
{
|
{
|
||||||
WireModelSpecification = WireModelSpecifications.FirstOrDefault();
|
WireModelSpecification = WireModelSpecifications.FirstOrDefault();
|
||||||
}
|
}
|
||||||
ConnectorModels = [.. datas.Where(it => !string.IsNullOrEmpty(it.ConnectorModel)).Select(it => it.ConnectorModel).Distinct(), ""];
|
//FrontConnectorModels = [.. datas.Where(it => !string.IsNullOrEmpty(it.FrontTerminalModel)).Select(it => it.FrontTerminalModel).Distinct(), ""];
|
||||||
FrontTerminalModels = [.. datas.Where(it => !string.IsNullOrEmpty(it.FrontTerminalModel)).Select(it => it.FrontTerminalModel).Distinct(), ""];
|
//BackConnectorModels = [.. datas.Where(it => !string.IsNullOrEmpty(it.BackTerminalModel)).Select(it => it.BackTerminalModel).Distinct(), ""];
|
||||||
BackTerminalModels = [.. datas.Where(it => !string.IsNullOrEmpty(it.BackTerminalModel)).Select(it => it.BackTerminalModel).Distinct(), ""];
|
|
||||||
LecChanging = false;
|
LecChanging = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -424,9 +527,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
HighFlexibility = "";
|
HighFlexibility = "";
|
||||||
WireCoreCount = "";
|
WireCoreCount = "";
|
||||||
WireModelSpecification = "";
|
WireModelSpecification = "";
|
||||||
ConnectorModel = "";
|
FrontConnectorType = "";
|
||||||
FrontTerminalModel = "";
|
BackConnectorType = "";
|
||||||
BackTerminalModel = "";
|
|
||||||
|
|
||||||
LecChanging = false;
|
LecChanging = false;
|
||||||
OnLecChanged("");
|
OnLecChanged("");
|
||||||
|
@ -434,8 +536,19 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
|
|
||||||
public void SaveLecToLine()
|
public void SaveLecToLine()
|
||||||
{
|
{
|
||||||
LecWires.Add(new MultiCoreWireLecModel
|
if(ApplicationScenario == null
|
||||||
|
|| WireType == null
|
||||||
|
|| WireDiameterSpecification == null
|
||||||
|
|| HighFlexibility == null
|
||||||
|
|| WireCoreCount == null
|
||||||
|
|| WireModelSpecification == null)
|
||||||
{
|
{
|
||||||
|
MessageBox.Show("有信息未选择!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var wire = new MultiCoreWireLecModel
|
||||||
|
{
|
||||||
|
SeqNo = LecWires.Count + 1,
|
||||||
ApplicationScenario = ApplicationScenario,
|
ApplicationScenario = ApplicationScenario,
|
||||||
WireType = WireType,
|
WireType = WireType,
|
||||||
WireDiameterSpecification = WireDiameterSpecification,
|
WireDiameterSpecification = WireDiameterSpecification,
|
||||||
|
@ -443,15 +556,42 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
IsHighFlexibilityStr = HighFlexibility,
|
IsHighFlexibilityStr = HighFlexibility,
|
||||||
WireCoreCount = WireCoreCount,
|
WireCoreCount = WireCoreCount,
|
||||||
WireModelSpecification = WireModelSpecification,
|
WireModelSpecification = WireModelSpecification,
|
||||||
ConnectorModel = ConnectorModel,
|
FrontConnectorModel = FrontConnectorModel,
|
||||||
FrontTerminalModel = FrontTerminalModel,
|
BackConnectorModel = BackConnectorModel,
|
||||||
BackTerminalModel = BackTerminalModel
|
};
|
||||||
});
|
LecWires.Add(wire);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearLecLines()
|
public void ClearLecLines()
|
||||||
{
|
{
|
||||||
LecWires.Clear();
|
LecWires.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void DeleteLecWireItem(int? seqNo)
|
||||||
|
{
|
||||||
|
if(seqNo != null)
|
||||||
|
{
|
||||||
|
var removeItem = LecWires.FirstOrDefault(it => it.SeqNo == seqNo!);
|
||||||
|
if(removeItem != null)
|
||||||
|
{
|
||||||
|
LecWires.Remove(removeItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReOrderLecWires();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ReOrderLecWires()
|
||||||
|
{
|
||||||
|
int seq = 1;
|
||||||
|
LecWires.OrderBy(it => it.SeqNo).ForEach(it =>
|
||||||
|
{
|
||||||
|
it.SeqNo = seq;
|
||||||
|
seq++;
|
||||||
|
});
|
||||||
|
OnPropertyChanged(nameof(LecWires));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue