diff --git a/Sinvo.EplanHpD.Plugin.Service/Model/MultiCoreWireLecDBModel.cs b/Sinvo.EplanHpD.Plugin.Service/Model/MultiCoreWireLecDBModel.cs index 7ea4fea..b8af537 100644 --- a/Sinvo.EplanHpD.Plugin.Service/Model/MultiCoreWireLecDBModel.cs +++ b/Sinvo.EplanHpD.Plugin.Service/Model/MultiCoreWireLecDBModel.cs @@ -9,45 +9,42 @@ namespace Sinvo.EplanHpD.Plugin.Service.Model /* * 应用场景 类型 线径规格(mm2) 是否高柔 线芯数 线材型号规格 插头型号 前端子型号 后端子型号 */ + + public int SeqNo { get; set; } + public string Id { get; set; } public string UniqueKey { get; set; } public string ProjectName { get; set; } public string UserId { get; set; } - - public int SeqNo { get; set; } - - - /// - /// 应用场景 - /// + public string WireKey { get; set; } public string ApplicationScenario { get; set; } - - - /// - /// 线径规格(mm2) - /// public string WireDiameterSpecification { get; set; } - - - - /// - /// 是否高柔 - /// public string IsHighFlexibilityStr { get; set; } - - /// - /// 线芯数 - /// public string WireCoreCount { get; set; } - + /// /// 线材型号规格 - /// + /// public string WireModelSpecification { get; set; } + /// + /// 线材颜色名 + /// + public string WireColorName { get; set; } + /// + /// 线材长度 + /// + [SugarColumn(IsNullable = true)] + public string WireLength { get; set; } + /// /// 前连接物型号 /// public string FrontConnectorModel { get; set; } + + /// + /// 前连接物料号 + /// + public string FrontConnectorMCode { get; set; } /// /// 前连接物数量 /// @@ -58,16 +55,93 @@ namespace Sinvo.EplanHpD.Plugin.Service.Model /// 后连接物型号 /// public string RearConnectorModel { get; set; } + + /// + /// 后连接物料号 + /// + public string RearConnectorMCode { get; set; } /// /// 后连接物数量 /// public int RearConnectorQuantity { get; set; } + /// + /// 号码管型号 + /// + [SugarColumn(IsNullable = true)] + public string NumberTubeModel { get; set; } + + /// + /// 号码管物料编码 + /// + [SugarColumn(IsNullable = true)] + public string NumberTubeMCode { get; set; } + + /// + /// 号码管长度 + /// + [SugarColumn(IsNullable = true)] + public int NumberTubeLength { get; set; } + [SugarColumn(IsNullable = true)] + public bool FrontConnectorIsPin { get; set; } + [SugarColumn(IsNullable = true)] + public bool RearConnectorIsPin { get; set; } + /// + /// 透明热缩管型号 + /// + [SugarColumn(IsNullable = true)] + public string TransparentHeatShrinkTubeModel { get; set; } + /// + /// 透明热缩管标示 + /// + [SugarColumn(IsNullable = true)] + public string TransparentHeatShrinkTubeDesc { get; set; } + /// + /// 透明热缩管物料编码 + /// + [SugarColumn(IsNullable = true)] + public string TransparentHeatShrinkTubeMCode { get; set; } + + /// + /// 黑色热缩管型号(插头) + /// + [SugarColumn(IsNullable = true)] + public string BlackHeatShrinkTubeModel { get; set; } + /// + /// 黑色热缩管物料编码(插头) + /// + [SugarColumn(IsNullable = true)] + public string BlackHeatShrinkTubeMCode { get; set; } + + /// + /// 黑色热缩管型号(剥线后) + /// + [SugarColumn(IsNullable = true)] + public string BlackHeatShrinkTubeModelAfterStripping { get; set; } + /// + /// 黑色热缩管物料编码(剥线后) + /// + [SugarColumn(IsNullable = true)] + public string BlackHeatShrinkTubeMCodeAfterStripping { get; set; } /// - /// 是否已布线 - /// - public bool Layouted { get; set; } = false; + /// 热缩管标识 + /// + [SugarColumn(IsNullable = true)] + public string HeatShrinkTubeDesc { get; set; } + + /// + /// 前段子剥线长度 + /// + [SugarColumn(IsNullable = true)] + public int FrontStrippingLength { get; set; } + /// + /// 后段子剥线长度 + /// + [SugarColumn(IsNullable = true)] + public int RearStrippingLength { get; set; } + + public bool Layouted { get; set; } } } diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Extension/ApplicationExt.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Extension/ApplicationExt.cs index 3fd1fa1..8c01c44 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Extension/ApplicationExt.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Extension/ApplicationExt.cs @@ -1,4 +1,5 @@ -using System; + +using System; using System.Windows; namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension @@ -36,9 +37,16 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Extension Resources = new ResourceDictionary { 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; + } } } diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs index 6e5218d..dd5b2ef 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs @@ -1,157 +1,732 @@ using MiniExcelLibs.Attributes; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; 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; } - public string UniqueKey { get; set; } - public string ProjectName { get; set; } - public string UserId { get; set; } - public string WireKey { get; set; } - public string ApplicationScenario { get; set; } - public string WireDiameterSpecification { get; set; } - public string IsHighFlexibilityStr { get; set; } - public string WireCoreCount { get; set; } + private string _uniqueKey; + public string UniqueKey + { + get => _uniqueKey; + set + { + if (_uniqueKey != value) + { + _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(); + } + } + } /// /// 引脚编号 /// - public string PinIndex { get; set; } + private string _pinIndex; + public string PinIndex + { + get => _pinIndex; + set + { + if (_pinIndex != value) + { + _pinIndex = value; + OnPropertyChanged(); + } + } + } + /// /// 线材型号规格 /// - public string WireModelSpecification { get; set; } + private string _wireModelSpecification; + public string WireModelSpecification + { + get => _wireModelSpecification; + set + { + if (_wireModelSpecification != value) + { + _wireModelSpecification = value; + OnPropertyChanged(); + } + } + } + /// /// 线材颜色名 /// - public string WireColorName { get; set; } + private string _wireColorName; + public string WireColorName + { + get => _wireColorName; + set + { + if (_wireColorName != value) + { + _wireColorName = value; + OnPropertyChanged(); + } + } + } + /// /// 线材颜色十六进制 /// - public string WireColorHex { get; set; } + private string _wireColorHex; + public string WireColorHex + { + get => _wireColorHex; + set + { + if (_wireColorHex != value) + { + _wireColorHex = value; + OnPropertyChanged(); + } + } + } + /// /// 线材颜色十六进制 次颜色 /// - 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; } /// /// 是否高柔 /// - public bool IsHighFlexibility { get; set; } - + private bool _isHighFlexibility; + public bool IsHighFlexibility + { + get => _isHighFlexibility; + set + { + if (_isHighFlexibility != value) + { + _isHighFlexibility = value; + OnPropertyChanged(); + } + } + } + /// /// 前连接物型号 /// - public string FrontConnectorModel { get; set; } + private string _frontConnectorModel; + public string FrontConnectorModel + { + get => _frontConnectorModel; + set + { + if (_frontConnectorModel != value) + { + _frontConnectorModel = value; + OnPropertyChanged(); + } + } + } /// /// 前连接物料号 /// - public string FrontConnectorMCode { get; set; } + private string _frontConnectorMCode; + public string FrontConnectorMCode + { + get => _frontConnectorMCode; + set + { + if (_frontConnectorMCode != value) + { + _frontConnectorMCode = value; + OnPropertyChanged(); + } + } + } + /// /// 前连接物数量 /// - public int FrontConnectorQuantity { get; set; } - + private int _frontConnectorQuantity; + public int FrontConnectorQuantity + { + get => _frontConnectorQuantity; + set + { + if (_frontConnectorQuantity != value) + { + _frontConnectorQuantity = value; + OnPropertyChanged(); + } + } + } /// /// 后连接物型号 /// - public string RearConnectorModel { get; set; } + private string _rearConnectorModel; + public string RearConnectorModel + { + get => _rearConnectorModel; + set + { + if (_rearConnectorModel != value) + { + _rearConnectorModel = value; + OnPropertyChanged(); + } + } + } /// /// 后连接物料号 /// - public string RearConnectorMCode { get; set; } + private string _rearConnectorMCode; + public string RearConnectorMCode + { + get => _rearConnectorMCode; + set + { + if (_rearConnectorMCode != value) + { + _rearConnectorMCode = value; + OnPropertyChanged(); + } + } + } + /// /// 后连接物数量 /// - public int RearConnectorQuantity { get; set; } + private int _rearConnectorQuantity; + public int RearConnectorQuantity + { + get => _rearConnectorQuantity; + set + { + if (_rearConnectorQuantity != value) + { + _rearConnectorQuantity = value; + OnPropertyChanged(); + } + } + } /// /// 号码管型号 /// - public string NumberTubeModel { get; set; } + private string _numberTubeModel; + public string NumberTubeModel + { + get => _numberTubeModel; + set + { + if (_numberTubeModel != value) + { + _numberTubeModel = value; + OnPropertyChanged(); + } + } + } /// /// 号码管物料编码 /// - public string NumberTubeMCode { get; set; } + private string _numberTubeMCode; + public string NumberTubeMCode + { + get => _numberTubeMCode; + set + { + if (_numberTubeMCode != value) + { + _numberTubeMCode = value; + OnPropertyChanged(); + } + } + } /// /// 号码管长度 /// - public int NumberTubeLength { get; set; } - public bool FrontConnectorIsPin { get; set; } - public bool RearConnectorIsPin { get; set; } + private int _numberTubeLength; + public int NumberTubeLength + { + 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(); + } + } + } + /// /// 透明热缩管型号 /// - public string TransparentHeatShrinkTubeModel { get; set; } + private string _transparentHeatShrinkTubeModel; + public string TransparentHeatShrinkTubeModel + { + get => _transparentHeatShrinkTubeModel; + set + { + if (_transparentHeatShrinkTubeModel != value) + { + _transparentHeatShrinkTubeModel = value; + OnPropertyChanged(); + } + } + } + /// /// 透明热缩管标示 /// - public string TransparentHeatShrinkTubeDesc { get; set; } + private string _transparentHeatShrinkTubeDesc; + public string TransparentHeatShrinkTubeDesc + { + get => _transparentHeatShrinkTubeDesc; + set + { + if (_transparentHeatShrinkTubeDesc != value) + { + _transparentHeatShrinkTubeDesc = value; + OnPropertyChanged(); + } + } + } + /// /// 透明热缩管物料编码 /// - public string TransparentHeatShrinkTubeMCode { get; set; } + private string _transparentHeatShrinkTubeMCode; + public string TransparentHeatShrinkTubeMCode + { + get => _transparentHeatShrinkTubeMCode; + set + { + if (_transparentHeatShrinkTubeMCode != value) + { + _transparentHeatShrinkTubeMCode = value; + OnPropertyChanged(); + } + } + } /// /// 黑色热缩管型号(插头) /// - public string BlackHeatShrinkTubeModel { get; set; } + private string _blackHeatShrinkTubeModel; + public string BlackHeatShrinkTubeModel + { + get => _blackHeatShrinkTubeModel; + set + { + if (_blackHeatShrinkTubeModel != value) + { + _blackHeatShrinkTubeModel = value; + OnPropertyChanged(); + } + } + } + /// /// 黑色热缩管物料编码(插头) /// - public string BlackHeatShrinkTubeMCode { get; set; } + private string _blackHeatShrinkTubeMCode; + public string BlackHeatShrinkTubeMCode + { + get => _blackHeatShrinkTubeMCode; + set + { + if (_blackHeatShrinkTubeMCode != value) + { + _blackHeatShrinkTubeMCode = value; + OnPropertyChanged(); + } + } + } /// /// 黑色热缩管型号(剥线后) /// - public string BlackHeatShrinkTubeModelAfterStripping { get; set; } + private string _blackHeatShrinkTubeModelAfterStripping; + public string BlackHeatShrinkTubeModelAfterStripping + { + get => _blackHeatShrinkTubeModelAfterStripping; + set + { + if (_blackHeatShrinkTubeModelAfterStripping != value) + { + _blackHeatShrinkTubeModelAfterStripping = value; + OnPropertyChanged(); + } + } + } + /// /// 黑色热缩管物料编码(剥线后) /// - public string BlackHeatShrinkTubeMCodeAfterStripping { get; set; } + private string _blackHeatShrinkTubeMCodeAfterStripping; + public string BlackHeatShrinkTubeMCodeAfterStripping + { + get => _blackHeatShrinkTubeMCodeAfterStripping; + set + { + if (_blackHeatShrinkTubeMCodeAfterStripping != value) + { + _blackHeatShrinkTubeMCodeAfterStripping = value; + OnPropertyChanged(); + } + } + } - /// /// 热缩管标识 /// - public string HeatShrinkTubeDesc { get; set; } + private string _heatShrinkTubeDesc; + public string HeatShrinkTubeDesc + { + get => _heatShrinkTubeDesc; + set + { + if (_heatShrinkTubeDesc != value) + { + _heatShrinkTubeDesc = value; + OnPropertyChanged(); + } + } + } /// /// 前段子剥线长度 /// - public int FrontStrippingLength { get; set; } + private int _frontStrippingLength; + public int FrontStrippingLength + { + get => _frontStrippingLength; + set + { + if (_frontStrippingLength != value) + { + _frontStrippingLength = value; + OnPropertyChanged(); + } + } + } + /// /// 后段子剥线长度 /// - public int RearStrippingLength { get; set; } - - public bool Layouted { get;set; } + private int _rearStrippingLength; + public int RearStrippingLength + { + 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; + /// + /// 插头型号 + /// + public string PlugModel + { + get => _plugModel; + set + { + if (_plugModel != value) + { + _plugModel = value; + OnPropertyChanged(); + } + } + } + private string _plugMCode; + /// + /// 插头料号 + /// + public string PlugMCode + { + get => _plugMCode; + set + { + if (_plugMCode != value) + { + _plugMCode = value; + OnPropertyChanged(); + } + } + } + private int _plugQty; + /// + /// 插头数量 + /// + public int PlugQty + { + get => _plugQty; + set + { + if (_plugQty != value) + { + _plugQty = value; + OnPropertyChanged(); + } + } + } private List _children = []; public List Children { - get { return _children; } - set { _children = value; } + get => _children; + 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)); } } } diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml index edc6546..a16aabc 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml @@ -52,40 +52,79 @@ + VirtualizingPanel.ScrollUnit="Pixel"> - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + +