From 9d346502eb7235e01654d9665b5fbdb131c437a2 Mon Sep 17 00:00:00 2001 From: supercjj2023 Date: Mon, 22 Sep 2025 15:42:18 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=92=8C=E5=B8=83=E7=BD=AE=E5=9B=BE?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=80=BC=E6=9C=89=E5=85=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learun.Application.Web/AppApi/IOModuleApiController.cs | 4 ++-- Learun.Application.Web/AppApi/PlotLayoutApiController.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Learun.Application.Web/AppApi/IOModuleApiController.cs b/Learun.Application.Web/AppApi/IOModuleApiController.cs index 95e49413..2dc853ef 100644 --- a/Learun.Application.Web/AppApi/IOModuleApiController.cs +++ b/Learun.Application.Web/AppApi/IOModuleApiController.cs @@ -88,7 +88,7 @@ namespace Learun.Application.Web.AppApi return -1;//无效的x off导致的 } if (double.TryParse(nearPanelProps.FirstOrDefault(x => x.PropertyName == GlobalObject.propName_YOff)?.PropertyValue, - , out double YOffValue)) + out double YOffValue)) { } @@ -129,7 +129,7 @@ namespace Learun.Application.Web.AppApi return null;//无效的x off导致的 } if (double.TryParse(curPanelProps.FirstOrDefault(x => x.PropertyName == GlobalObject.propName_YOff)?.PropertyValue, -, out double AssignPanelYValue)) + out double AssignPanelYValue)) { } diff --git a/Learun.Application.Web/AppApi/PlotLayoutApiController.cs b/Learun.Application.Web/AppApi/PlotLayoutApiController.cs index e219c15f..2624e147 100644 --- a/Learun.Application.Web/AppApi/PlotLayoutApiController.cs +++ b/Learun.Application.Web/AppApi/PlotLayoutApiController.cs @@ -181,7 +181,7 @@ namespace Learun.Application.Web.AppApi { #region 每个基点关联的设备 //甲板 区域都和基点一致的设备 - var DeckMatchedTagIds = EquipPropAll.Where(x => x.PropertyName == "甲板号" && x.PropertyValue == basePoint.deck).Select(X => X.EngineDataID).ToList(); + var DeckMatchedTagIds = EquipPropAll.Where(x => x.PropertyName == "甲板号" && (x.PropertyValue?.Split(new[] { "||" }, StringSplitOptions.None)[0] == basePoint.deck)).Select(X => X.EngineDataID).ToList(); //var AreaMatchedTagIds = EquipPropAll.Where(x => x.PropertyName == "区域" && x.PropertyValue == basePoint.area).Select(X => X.EngineDataID).ToList(); //#task 9542 var matchPointTagIds = DeckMatchedTagIds;//.Intersect(AreaMatchedTagIds).ToList(); From 2e665e9f3d652cc306f545046069c2e1e49294f2 Mon Sep 17 00:00:00 2001 From: xingheng Date: Mon, 22 Sep 2025 15:44:15 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=86=E9=85=8D?= =?UTF-8?q?=EF=BC=88=E5=B0=B1=E8=BF=91=E6=89=BE=E9=87=87=E9=9B=86=E7=AE=B1?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=AE=8C=E6=88=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppApi/IOModuleApiController.cs | 74 ++++++----- .../ZZDT_EC/ec_cable/ec_CableBLL.cs | 119 ++++++++++-------- .../ZZDT_EC/ec_cable/ec_CableEntity.cs | 3 +- 3 files changed, 113 insertions(+), 83 deletions(-) diff --git a/Learun.Application.Web/AppApi/IOModuleApiController.cs b/Learun.Application.Web/AppApi/IOModuleApiController.cs index 95e49413..8582a605 100644 --- a/Learun.Application.Web/AppApi/IOModuleApiController.cs +++ b/Learun.Application.Web/AppApi/IOModuleApiController.cs @@ -1,4 +1,5 @@ using DocumentFormat.OpenXml.Drawing.Spreadsheet; +using DocumentFormat.OpenXml.Spreadsheet; using Learun.Application.Organization; using Learun.Application.TwoDevelopment.ZZDT_EC; using Learun.Application.TwoDevelopment.ZZDT_EC.Frame; @@ -47,7 +48,7 @@ namespace Learun.Application.Web.AppApi /// - /// 找到某一个预分配箱子 附近的某一个箱子 + /// 找到某一个预分配箱子 附近的某一个箱子。且io类型能匹配上 /// /// /// @@ -55,9 +56,10 @@ namespace Learun.Application.Web.AppApi /// Digital,4-20mA,10v,pt100,pulse /// - private ec_PanelEntity FindPanelNearby(string curPanelId, List frameLists, List allPanel, + private ec_PanelEntity FindPanelNearby(ec_CableEntity cableObj, List frameLists, List allPanel, Dictionary> allPanelProps, string IOTypeOnCable) { + var curPanelId = cableObj.PanelID; double GetPanelXYDistance2Target(string panelId, double targetX, double targetY) { var nearPanel = allPanel.FirstOrDefault(x => x.PanelID == panelId); @@ -88,7 +90,7 @@ namespace Learun.Application.Web.AppApi return -1;//无效的x off导致的 } if (double.TryParse(nearPanelProps.FirstOrDefault(x => x.PropertyName == GlobalObject.propName_YOff)?.PropertyValue, - , out double YOffValue)) + out double YOffValue)) { } @@ -129,7 +131,7 @@ namespace Learun.Application.Web.AppApi return null;//无效的x off导致的 } if (double.TryParse(curPanelProps.FirstOrDefault(x => x.PropertyName == GlobalObject.propName_YOff)?.PropertyValue, -, out double AssignPanelYValue)) + out double AssignPanelYValue)) { } @@ -141,33 +143,49 @@ namespace Learun.Application.Web.AppApi foreach (var panel in allPanel.Where(x => x.PanelID != curPanelId)) { #region io + var IOMatched = true; + var IOsOnPanel = panel.allowedIOTypes.Split(',').ToList(); + //剩下的感觉都可以是set上的参数? + foreach (var set in cableObj.Sets) + { + #region 判断下io匹配程度 + var setNew = ec_CableBLL.SetIOMatchPanel(cableObj.PreAssignIOType, set, IOsOnPanel); - #endregion - #region distance - //拿到每一个的xy属性 - //然后和预分配箱子进行对比 - var DISTANCE = GetPanelXYDistance2Target(panel.PanelID, AssignPanelXValue + AssignPanelXOffValue, AssignPanelYValue); - - if (0.1 == minDistance && DISTANCE > 0) - { - minDistance = DISTANCE; nearestPanel = panel; - } - else if (DISTANCE < minDistance && DISTANCE > 0) - { - minDistance = DISTANCE; nearestPanel = panel; + if (IOsOnPanel.Contains(setNew.IOType.ToString())) + { + setNew.IOTypeMatch = true; + + } + else + { + setNew.IOTypeMatch = false; IOMatched = false; + //不匹配 + break; + } + #endregion } #endregion + if (IOMatched) + { + //如果io匹配了,再找附近的 + #region distance + //拿到每一个的xy属性 + //然后和预分配箱子进行对比 + var DISTANCE = GetPanelXYDistance2Target(panel.PanelID, AssignPanelXValue + AssignPanelXOffValue, AssignPanelYValue); - } - //根据电缆上的信号,去找匹配的排序第一位(已经按照距离排序过)的箱子 - switch (IOTypeOnCable.ToUpper()) - { - case "DIGITAL": - //其他就近箱子的 allowIOTypes里有DI DO - break; - default: - break; - } + if (0.1 == minDistance && DISTANCE > 0) + { + minDistance = DISTANCE; nearestPanel = panel; + } + else if (DISTANCE < minDistance && DISTANCE > 0) + { + minDistance = DISTANCE; nearestPanel = panel; + } + #endregion + } + + + } return nearestPanel; } @@ -421,7 +439,7 @@ namespace Learun.Application.Web.AppApi bool nearbyFound = false; foreach (var cable in cablesNotMatchIO) { - var nearPanel = FindPanelNearby(cable.PanelID, allFrames, allPanel, allPanelProp, cable.PreAssignIOType); + var nearPanel = FindPanelNearby(cable, allFrames, allPanel, allPanelProp, cable.PreAssignIOType); if (nearPanel == null) { nearbyFound = false; diff --git a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableBLL.cs b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableBLL.cs index 46cc3663..b79e078b 100644 --- a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableBLL.cs +++ b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableBLL.cs @@ -1,4 +1,5 @@ using DocumentFormat.OpenXml.Drawing.Spreadsheet; +using DocumentFormat.OpenXml.Spreadsheet; using Learun.Util; using Learun.Util.SqlSugar; using SqlSugar; @@ -7,6 +8,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Data; using System.Linq; +using System.Windows; namespace Learun.Application.TwoDevelopment.ZZDT_EC { @@ -314,70 +316,27 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC foreach (var set in sets) { #region 判断下io匹配程度 - if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输入.ToString() && cable.PreAssignIOType.ToLower() == "digital") + var setNew = SetIOMatchPanel(cable.PreAssignIOType, set, IOsOnPanel); + + if (IOsOnPanel.Contains(setNew.IOType.ToString())) { - set.IOType = GlobalEnum.IOType.DI; - } - else if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输出.ToString() && cable.PreAssignIOType.ToLower() == "digital") - { - set.IOType = GlobalEnum.IOType.DO; - } - else if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输入.ToString() && cable.PreAssignIOType == "4~20mA") - { - set.IOType = GlobalEnum.IOType.AI; - } - else if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输出.ToString() && cable.PreAssignIOType == "4~20mA") - { - set.IOType = GlobalEnum.IOType.AO; - } - else if (cable.PreAssignIOType == "10v") - { - set.IOType = GlobalEnum.IOType.TenVolt; - } - else if (cable.PreAssignIOType == GlobalEnum.signalType.PT100.ToString()) - { - set.IOType = GlobalEnum.IOType.PT100; - } - else if (cable.PreAssignIOType.ToUpper() == GlobalEnum.signalType.PULSE.ToString()) - { - set.IOType = GlobalEnum.IOType.PULSE; - } - else if (cable.PreAssignIOType == GlobalEnum.signalType.PT100.ToString()) - { - set.IOType = GlobalEnum.IOType.PT100; - } - //下面是通讯的 - else - { - - } - - if (IOsOnPanel.Contains(set.IOType.ToString())) - { - set.IOTypeMatch = true; + setNew.IOTypeMatch = true; } else { - set.IOTypeMatch = false; - cable.IOTypesNotMatchedList.Add(set.IOType.ToString());//从电缆上就能知道哪些io是匹配补上的 + setNew.IOTypeMatch = false; + cable.IOTypesNotMatchedList.Add(setNew.IOType.ToString());//从电缆上就能知道哪些io是匹配补上的 } #endregion - var wires = Wires.Where(x => x.CableSetID == set.CableSetID); - set.Wires = wires.ToList(); + var wires = Wires.Where(x => x.CableSetID == setNew.CableSetID); + setNew.Wires = wires.ToList(); + cable.Sets.Add(setNew); } - cable.Sets = sets; - //if (cable.Sets.Any(x => !x.IOTypeMatch)) - //{ - // cable.IOTypeMatch = true; - //} - //else - //{ - // cable.IOTypeMatch = false; - //} + //cable.Sets = sets; } - //分组 + //排序 preAssignedCables = preAssignedCables.OrderBy(x => x.PreAssignIOType).ToList(); @@ -397,7 +356,59 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC else { ec_CableService.DeleteEntity(ProjectId, CableID); } } + /// + /// 预分配的电缆上的io,是否和电缆上的io能匹配 + /// + /// + public static ec_CableSetEntity SetIOMatchPanel(string signalOnCable, ec_CableSetEntity set, List IOsOnPanel) + { + //var IOsOnPanel = panelObj.allowedIOTypes.Split(',').ToList(); + //剩下的感觉都可以是set上的参数? + + + #region 判断下io匹配程度 + if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输入.ToString() && signalOnCable.ToLower() == "digital") + { + set.IOType = GlobalEnum.IOType.DI; + } + else if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输出.ToString() && signalOnCable.ToLower() == "digital") + { + set.IOType = GlobalEnum.IOType.DO; + } + else if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输入.ToString() && signalOnCable == "4~20mA") + { + set.IOType = GlobalEnum.IOType.AI; + } + else if (set.PreAssignInOrOut == GlobalEnum.inOrOut.输出.ToString() && signalOnCable == "4~20mA") + { + set.IOType = GlobalEnum.IOType.AO; + } + else if (signalOnCable == "10v") + { + set.IOType = GlobalEnum.IOType.TenVolt; + } + else if (signalOnCable == GlobalEnum.signalType.PT100.ToString()) + { + set.IOType = GlobalEnum.IOType.PT100; + } + else if (signalOnCable.ToUpper() == GlobalEnum.signalType.PULSE.ToString()) + { + set.IOType = GlobalEnum.IOType.PULSE; + } + else if (signalOnCable == GlobalEnum.signalType.PT100.ToString()) + { + set.IOType = GlobalEnum.IOType.PT100; + } + //下面是通讯的 + else + { + } + + #endregion + + return set; + } /// /// 保存实体数据(新增、修改) /// 主键 diff --git a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableEntity.cs b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableEntity.cs index bea6c0f0..f9bf1f49 100644 --- a/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableEntity.cs +++ b/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ZZDT_EC/ec_cable/ec_CableEntity.cs @@ -147,7 +147,8 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC /// - /// From连接处的工程位号信息。同时,也表达下预分配电缆panelid对应的柜子信息。 + /// From连接处的工程位号信息。 + /// 同时,也表达下预分配电缆panelid对应的柜子信息。 /// [SugarColumn(IsIgnore = true)] public ec_PanelEntity ToPanel { set; get; } From 7d17fab113a51294242633a5ba9c5eeed55de194 Mon Sep 17 00:00:00 2001 From: supercjj2023 Date: Tue, 23 Sep 2025 15:17:57 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E7=94=B1=E4=BA=8Euserid=E4=B8=BANULL?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=AF=B9=E8=B1=A1=E5=B1=9E=E6=80=A7=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppApi/ObjectTypeApiController.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Learun.Application.Web/AppApi/ObjectTypeApiController.cs b/Learun.Application.Web/AppApi/ObjectTypeApiController.cs index 8fe7effb..7aa15d4a 100644 --- a/Learun.Application.Web/AppApi/ObjectTypeApiController.cs +++ b/Learun.Application.Web/AppApi/ObjectTypeApiController.cs @@ -631,10 +631,17 @@ namespace Learun.Application.Web.AppApi //每个位号的属性信息 foreach (var tag in objectType.tags) { - if (userDict.TryGetValue(tag.CreateUserID, out string createUserName)) + if (!string.IsNullOrEmpty(tag.CreateUserID)) { - tag.CreateUserName = createUserName;// allUser.FirstOrDefault(x => x.F_UserId == item.CreateUserID)?.F_RealName; + if (userDict.TryGetValue(tag.CreateUserID, out string createUserName)) + { + tag.CreateUserName = createUserName;// allUser.FirstOrDefault(x => x.F_UserId == item.CreateUserID)?.F_RealName; + } + } + else + { + tag.CreateUserName = string.Empty; } tag.EngineDataProperty = tagPropDictByTag[tag.EngineDataID];// tagPropAll.Where(x => x.EngineDataID == tag.EngineDataID).ToList(); From e24ee573558b8f81ad78544efcfe2a8d77c299d4 Mon Sep 17 00:00:00 2001 From: "CHEN-ZW\\acer" Date: Tue, 23 Sep 2025 16:38:40 +0800 Subject: [PATCH 04/13] 1 --- .../SWSDBSchemeUpgradeTool_MarkupCompile.lref | 4 +- newFront/c#前端/SWS.CAD/CADFunc/General.cs | 1 + newFront/c#前端/SWS.CAD/SWS.CAD.csproj | 12 +- .../DialogCablePreAssignPreviewViewModel.cs | 8 +- .../DialogCablePreAssignResultViewModel.cs | 33 +- .../DialogIODistributionViewModel.cs | 4 +- .../DialogSignalPredistributionViewModel.cs | 3 + .../SWS.CAD/ViewModels/LeftPanelViewModel.cs | 10 +- .../SWS.CAD/ViewModels/NewDrawingViewModel.cs | 6 +- .../DialogCablePreAssignResult.xaml | 8 +- .../DialogIODistribution.xaml | 392 +++++++++--------- .../SWS.CAD/Views/Dialog/DialogSectionBox.xaml | 12 + .../Views/Dialog/DialogSectionBox.xaml.cs | 28 ++ newFront/c#前端/SWS.CAD/Views/Login.xaml | 4 +- .../SWS.CAD/Views/Style/CustomStyles.xaml | 4 + .../c#前端/SWS.Commons/SWS.Commons.csproj | 4 + .../obj/Debug/Views/DialogTest2.g.cs | 1 + .../obj/Debug/Views/DialogTest2.g.i.cs | 1 + newFront/c#前端/SWS.Model/SWS.Model.csproj | 7 +- .../c#前端/SWS.Model/SWS.Model.csproj.user | 2 +- .../SWS.Model/Signal/SignalManagementInfo.cs | 1 + .../c#前端/SWS.Model/Signal/SignalNotice.cs | 4 +- newFront/c#前端/SWS.Model/ec_Cable.cs | 2 + newFront/c#前端/SWS.Model/ec_Wire_Group.cs | 40 +- .../c#前端/SWS.Model/ec_wire_group_log.cs | 6 +- .../c#前端/SWS.Model/ec_wire_group_notice.cs | 18 - .../c#前端/SWS.Service/PlotLayoutService.cs | 1 + .../c#前端/SWS.Service/WireGroupService.cs | 2 +- .../.vs/SWS.Share.csproj.dtbcache.json | 1 + newFront/c#前端/SWS.Share/ActionHistory.cs | 15 + newFront/c#前端/SWS.Share/Enums/Action.cs | 25 ++ .../SWS.Share/Enums/WireGroupStatusEnum.cs | 43 ++ .../c#前端/SWS.Share/LayoutTagInfoBrief.cs | 80 ++++ newFront/c#前端/SWS.Share/SWS.Share.csproj | 4 + .../c#前端/SWS.Share/SWS.Share.csproj.user | 2 +- newFront/c#前端/SWS.WPF/SWS.WPF.csproj | 4 + newFront/c#前端/SWS.WPF/SWS.WPF.csproj.user | 2 +- .../DialogSignalManagementViewModel.cs | 17 +- .../DialogSignalPropertyhisAndLogsViewModel.cs | 4 +- 39 files changed, 511 insertions(+), 304 deletions(-) create mode 100644 newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml create mode 100644 newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml.cs create mode 100644 newFront/c#前端/SWS.Share/.vs/SWS.Share.csproj.dtbcache.json create mode 100644 newFront/c#前端/SWS.Share/ActionHistory.cs create mode 100644 newFront/c#前端/SWS.Share/Enums/Action.cs create mode 100644 newFront/c#前端/SWS.Share/Enums/WireGroupStatusEnum.cs create mode 100644 newFront/c#前端/SWS.Share/LayoutTagInfoBrief.cs diff --git a/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref b/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref index 2fe5958e..84466716 100644 --- a/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref +++ b/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref @@ -1,5 +1,5 @@  -FD:\陈进步\项目\009\SWSDBSchemeUpgradeTool\MainWindow.xaml;; -FD:\陈进步\项目\009\SWSDBSchemeUpgradeTool\SQLPreview.xaml;; +FE:\Di-Electrical\SWSDBSchemeUpgradeTool\MainWindow.xaml;; +FE:\Di-Electrical\SWSDBSchemeUpgradeTool\SQLPreview.xaml;; diff --git a/newFront/c#前端/SWS.CAD/CADFunc/General.cs b/newFront/c#前端/SWS.CAD/CADFunc/General.cs index 4f85ae1d..21a66224 100644 --- a/newFront/c#前端/SWS.CAD/CADFunc/General.cs +++ b/newFront/c#前端/SWS.CAD/CADFunc/General.cs @@ -5,6 +5,7 @@ using Bricscad.Global; using SWS.CAD.CADFunc.Editor; using SWS.CAD.Helper; using SWS.CAD.Views.CustomControl; +using SWS.Commons; using System; using System.Collections.Generic; using System.Drawing; diff --git a/newFront/c#前端/SWS.CAD/SWS.CAD.csproj b/newFront/c#前端/SWS.CAD/SWS.CAD.csproj index 1419120f..109ea715 100644 --- a/newFront/c#前端/SWS.CAD/SWS.CAD.csproj +++ b/newFront/c#前端/SWS.CAD/SWS.CAD.csproj @@ -181,12 +181,8 @@ - - - - @@ -534,11 +530,17 @@ {51cb6f5b-16e9-4ee0-baa4-144dd1ec8580} SWS.Service + + {87E71797-E60A-4637-BA32-C8B57154ABC3} + SWS.Share + {7aff9117-78e7-4395-9f23-6dcfe09f9299} SWS.WPF - + + + \ No newline at end of file diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs index c70099f6..559e4fb0 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs @@ -53,7 +53,7 @@ namespace SWS.CAD.ViewModels } private List CablePreAssigns; - public async void OnDialogOpened(IDialogParameters parameters) + public void OnDialogOpened(IDialogParameters parameters) { //title = parameters.GetValue(GlobalObject.dialogPar.title.ToString()); title = "待分配的信号预览和统计"; @@ -128,7 +128,7 @@ namespace SWS.CAD.ViewModels IDialogParameters para = new Prism.Services.Dialogs.DialogParameters(); para.Add(GlobalObject.dialogPar.para1.ToString(), PreAssignCables); var _dialogService = GlobalObject._prismContainer.Resolve(); - _dialogService.ShowDialog(nameof(DialogCablePreAssignResult), para, async (RES) => + _dialogService.ShowDialog(nameof(DialogCablePreAssignResult), para, (RES) => { if (RES.Result == ButtonResult.Yes) { @@ -182,7 +182,7 @@ namespace SWS.CAD.ViewModels /// 页面左侧按钮 /// /// - public virtual async void Button_Click(object parameter) + public virtual void Button_Click(object parameter) { if (parameter.ToString().Equals("全选")) { @@ -288,7 +288,7 @@ namespace SWS.CAD.ViewModels TagNumber = ec_Cable.TagNumber; PreAssignIOType = ec_Cable.PreAssignIOType; CableClass = ec_Cable.CableClass.Equals("homerun") ? "是" : "否"; - ToPanel_TagNumber = ec_Cable.ToPanel != null ? ec_Cable.ToPanel.TagNumber : null; + ToPanel_TagNumber = ec_Cable.AssignedPanel != null ? ec_Cable.AssignedPanel.TagNumber : null; } #endregion diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs index a7b1498b..af171f8f 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs @@ -108,6 +108,7 @@ namespace SWS.CAD.ViewModels public override async void ExecuteOKCommandAsync(object para) { + //只传入分配成功的电缆 var Cables = new List(); if (AllPreAssignCables != null) { @@ -153,7 +154,7 @@ namespace SWS.CAD.ViewModels { foreach (var PreAssignCable in AllPreAssignCables) { - if (PreAssignCable.Sets != null && !string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo)) + if (PreAssignCable.AssignedPanel!=null) { PreAssignCables.Add(PreAssignCable); } @@ -163,7 +164,7 @@ namespace SWS.CAD.ViewModels { foreach (var PreAssignCable in AllPreAssignCables) { - if (PreAssignCable.Sets == null || string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo)) + if (PreAssignCable.AssignedPanel == null) { PreAssignCables.Add(PreAssignCable); } @@ -179,14 +180,14 @@ namespace SWS.CAD.ViewModels PreAllocationResultls = new ObservableCollection(); if (cable == null) return; - if (cable.Sets != null) + if (cable.AssignedPanel != null) { foreach (var Set in cable.Sets) { PreAllocationResult preAllocationResult = new PreAllocationResult(); preAllocationResult.CablePair = Set.CableSetName; preAllocationResult.IOType = cable.PreAssignIOType; - preAllocationResult.ToPanel_TagNumber = cable.ToPanel == null ? "" : cable.ToPanel.TagNumber; + preAllocationResult.ToPanel_TagNumber = cable.AssignedPanel == null ? "" : cable.AssignedPanel.TagNumber; preAllocationResult.Panel_TagNumber = string.IsNullOrEmpty(Set.ConnectionInfo) ? "" : Set.ConnectionInfo.Split('/')[0].Split(':')[1].Trim(); preAllocationResult.StripName = string.IsNullOrEmpty(Set.ConnectionInfo) ? "" : Set.ConnectionInfo.Split('/')[1].Split(':')[1].Trim(); preAllocationResult.Terms = new ObservableCollection(Set.AssignedTerms); @@ -220,7 +221,9 @@ namespace SWS.CAD.ViewModels public string CablePair { get { return _CablePair; } - set { _CablePair = value; } + set { _CablePair = value; + RaisePropertyChanged(nameof(CablePair)); + } } private string _IOType; @@ -230,7 +233,9 @@ namespace SWS.CAD.ViewModels public string IOType { get { return _IOType; } - set { _IOType = value; } + set { _IOType = value; + RaisePropertyChanged(nameof(IOType)); + } } @@ -241,7 +246,9 @@ namespace SWS.CAD.ViewModels public string ToPanel_TagNumber { get { return _ToPanel_TagNumber; } - set { _ToPanel_TagNumber = value; } + set { _ToPanel_TagNumber = value; + RaisePropertyChanged(nameof(ToPanel_TagNumber)); + } } private string _Panel_TagNumber; @@ -251,7 +258,9 @@ namespace SWS.CAD.ViewModels public string Panel_TagNumber { get { return _Panel_TagNumber; } - set { _Panel_TagNumber = value; } + set { _Panel_TagNumber = value; + RaisePropertyChanged(nameof(Panel_TagNumber)); + } } private string _StripName; @@ -261,7 +270,9 @@ namespace SWS.CAD.ViewModels public string StripName { get { return _StripName; } - set { _StripName = value; } + set { _StripName = value; + RaisePropertyChanged(nameof(StripName)); + } } private ObservableCollection _Terms; @@ -271,7 +282,9 @@ namespace SWS.CAD.ViewModels public ObservableCollection Terms { get { return _Terms; } - set { _Terms = value; } + set { _Terms = value; + RaisePropertyChanged(nameof(Terms)); + } } diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs index f0f93dd9..935edecd 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs @@ -410,7 +410,7 @@ namespace SWS.CAD.ViewModels #endregion #region 改变关联和解除信号按钮的可用状态 - private async void UpdateButtonEnabled() + private void UpdateButtonEnabled() { if (SelectedChannelInfo != null) { @@ -2723,7 +2723,7 @@ namespace SWS.CAD.ViewModels IDialogParameters para = new Prism.Services.Dialogs.DialogParameters(); para.Add(GlobalObject.dialogPar.para1.ToString(), PreAssignCables); var _dialogService = GlobalObject._prismContainer.Resolve(); - _dialogService.ShowDialog(nameof(DialogCablePreAssignPreview), para, async (RES) => + _dialogService.ShowDialog(nameof(DialogCablePreAssignPreview), para, (RES) => { if (RES.Result == ButtonResult.Yes) { diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogSignalPredistributionViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogSignalPredistributionViewModel.cs index 8f100e4e..5b96a500 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogSignalPredistributionViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogSignalPredistributionViewModel.cs @@ -22,6 +22,9 @@ using Unity; namespace SWS.CAD.ViewModels { + /// + /// 信号预分配页面的模型类 + /// public class DialogSignalPredistributionViewModel : DialogBase, IDialogAware { #region 字段 diff --git a/newFront/c#前端/SWS.CAD/ViewModels/LeftPanelViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/LeftPanelViewModel.cs index ec98813f..89930e29 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/LeftPanelViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/LeftPanelViewModel.cs @@ -506,7 +506,7 @@ namespace SWS.CAD.ViewModels foreach (var id in listObjectTypeId) { //获取节点 - Model.TreeModel node = Helper.TreeHelper.GetTreeModel(GlobalObject.objectTypeTree, id); + Model.TreeModel node = TreeHelper.GetTreeModel(GlobalObject.objectTypeTree, id); if (node != null) { var node1 = (Model.TreeModel)node.Clone(); @@ -531,7 +531,7 @@ namespace SWS.CAD.ViewModels GlobalObject.AllDwgName.Clear(); foreach (var dwg in Drawings) { - Helper.TreeHelper.GetTreeText(dwg); + TreeHelper.GetTreeText(dwg); } #endregion @@ -1975,7 +1975,7 @@ namespace SWS.CAD.ViewModels foreach (var dto in historyDrawingsTree) { //获取节点下的图纸 - node = Helper.TreeHelper.GetTreeModel(dto, item.DrawingFileID); + node = TreeHelper.GetTreeModel(dto, item.DrawingFileID); if (node != null) { break; @@ -2283,7 +2283,7 @@ namespace SWS.CAD.ViewModels if (string.IsNullOrEmpty(strRecentObjectType)) { //获取节点 - Model.TreeModel node = Helper.TreeHelper.GetTreeModel(GlobalObject.objectTypeTree, selectType.ID); + Model.TreeModel node = TreeHelper.GetTreeModel(GlobalObject.objectTypeTree, selectType.ID); var addNode = (Model.TreeModel)node.Clone(); var firstNode = objectTypeTree[0]; //UI添加到最近使用 @@ -2304,7 +2304,7 @@ namespace SWS.CAD.ViewModels } listObjectTypeId.Insert(0, selectType.ID); //获取节点 - Model.TreeModel node = Helper.TreeHelper.GetTreeModel(GlobalObject.objectTypeTree, selectType.ID); + Model.TreeModel node = TreeHelper.GetTreeModel(GlobalObject.objectTypeTree, selectType.ID); var addNode = (Model.TreeModel)node.Clone(); firstNode.ChildNodes.Insert(0, addNode);//UI添加到最近使用 ids = string.Join(",", listObjectTypeId); diff --git a/newFront/c#前端/SWS.CAD/ViewModels/NewDrawingViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/NewDrawingViewModel.cs index 72fc86f9..8c032e26 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/NewDrawingViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/NewDrawingViewModel.cs @@ -254,7 +254,7 @@ namespace SWS.CAD.ViewModels //所属系统下拉框 foreach (var item in dwgSystem) { - var node = Helper.TreeHelper.GetTreeModel(item, dwgFile.DrawingSystem); + var node = TreeHelper.GetTreeModel(item, dwgFile.DrawingSystem); if (node != null) { SelectedSystemItem = node; @@ -264,7 +264,7 @@ namespace SWS.CAD.ViewModels //图纸目录下拉框 foreach (var item in dwgCatalogueID) { - var node = Helper.TreeHelper.GetTreeModel(item, dwgFile.DrawingCatalogueID); + var node = TreeHelper.GetTreeModel(item, dwgFile.DrawingCatalogueID); if (node != null) { SelectedCatalogueIDItem = node; @@ -476,7 +476,7 @@ namespace SWS.CAD.ViewModels foreach (var catalogueId in tempCatalogueID) { //遍历获取当前节点数据 - node = Helper.TreeHelper.GetTreeModel(catalogueId, dwgNode.ID); + node = TreeHelper.GetTreeModel(catalogueId, dwgNode.ID); if (node != null) { break; } } diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml index 27116793..b7e290ff 100644 --- a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml @@ -92,7 +92,13 @@ ShowGroupPanel="False" telerik:StyleManager.Theme="Office_Blue" ItemsSource="{Binding PreAllocationResultls}" SelectedItem="{Binding SelectedChannelInfo, Mode=TwoWay}" > - + + + + diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml index d9d29926..2efec14a 100644 --- a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogIODistribution.xaml @@ -241,7 +241,7 @@ - + @@ -364,135 +364,135 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - + + + + + + + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - + + + + + - - - - - - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + - - - - + + + - - - - + + + + - - - + + + diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml new file mode 100644 index 00000000..df6bae5f --- /dev/null +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml.cs b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml.cs new file mode 100644 index 00000000..c608167c --- /dev/null +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogSectionBox.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace SWS.CAD.Views.Dialog +{ + /// + /// DialogSectionBox.xaml 的交互逻辑 + /// + public partial class DialogSectionBox : UserControl + { + public DialogSectionBox() + { + InitializeComponent(); + } + } +} diff --git a/newFront/c#前端/SWS.CAD/Views/Login.xaml b/newFront/c#前端/SWS.CAD/Views/Login.xaml index d78fbf72..c7c8fc51 100644 --- a/newFront/c#前端/SWS.CAD/Views/Login.xaml +++ b/newFront/c#前端/SWS.CAD/Views/Login.xaml @@ -4,8 +4,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:local="clr-namespace:SWS.CAD.Views.CustomControl" - xmlns:local2="clr-namespace:SWS.CAD.Helper" - xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" + xmlns:local2="clr-namespace:SWS.Commons;assembly=SWS.Commons" + xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Width="300" Height="250" AllowsTransparency="True" diff --git a/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml b/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml index 223f6291..0a8922b5 100644 --- a/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml +++ b/newFront/c#前端/SWS.CAD/Views/Style/CustomStyles.xaml @@ -39,6 +39,10 @@ + + + +