From 07c665e481e2d523eead013d91f9b3cf2a1eca25 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Mon, 14 Apr 2025 09:12:39 +0800 Subject: [PATCH 1/8] =?UTF-8?q?105040=20Update=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=A0=87=E8=AF=86=EF=BC=8C=E5=8F=AA=E5=9C=A8?= =?UTF-8?q?DEBUG=E6=A8=A1=E5=BC=8F=E4=B8=8B=E5=90=AF=E7=94=A8=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=8A=9F=E8=83=BD=E4=B8=8E=E5=A4=9A=E8=8A=AF=E7=BA=BF?= =?UTF-8?q?=E7=BA=BF=E6=9D=90=E9=80=89=E5=9E=8B=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultiCoreWirePluginEntry.cs | 6 ++++- Sinvo.EplanHpD.Plugin/PluginEntry.cs | 24 +++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Sinvo.EplanHpD.Plugin/MultiCoreWirePluginEntry.cs b/Sinvo.EplanHpD.Plugin/MultiCoreWirePluginEntry.cs index 99c689f..4d6e86a 100644 --- a/Sinvo.EplanHpD.Plugin/MultiCoreWirePluginEntry.cs +++ b/Sinvo.EplanHpD.Plugin/MultiCoreWirePluginEntry.cs @@ -16,7 +16,7 @@ using System.Windows.Forms.Integration; namespace Sinvo.EplanHpD.Plugin { -#if Release_WireAndCable || DEBUG +#if DEBUG public class MultiCoreWirePluginEntry : EPLAN.Harness.API.Plugins.IHpDPlugin #else public class MultiCoreWirePluginEntry @@ -59,6 +59,7 @@ namespace Sinvo.EplanHpD.Plugin public void Execute(HpdApi api) { +#if DEBUG bool isLogin = PluginServices.IsLogin; if (!isLogin) { @@ -70,6 +71,7 @@ namespace Sinvo.EplanHpD.Plugin } if (isLogin) { +#endif new DBHelper().CodeFirst(); var doc = api.CurrentProject.GetActiveDocument(); if (window == null) @@ -92,7 +94,9 @@ namespace Sinvo.EplanHpD.Plugin window.WindowState = System.Windows.WindowState.Normal; window.Activate(); } +#if DEBUG } +#endif } public void Initialize() { diff --git a/Sinvo.EplanHpD.Plugin/PluginEntry.cs b/Sinvo.EplanHpD.Plugin/PluginEntry.cs index 67653bb..ad94036 100644 --- a/Sinvo.EplanHpD.Plugin/PluginEntry.cs +++ b/Sinvo.EplanHpD.Plugin/PluginEntry.cs @@ -61,17 +61,17 @@ namespace Sinvo.EplanHpD.Plugin private MainWindow window; public void Execute(HpdApi api) { - bool isLogin = PluginServices.IsLogin; - if (!isLogin) - { - var LoginWindow = new LoginWindow(); - if (LoginWindow.ShowDialog() == true) - { - isLogin = PluginServices.IsLogin; - } - } - if (isLogin) - { + //bool isLogin = PluginServices.IsLogin; + //if (!isLogin) + //{ + // var LoginWindow = new LoginWindow(); + // if (LoginWindow.ShowDialog() == true) + // { + // isLogin = PluginServices.IsLogin; + // } + //} + //if (isLogin) + //{ bool isUpdated = false; try @@ -150,7 +150,7 @@ namespace Sinvo.EplanHpD.Plugin { FlexMessageBox.Error(ex.ToString()); } - } + //} } public void Initialize() From dce99c813c8d87f26ab31c09318319c118db6bf9 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Mon, 14 Apr 2025 09:14:39 +0800 Subject: [PATCH 2/8] =?UTF-8?q?105040=20Update=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultiCoreWire/MultiCoreWireWindow.xaml | 30 ++++++++++++------- .../MultiCoreWireViewModel.cs | 3 +- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml index eafffc0..a182168 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml @@ -23,7 +23,11 @@ - + + + + + - - - - - - - - - - + + + + + + + + + + + Date: Mon, 14 Apr 2025 10:27:18 +0800 Subject: [PATCH 3/8] =?UTF-8?q?105040=20Update=20=E6=B8=85=E7=90=86?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Models/CableLectotype/LectotypeLineModel.cs | 2 +- Sinvo.EplanHpD.Plugin.WPFUI/Utils/LectotypeManager.cs | 4 ++-- Sinvo.EplanHpD.Plugin.WPFUI/View/LoginWindow.xaml.cs | 2 +- .../View/Scanner/ScannerInfo.xaml.cs | 8 ++++---- .../View/WireCheck/MainWindow.xaml.cs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/CableLectotype/LectotypeLineModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/CableLectotype/LectotypeLineModel.cs index 5ff0b2a..ce6ba82 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Models/CableLectotype/LectotypeLineModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/CableLectotype/LectotypeLineModel.cs @@ -288,7 +288,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models } } - private string _cableModelNo; + //private string _cableModelNo; public string CableModelNo { get diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Utils/LectotypeManager.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/LectotypeManager.cs index 00df2ba..1709c68 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Utils/LectotypeManager.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/LectotypeManager.cs @@ -37,7 +37,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils } CableLectotypeViewModel viewModel = null; - Task.Factory.StartNew(() => + await Task.Factory.StartNew(() => { var service = new MotorLectotypeService(); var data = service.GetMotorLectotypeData(motor.GetUniqueFlag()); @@ -55,7 +55,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils } } - }).Wait(); + }); if (viewModel == null) { return new CableLectotypeViewModel(motor); diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/LoginWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/LoginWindow.xaml.cs index 0215dea..b873e1d 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/LoginWindow.xaml.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/LoginWindow.xaml.cs @@ -67,7 +67,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View { viewModel.User = user; viewModel.IsRemember = true; - _ = this.Dispatcher.BeginInvoke(() => + await this.Dispatcher.BeginInvoke(() => { this.PasswordTxt.Password = user.UserPassword; LoadGroupAndRole(); diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/Scanner/ScannerInfo.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/Scanner/ScannerInfo.xaml.cs index 7547173..f634f32 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/Scanner/ScannerInfo.xaml.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/Scanner/ScannerInfo.xaml.cs @@ -66,7 +66,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View /// private void Button_Click(object sender, RoutedEventArgs e) { - if (string.IsNullOrEmpty(_scannerViewModel.S_part)) ; + if (string.IsNullOrEmpty(_scannerViewModel.S_part)) { } else { _scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().S_PartID); @@ -79,7 +79,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View /// private void Button_Click_1(object sender, RoutedEventArgs e) { - if (string.IsNullOrEmpty(_scannerViewModel.S_pin)) ; + if (string.IsNullOrEmpty(_scannerViewModel.S_pin)) { } else { _scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().S_pinID); @@ -88,7 +88,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View private void Button_Click_2(object sender, RoutedEventArgs e) { - if (string.IsNullOrEmpty(_scannerViewModel.E_part)) ; + if (string.IsNullOrEmpty(_scannerViewModel.E_part)) { } else { _scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().E_PartID); @@ -97,7 +97,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View private void Button_Click_3(object sender, RoutedEventArgs e) { - if (string.IsNullOrEmpty(_scannerViewModel.E_pin)) ; + if (string.IsNullOrEmpty(_scannerViewModel.E_pin)) { } else { _scannerViewModel.ToSourceById(_scannerViewModel._ScanCableModels.FirstOrDefault().E_pinID); diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/WireCheck/MainWindow.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/WireCheck/MainWindow.xaml.cs index 969d869..435b2ee 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/WireCheck/MainWindow.xaml.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/WireCheck/MainWindow.xaml.cs @@ -178,7 +178,7 @@ public partial class MainWindow : System.Windows.Window Task.WaitAll(dataColumns, data); var stuffedData = ViewModel.StuffData(data.Result); - _ = stuffedData.ContinueWith(x => + await stuffedData.ContinueWith(x => { _ = this.Dispatcher.BeginInvoke(delegate () { From 90a766d606ba33f9974d71f79874d5bce24ac286 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Mon, 14 Apr 2025 17:58:45 +0800 Subject: [PATCH 4/8] =?UTF-8?q?105040=20Update=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=80=89=E5=9E=8B=E7=95=8C=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sinvo.EplanHpD.Plugin.WPFUI/Datas/Brands.cs | 6 +- .../MultiCoreWire/MultiCoreWireWindow.xaml | 270 ++++++++++++------ 2 files changed, 190 insertions(+), 86 deletions(-) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Datas/Brands.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Datas/Brands.cs index b576dac..c25a734 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Datas/Brands.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Datas/Brands.cs @@ -41,7 +41,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Datas 5. 数据表中Sheet名称: 安川 */ {ANCHUAN, - new BrandData{ + new BrandData { Name = ANCHUAN, ComplexLine = false, SheetName = ANCHUAN, @@ -61,7 +61,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Datas 5. 数据表中Sheet名称: 汇川 */ {HUICHUAN, - new BrandData{ + new BrandData { Name = HUICHUAN, ComplexLine = false, SheetName = HUICHUAN, @@ -81,7 +81,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Datas 5. 数据表中Sheet名称: HK_KT */ {SANLING_HK_KT, - new BrandData{ + new BrandData { Name = SANLING_HK_KT, ComplexLine = true, SheetName = SANLING_HK_KT, diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml index a182168..9aa4ad0 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/MultiCoreWireWindow.xaml @@ -25,102 +25,207 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + VerticalAlignment="Top" + Orientation="Vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + - + - From 4212086da157966dedf558268939206b55d9e274 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Tue, 22 Apr 2025 14:33:49 +0800 Subject: [PATCH 5/8] =?UTF-8?q?105040=20Update=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=A4=9A=E8=8A=AF=E7=BA=BF=E7=BA=BF=E6=9D=90=E9=80=89=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultiCoreWire/MultiCoreWireDataModel.cs | 5 +- .../MultiCoreWire/MultiCoreWireLecModel.cs | 447 ++++++++++- .../MultiCoreWireTerminalModel.cs | 27 + .../Sinvo.EplanHpD.Plugin.WPFUI.csproj | 8 + .../Utils/MultiCoreWireExcelHelper.cs | 3 +- .../MultiCoreWireLayoutHelperWindow.xaml | 79 ++ .../MultiCoreWireLayoutHelperWindow.xaml.cs | 33 + .../MultiCoreWire/MultiCoreWireWindow.xaml | 705 ++++++++++-------- .../MultiCoreWire/MultiCoreWireWindow.xaml.cs | 16 +- .../MultiCoreWireViewModel.cs | 312 +++++--- 10 files changed, 1188 insertions(+), 447 deletions(-) create mode 100644 Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireTerminalModel.cs create mode 100644 Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml create mode 100644 Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml.cs diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs index 5e8c035..283db85 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireDataModel.cs @@ -34,10 +34,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Models /// 是否高柔 /// public bool IsHighFlexibility { get; set; } - /// - /// 插头型号 - /// - public string ConnectorModel { get; set; } + /// /// 前端子型号 /// diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs index e447d7d..1502878 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireLecModel.cs @@ -1,4 +1,5 @@ using MiniExcelLibs.Attributes; +using Sinvo.EplanHpD.Plugin.WPFUI.Models.MultiCoreWire; using System; using System.Collections.Generic; using System.ComponentModel; @@ -7,66 +8,460 @@ using System.Text; using System.Threading.Tasks; namespace Sinvo.EplanHpD.Plugin.WPFUI.Models -{ - public class MultiCoreWireLecModel +{ + public class MultiCoreWireLecModel : INotifyPropertyChanged { /* * 应用场景 类型 线径规格(mm2) 是否高柔 线芯数 线材型号规格 插头型号 前端子型号 后端子型号 */ + private int _seqNo; + public int SeqNo + { + get => _seqNo; + set + { + _seqNo = value; + OnPropertyChanged(nameof(SeqNo)); + } + } + /// /// 应用场景 /// + private string _applicationScenario; [ExcelColumn(Name = "应用场合")] - public string ApplicationScenario { get; set; } + public string ApplicationScenario + { + get => _applicationScenario; + set + { + _applicationScenario = value; + OnPropertyChanged(nameof(ApplicationScenario)); + } + } + /// /// 线材类型 /// - [ExcelColumn(Ignore = true)] - public string WireType { get; set; } + private string _wireType; + [ExcelColumn(Ignore = true)] + public string WireType + { + get => _wireType; + set + { + _wireType = value; + OnPropertyChanged(nameof(WireType)); + } + } + /// /// 线径规格(mm2) /// + private string _wireDiameterSpecification; [ExcelColumn(IndexName = "F")] - public string WireDiameterSpecification { get; set; } - /// - /// 是否高柔 - /// - [ExcelColumn(Ignore = true)] - public bool IsHighFlexibility { get; set; } + public string WireDiameterSpecification + { + get => _wireDiameterSpecification; + set + { + _wireDiameterSpecification = value; + OnPropertyChanged(nameof(WireDiameterSpecification)); + } + } /// /// 是否高柔 /// + private bool _isHighFlexibility; + [ExcelColumn(Ignore = true)] + public bool IsHighFlexibility + { + get => _isHighFlexibility; + set + { + _isHighFlexibility = value; + OnPropertyChanged(nameof(IsHighFlexibility)); + } + } + + /// + /// 是否高柔 + /// + private string _isHighFlexibilityStr; [ExcelColumn(Name = "是否高柔")] - public string IsHighFlexibilityStr { get; set; } + public string IsHighFlexibilityStr + { + get => _isHighFlexibilityStr; + set + { + _isHighFlexibilityStr = value; + OnPropertyChanged(nameof(IsHighFlexibilityStr)); + } + } + /// /// 线芯数 /// + private string _wireCoreCount; [ExcelColumn(Name = "线芯数")] - public string WireCoreCount { get; set; } + public string WireCoreCount + { + get => _wireCoreCount; + set + { + _wireCoreCount = value; + OnPropertyChanged(nameof(WireCoreCount)); + } + } + /// /// 线材型号规格 /// + private string _wireModelSpecification; [ExcelColumn(Name = "线材型号规格")] - public string WireModelSpecification { get; set; } + public string WireModelSpecification + { + get => _wireModelSpecification; + set + { + _wireModelSpecification = value; + OnPropertyChanged(nameof(WireModelSpecification)); + } + } + /// /// 插头型号 /// + private string _connectorModel; [ExcelColumn(Name = "插头型号")] - public string ConnectorModel { get; set; } - /// - /// 前端子型号 - /// - [ExcelColumn(Ignore = true)] - public string FrontTerminalModel { get; set; } - /// - /// 后端子型号 - /// - [ExcelColumn(Ignore = true)] - public string BackTerminalModel { get; set; } + public string ConnectorModel + { + get => _connectorModel; + set + { + _connectorModel = value; + OnPropertyChanged(nameof(ConnectorModel)); + } + } - + /// + /// 叉耳端子 + /// + private string _forkTerminal; + [ExcelColumn(Name = "叉耳端子")] + public string ForkTerminal + { + get => _forkTerminal; + set + { + _forkTerminal = value; + OnPropertyChanged(nameof(ForkTerminal)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + /// + /// 叉耳端子剥线长度(mm) + /// + private double _forkTerminalStripLength; + [ExcelColumn(Name = "叉耳端子剥线长度(mm)")] + public double ForkTerminalStripLength + { + get => _forkTerminalStripLength; + set + { + _forkTerminalStripLength = value; + OnPropertyChanged(nameof(ForkTerminalStripLength)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 叉耳端子物料编码 + /// + private string _forkTerminalMaterialCode; + [ExcelColumn(Name = "叉耳端子物料编码")] + public string ForkTerminalMaterialCode + { + get => _forkTerminalMaterialCode; + set + { + _forkTerminalMaterialCode = value; + OnPropertyChanged(nameof(ForkTerminalMaterialCode)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 扁形端子 + /// + private string _flatTerminal; + [ExcelColumn(Name = "扁形端子")] + public string FlatTerminal + { + get => _flatTerminal; + set + { + _flatTerminal = value; + OnPropertyChanged(nameof(FlatTerminal)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 扁形端子剥线长度(mm) + /// + private double _flatTerminalStripLength; + [ExcelColumn(Name = "扁形端子剥线长度(mm)")] + public double FlatTerminalStripLength + { + get => _flatTerminalStripLength; + set + { + _flatTerminalStripLength = value; + OnPropertyChanged(nameof(FlatTerminalStripLength)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 扁形端子物料编码 + /// + private string _flatTerminalMaterialCode; + [ExcelColumn(Name = "扁形端子物料编码")] + public string FlatTerminalMaterialCode + { + get => _flatTerminalMaterialCode; + set + { + _flatTerminalMaterialCode = value; + OnPropertyChanged(nameof(FlatTerminalMaterialCode)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// O型端子 + /// + private string _oTypeTerminal; + [ExcelColumn(Name = "O型端子")] + public string OTypeTerminal + { + get => _oTypeTerminal; + set + { + _oTypeTerminal = value; + OnPropertyChanged(nameof(OTypeTerminal)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// O型端子剥线长度(mm) + /// + private double _oTypeTerminalStripLength; + [ExcelColumn(Name = "O型端子剥线长度(mm)")] + public double OTypeTerminalStripLength + { + get => _oTypeTerminalStripLength; + set + { + _oTypeTerminalStripLength = value; + OnPropertyChanged(nameof(OTypeTerminalStripLength)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// O型端子物料编码 + /// + private string _oTypeTerminalMaterialCode; + [ExcelColumn(Name = "O型端子物料编码")] + public string OTypeTerminalMaterialCode + { + get => _oTypeTerminalMaterialCode; + set + { + _oTypeTerminalMaterialCode = value; + OnPropertyChanged(nameof(OTypeTerminalMaterialCode)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 针型端子 + /// + private string _pinTerminal; + [ExcelColumn(Name = "针型端子")] + public string PinTerminal + { + get => _pinTerminal; + set + { + _pinTerminal = value; + OnPropertyChanged(nameof(PinTerminal)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 针型端子剥线长度(mm) + /// + private double _pinTerminalStripLength; + [ExcelColumn(Name = "针型端子剥线长度(mm)")] + public double PinTerminalStripLength + { + get => _pinTerminalStripLength; + set + { + _pinTerminalStripLength = value; + OnPropertyChanged(nameof(PinTerminalStripLength)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 针型端子物料编码 + /// + private string _pinTerminalMaterialCode; + [ExcelColumn(Name = "针型端子物料编码")] + public string PinTerminalMaterialCode + { + get => _pinTerminalMaterialCode; + set + { + _pinTerminalMaterialCode = value; + OnPropertyChanged(nameof(PinTerminalMaterialCode)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// Y形端子 + /// + private string _yTypeTerminal; + [ExcelColumn(Name = "Y形端子")] + public string YTypeTerminal + { + get => _yTypeTerminal; + set + { + _yTypeTerminal = value; + OnPropertyChanged(nameof(YTypeTerminal)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// Y形端子剥线长度(mm) + /// + private double _yTypeTerminalStripLength; + [ExcelColumn(Name = "Y形端子剥线长度(mm)")] + public double YTypeTerminalStripLength + { + get => _yTypeTerminalStripLength; + set + { + _yTypeTerminalStripLength = value; + OnPropertyChanged(nameof(YTypeTerminalStripLength)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// Y形端子物料编码 + /// + private string _yTypeTerminalMaterialCode; + [ExcelColumn(Name = "Y形端子物料编码")] + public string YTypeTerminalMaterialCode + { + get => _yTypeTerminalMaterialCode; + set + { + _yTypeTerminalMaterialCode = value; + OnPropertyChanged(nameof(YTypeTerminalMaterialCode)); + OnPropertyChanged(nameof(TerminalModels)); + } + } + + /// + /// 前连接 + /// + private string _frontConnectorModel; + [ExcelColumn(Ignore = true)] + public string FrontConnectorModel + { + get => _frontConnectorModel; + set + { + _frontConnectorModel = value; + OnPropertyChanged(nameof(FrontConnectorModel)); + } + } + + /// + /// 后连接 + /// + private string _backConnectorModel; + [ExcelColumn(Ignore = true)] + public string BackConnectorModel + { + get => _backConnectorModel; + set + { + _backConnectorModel = value; + OnPropertyChanged(nameof(BackConnectorModel)); + } + } + + + [ExcelColumn(Ignore = true)] + public List 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)); + } } } diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireTerminalModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireTerminalModel.cs new file mode 100644 index 0000000..0820bb7 --- /dev/null +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Models/MultiCoreWire/MultiCoreWireTerminalModel.cs @@ -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 + { + /// + /// 端子型号 + /// + public string TerminalModel { get; set; } + + /// + /// 端子剥线长度(mm) + public double TerminalStripLength { get; set; } + + /// + /// 端子物料编码 + /// + public string TerminalMaterialCode { get; set; } + + } +} diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj index bae9ae8..41342f4 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Sinvo.EplanHpD.Plugin.WPFUI.csproj @@ -253,6 +253,7 @@ + @@ -308,6 +309,9 @@ LoginWindow.xaml + + MultiCoreWireLayoutHelperWindow.xaml + MultiCoreWireWindow.xaml @@ -348,6 +352,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/Utils/MultiCoreWireExcelHelper.cs b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/MultiCoreWireExcelHelper.cs index b6f04dd..27997bd 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/Utils/MultiCoreWireExcelHelper.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/Utils/MultiCoreWireExcelHelper.cs @@ -39,6 +39,7 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.Utils var data = MiniExcel.Query(dataFileStream,sheetName: "多芯线WPS数据配对"); //MiniExcel.Query() return data; - } + } + } } diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml new file mode 100644 index 0000000..2b8e323 --- /dev/null +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/MultiCoreWire/LayoutHelper/MultiCoreWireLayoutHelperWindow.xaml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +