105040
增强多芯线模型和视图的功能与稳定性 在 `MultiCoreWireLecDBModel.cs` 中添加了多个新属性,移除旧属性,并增强了文档说明。 在 `ApplicationExt.cs` 中实现了全局异常处理,提升了应用稳定性。 重构 `MultiCoreWireDataModel.cs`,实现数据绑定通知机制,确保 UI 更新及时。 更新 `MultiCoreWireLayoutHelperWindow.xaml` 的样式和数据模板,增强数据可视化。 在 `MultiCoreWireWindow.xaml` 中添加机构信息的绑定,确保用户输入正确。 在 `MultiCoreWireViewModel.cs` 中添加新属性和方法,改进数据处理和导出功能。 重构 `MultiCoreWireLayoutHelperViewModel.cs` 的数据加载逻辑,确保数据一致性和 UI 更新。
This commit is contained in:
parent
27cd690bc6
commit
e40d2ce185
|
|
@ -9,45 +9,42 @@ namespace Sinvo.EplanHpD.Plugin.Service.Model
|
||||||
/*
|
/*
|
||||||
* 应用场景 类型 线径规格(mm2) 是否高柔 线芯数 线材型号规格 插头型号 前端子型号 后端子型号
|
* 应用场景 类型 线径规格(mm2) 是否高柔 线芯数 线材型号规格 插头型号 前端子型号 后端子型号
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
public int SeqNo { get; set; }
|
||||||
|
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
public string UniqueKey { get; set; }
|
public string UniqueKey { get; set; }
|
||||||
public string ProjectName { get; set; }
|
public string ProjectName { get; set; }
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
|
public string WireKey { get; set; }
|
||||||
public int SeqNo { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 应用场景
|
|
||||||
/// </summary>
|
|
||||||
public string ApplicationScenario { get; set; }
|
public string ApplicationScenario { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 线径规格(mm2)
|
|
||||||
/// </summary>
|
|
||||||
public string WireDiameterSpecification { get; set; }
|
public string WireDiameterSpecification { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 是否高柔
|
|
||||||
/// </summary>
|
|
||||||
public string IsHighFlexibilityStr { get; set; }
|
public string IsHighFlexibilityStr { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 线芯数
|
|
||||||
/// </summary>
|
|
||||||
public string WireCoreCount { get; set; }
|
public string WireCoreCount { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材型号规格
|
/// 线材型号规格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WireModelSpecification { get; set; }
|
public string WireModelSpecification { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 线材颜色名
|
||||||
|
/// </summary>
|
||||||
|
public string WireColorName { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 线材长度
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string WireLength { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前连接物型号
|
/// 前连接物型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FrontConnectorModel { get; set; }
|
public string FrontConnectorModel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 前连接物料号
|
||||||
|
/// </summary>
|
||||||
|
public string FrontConnectorMCode { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前连接物数量
|
/// 前连接物数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -58,16 +55,93 @@ namespace Sinvo.EplanHpD.Plugin.Service.Model
|
||||||
/// 后连接物型号
|
/// 后连接物型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string RearConnectorModel { get; set; }
|
public string RearConnectorModel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 后连接物料号
|
||||||
|
/// </summary>
|
||||||
|
public string RearConnectorMCode { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 后连接物数量
|
/// 后连接物数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int RearConnectorQuantity { get; set; }
|
public int RearConnectorQuantity { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 号码管型号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string NumberTubeModel { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 号码管物料编码
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string NumberTubeMCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 号码管长度
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int NumberTubeLength { get; set; }
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public bool FrontConnectorIsPin { get; set; }
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public bool RearConnectorIsPin { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 透明热缩管型号
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string TransparentHeatShrinkTubeModel { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 透明热缩管标示
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string TransparentHeatShrinkTubeDesc { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 透明热缩管物料编码
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string TransparentHeatShrinkTubeMCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 黑色热缩管型号(插头)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string BlackHeatShrinkTubeModel { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 黑色热缩管物料编码(插头)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string BlackHeatShrinkTubeMCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 黑色热缩管型号(剥线后)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string BlackHeatShrinkTubeModelAfterStripping { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 黑色热缩管物料编码(剥线后)
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string BlackHeatShrinkTubeMCodeAfterStripping { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否已布线
|
/// 热缩管标识
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Layouted { get; set; } = false;
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public string HeatShrinkTubeDesc { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 前段子剥线长度
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int FrontStrippingLength { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 后段子剥线长度
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public int RearStrippingLength { get; set; }
|
||||||
|
|
||||||
|
public bool Layouted { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
|
||||||
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension
|
namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension
|
||||||
|
|
@ -36,9 +37,16 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension
|
||||||
Resources = new ResourceDictionary
|
Resources = new ResourceDictionary
|
||||||
{
|
{
|
||||||
Source = new Uri("pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml")
|
Source = new Uri("pack://application:,,,/Sinvo.EplanHpD.Plugin.WPFUI;component/Themes/Theme.xaml")
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
||||||
|
{
|
||||||
|
HandyControl.Controls.MessageBox.Show($"{sender.GetType()}: {e.Exception.Message}");
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,157 +1,732 @@
|
||||||
using MiniExcelLibs.Attributes;
|
using MiniExcelLibs.Attributes;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
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 MultiCoreWireDataModel
|
public class MultiCoreWireDataModel : CheckedModel,INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
private int _seqNo;
|
||||||
|
public int SeqNo
|
||||||
|
{
|
||||||
|
get => _seqNo;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_seqNo != value)
|
||||||
|
{
|
||||||
|
_seqNo = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int SeqNo { get; set; }
|
private string _id;
|
||||||
|
public string Id
|
||||||
|
{
|
||||||
|
get => _id;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_id != value)
|
||||||
|
{
|
||||||
|
_id = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string Id { get; set; }
|
private string _uniqueKey;
|
||||||
public string UniqueKey { get; set; }
|
public string UniqueKey
|
||||||
public string ProjectName { get; set; }
|
{
|
||||||
public string UserId { get; set; }
|
get => _uniqueKey;
|
||||||
public string WireKey { get; set; }
|
set
|
||||||
public string ApplicationScenario { get; set; }
|
{
|
||||||
public string WireDiameterSpecification { get; set; }
|
if (_uniqueKey != value)
|
||||||
public string IsHighFlexibilityStr { get; set; }
|
{
|
||||||
public string WireCoreCount { get; set; }
|
_uniqueKey = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _projectName;
|
||||||
|
public string ProjectName
|
||||||
|
{
|
||||||
|
get => _projectName;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_projectName != value)
|
||||||
|
{
|
||||||
|
_projectName = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _userId;
|
||||||
|
public string UserId
|
||||||
|
{
|
||||||
|
get => _userId;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_userId != value)
|
||||||
|
{
|
||||||
|
_userId = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _wireKey;
|
||||||
|
public string WireKey
|
||||||
|
{
|
||||||
|
get => _wireKey;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireKey != value)
|
||||||
|
{
|
||||||
|
_wireKey = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _applicationScenario;
|
||||||
|
public string ApplicationScenario
|
||||||
|
{
|
||||||
|
get => _applicationScenario;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_applicationScenario != value)
|
||||||
|
{
|
||||||
|
_applicationScenario = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _wireDiameterSpecification;
|
||||||
|
public string WireDiameterSpecification
|
||||||
|
{
|
||||||
|
get => _wireDiameterSpecification;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireDiameterSpecification != value)
|
||||||
|
{
|
||||||
|
_wireDiameterSpecification = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _isHighFlexibilityStr;
|
||||||
|
public string IsHighFlexibilityStr
|
||||||
|
{
|
||||||
|
get => _isHighFlexibilityStr;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_isHighFlexibilityStr != value)
|
||||||
|
{
|
||||||
|
_isHighFlexibilityStr = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _wireCoreCount;
|
||||||
|
public string WireCoreCount
|
||||||
|
{
|
||||||
|
get => _wireCoreCount;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireCoreCount != value)
|
||||||
|
{
|
||||||
|
_wireCoreCount = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 引脚编号
|
/// 引脚编号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string PinIndex { get; set; }
|
private string _pinIndex;
|
||||||
|
public string PinIndex
|
||||||
|
{
|
||||||
|
get => _pinIndex;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_pinIndex != value)
|
||||||
|
{
|
||||||
|
_pinIndex = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材型号规格
|
/// 线材型号规格
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WireModelSpecification { get; set; }
|
private string _wireModelSpecification;
|
||||||
|
public string WireModelSpecification
|
||||||
|
{
|
||||||
|
get => _wireModelSpecification;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireModelSpecification != value)
|
||||||
|
{
|
||||||
|
_wireModelSpecification = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材颜色名
|
/// 线材颜色名
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WireColorName { get; set; }
|
private string _wireColorName;
|
||||||
|
public string WireColorName
|
||||||
|
{
|
||||||
|
get => _wireColorName;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireColorName != value)
|
||||||
|
{
|
||||||
|
_wireColorName = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材颜色十六进制
|
/// 线材颜色十六进制
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WireColorHex { get; set; }
|
private string _wireColorHex;
|
||||||
|
public string WireColorHex
|
||||||
|
{
|
||||||
|
get => _wireColorHex;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireColorHex != value)
|
||||||
|
{
|
||||||
|
_wireColorHex = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 线材颜色十六进制 次颜色
|
/// 线材颜色十六进制 次颜色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WireColorHexSec { get; set; }
|
private string _wireColorHexSec;
|
||||||
|
public string WireColorHexSec
|
||||||
|
{
|
||||||
|
get => _wireColorHexSec;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireColorHexSec != value)
|
||||||
|
{
|
||||||
|
_wireColorHexSec = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsMultiColor { get; set; }
|
private bool _isMultiColor;
|
||||||
|
public bool IsMultiColor
|
||||||
|
{
|
||||||
|
get => _isMultiColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_isMultiColor != value)
|
||||||
|
{
|
||||||
|
_isMultiColor = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string WireType { get; set; }
|
private string _wireType;
|
||||||
|
public string WireType
|
||||||
|
{
|
||||||
|
get => _wireType;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireType != value)
|
||||||
|
{
|
||||||
|
_wireType = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _wireLength;
|
||||||
|
public string WireLength
|
||||||
|
{
|
||||||
|
get => _wireLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_wireLength != value)
|
||||||
|
{
|
||||||
|
_wireLength = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string WireLength { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 是否高柔
|
/// 是否高柔
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsHighFlexibility { get; set; }
|
private bool _isHighFlexibility;
|
||||||
|
public bool IsHighFlexibility
|
||||||
|
{
|
||||||
|
get => _isHighFlexibility;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_isHighFlexibility != value)
|
||||||
|
{
|
||||||
|
_isHighFlexibility = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前连接物型号
|
/// 前连接物型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FrontConnectorModel { get; set; }
|
private string _frontConnectorModel;
|
||||||
|
public string FrontConnectorModel
|
||||||
|
{
|
||||||
|
get => _frontConnectorModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_frontConnectorModel != value)
|
||||||
|
{
|
||||||
|
_frontConnectorModel = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前连接物料号
|
/// 前连接物料号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FrontConnectorMCode { get; set; }
|
private string _frontConnectorMCode;
|
||||||
|
public string FrontConnectorMCode
|
||||||
|
{
|
||||||
|
get => _frontConnectorMCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_frontConnectorMCode != value)
|
||||||
|
{
|
||||||
|
_frontConnectorMCode = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前连接物数量
|
/// 前连接物数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int FrontConnectorQuantity { get; set; }
|
private int _frontConnectorQuantity;
|
||||||
|
public int FrontConnectorQuantity
|
||||||
|
{
|
||||||
|
get => _frontConnectorQuantity;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_frontConnectorQuantity != value)
|
||||||
|
{
|
||||||
|
_frontConnectorQuantity = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 后连接物型号
|
/// 后连接物型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string RearConnectorModel { get; set; }
|
private string _rearConnectorModel;
|
||||||
|
public string RearConnectorModel
|
||||||
|
{
|
||||||
|
get => _rearConnectorModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_rearConnectorModel != value)
|
||||||
|
{
|
||||||
|
_rearConnectorModel = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 后连接物料号
|
/// 后连接物料号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string RearConnectorMCode { get; set; }
|
private string _rearConnectorMCode;
|
||||||
|
public string RearConnectorMCode
|
||||||
|
{
|
||||||
|
get => _rearConnectorMCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_rearConnectorMCode != value)
|
||||||
|
{
|
||||||
|
_rearConnectorMCode = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 后连接物数量
|
/// 后连接物数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int RearConnectorQuantity { get; set; }
|
private int _rearConnectorQuantity;
|
||||||
|
public int RearConnectorQuantity
|
||||||
|
{
|
||||||
|
get => _rearConnectorQuantity;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_rearConnectorQuantity != value)
|
||||||
|
{
|
||||||
|
_rearConnectorQuantity = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 号码管型号
|
/// 号码管型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NumberTubeModel { get; set; }
|
private string _numberTubeModel;
|
||||||
|
public string NumberTubeModel
|
||||||
|
{
|
||||||
|
get => _numberTubeModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_numberTubeModel != value)
|
||||||
|
{
|
||||||
|
_numberTubeModel = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 号码管物料编码
|
/// 号码管物料编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string NumberTubeMCode { get; set; }
|
private string _numberTubeMCode;
|
||||||
|
public string NumberTubeMCode
|
||||||
|
{
|
||||||
|
get => _numberTubeMCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_numberTubeMCode != value)
|
||||||
|
{
|
||||||
|
_numberTubeMCode = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 号码管长度
|
/// 号码管长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int NumberTubeLength { get; set; }
|
private int _numberTubeLength;
|
||||||
public bool FrontConnectorIsPin { get; set; }
|
public int NumberTubeLength
|
||||||
public bool RearConnectorIsPin { get; set; }
|
{
|
||||||
|
get => _numberTubeLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_numberTubeLength != value)
|
||||||
|
{
|
||||||
|
_numberTubeLength = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _frontConnectorIsPin;
|
||||||
|
public bool FrontConnectorIsPin
|
||||||
|
{
|
||||||
|
get => _frontConnectorIsPin;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_frontConnectorIsPin != value)
|
||||||
|
{
|
||||||
|
_frontConnectorIsPin = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _rearConnectorIsPin;
|
||||||
|
public bool RearConnectorIsPin
|
||||||
|
{
|
||||||
|
get => _rearConnectorIsPin;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_rearConnectorIsPin != value)
|
||||||
|
{
|
||||||
|
_rearConnectorIsPin = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 透明热缩管型号
|
/// 透明热缩管型号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TransparentHeatShrinkTubeModel { get; set; }
|
private string _transparentHeatShrinkTubeModel;
|
||||||
|
public string TransparentHeatShrinkTubeModel
|
||||||
|
{
|
||||||
|
get => _transparentHeatShrinkTubeModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_transparentHeatShrinkTubeModel != value)
|
||||||
|
{
|
||||||
|
_transparentHeatShrinkTubeModel = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 透明热缩管标示
|
/// 透明热缩管标示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TransparentHeatShrinkTubeDesc { get; set; }
|
private string _transparentHeatShrinkTubeDesc;
|
||||||
|
public string TransparentHeatShrinkTubeDesc
|
||||||
|
{
|
||||||
|
get => _transparentHeatShrinkTubeDesc;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_transparentHeatShrinkTubeDesc != value)
|
||||||
|
{
|
||||||
|
_transparentHeatShrinkTubeDesc = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 透明热缩管物料编码
|
/// 透明热缩管物料编码
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string TransparentHeatShrinkTubeMCode { get; set; }
|
private string _transparentHeatShrinkTubeMCode;
|
||||||
|
public string TransparentHeatShrinkTubeMCode
|
||||||
|
{
|
||||||
|
get => _transparentHeatShrinkTubeMCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_transparentHeatShrinkTubeMCode != value)
|
||||||
|
{
|
||||||
|
_transparentHeatShrinkTubeMCode = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 黑色热缩管型号(插头)
|
/// 黑色热缩管型号(插头)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BlackHeatShrinkTubeModel { get; set; }
|
private string _blackHeatShrinkTubeModel;
|
||||||
|
public string BlackHeatShrinkTubeModel
|
||||||
|
{
|
||||||
|
get => _blackHeatShrinkTubeModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_blackHeatShrinkTubeModel != value)
|
||||||
|
{
|
||||||
|
_blackHeatShrinkTubeModel = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 黑色热缩管物料编码(插头)
|
/// 黑色热缩管物料编码(插头)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BlackHeatShrinkTubeMCode { get; set; }
|
private string _blackHeatShrinkTubeMCode;
|
||||||
|
public string BlackHeatShrinkTubeMCode
|
||||||
|
{
|
||||||
|
get => _blackHeatShrinkTubeMCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_blackHeatShrinkTubeMCode != value)
|
||||||
|
{
|
||||||
|
_blackHeatShrinkTubeMCode = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 黑色热缩管型号(剥线后)
|
/// 黑色热缩管型号(剥线后)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BlackHeatShrinkTubeModelAfterStripping { get; set; }
|
private string _blackHeatShrinkTubeModelAfterStripping;
|
||||||
|
public string BlackHeatShrinkTubeModelAfterStripping
|
||||||
|
{
|
||||||
|
get => _blackHeatShrinkTubeModelAfterStripping;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_blackHeatShrinkTubeModelAfterStripping != value)
|
||||||
|
{
|
||||||
|
_blackHeatShrinkTubeModelAfterStripping = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 黑色热缩管物料编码(剥线后)
|
/// 黑色热缩管物料编码(剥线后)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string BlackHeatShrinkTubeMCodeAfterStripping { get; set; }
|
private string _blackHeatShrinkTubeMCodeAfterStripping;
|
||||||
|
public string BlackHeatShrinkTubeMCodeAfterStripping
|
||||||
|
{
|
||||||
|
get => _blackHeatShrinkTubeMCodeAfterStripping;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_blackHeatShrinkTubeMCodeAfterStripping != value)
|
||||||
|
{
|
||||||
|
_blackHeatShrinkTubeMCodeAfterStripping = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 热缩管标识
|
/// 热缩管标识
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string HeatShrinkTubeDesc { get; set; }
|
private string _heatShrinkTubeDesc;
|
||||||
|
public string HeatShrinkTubeDesc
|
||||||
|
{
|
||||||
|
get => _heatShrinkTubeDesc;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_heatShrinkTubeDesc != value)
|
||||||
|
{
|
||||||
|
_heatShrinkTubeDesc = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 前段子剥线长度
|
/// 前段子剥线长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int FrontStrippingLength { get; set; }
|
private int _frontStrippingLength;
|
||||||
|
public int FrontStrippingLength
|
||||||
|
{
|
||||||
|
get => _frontStrippingLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_frontStrippingLength != value)
|
||||||
|
{
|
||||||
|
_frontStrippingLength = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 后段子剥线长度
|
/// 后段子剥线长度
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int RearStrippingLength { get; set; }
|
private int _rearStrippingLength;
|
||||||
|
public int RearStrippingLength
|
||||||
public bool Layouted { get;set; }
|
{
|
||||||
|
get => _rearStrippingLength;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_rearStrippingLength != value)
|
||||||
|
{
|
||||||
|
_rearStrippingLength = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool _layouted;
|
||||||
|
public bool Layouted
|
||||||
|
{
|
||||||
|
get => _layouted;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_layouted != value)
|
||||||
|
{
|
||||||
|
_layouted = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _plugModel;
|
||||||
|
/// <summary>
|
||||||
|
/// 插头型号
|
||||||
|
/// </summary>
|
||||||
|
public string PlugModel
|
||||||
|
{
|
||||||
|
get => _plugModel;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_plugModel != value)
|
||||||
|
{
|
||||||
|
_plugModel = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _plugMCode;
|
||||||
|
/// <summary>
|
||||||
|
/// 插头料号
|
||||||
|
/// </summary>
|
||||||
|
public string PlugMCode
|
||||||
|
{
|
||||||
|
get => _plugMCode;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_plugMCode != value)
|
||||||
|
{
|
||||||
|
_plugMCode = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int _plugQty;
|
||||||
|
/// <summary>
|
||||||
|
/// 插头数量
|
||||||
|
/// </summary>
|
||||||
|
public int PlugQty
|
||||||
|
{
|
||||||
|
get => _plugQty;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_plugQty != value)
|
||||||
|
{
|
||||||
|
_plugQty = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
private List<MultiCoreWireDataModel> _children = [];
|
private List<MultiCoreWireDataModel> _children = [];
|
||||||
public List<MultiCoreWireDataModel> Children
|
public List<MultiCoreWireDataModel> Children
|
||||||
{
|
{
|
||||||
get { return _children; }
|
get => _children;
|
||||||
set { _children = value; }
|
set
|
||||||
|
{
|
||||||
|
if (_children != value)
|
||||||
|
{
|
||||||
|
_children = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||||
|
{
|
||||||
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,40 +52,79 @@
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
hc:GridViewAttach.ColumnHeaderHeight="10"
|
|
||||||
ItemsSource="{Binding LecWires}"
|
ItemsSource="{Binding LecWires}"
|
||||||
Style="{StaticResource ListView.Small}">
|
VirtualizingPanel.ScrollUnit="Pixel">
|
||||||
<ListView.ItemContainerStyle>
|
<ListView.ItemContainerStyle>
|
||||||
<Style BasedOn="{StaticResource ListViewItemBaseStyle.Small}" TargetType="ListViewItem">
|
<Style BasedOn="{StaticResource ListViewItemBaseStyle.Small}" TargetType="ListViewItem">
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||||
|
<Setter Property="BorderBrush" Value="Gray" />
|
||||||
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
|
<Setter Property="Margin" Value="2" />
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<DataTrigger Binding="{Binding Layouted}" Value="True">
|
<DataTrigger Binding="{Binding Layouted}" Value="True">
|
||||||
<Setter Property="Background" Value="#18a05d" />
|
<Setter Property="Background" Value="#18a05d" />
|
||||||
<Setter Property="Foreground" Value="White" />
|
<Setter Property="Foreground" Value="White" />
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
|
|
||||||
</Style>
|
</Style>
|
||||||
</ListView.ItemContainerStyle>
|
</ListView.ItemContainerStyle>
|
||||||
<ListView.View>
|
<ListView.ItemTemplate>
|
||||||
<GridView>
|
<DataTemplate>
|
||||||
<GridViewColumn
|
<Grid Margin="5" HorizontalAlignment="Stretch">
|
||||||
Width="80"
|
<Grid.RowDefinitions>
|
||||||
DisplayMemberBinding="{Binding SeqNo}"
|
<RowDefinition Height="Auto" />
|
||||||
Header="序号" />
|
<RowDefinition Height="Auto" />
|
||||||
<GridViewColumn Width="330" Header="线型号">
|
<RowDefinition Height="Auto" />
|
||||||
<GridViewColumn.CellTemplate>
|
<RowDefinition Height="Auto" />
|
||||||
<DataTemplate>
|
</Grid.RowDefinitions>
|
||||||
<TextBox
|
<TextBox
|
||||||
Width="300"
|
Grid.Row="0"
|
||||||
MaxWidth="300"
|
Margin="0,2,0,5"
|
||||||
GotFocus="TextBox_GotFocus"
|
HorizontalAlignment="Stretch"
|
||||||
IsReadOnly="True"
|
GotFocus="TextBox_GotFocus"
|
||||||
Text="{Binding WireModelSpecification}" />
|
IsReadOnly="True"
|
||||||
</DataTemplate>
|
TextAlignment="Center">
|
||||||
</GridViewColumn.CellTemplate>
|
<TextBox.Text>
|
||||||
</GridViewColumn>
|
<MultiBinding StringFormat="{}{0}-{1}">
|
||||||
</GridView>
|
<Binding Path="ApplicationScenario" />
|
||||||
</ListView.View>
|
<Binding Path="WireKey" />
|
||||||
|
</MultiBinding>
|
||||||
|
</TextBox.Text>
|
||||||
|
</TextBox>
|
||||||
|
<TextBox
|
||||||
|
Grid.Row="1"
|
||||||
|
Margin="0,2,0,5"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Center"
|
||||||
|
GotFocus="TextBox_GotFocus"
|
||||||
|
IsReadOnly="True"
|
||||||
|
Text="{Binding WireModelSpecification}" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="2"
|
||||||
|
Margin="0,2"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Text="{Binding FrontConnectorModel, StringFormat=前连接:{0}}"
|
||||||
|
TextAlignment="Center" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="3"
|
||||||
|
Margin="0,2"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Text="{Binding RearConnectorModel, StringFormat=后连接:{0}}"
|
||||||
|
TextAlignment="Center" />
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
<!-- 添加一个空数据模板 -->
|
||||||
|
<ListView.Template>
|
||||||
|
<ControlTemplate>
|
||||||
|
<hc:ScrollViewer>
|
||||||
|
<ItemsPresenter />
|
||||||
|
</hc:ScrollViewer>
|
||||||
|
</ControlTemplate>
|
||||||
|
</ListView.Template>
|
||||||
</ListView>
|
</ListView>
|
||||||
|
|
||||||
<hc:SimpleStackPanel
|
<hc:SimpleStackPanel
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Margin="10"
|
Margin="10"
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View.MultiCoreWire.LayoutHelper
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Clipboard.SetDataObject(content);
|
Clipboard.SetDataObject(content);
|
||||||
Growl.SuccessGlobal("复制成功!");
|
Growl.SuccessGlobal($"{content} 复制成功!");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,14 @@
|
||||||
<Setter Property="Margin" Value="2" />
|
<Setter Property="Margin" Value="2" />
|
||||||
</Style>
|
</Style>
|
||||||
</hc:SimpleStackPanel.Resources>
|
</hc:SimpleStackPanel.Resources>
|
||||||
<hc:TextBox hc:TitleElement.Title="机构编号" hc:TitleElement.TitlePlacement="Left" />
|
<hc:TextBox
|
||||||
<hc:TextBox hc:TitleElement.Title="机构名称" hc:TitleElement.TitlePlacement="Left" />
|
hc:TitleElement.Title="机构编号"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
Text="{Binding MechanismNo}" />
|
||||||
|
<hc:TextBox
|
||||||
|
hc:TitleElement.Title="机构名称"
|
||||||
|
hc:TitleElement.TitlePlacement="Left"
|
||||||
|
Text="{Binding MechanismName}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<Button
|
<Button
|
||||||
Margin="10,0"
|
Margin="10,0"
|
||||||
|
|
@ -50,6 +56,7 @@
|
||||||
Style="{StaticResource ButtonSuccess}" />
|
Style="{StaticResource ButtonSuccess}" />
|
||||||
<Button
|
<Button
|
||||||
Margin="10,0"
|
Margin="10,0"
|
||||||
|
Click="ExportBtn_Click"
|
||||||
Content="导出下单表"
|
Content="导出下单表"
|
||||||
Style="{StaticResource ButtonSuccess}" />
|
Style="{StaticResource ButtonSuccess}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
|
|
@ -273,6 +280,26 @@
|
||||||
ItemsSource="{Binding WireModelSpecifications}"
|
ItemsSource="{Binding WireModelSpecifications}"
|
||||||
SelectedValue="{Binding WireModelSpecification}" />
|
SelectedValue="{Binding WireModelSpecification}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
|
<hc:SimpleStackPanel
|
||||||
|
Margin="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
MinWidth="70"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="线材外皮颜色:" />
|
||||||
|
<hc:ComboBox
|
||||||
|
MinWidth="60"
|
||||||
|
Margin="10,0"
|
||||||
|
SelectedValue="{Binding WireColorName}"
|
||||||
|
SelectedValuePath="Tag">
|
||||||
|
<ComboBoxItem
|
||||||
|
Content="黑色"
|
||||||
|
Selector.IsSelected="True"
|
||||||
|
Tag="BK" />
|
||||||
|
<ComboBoxItem Content="橙色" Tag="OG" />
|
||||||
|
</hc:ComboBox>
|
||||||
|
</hc:SimpleStackPanel>
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
<DockPanel
|
<DockPanel
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
|
@ -382,18 +409,31 @@
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Border>
|
<Border>
|
||||||
<Expander>
|
<Expander IsExpanded="False">
|
||||||
<Expander.Resources>
|
<Expander.Resources>
|
||||||
<Style BasedOn="{StaticResource ExpanderBaseStyle}" TargetType="Expander">
|
<Style BasedOn="{StaticResource ExpanderBaseStyle}" TargetType="Expander">
|
||||||
<Setter Property="Background" Value="#CC002255" />
|
<Setter Property="Background" Value="#CC002255" />
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding IsError}" Value="True">
|
||||||
|
<Setter Property="Background" Value="#dc4d41" />
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
|
||||||
</Style>
|
</Style>
|
||||||
</Expander.Resources>
|
</Expander.Resources>
|
||||||
<Expander.Header>
|
<Expander.Header>
|
||||||
<hc:SimpleStackPanel Orientation="Horizontal">
|
<hc:SimpleStackPanel Orientation="Horizontal">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
|
MinWidth="700"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Foreground="White"
|
Foreground="White"
|
||||||
Text="{Binding WireModelSpecification}" />
|
Text="{Binding WireModelSpecification}" />
|
||||||
|
<TextBlock
|
||||||
|
Margin="10,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="White"
|
||||||
|
Text="{Binding CheckedMsg}" />
|
||||||
</hc:SimpleStackPanel>
|
</hc:SimpleStackPanel>
|
||||||
</Expander.Header>
|
</Expander.Header>
|
||||||
<DataGrid
|
<DataGrid
|
||||||
|
|
@ -403,7 +443,6 @@
|
||||||
ItemsSource="{Binding Children}">
|
ItemsSource="{Binding Children}">
|
||||||
<DataGrid.Resources>
|
<DataGrid.Resources>
|
||||||
<localconverter:WireColorConverter x:Key="WireColorConverter" />
|
<localconverter:WireColorConverter x:Key="WireColorConverter" />
|
||||||
|
|
||||||
</DataGrid.Resources>
|
</DataGrid.Resources>
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTextColumn Binding="{Binding WireModelSpecification}" Header="线芯名称" />
|
<DataGridTextColumn Binding="{Binding WireModelSpecification}" Header="线芯名称" />
|
||||||
|
|
@ -422,7 +461,7 @@
|
||||||
</MultiBinding>
|
</MultiBinding>
|
||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Setter Property="BorderThickness" Value="0,0,0,2" />
|
<Setter Property="BorderThickness" Value="0,0,0,4" />
|
||||||
<Setter Property="hc:BorderElement.CornerRadius" Value="0" />
|
<Setter Property="hc:BorderElement.CornerRadius" Value="0" />
|
||||||
<Setter Property="Margin" Value="0" />
|
<Setter Property="Margin" Value="0" />
|
||||||
</Style>
|
</Style>
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,10 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View
|
||||||
layoutWindow.Show();
|
layoutWindow.Show();
|
||||||
this.Close();
|
this.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ExportBtn_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
viewModel.ExportLines();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
{
|
{
|
||||||
_currentFlexDesigner.SelectSet.SelectionChanged += SelectSet_SelectionChanged;
|
_currentFlexDesigner.SelectSet.SelectionChanged += SelectSet_SelectionChanged;
|
||||||
}
|
}
|
||||||
|
LecWires = [];
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
private void SelectSet_SelectionChanged(object sender, EventArgs e)
|
private void SelectSet_SelectionChanged(object sender, EventArgs e)
|
||||||
|
|
@ -104,19 +105,26 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
if (linePart != null)
|
if (linePart != null)
|
||||||
{
|
{
|
||||||
var libName = linePart?.LibraryName;
|
var libName = linePart?.LibraryName;
|
||||||
|
var name = linePart.Name;
|
||||||
// 绝缘层选择上一层的导线来获取信息
|
// 绝缘层选择上一层的导线来获取信息
|
||||||
if (part is OccCablesInsulatorGraph)
|
if (part is OccCablesInsulatorGraph)
|
||||||
{
|
{
|
||||||
libName = (part.Parents?.First() as OccCableForked).LibraryName;
|
libName = (part.Parents?.First() as OccCableForked).LibraryName;
|
||||||
|
name = (part.Parents?.First() as OccCableForked).Name;
|
||||||
//partLineModel = (part.Parents?.First() as OccCableForked).LibraryName.Split('&')[1];
|
//partLineModel = (part.Parents?.First() as OccCableForked).LibraryName.Split('&')[1];
|
||||||
}
|
}
|
||||||
if(LecWires.Any(it =>it.WireModelSpecification == libName))
|
if(LecWires.Any(it =>it.WireModelSpecification == libName))
|
||||||
{
|
{
|
||||||
var wire = LecWires.FirstOrDefault(it => it.WireModelSpecification == libName && !it.Layouted);
|
var wire = LecWires.FirstOrDefault(it =>
|
||||||
|
it.WireModelSpecification == libName
|
||||||
|
&& name == $"{it.ApplicationScenario}-{it.WireKey}"
|
||||||
|
&& !it.Layouted);
|
||||||
if(wire != null)
|
if(wire != null)
|
||||||
{
|
{
|
||||||
wire.Layouted = true;
|
wire.Layouted = true;
|
||||||
_service.UpdateWireIsLayout(wire.Id);
|
_service.UpdateWireIsLayout(wire.Id);
|
||||||
|
OnPropertyChanged(nameof(LecWires));
|
||||||
|
OnPropertyChanged("Layouted");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -194,6 +202,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
|
|
||||||
private void UpdatePropNotify()
|
private void UpdatePropNotify()
|
||||||
{
|
{
|
||||||
|
OnPropertyChanged(nameof(LecWires));
|
||||||
OnPropertyChanged(nameof(ApplicationScenario));
|
OnPropertyChanged(nameof(ApplicationScenario));
|
||||||
OnPropertyChanged(nameof(HasPrev));
|
OnPropertyChanged(nameof(HasPrev));
|
||||||
OnPropertyChanged(nameof(HasNext));
|
OnPropertyChanged(nameof(HasNext));
|
||||||
|
|
@ -210,7 +219,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
OnPropertyChanged(nameof(ApplicationScenario));
|
OnPropertyChanged(nameof(ApplicationScenario));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private ObservableCollection<MultiCoreWireDataModel> _lecWires = [];
|
private ObservableCollection<MultiCoreWireDataModel> _lecWires;
|
||||||
|
|
||||||
public ObservableCollection<MultiCoreWireDataModel> LecWires
|
public ObservableCollection<MultiCoreWireDataModel> LecWires
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ using EPLAN.Harness.Core.Utils;
|
||||||
using EPLAN.Harness.ProjectCore;
|
using EPLAN.Harness.ProjectCore;
|
||||||
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
using EPLAN.Harness.ProjectCore.Occurrences.Designer;
|
||||||
using HandyControl.Controls;
|
using HandyControl.Controls;
|
||||||
|
using MiniExcelLibs;
|
||||||
using MiniExcelLibs.Attributes;
|
using MiniExcelLibs.Attributes;
|
||||||
|
using MiniExcelLibs.OpenXml;
|
||||||
using Sinvo.EplanHpD.Plugin.Service;
|
using Sinvo.EplanHpD.Plugin.Service;
|
||||||
using Sinvo.EplanHpD.Plugin.Service.Model;
|
using Sinvo.EplanHpD.Plugin.Service.Model;
|
||||||
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
using Sinvo.EplanHpD.Plugin.WPFUI.Models;
|
||||||
|
|
@ -56,6 +58,34 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string _mechanismNo;
|
||||||
|
/// <summary>
|
||||||
|
/// 机构号
|
||||||
|
/// </summary>
|
||||||
|
public string MechanismNo
|
||||||
|
{
|
||||||
|
get => _mechanismNo;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_mechanismNo = value;
|
||||||
|
OnPropertyChanged(nameof(MechanismNo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string _mechanismName;
|
||||||
|
/// <summary>
|
||||||
|
/// 机构名称
|
||||||
|
/// </summary>
|
||||||
|
public string MechanismName
|
||||||
|
{
|
||||||
|
get => _mechanismName;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_mechanismName = value;
|
||||||
|
OnPropertyChanged(nameof(MechanismName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private string _applicationScenario;
|
private string _applicationScenario;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 应用场景
|
/// 应用场景
|
||||||
|
|
@ -457,6 +487,21 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
OnPropertyChanged(nameof(RearConnectorCount));
|
OnPropertyChanged(nameof(RearConnectorCount));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private string _wireColorName;
|
||||||
|
/// <summary>
|
||||||
|
/// 线材外皮颜色
|
||||||
|
/// </summary>
|
||||||
|
public string WireColorName
|
||||||
|
{
|
||||||
|
get => _wireColorName;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_wireColorName = value;
|
||||||
|
OnPropertyChanged(nameof(WireColorName));
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -485,22 +530,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
{
|
{
|
||||||
wiresData.ForEach(wire =>
|
wiresData.ForEach(wire =>
|
||||||
{
|
{
|
||||||
LecWires.Add(new MultiCoreWireDataModel
|
var wiredata = MapperUtil.MapFor<MultiCoreWireDataModel, MultiCoreWireLecDBModel>(wire);
|
||||||
{
|
LecWires.Add(wiredata);
|
||||||
Id = wire.Id,
|
|
||||||
SeqNo = wire.SeqNo,
|
|
||||||
ApplicationScenario = wire.ApplicationScenario,
|
|
||||||
WireKey = Wirekey,
|
|
||||||
WireDiameterSpecification = wire.WireDiameterSpecification,
|
|
||||||
IsHighFlexibilityStr = wire.IsHighFlexibilityStr,
|
|
||||||
WireCoreCount = wire.WireCoreCount,
|
|
||||||
WireModelSpecification = wire.WireModelSpecification,
|
|
||||||
FrontConnectorModel = wire.FrontConnectorModel,
|
|
||||||
RearConnectorModel = wire.RearConnectorModel,
|
|
||||||
UserId = wire.UserId,
|
|
||||||
ProjectName = wire.ProjectName,
|
|
||||||
UniqueKey = wire.UniqueKey
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -560,12 +591,6 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
HighFlexibilitys = [.. datas.Where(it => !string.IsNullOrEmpty(it.IsHighFlexibilityStr)).Select(it => it.IsHighFlexibilityStr).Distinct(), ""];
|
HighFlexibilitys = [.. datas.Where(it => !string.IsNullOrEmpty(it.IsHighFlexibilityStr)).Select(it => it.IsHighFlexibilityStr).Distinct(), ""];
|
||||||
|
|
||||||
WireCores = [.. datas.Where(it => !string.IsNullOrEmpty(it.WireCoreCount)).Select(it => it.WireCoreCount).Distinct(), ""];
|
WireCores = [.. datas.Where(it => !string.IsNullOrEmpty(it.WireCoreCount)).Select(it => it.WireCoreCount).Distinct(), ""];
|
||||||
//if (WireCores.Where(it => !string.IsNullOrEmpty(it)).Count() == 1 && propName != nameof(WireCoreCount))
|
|
||||||
//{
|
|
||||||
// WireCoreCount = WireCores.FirstOrDefault();
|
|
||||||
//}
|
|
||||||
//FrontConnectorModels = [.. 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(), ""];
|
|
||||||
WireModelSpecifications = [.. datas.Where(it => !string.IsNullOrEmpty(it.WireModelSpecification)).Select(it => it.WireModelSpecification).Distinct(), ""];
|
WireModelSpecifications = [.. datas.Where(it => !string.IsNullOrEmpty(it.WireModelSpecification)).Select(it => it.WireModelSpecification).Distinct(), ""];
|
||||||
if (WireModelSpecifications.Where(it => !string.IsNullOrEmpty(it)).Count() == 1 && propName != nameof(WireModelSpecification))
|
if (WireModelSpecifications.Where(it => !string.IsNullOrEmpty(it)).Count() == 1 && propName != nameof(WireModelSpecification))
|
||||||
{
|
{
|
||||||
|
|
@ -585,27 +610,29 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
var des = FlexProject.CurrentProject.GetDesigners().FirstOrDefault(it => it.ID == _docId) ?? throw new Exception("设计器不存在");
|
var des = FlexProject.CurrentProject.GetDesigners().FirstOrDefault(it => it.ID == _docId) ?? throw new Exception("设计器不存在");
|
||||||
var cables = des.GetOrganizerOccurrences(_docId, typeof(OccCableForked));
|
var cables = des.GetOrganizerOccurrences(_docId, typeof(OccCableForked));
|
||||||
Wires?.Clear();
|
Wires?.Clear();
|
||||||
cables.Where(it => it.Name?.StartsWith("信号线") ?? false).ForEach(it =>
|
cables.Where(it => StartWithApplicationScenario(it.Name)).ForEach(it =>
|
||||||
{
|
{
|
||||||
var wireData = new MultiCoreWireDataModel
|
var wireData = new MultiCoreWireDataModel
|
||||||
{
|
{
|
||||||
WireModelSpecification = $"{it.Name} / {it.LibraryName}"
|
WireModelSpecification = $"{it.Name} / {it.LibraryName}"
|
||||||
};
|
};
|
||||||
//Debug.WriteLine($"{it.Name} - {it.LibraryName}");
|
if(LecWires != null && !LecWires.Any(i => $"{i.ApplicationScenario}-{i.WireKey}" == it.Name && i.WireModelSpecification == it.LibraryName))
|
||||||
|
{
|
||||||
|
wireData.IsError = true;
|
||||||
|
wireData.CheckedMsg = "无法匹配选型数据!";
|
||||||
|
wireData.IsChecked = true;
|
||||||
|
}
|
||||||
if (it.Children?.Any() ?? false)
|
if (it.Children?.Any() ?? false)
|
||||||
{
|
{
|
||||||
it.Children.ForEach(c =>
|
it.Children.ForEach(c =>
|
||||||
{
|
{
|
||||||
//Debug.WriteLine($"\t{c.Name} - {c.LibraryName}");
|
|
||||||
if (c.Children?.Any() ?? false)
|
if (c.Children?.Any() ?? false)
|
||||||
{
|
{
|
||||||
c.Children.Where(ccc => ccc is OccWire).ForEach(cc =>
|
c.Children.Where(ccc => ccc is OccWire).ForEach(cc =>
|
||||||
{
|
{
|
||||||
if (cc is OccWire wire)
|
if (cc is OccWire wire)
|
||||||
{
|
{
|
||||||
//var color = materials.Where(col => col == wire.Color)
|
var wireItem = new MultiCoreWireDataModel
|
||||||
//Debug.WriteLine($"\t\t{wire.Name} - {wire.LibraryName} - {FlexColors.GetName(wire.Color.Major)}");
|
|
||||||
wireData.Children.Add(new MultiCoreWireDataModel
|
|
||||||
{
|
{
|
||||||
WireModelSpecification = wire.Name,
|
WireModelSpecification = wire.Name,
|
||||||
WireColorName = FlexColors.GetName(wire.Color.Major) + (FlexColors.GetName(wire.Color.Minor) == "未设置" ? "" : " " + FlexColors.GetName(wire.Color.Minor)),
|
WireColorName = FlexColors.GetName(wire.Color.Major) + (FlexColors.GetName(wire.Color.Minor) == "未设置" ? "" : " " + FlexColors.GetName(wire.Color.Minor)),
|
||||||
|
|
@ -614,7 +641,9 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
IsMultiColor = wire.Color.Major.IsValid() && wire.Color.Minor.IsValid(),
|
IsMultiColor = wire.Color.Major.IsValid() && wire.Color.Minor.IsValid(),
|
||||||
FrontConnectorModel = wire.GetEndingPins()?.FirstOrDefault()?.Parents?.FirstOrDefault()?.LibraryName,
|
FrontConnectorModel = wire.GetEndingPins()?.FirstOrDefault()?.Parents?.FirstOrDefault()?.LibraryName,
|
||||||
RearConnectorModel = wire.GetEndingPins()?.LastOrDefault()?.Parents?.FirstOrDefault()?.LibraryName
|
RearConnectorModel = wire.GetEndingPins()?.LastOrDefault()?.Parents?.FirstOrDefault()?.LibraryName
|
||||||
});
|
};
|
||||||
|
|
||||||
|
wireData.Children.Add(wireItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -624,6 +653,18 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
});
|
});
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool StartWithApplicationScenario(string wireName)
|
||||||
|
{
|
||||||
|
if(ApplicationScenarios != null && ApplicationScenarios.Any())
|
||||||
|
{
|
||||||
|
return ApplicationScenarios.Where(it => !string.IsNullOrEmpty(it)).Any(wireName.StartsWith);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
public void OnPropertyChanged(string propertyName)
|
public void OnPropertyChanged(string propertyName)
|
||||||
{
|
{
|
||||||
|
|
@ -641,8 +682,11 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
WireModelSpecification = "";
|
WireModelSpecification = "";
|
||||||
FrontConnectorType = "";
|
FrontConnectorType = "";
|
||||||
RearConnectorType = "";
|
RearConnectorType = "";
|
||||||
|
FrontConnectorModel = "";
|
||||||
|
RearConnectorModel = "";
|
||||||
LecChanging = false;
|
LecChanging = false;
|
||||||
|
Wirekey = "";
|
||||||
|
WireColorName = "";
|
||||||
OnLecChanged("");
|
OnLecChanged("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -664,6 +708,11 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
HandyControl.Controls.MessageBox.Show("不能两头都是插头!", caption: "提示", icon: MessageBoxImage.Warning);
|
HandyControl.Controls.MessageBox.Show("不能两头都是插头!", caption: "提示", icon: MessageBoxImage.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(RearConnectorCount == 0 || FrontConnectorCount == 0)
|
||||||
|
{
|
||||||
|
HandyControl.Controls.MessageBox.Show("连接物数量不能为0!", caption: "提示", icon: MessageBoxImage.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (LecWires.Any(it => it.ApplicationScenario == ApplicationScenario && it.WireModelSpecification == WireModelSpecification
|
if (LecWires.Any(it => it.ApplicationScenario == ApplicationScenario && it.WireModelSpecification == WireModelSpecification
|
||||||
&& it.FrontConnectorModel == FrontConnectorModel && it.RearConnectorModel == RearConnectorModel))
|
&& it.FrontConnectorModel == FrontConnectorModel && it.RearConnectorModel == RearConnectorModel))
|
||||||
{
|
{
|
||||||
|
|
@ -700,6 +749,8 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
RearConnectorMCode = rearConnectorMCode,
|
RearConnectorMCode = rearConnectorMCode,
|
||||||
RearConnectorIsPin = RearConnectorType == "端子",
|
RearConnectorIsPin = RearConnectorType == "端子",
|
||||||
|
|
||||||
|
WireColorName = WireColorName,
|
||||||
|
|
||||||
UserId = PluginServices.user.ID,
|
UserId = PluginServices.user.ID,
|
||||||
ProjectName = LectotypeManager.CURRENT_DOC_NAME,
|
ProjectName = LectotypeManager.CURRENT_DOC_NAME,
|
||||||
UniqueKey = $"{LectotypeManager.CURRENT_DOC_NAME}_{PluginServices.user.ID}"
|
UniqueKey = $"{LectotypeManager.CURRENT_DOC_NAME}_{PluginServices.user.ID}"
|
||||||
|
|
@ -722,8 +773,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wire.RearConnectorIsPin)
|
if (!wire.RearConnectorIsPin)
|
||||||
{
|
{
|
||||||
// 获取插头信息
|
|
||||||
// 获取插头信息
|
// 获取插头信息
|
||||||
var connectorInfo = MultiCoreWireExcelHelper.Instance.GetConnectorHeatShrinkMappingDatas(wire.RearConnectorModel);
|
var connectorInfo = MultiCoreWireExcelHelper.Instance.GetConnectorHeatShrinkMappingDatas(wire.RearConnectorModel);
|
||||||
if (connectorInfo != null)
|
if (connectorInfo != null)
|
||||||
|
|
@ -764,6 +814,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
}
|
}
|
||||||
}).ContinueWith(x =>
|
}).ContinueWith(x =>
|
||||||
{
|
{
|
||||||
|
// TODO Save line data
|
||||||
//_service.SaveData(new MultiCoreWireLecDBModel
|
//_service.SaveData(new MultiCoreWireLecDBModel
|
||||||
//{
|
//{
|
||||||
// Id = wire.Id,
|
// Id = wire.Id,
|
||||||
|
|
@ -784,9 +835,12 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
// RearConnectorQuantity = wire.RearConnectorQuantity
|
// RearConnectorQuantity = wire.RearConnectorQuantity
|
||||||
|
|
||||||
//});
|
//});
|
||||||
|
var wireData = MapperUtil.MapFor<MultiCoreWireLecDBModel, MultiCoreWireDataModel>(wire);
|
||||||
Application.Current.Dispatcher.BeginInvoke(() =>
|
Application.Current.Dispatcher.BeginInvoke(() =>
|
||||||
{
|
{
|
||||||
|
_service.SaveData(wireData);
|
||||||
LecWires.Add(wire);
|
LecWires.Add(wire);
|
||||||
|
ClearLecData();
|
||||||
OnPropertyChanged(nameof(LecWires));
|
OnPropertyChanged(nameof(LecWires));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -802,6 +856,11 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var result = HandyControl.Controls.MessageBox.Show($"是否清除数据?", "提示", button: MessageBoxButton.YesNo);
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
LecWires.Clear();
|
LecWires.Clear();
|
||||||
_service.ClearSelf(CurrUniqueKey);
|
_service.ClearSelf(CurrUniqueKey);
|
||||||
}
|
}
|
||||||
|
|
@ -829,9 +888,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
HandyControl.Controls.MessageBox.Error($"删除数据失败!{ex}");
|
HandyControl.Controls.MessageBox.Error($"删除数据失败!{ex}");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//ReOrderLecWires();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -862,15 +919,26 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.ViewModel.MultiCoreWireViewModel
|
||||||
OnFrontConnectorTypeModels(FrontConnectorType);
|
OnFrontConnectorTypeModels(FrontConnectorType);
|
||||||
OnRearConnectorTypeChange(RearConnectorType);
|
OnRearConnectorTypeChange(RearConnectorType);
|
||||||
}
|
}
|
||||||
//private void ReOrderLecWires()
|
|
||||||
//{
|
public void ExportLines()
|
||||||
// int seq = 1;
|
{
|
||||||
// LecWires.OrderBy(it => it.SeqNo).ForEach(it =>
|
if(string.IsNullOrEmpty(MechanismNo) || string.IsNullOrEmpty(MechanismName))
|
||||||
// {
|
{
|
||||||
// it.SeqNo = seq;
|
HandyControl.Controls.MessageBox.Show("机构号或机构名称不能为空!", caption: "提示", icon: MessageBoxImage.Warning);
|
||||||
// seq++;
|
return;
|
||||||
// });
|
}
|
||||||
// OnPropertyChanged(nameof(LecWires));
|
MiniExcel.SaveAsByTemplate("D:\\Desktop\\123.xlsx", "D:\\Desktop\\EPLAN\\多芯线\\副本多芯线下单模板_测试.xlsx", new
|
||||||
//}
|
{
|
||||||
|
data = new List<dynamic> {
|
||||||
|
new { MechanismNo, MechanismName, WireModelStr= '1' },
|
||||||
|
new { MechanismNo, MechanismName, WireModelStr= '2' },
|
||||||
|
new { MechanismNo, MechanismName, WireModelStr= '3' }
|
||||||
|
}
|
||||||
|
},new OpenXmlConfiguration
|
||||||
|
{
|
||||||
|
FillMergedCells = true
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue