diff --git a/Learun.Application.Web/AppApi/IOModuleApiController.cs b/Learun.Application.Web/AppApi/IOModuleApiController.cs
index b21f47ae..ad0ae97d 100644
--- a/Learun.Application.Web/AppApi/IOModuleApiController.cs
+++ b/Learun.Application.Web/AppApi/IOModuleApiController.cs
@@ -45,8 +45,16 @@ namespace Learun.Application.Web.AppApi
#endregion
-
-
+ ///
+ /// 根据模板自动创建端子排
+ ///
+ ///
+ ///
+ ///
+ private ec_PanelStripEntity CreatePanelStripByProfile2(string projId, string TSname, string panelId, GlobalEnum.IOType iOType)
+ {
+ return new ec_PanelStripEntity();
+ }
///
/// 找到某一个预分配箱子 附近的某一个箱子。且io类型能匹配上
///
@@ -185,7 +193,7 @@ namespace Learun.Application.Web.AppApi
}
- }
+ }
return nearestPanel;
}
@@ -436,27 +444,25 @@ namespace Learun.Application.Web.AppApi
{
//有不匹配的,但是用户允许继续
//如果选是,则在之后的自动分配过程中会自动寻找匹配的采集箱,原则上从就近的开始找,如果没有匹配的采集箱,则提示“未找到具有XX类型的采集箱,请新增后再次分配,是否取消自动分配进程?”
- bool nearbyFound = false;
+
foreach (var cable in cablesNotMatchIO)
{
var nearPanel = FindPanelNearby(cable, allFrames, allPanel, allPanelProp, cable.PreAssignIOType);
- if (nearPanel == null)
- {
- nearbyFound = false;
- //必要的数据存入redis,以便后续步骤使用
- redisObj.Remove("IOModule_AutoAssign2Ch_" + projId, CacheId.IOModule_AutoAssign2Ch);
- redisObj.Write>("IOModule_AutoAssign2Ch_" + projId, cablesNeedAssigned, CacheId.IOModule_AutoAssign2Ch);
- return Fail($"在附近未找到具有{cable.PreAssignIOType}类型的采集箱,请新增后再次分配,是否取消自动分配进程?");
- //之后插件端进行选择。
- //如果不想新增,则选择否,继续自动分配,没有分配到的信号在备注上填写由于何种原因没有被分配,弹出未被分配的信号列表供查看。
- //也就是这里要等所有循环结束后才能return结果,而不是目前一个nearByFound = false时就退出了。
- }
- else
- {
- nearbyFound = true;
- }
- }
+ cable.AssignedPanel = nearPanel;
+
+ }
+ var cableNotFoundNearPanel = cablesNotMatchIO.FindAll(x => x.AssignedPanel == null);
+ if (cableNotFoundNearPanel != null && cableNotFoundNearPanel.Count > 0)
+ {
+ redisObj.Remove("IOModule_AutoAssign2Ch_" + projId, CacheId.IOModule_AutoAssign2Ch);
+ redisObj.Write>("IOModule_AutoAssign2Ch_" + projId, cablesNeedAssigned, CacheId.IOModule_AutoAssign2Ch);
+
+ return Fail($"在电缆{string.Join(",", cableNotFoundNearPanel.Select(x => x.TagNumber))}附近未找到具有IO类型匹配的采集箱,请新增后再次分配,是否取消自动分配进程?");
+ //之后插件端进行选择。
+ //如果不想新增,则选择否,继续自动分配,没有分配到的信号在备注上填写由于何种原因没有被分配,弹出未被分配的信号列表供查看。
+ //也就是这里要等所有循环结束后才能return结果,而不是目前一个nearByFound = false时就退出了。
+ }
}
@@ -501,64 +507,252 @@ namespace Learun.Application.Web.AppApi
ICache redisObj = CacheFactory.CaChe();
var cablesNeedAssigned = redisObj.Read>("IOModule_AutoAssign2Ch_" + projId, CacheId.IOModule_AutoAssign2Ch);
- //#region 1.2 开始自动分配(不保存到数据库)
- #region 先分组 1.2.2
- var cablesGrouped = cablesNeedAssigned.OrderBy(x => x.PanelID).ThenBy(x => x.PreAssignIOType).ThenBy(x => x.System).ToList();
+ var setTb = ProjectSugar.TableName(projId);
+ var allSettings = SqlSugarHelper.Db.Queryable().AS(setTb).ToList();
+ //IO_CardProfile
- foreach (var item in cablesNeedAssigned)
+ var signalTb = ProjectSugar.TableName(projId);
+ var allSignals = SqlSugarHelper.Db.Queryable().AS(signalTb).ToList();
+ var allUsedCH = allSignals.Where(x => !string.IsNullOrEmpty(x.ChannelID)).Select(x => x.ChannelID).Distinct().ToList();
+
+ //1.2 流程图 分组原则为同一信号类型、同一系统的为一组
+ var cablesGrouped = cablesNeedAssigned.OrderBy(x => x.PanelID).ThenBy(x => x.PreAssignIOType).ThenBy(x => x.System).ToList();
+ cablesGrouped = cablesGrouped.Where(x => x.Sets != null && x.Sets.Count() > 0 && x.AssignedPanel != null).ToList();//过滤掉没有set的,或者没有找到箱子的
+ cablesGrouped = cablesGrouped.Where(x => x.Sets.Where(xx => !string.IsNullOrEmpty(xx.PreAssignGroup_Desc)).Count() > 0).ToList();//过滤掉set没有分配信号的
+
+
+ var allPanelIds = cablesGrouped.Select(x => x.PanelID).Distinct();
+ var stripBll = new ec_PanelStripBLL();
+ var allStrips = stripBll.GetList("{ProjectId:\"" + projId + "\"}",OnlySelf:false)
+ .Where(x => allPanelIds.Contains(x.PanelID))
+ .GroupBy(x => x.PanelID)
+ .ToDictionary(x => x.Key, x => x.ToList());
+ //感觉逻辑上用panel来循环会更合理
+ foreach (var curPanelId in allPanelIds)
{
- if (item.Sets == null || item.Sets.Count() == 0)
+ int newTSSeq = 10001;
+
+ var curStrips = allStrips[curPanelId];
+ var cablesOnThisPanel = cablesGrouped.Where(x => x.PanelID == curPanelId).ToList();
+ if (cablesOnThisPanel == null || cablesOnThisPanel.Count == 0)
{
- //也归类到未成功
+ continue;//next panel
}
- else
+ //var lastCableSystemAndIOType = cablesOnThisPanel.First().System + cablesOnThisPanel.First().PreAssignIOType;//用于判断是否是同一个组
+ var lastUsedStrip = (ec_PanelStripEntity)null;
+ foreach (var cable in cablesOnThisPanel)
{
- foreach (var set in item.Sets)
+ //1.2.2 分组原则为同一信号类型、同一系统的为一组,系统属性从电缆的from端上的设备中取设备的系统,同组的优先放到同一个箱子的同一个模块里面,
+ //如果一组放完后发现模块还有多余的通道可以放则下一个系统继续从这个模块开始分配。
+ //???总感觉这句话,总结后:可以无脑用上一个模块,直到模块满了再用下一个模块。
+ #region 判断是否是同一组
+ //bool sameGroup = true;
+ //if (lastCableSystemAndIOType != cable.System + cable.PreAssignIOType)
+ //{
+ // sameGroup = false;//换组了
+ //}
+ #endregion
+ //1.2 流程图 读取有提前选好箱子的信号
+ GlobalEnum.IOType ioTypeOnCable = default;
+ var setsSpared = cable.Sets.Where(x => string.IsNullOrEmpty(x.PreAssignGroup_Desc) || string.IsNullOrEmpty(x.PreAssignInOrOut)).ToList();
+ var setsIn = cable.Sets.Where(x => x.PreAssignInOrOut == SWS.Share.Enum.inOrOut.输入.ToString()).ToList();
+ var setsOut = cable.Sets.Where(x => x.PreAssignInOrOut == SWS.Share.Enum.inOrOut.输出.ToString()).ToList();
+
+ #region 1.2.4 同一根电缆,如果带公共端的报警信号,必须接到一个模块里面
+ if (cable.PreAssignIOType.ToLower() == GlobalEnum.signalType.Digital.ToString().ToLower())
{
- set.ConnectionInfo = $"采集箱:{item.ToPanel.TagNumber}/模块(端子排):{"test_ts"}/通道:{"test_ch"}";
- set.AssignedTerms = set.Wires.Select(x => x.PreAssignChannelTermNo).ToList();// new List() { "test_term1", "test_term2" };//假数据
+
+ if (setsIn.Count > 0 && setsOut.Count > 0)
+ {
+ //from cjj 25 09 23 wechat:一根电缆可能会出现既有输入也有输出,如果碰到就放到两个端子排里面,公共端不会出现一个输出,一个输入的
+ continue;
+ }
+ //todo
}
+ #endregion
+
+ #region input
+ ec_PanelStripEntity curStrip = null;
+ var matchedStrips = curStrips.Where(x => x.IO_TYPE == ioTypeOnCable.ToString()).ToList();
+ if (matchedStrips != null && lastUsedStrip != null && lastUsedStrip.IO_TYPE == ioTypeOnCable.ToString())
+ {
+ //1.2.2 优先使用上一个模块,直到模块满了再用下一个模块。
+ matchedStrips.Insert(0, lastUsedStrip);
+ }
+ if (setsIn.Count + setsSpared.Count() > 10)
+ {
+ //另外如果电缆对数大于10对,即像12*2*0.75这种,无论它预分配了多少根电缆对,永远预留4个以下的空白通道。
+ //意思就是一个模块里面够4个或4个以上空白通道就留4个空白通道,
+ //如果不够4个就留4个以下即可。
+ }
+ else
+ {
+ string PanelName = cable.AssignedPanel.TagNumber;//当前电缆预分配的箱子名称
+ switch (cable.PreAssignIOType.ToLower())
+ {
+ case "digital":
+ //数字量
+ ioTypeOnCable = GlobalEnum.IOType.DI;
+ break;
+ case "4~20ma":
+ //模拟量4-20mA
+ ioTypeOnCable = GlobalEnum.IOType.AI;
+ break;
+ case "10v":
+ ioTypeOnCable = GlobalEnum.IOType.TenVolt;
+ break;
+ case "pt100":
+ ioTypeOnCable = GlobalEnum.IOType.PT100;
+ break;
+ case "pulse":
+ ioTypeOnCable = GlobalEnum.IOType.PULSE;
+ break;
+ default:
+ //通讯类 485 422啥的
+ continue;
+ break;
+ }
+
+ //1.2 流程图 箱子里是否已经存在端子排(io匹配)
+
+ bool alreadyInsertNewTs = false;
+ if (matchedStrips == null || matchedStrips.Count == 0)
+ {
+ //没有端子排
+ //1.2 流程图 根据信号数里自动新建端子排,端子排通道数里根据箱子模板中的默认值获得
+ var newTS = CreatePanelStripByProfile2(projId, "TS_" + ioTypeOnCable.ToString() + "_" + newTSSeq++, curPanelId, ioTypeOnCable);
+ alreadyInsertNewTs = true;
+ matchedStrips.Add(newTS);
+ }
+
+ #region 1.2 流程图 空的通道数够不够
+ if (cable.CableClass == SWS.Share.Enum.cableClass.homerun.ToString())
+ {
+ //1.2.3(2)如果模块是通讯信号(像RS485这种就是通讯信号),则不用管预留空白通道这个事情,看到有空的通道就放。
+ //当前这个端子排就是可用的
+
+ curStrip = matchedStrips.First();
+
+
+ }
+ else
+ {
+ //1.2.3 (1) 非通讯,如果空的通道大于整个模块的5%,则可以利用,利用到小于5%了则停止利用,如果本身空通道数占的比例就小于5%,则不利用。
+
+ curStrip = FindNextAvailableTS(matchedStrips, allUsedCH);
+
+ if (curStrip == null)
+ {
+ var newTS = CreatePanelStripByProfile2(projId, "TS_" + ioTypeOnCable.ToString() + "_" + newTSSeq++, curPanelId, ioTypeOnCable);
+ alreadyInsertNewTs = true;
+ matchedStrips.Add(newTS);
+ curStrip = newTS;
+
+ }
+ }
+ var usedChs = curStrip.Channels.Where(x => allUsedCH.Contains(x.ChannelID)).Select(x => x.ChannelID).ToList();
+ var notUsedChs = curStrip.Channels.Where(x => !usedChs.Contains(x.ChannelID)).ToList();
+ #endregion
+ #region 1.2 流程图 按规则先放几个信号进去
+ if (notUsedChs.Count < setsIn.Count + setsSpared.Count())
+ {
+ //不够放,又要新建?
+ if (alreadyInsertNewTs)
+ {
+ //压根就有问题,说明电缆的set太多了,就算是新建的模块,一个channel都没有使用的情况下,都塞不下。
+ continue;
+ }
+ else
+ {
+ //相当于前面5%的判断过了,但是呢放不下所有需要的set
+ var newTS = CreatePanelStripByProfile2(projId, "TS_" + ioTypeOnCable.ToString() + "_" + newTSSeq++, curPanelId, ioTypeOnCable);
+ alreadyInsertNewTs = true;
+ matchedStrips.Add(newTS);
+ curStrip = newTS;
+ usedChs = curStrip.Channels.Where(x => allUsedCH.Contains(x.ChannelID)).Select(x => x.ChannelID).ToList();
+ notUsedChs = curStrip.Channels.Where(x => !usedChs.Contains(x.ChannelID)).ToList();
+ if (notUsedChs.Count < setsIn.Count + setsSpared.Count())
+ {
+ //压根就有问题,说明电缆的set太多了,就算是新建的模块,一个channel都没有使用的情况下,都塞不下。
+ continue;
+ }
+ }
+ }
+ lastUsedStrip = curStrip;
+ //能放下
+ for (int i = 0; i < setsIn.Count; i++)
+ {
+ var set = setsIn[i];
+ var ch = notUsedChs[i];
+ set.ConnectionInfo = $"采集箱:{PanelName}/模块(端子排):{curStrip.StripName}/通道:{ch.ChannelName}";
+ //更新全局已使用通道
+ allUsedCH.Add(ch.ChannelID);
+ }
+ var chOffIdx = setsIn.Count;
+ for (int i = 0; i < setsSpared.Count(); i++)
+ {
+ var set = setsSpared[i];
+ var ch = notUsedChs[chOffIdx + i];
+ set.ConnectionInfo = $"采集箱:{PanelName}/模块(端子排):{curStrip.StripName}/通道:{ch.ChannelName}/冗余";
+ //更新全局已使用通道
+ allUsedCH.Add(ch.ChannelID);
+ }
+ #endregion
+ }
+ #endregion
+ #region output
+ if (setsOut.Count + setsSpared.Count() > 10)
+ {
+ //另外如果电缆对数大于10对,即像12*2*0.75这种,无论它预分配了多少根电缆对,永远预留4个以下的空白通道。
+ //意思就是一个模块里面够4个或4个以上空白通道就留4个空白通道,
+ //如果不够4个就留4个以下即可。
+
+ }
+ else
+ {
+ //空白通道原则
+ //如5*2*0.75规格的电缆,电缆对就是5对,但可能它只预分配了2个电缆对,即只有2个信号被预分配了,
+ //但考虑模块通道的时候是考虑5对,而不是只考虑已经预分配的2个电缆对
+
+ //目前还剩多少
+ //空的通道够不够
+ int sparedChCount = 0;
+ }
+ #endregion
}
}
- //var curPanel = new ec_PanelEntity();
- //curPanel = panelsNeed.FirstOrDefault(x => x.PanelID == cablesNeedAssigned[0].PanelID);//先定位到第一个电缆所在的箱子
- //curPanel.strips = stripsNeed.Where(x => x.PanelID == curPanel.PanelID).ToList();
- //var curStrip = new ec_PanelStripEntity();
- #endregion
- //for (var i = 0; i < cablesNeedAssigned.Count; i++)
- //{
- // #region 是否有端子排 1.2.1
- // if (curPanel.PanelID != cablesNeedAssigned[i].PanelID)
- // {
- // curPanel = panelsNeed.FirstOrDefault(x => x.PanelID == cablesNeedAssigned[0].PanelID);//切换箱子
- // curPanel.strips = stripsNeed.Where(x => x.PanelID == curPanel.PanelID).ToList();
- // }
- // foreach (var set in cablesNeedAssigned[i].Sets)
- // {
- // var availableStrips = curPanel.strips.Where(x => x.IO_TYPE.ToUpper() == set.IOType.ToString().ToUpper()).ToList();
-
- // if (availableStrips != null && availableStrips.Count > 0)
- // {
- // //已经存在端子排
- // }
- // else
- // {
- // //没有端子排,根据信号数里自动新建端子排,通道数里根据端子io模板的默认值获得
- // //?????????????????????????????????
- // }
- // }
- // //可能要换一下循环主体,评估下是按照cable循环好,还是按strip循环好
- // #endregion
-
- //}
- //#endregion
return Success(cablesNeedAssigned);
}
+ ///
+ /// 找到下一个可用的端子排
+ ///
+ /// 所有的端子排
+ /// 使用过的channelId
+ ///
+ private ec_PanelStripEntity FindNextAvailableTS(List TSs, List allUsedCH)
+ {
+ foreach (var TS in TSs)
+ {
+ var usedChs = TS.Channels.Where(x => allUsedCH.Contains(x.ChannelID)).Select(x => x.ChannelID).ToList();
+ var notUsedChs = TS.Channels.Where(x => !usedChs.Contains(x.ChannelID)).ToList();
+ double sparedRate = notUsedChs.Count * 1.0 / TS.Channels.Count * 1.0;
+ if (sparedRate < 0.05)
+ {
+ //没有空闲通道 next
+ }
+ else
+ {
+ return TS;//找到了
+ }
+ }
+
+ return null;//都没有
+ }
///
/// 根据step2的预分配结果,进行实际的分配,修改数据库。
///
@@ -750,9 +944,8 @@ namespace Learun.Application.Web.AppApi
}
}
///
- /// 通过预设模式,批量创建端子排 通道 端子
- ///
- ///
+ /// 通过预设模式,批量创建端子排 通道 端子。此时strip数里 set数里已经根据profile给定好了。
+ ///
///
[HttpPost]
[HandlerApiLogin(FilterMode.Enforce)]
diff --git a/Learun.Application.Web/AppApi/PlotLayoutApiController.cs b/Learun.Application.Web/AppApi/PlotLayoutApiController.cs
index 2624e147..a164e741 100644
--- a/Learun.Application.Web/AppApi/PlotLayoutApiController.cs
+++ b/Learun.Application.Web/AppApi/PlotLayoutApiController.cs
@@ -130,7 +130,7 @@ namespace Learun.Application.Web.AppApi
area = AREA,
Scale = BasePointProp_scale == null ? 1 : (double.TryParse(BasePointProp_scale.PropertyValue, out double scale) ? scale : 1)
};
-
+ layoutTag.Scale = 1.0 / layoutTag.Scale; // 这里的比例是放大多少倍,所以取倒数。
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 b79e078b..8c3d554e 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
@@ -309,7 +309,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
- cable.ToPanel = panelObj;//暂用一下topanel属性,相当于电缆预分配的采集箱背后的Panel对象。
+ cable.AssignedPanel = panelObj;
var IOsOnPanel = panelObj.allowedIOTypes.Split(',').ToList();
//剩下的感觉都可以是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 f9bf1f49..d66ffd38 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
@@ -87,6 +87,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
}
+
///
/// 编辑调用
///
@@ -109,7 +110,7 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
///
///
[SugarColumn(IsIgnore = true)]
- public List Sets { set; get; }
+ public List Sets { set; get; } = new List();
///
/// 平行电缆数据
@@ -147,13 +148,15 @@ namespace Learun.Application.TwoDevelopment.ZZDT_EC
///
- /// From连接处的工程位号信息。
- /// 同时,也表达下预分配电缆panelid对应的柜子信息。
+ /// From连接处的工程位号信息。
///
[SugarColumn(IsIgnore = true)]
public ec_PanelEntity ToPanel { set; get; }
-
-
+ ///
+ /// 根据算出来的实际分配的箱子,当然也能和panelid不同,而是就近的另外一个采集箱
+ ///
+ [SugarColumn(IsIgnore = true)]
+ public ec_PanelEntity AssignedPanel { set; get; }
#endregion
}
}
diff --git a/newFront/c#前端/CAD.Extend/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/newFront/c#前端/CAD.Extend/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
index 5158d93a..bc671bf5 100644
Binary files a/newFront/c#前端/CAD.Extend/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/newFront/c#前端/CAD.Extend/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogAutoArrangeLayout.g.cs b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogAutoArrangeLayout.g.cs
deleted file mode 100644
index 3fd1d88d..00000000
--- a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogAutoArrangeLayout.g.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D381518E6A709FE4FD61B7B59C0FE6A02830580BBED56CC9959DA9E027AC6A01"
-//------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本:4.0.30319.42000
-//
-// 对此文件的更改可能会导致不正确的行为,并且如果
-// 重新生成代码,这些更改将会丢失。
-//
-//------------------------------------------------------------------------------
-
-using Microsoft.Xaml.Behaviors;
-using Microsoft.Xaml.Behaviors.Core;
-using Microsoft.Xaml.Behaviors.Input;
-using Microsoft.Xaml.Behaviors.Layout;
-using Microsoft.Xaml.Behaviors.Media;
-using Prism.DryIoc;
-using Prism.Interactivity;
-using Prism.Ioc;
-using Prism.Mvvm;
-using Prism.Regions;
-using Prism.Regions.Behaviors;
-using Prism.Services.Dialogs;
-using Prism.Unity;
-using SWS.CustomControl;
-using SWS.Electrical;
-using System;
-using System.Diagnostics;
-using System.Windows;
-using System.Windows.Automation;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Markup;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Media.Effects;
-using System.Windows.Media.Imaging;
-using System.Windows.Media.Media3D;
-using System.Windows.Media.TextFormatting;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.Windows.Shell;
-using Telerik.Windows.Controls;
-using Telerik.Windows.Controls.Animation;
-using Telerik.Windows.Controls.Behaviors;
-using Telerik.Windows.Controls.Carousel;
-using Telerik.Windows.Controls.ComboBox;
-using Telerik.Windows.Controls.Data.PropertyGrid;
-using Telerik.Windows.Controls.DragDrop;
-using Telerik.Windows.Controls.GridView;
-using Telerik.Windows.Controls.LayoutControl;
-using Telerik.Windows.Controls.Legend;
-using Telerik.Windows.Controls.MultiColumnComboBox;
-using Telerik.Windows.Controls.Primitives;
-using Telerik.Windows.Controls.RadialMenu;
-using Telerik.Windows.Controls.TransitionEffects;
-using Telerik.Windows.Controls.TreeListView;
-using Telerik.Windows.Controls.TreeView;
-using Telerik.Windows.Controls.Wizard;
-using Telerik.Windows.Data;
-using Telerik.Windows.DragDrop;
-using Telerik.Windows.DragDrop.Behaviors;
-using Telerik.Windows.Input.Touch;
-using Telerik.Windows.Shapes;
-
-
-namespace SWS.Electrical.Views {
-
-
- ///
- /// DialogAutoArrangeLayout
- ///
- public partial class DialogAutoArrangeLayout : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
-
-
- #line 122 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
- internal SWS.CustomControl.customWindowTitleBar titleBar;
-
- #line default
- #line hidden
-
-
- #line 237 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
- internal System.Windows.Controls.DataGrid dgTag;
-
- #line default
- #line hidden
-
-
- #line 340 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
- internal System.Windows.Controls.DataGrid dgErrTag;
-
- #line default
- #line hidden
-
- private bool _contentLoaded;
-
- ///
- /// InitializeComponent
- ///
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
- public void InitializeComponent() {
- if (_contentLoaded) {
- return;
- }
- _contentLoaded = true;
- System.Uri resourceLocater = new System.Uri("/SWS.Electrical;component/views/dialogautoarrangelayout.xaml", System.UriKind.Relative);
-
- #line 1 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
- System.Windows.Application.LoadComponent(this, resourceLocater);
-
- #line default
- #line hidden
- }
-
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
- void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
- switch (connectionId)
- {
- case 1:
- this.titleBar = ((SWS.CustomControl.customWindowTitleBar)(target));
- return;
- case 2:
- this.dgTag = ((System.Windows.Controls.DataGrid)(target));
-
- #line 243 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
- this.dgTag.LoadingRow += new System.EventHandler(this.dgTag_LoadingRow);
-
- #line default
- #line hidden
- return;
- case 3:
- this.dgErrTag = ((System.Windows.Controls.DataGrid)(target));
-
- #line 346 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
- this.dgErrTag.LoadingRow += new System.EventHandler(this.dgTag_LoadingRow);
-
- #line default
- #line hidden
- return;
- }
- this._contentLoaded = true;
- }
- }
-}
-
diff --git a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogTest2.g.cs b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogTest2.g.cs
deleted file mode 100644
index c297cebe..00000000
--- a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/DialogTest2.g.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-#pragma checksum "..\..\..\Views\DialogTest2.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6D6B0D2E8B29B2F4DE2F7CF02D2382F69B7F06455C4BC9504C7F76B8C7D980B6"
-//------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本:4.0.30319.42000
-//
-// 对此文件的更改可能会导致不正确的行为,并且如果
-// 重新生成代码,这些更改将会丢失。
-//
-//------------------------------------------------------------------------------
-
-using Microsoft.Xaml.Behaviors;
-using Microsoft.Xaml.Behaviors.Core;
-using Microsoft.Xaml.Behaviors.Input;
-using Microsoft.Xaml.Behaviors.Layout;
-using Microsoft.Xaml.Behaviors.Media;
-using Prism.DryIoc;
-using Prism.Interactivity;
-using Prism.Ioc;
-using Prism.Mvvm;
-using Prism.Regions;
-using Prism.Regions.Behaviors;
-using Prism.Services.Dialogs;
-using Prism.Unity;
-using SWS.CustomControl;
-using SWS.Electrical.Views;
-using System;
-using System.Diagnostics;
-using System.Windows;
-using System.Windows.Automation;
-using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Markup;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Media.Effects;
-using System.Windows.Media.Imaging;
-using System.Windows.Media.Media3D;
-using System.Windows.Media.TextFormatting;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.Windows.Shell;
-using Telerik.Windows.Controls;
-using Telerik.Windows.Controls.Animation;
-using Telerik.Windows.Controls.Behaviors;
-using Telerik.Windows.Controls.Carousel;
-using Telerik.Windows.Controls.ComboBox;
-using Telerik.Windows.Controls.Data.PropertyGrid;
-using Telerik.Windows.Controls.DragDrop;
-using Telerik.Windows.Controls.GridView;
-using Telerik.Windows.Controls.LayoutControl;
-using Telerik.Windows.Controls.Legend;
-using Telerik.Windows.Controls.MultiColumnComboBox;
-using Telerik.Windows.Controls.Primitives;
-using Telerik.Windows.Controls.RadialMenu;
-using Telerik.Windows.Controls.TransitionEffects;
-using Telerik.Windows.Controls.TreeListView;
-using Telerik.Windows.Controls.TreeView;
-using Telerik.Windows.Controls.Wizard;
-using Telerik.Windows.Data;
-using Telerik.Windows.DragDrop;
-using Telerik.Windows.DragDrop.Behaviors;
-using Telerik.Windows.Input.Touch;
-using Telerik.Windows.Shapes;
-
-
-namespace SWS.Electrical.Views {
-
-
- ///
- /// DialogTest2
- ///
- public partial class DialogTest2 : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
-
-
- #line 33 "..\..\..\Views\DialogTest2.xaml"
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
- internal SWS.CustomControl.customWindowTitleBar titleBar;
-
- #line default
- #line hidden
-
- private bool _contentLoaded;
-
- ///
- /// InitializeComponent
- ///
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
- public void InitializeComponent() {
- if (_contentLoaded) {
- return;
- }
- _contentLoaded = true;
- System.Uri resourceLocater = new System.Uri("/SWS.Electrical;component/views/dialogtest2.xaml", System.UriKind.Relative);
-
- #line 1 "..\..\..\Views\DialogTest2.xaml"
- System.Windows.Application.LoadComponent(this, resourceLocater);
-
- #line default
- #line hidden
- }
-
- [System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
- [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
- [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
- void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
- switch (connectionId)
- {
- case 1:
- this.titleBar = ((SWS.CustomControl.customWindowTitleBar)(target));
- return;
- }
- this._contentLoaded = true;
- }
- }
-}
-
diff --git a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.cs b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.cs
index 5c322115..98d42d44 100644
--- a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.cs
+++ b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.cs
@@ -9,6 +9,23 @@
//
//------------------------------------------------------------------------------
+using Microsoft.Xaml.Behaviors;
+using Microsoft.Xaml.Behaviors.Core;
+using Microsoft.Xaml.Behaviors.Input;
+using Microsoft.Xaml.Behaviors.Layout;
+using Microsoft.Xaml.Behaviors.Media;
+using Prism.DryIoc;
+using Prism.Interactivity;
+using Prism.Ioc;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Regions.Behaviors;
+using Prism.Services.Dialogs;
+using Prism.Unity;
+using SWS.CustomControl;
+using SWS.Electrical;
+using SWS.Electrical.Views;
+using SWS.Model;
using System;
using System.Diagnostics;
using System.Windows;
@@ -29,6 +46,28 @@ using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
+using Telerik.Windows.Controls;
+using Telerik.Windows.Controls.Animation;
+using Telerik.Windows.Controls.Behaviors;
+using Telerik.Windows.Controls.Carousel;
+using Telerik.Windows.Controls.ComboBox;
+using Telerik.Windows.Controls.Data.PropertyGrid;
+using Telerik.Windows.Controls.DragDrop;
+using Telerik.Windows.Controls.GridView;
+using Telerik.Windows.Controls.LayoutControl;
+using Telerik.Windows.Controls.Legend;
+using Telerik.Windows.Controls.MultiColumnComboBox;
+using Telerik.Windows.Controls.Primitives;
+using Telerik.Windows.Controls.RadialMenu;
+using Telerik.Windows.Controls.TransitionEffects;
+using Telerik.Windows.Controls.TreeListView;
+using Telerik.Windows.Controls.TreeView;
+using Telerik.Windows.Controls.Wizard;
+using Telerik.Windows.Data;
+using Telerik.Windows.DragDrop;
+using Telerik.Windows.DragDrop.Behaviors;
+using Telerik.Windows.Input.Touch;
+using Telerik.Windows.Shapes;
namespace SWS.Electrical.Views {
diff --git a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.i.cs b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.i.cs
index 5c322115..98d42d44 100644
--- a/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.i.cs
+++ b/newFront/c#前端/SWS.Electrical/obj/Debug/Views/SWSDialogWindow.g.i.cs
@@ -9,6 +9,23 @@
//
//------------------------------------------------------------------------------
+using Microsoft.Xaml.Behaviors;
+using Microsoft.Xaml.Behaviors.Core;
+using Microsoft.Xaml.Behaviors.Input;
+using Microsoft.Xaml.Behaviors.Layout;
+using Microsoft.Xaml.Behaviors.Media;
+using Prism.DryIoc;
+using Prism.Interactivity;
+using Prism.Ioc;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Regions.Behaviors;
+using Prism.Services.Dialogs;
+using Prism.Unity;
+using SWS.CustomControl;
+using SWS.Electrical;
+using SWS.Electrical.Views;
+using SWS.Model;
using System;
using System.Diagnostics;
using System.Windows;
@@ -29,6 +46,28 @@ using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
+using Telerik.Windows.Controls;
+using Telerik.Windows.Controls.Animation;
+using Telerik.Windows.Controls.Behaviors;
+using Telerik.Windows.Controls.Carousel;
+using Telerik.Windows.Controls.ComboBox;
+using Telerik.Windows.Controls.Data.PropertyGrid;
+using Telerik.Windows.Controls.DragDrop;
+using Telerik.Windows.Controls.GridView;
+using Telerik.Windows.Controls.LayoutControl;
+using Telerik.Windows.Controls.Legend;
+using Telerik.Windows.Controls.MultiColumnComboBox;
+using Telerik.Windows.Controls.Primitives;
+using Telerik.Windows.Controls.RadialMenu;
+using Telerik.Windows.Controls.TransitionEffects;
+using Telerik.Windows.Controls.TreeListView;
+using Telerik.Windows.Controls.TreeView;
+using Telerik.Windows.Controls.Wizard;
+using Telerik.Windows.Data;
+using Telerik.Windows.DragDrop;
+using Telerik.Windows.DragDrop.Behaviors;
+using Telerik.Windows.Input.Touch;
+using Telerik.Windows.Shapes;
namespace SWS.Electrical.Views {
diff --git a/newFront/c#前端/SWS.Share/ConstString.cs b/newFront/c#前端/SWS.Share/ConstString.cs
new file mode 100644
index 00000000..cb1ed962
--- /dev/null
+++ b/newFront/c#前端/SWS.Share/ConstString.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SWS.Share
+{
+ public class ConstString
+ {
+
+ }
+}
diff --git a/newFront/c#前端/SWS.Share/Enum.cs b/newFront/c#前端/SWS.Share/Enum.cs
new file mode 100644
index 00000000..e3553f51
--- /dev/null
+++ b/newFront/c#前端/SWS.Share/Enum.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SWS.Share
+{
+ public class Enum
+ {
+ public enum inOrOut
+ {
+ 输入 = 0,
+ 输出 = 1
+ }
+ public enum cableClass
+ {
+ conventional = 0,
+ homerun = 1
+ }
+ }
+}
diff --git a/newFront/c#前端/SWS.Share/SWS.Share.csproj b/newFront/c#前端/SWS.Share/SWS.Share.csproj
index 91be2f35..851b7bba 100644
--- a/newFront/c#前端/SWS.Share/SWS.Share.csproj
+++ b/newFront/c#前端/SWS.Share/SWS.Share.csproj
@@ -43,6 +43,8 @@
+
+
diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.cs
index 73b12740..ff9ac670 100644
--- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.cs
+++ b/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.cs
@@ -9,6 +9,8 @@
//
//------------------------------------------------------------------------------
+using SWS.Commons.Helper.Converter;
+using SWS.CustomControl;
using System;
using System.Diagnostics;
using System.Windows;
@@ -29,6 +31,28 @@ using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
+using Telerik.Windows.Controls;
+using Telerik.Windows.Controls.Animation;
+using Telerik.Windows.Controls.Behaviors;
+using Telerik.Windows.Controls.Carousel;
+using Telerik.Windows.Controls.ComboBox;
+using Telerik.Windows.Controls.Data.PropertyGrid;
+using Telerik.Windows.Controls.DragDrop;
+using Telerik.Windows.Controls.GridView;
+using Telerik.Windows.Controls.LayoutControl;
+using Telerik.Windows.Controls.Legend;
+using Telerik.Windows.Controls.MultiColumnComboBox;
+using Telerik.Windows.Controls.Primitives;
+using Telerik.Windows.Controls.RadialMenu;
+using Telerik.Windows.Controls.TransitionEffects;
+using Telerik.Windows.Controls.TreeListView;
+using Telerik.Windows.Controls.TreeView;
+using Telerik.Windows.Controls.Wizard;
+using Telerik.Windows.Data;
+using Telerik.Windows.DragDrop;
+using Telerik.Windows.DragDrop.Behaviors;
+using Telerik.Windows.Input.Touch;
+using Telerik.Windows.Shapes;
namespace SWS.WPF.Views {
diff --git a/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.i.cs b/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.i.cs
index 73b12740..ff9ac670 100644
--- a/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.i.cs
+++ b/newFront/c#前端/SWS.WPF/obj/Debug/Views/CustomDialogWindow.g.i.cs
@@ -9,6 +9,8 @@
//
//------------------------------------------------------------------------------
+using SWS.Commons.Helper.Converter;
+using SWS.CustomControl;
using System;
using System.Diagnostics;
using System.Windows;
@@ -29,6 +31,28 @@ using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
+using Telerik.Windows.Controls;
+using Telerik.Windows.Controls.Animation;
+using Telerik.Windows.Controls.Behaviors;
+using Telerik.Windows.Controls.Carousel;
+using Telerik.Windows.Controls.ComboBox;
+using Telerik.Windows.Controls.Data.PropertyGrid;
+using Telerik.Windows.Controls.DragDrop;
+using Telerik.Windows.Controls.GridView;
+using Telerik.Windows.Controls.LayoutControl;
+using Telerik.Windows.Controls.Legend;
+using Telerik.Windows.Controls.MultiColumnComboBox;
+using Telerik.Windows.Controls.Primitives;
+using Telerik.Windows.Controls.RadialMenu;
+using Telerik.Windows.Controls.TransitionEffects;
+using Telerik.Windows.Controls.TreeListView;
+using Telerik.Windows.Controls.TreeView;
+using Telerik.Windows.Controls.Wizard;
+using Telerik.Windows.Data;
+using Telerik.Windows.DragDrop;
+using Telerik.Windows.DragDrop.Behaviors;
+using Telerik.Windows.Input.Touch;
+using Telerik.Windows.Shapes;
namespace SWS.WPF.Views {