This commit is contained in:
xingheng 2025-09-15 20:28:57 +08:00
commit e96f397f4f
66 changed files with 2521 additions and 2278 deletions

9
.gitignore vendored
View File

@ -1100,3 +1100,12 @@ bin/release/
/Learun.Framework.Module/Learun.Util/Learun.Util.Operat/bin/Debug/Learun.Util.xml
/Learun.Framework.Module/Learun.Util/Learun.Util/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
newFront/c#前端/.vs/
/Department2/obj/Debug/Department2.csproj.AssemblyReference.cache
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/3ad7c96f-983b-4ac1-9f92-f5a7901a6021.vsidx
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/815c1f12-618a-42f1-9f48-530a4fe7066c.vsidx
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/da4d986e-a00f-4854-84e3-051892159db9.vsidx
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f3f7e679-645b-4fe3-a724-f2e55e8cd4fe.vsidx
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f843a722-ec3e-425b-a704-f3537ea54b49.vsidx
/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f03e1583-e8e0-43b7-9dbb-a1896ce4b92d.vsidx
/newFront/c#前端/.vs/SWS.CAD/FileContentIndex/f2e37380-e651-406b-9320-af642620eee9.vsidx

View File

@ -127,6 +127,11 @@ namespace Learun.Application.Web.AppApi
{
List<BOMTagInfo> allTagsInThisGroup = group.ToList();
var GroupName = group.Key.Group; //A-ABC, 正常情况下A是system放下面B是tag放上面
if (!GroupName.Contains("-"))
{
continue;
}
var upper_text_Part1 = GroupName.Split('-')[1];//ABC
var upper_text_Part2 = "";//seq
#region seq的不同情况

View File

@ -58,6 +58,7 @@ namespace DI_Electrical
GlobalObject._prismContainer.RegisterDialog<DialogSignalPropertyhisAndLogs, DialogSignalPropertyhisAndLogsViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogSignalSelect, DialogSignalSelectViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogAllOutputSignal, DialogAllOutputSignalViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogAssociatedSignal, DialogAssociatedSignalViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogInput, DialogInputViewModel>();
GlobalObject._prismContainer.Register<IDialogService, DialogService>();

View File

@ -69,9 +69,9 @@ namespace DI_Electrical.ViewModels
MessageBox.Show("本地文件目录不存在。");
return;
}
var data = _configService.parser.ReadFile(_configService.path);
//var data = _configService.parser.ReadFile(_configService.path);
_configService._httpService.Init(address, port);
//_configService._httpService.Init(address, port);
IsBusy = true;
BusyContent = "保存中...";
var testRes = await _LoginService.Login("1", "11");
@ -85,10 +85,17 @@ namespace DI_Electrical.ViewModels
{
address = address.Replace("https://", "").Replace("http://", "");
}
data["Profile"]["Address"] = address;
data["Profile"]["Port"] = port.ToString();
data["Profile"]["Directory"] = _directory;
_configService.parser.WriteFile(_configService.path, data);
//data["Profile"]["Address"] = address;
//data["Profile"]["Port"] = port.ToString();
//data["Profile"]["Directory"] = _directory;
//_configService.parser.WriteFile(_configService.path, data);
//IniHelper.WriteValueFromIniFile("Profile", "strIPAddress", address);
//IniHelper.WriteValueFromIniFile("Profile", "nPort", port.ToString());
//IniHelper.WriteValueFromIniFile("Profile", "strLocalWorkDir", _directory);
_configService.Save("Profile", "strIPAddress", address);
_configService.Save("Profile", "nPort", port.ToString());
_configService.Save("Profile", "strLocalWorkDir", _directory);
GlobalObject.isConfigIniCreateBySys = false;
GlobalObject.SetLocalFileDirectory(_directory);

View File

@ -72,9 +72,9 @@ namespace DI_Electrical.ViewModels
Command_Config = new DelegateCommand(onConfig);
containerProvider = container;
if (GlobalObject.isConfigIniCreateBySys)
{
var config= container.Resolve<Config>();
config.ShowDialog();
{
var config = container.Resolve<Config>();
config.ShowDialog();
}
UserName = _configService.Read(nameof(ConfigIni.UserName));
@ -91,14 +91,14 @@ namespace DI_Electrical.ViewModels
{
sPASSWORD = GlobalObject.userInfo.userPs;
}
curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port));
curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort");
}
public void onConfig(object o)
{
var config = containerProvider.Resolve<Config>();
config.ShowDialog();
curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port));
curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort");
}
public override async void ExecuteOKCommandAsync(object obj)
@ -116,7 +116,7 @@ namespace DI_Electrical.ViewModels
else
{
IsBusy = true; BusyContent = "登录中...";
var res = await _Service.Login(UserName, Userpass);
var res = await _Service.Login(UserName, Userpass);
IsBusy = false;
if (string.IsNullOrEmpty(res))
{

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,7 @@ using Panel = Bricscad.Windows.Panel;
using GlobalObject = SWS.Commons.GlobalObject;
using SWS.Model;
using SWS.Service;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Information;
[assembly: CommandClass(typeof(Commands))]
@ -540,6 +541,8 @@ namespace SWS.CAD
//选择的元素返回的属性信息
var ResTagInfosByPixels = new Model.ec_objecttype();
var listPropertys = new List<propertyModel>();
var _objectTypeService = GlobalObject.container.Resolve<ObjectTypeService>();
var _iOModuleService = GlobalObject.container.Resolve<IOModuleService>();
// 持续选择直到获取有效电缆
bool isValidCable = false;
@ -564,7 +567,7 @@ namespace SWS.CAD
{
// 获取句柄Handle 是字符串类型)
var handId = (cable.Handle.ToString());
var _objectTypeService = GlobalObject.container.Resolve<ObjectTypeService>();
_objectTypeService = GlobalObject.container.Resolve<ObjectTypeService>();
var res = await _objectTypeService.GetTagInfosByPixels(dwgFile.Id, handId);
if (res != null)
{
@ -600,8 +603,20 @@ namespace SWS.CAD
//Thread.Sleep(2000);
if (isValidCable)
{
var _iOModuleService = GlobalObject.container.Resolve<IOModuleService>();
var ResTagNumberById = await _objectTypeService.GetTagNumberById(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID);
var ObjectTypePListBy = await _objectTypeService.GetObjectTypePListByIds(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID);
string CableSpecification = ObjectTypePListBy.Where(q => q.PropertyName.Equals("电缆规格")).Select(s => s.EnumDataCode).FirstOrDefault();
CableSpecification = CableSpecification.Substring(0, CableSpecification.Length - 1);
var LatestSerialNumber = await _objectTypeService.GetLatestSerialNumber(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID);
//获取位号的电缆属性,判断是否设置电缆规格
var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber);
var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber)).FirstOrDefault();
if (string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
//if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
{
System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning); return;
}
var ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID);
//如果配置不存在
if (ResCableEngID == null)
@ -636,6 +651,7 @@ namespace SWS.CAD
ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
@ -645,6 +661,7 @@ namespace SWS.CAD
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
@ -653,6 +670,20 @@ namespace SWS.CAD
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n - 1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + n.ToString();
}
break;
case "按电缆对编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
@ -663,12 +694,9 @@ namespace SWS.CAD
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1).ToString();
Tag = (i + 1) + "-" + (j + 1).ToString();
}
break;
case "按电缆对编号":
a = ResTagInfosByPixels.tags.FirstOrDefault().TagNumber;
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
@ -705,6 +733,7 @@ namespace SWS.CAD
ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
@ -714,6 +743,7 @@ namespace SWS.CAD
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
@ -722,6 +752,20 @@ namespace SWS.CAD
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n - 1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + n.ToString();
}
break;
case "按电缆对编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
@ -732,12 +776,9 @@ namespace SWS.CAD
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1).ToString();
Tag = (i + 1) + "-" + (j + 1).ToString();
}
break;
case "按电缆对编号":
a = ResTagInfosByPixels.tags.FirstOrDefault().TagNumber;
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
@ -849,9 +890,305 @@ namespace SWS.CAD
btnCableSinal.ToolTip = "信号预分配";
btnCableSinal.Text = "信号预分配";
btnCableSinal.ButtonStyle = RibbonButtonStyle.SmallWithText;
btnCableSinal.CommandHandler = new DelegateCommand(x =>
btnCableSinal.CommandHandler = new DelegateCommand(async x =>
{
MessageBox.Show("功能开发中...");
if (GlobalObject.userInfo == null || GlobalObject.curProject == null)
{
MessageBox.Show("请先登录系统并选择项目!");
return;
}
//在SWS系统内打开且不是只读的图纸才可
var dwgName = General.GetDwgName();
var dwgFile = GlobalObject.ListDwgOpened.FirstOrDefault(a => a.Path == dwgName && a.IsReadOnly == false);
if (dwgFile == null)
{ return; }
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
Editor ed = doc.Editor;
//选择的元素返回的属性信息
var ResTagInfosByPixels = new Model.ec_objecttype();
var listPropertys = new List<propertyModel>();
var _objectTypeService = GlobalObject.container.Resolve<ObjectTypeService>();
var _iOModuleService = GlobalObject.container.Resolve<IOModuleService>();
// 持续选择直到获取有效电缆
bool isValidCable = false;
try
{
#region
// 创建选择选项(禁用回车确认)
PromptEntityOptions options = new PromptEntityOptions("\n请单击选择电缆: ");
options.AllowNone = false; // 禁止空选
// 执行选择(直接单击生效)
PromptEntityResult resultEntity = ed.GetEntity(options);
//WindowVisibility = System.Windows.Visibility.Hidden;
while (resultEntity.Status == PromptStatus.OK)
{
using (Transaction tr = db.TransactionManager.StartTransaction())
{
// 获取选中的电缆实体
Entity cable = tr.GetObject(resultEntity.ObjectId, OpenMode.ForRead) as Entity;
//if (cable != null&&cable.XData != null)
if (cable != null)
{
// 获取句柄Handle 是字符串类型)
var handId = (cable.Handle.ToString());
var res = await _objectTypeService.GetTagInfosByPixels(dwgFile.Id, handId);
if (res != null)
{
if (res.Count == 1)
{
var item = res[0];
var objTypeName = item.ObjectTypeName;
if (objTypeName.Contains("电缆"))
{
ResTagInfosByPixels = item;
isValidCable = true; // 校验通过
ed.WriteMessage($"\n已选择电缆:{ResTagInfosByPixels.tags.FirstOrDefault().TagNumber}");
}
}
}
}
tr.Commit();
}
if (isValidCable)
{
break;
}
else
{
ed.WriteMessage($"\n已选择电缆:");
resultEntity = ed.GetEntity(options);
}
}
#endregion
//Thread.Sleep(2000);
if (isValidCable)
{
var ResTagNumberById = await _objectTypeService.GetTagNumberById(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID);
var ObjectTypePListBy = await _objectTypeService.GetObjectTypePListByIds(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID);
string CableSpecification = ObjectTypePListBy.Where(q => q.PropertyName.Equals("电缆规格")).Select(s => s.EnumDataCode).FirstOrDefault();
CableSpecification = CableSpecification.Substring(0, CableSpecification.Length - 1);
var LatestSerialNumber = await _objectTypeService.GetLatestSerialNumber(ResTagInfosByPixels.tags.FirstOrDefault().ObjectTypeID);
//获取位号的电缆属性,判断是否设置电缆规格
var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber);
var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(ResTagInfosByPixels.tags.FirstOrDefault().TagNumber)).FirstOrDefault();
if(string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
//if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
{
System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning); return;
}
var ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID);
//如果配置不存在
if (ResCableEngID == null)
{
listPropertys = new List<propertyModel>();
System.Windows.MessageBoxResult result = System.Windows.MessageBox.Show($"是否为通讯母线?", "KunHengCAD", System.Windows.MessageBoxButton.OKCancel, System.Windows.MessageBoxImage.Question);
if (result == System.Windows.MessageBoxResult.OK)
{
listPropertys = new List<propertyModel>();
Dictionary<string, string> pulldownlist;
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对数", GroupName = "基本参数", PropertyValue = "1", ControlTypeName = PROPERTYType.TextBox, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "每电缆对芯数", GroupName = "基本参数", PropertyValue = "2", ControlTypeName = PROPERTYType.TextBox, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对编号前缀", GroupName = "基本参数", PropertyValue = "Set", ControlTypeName = PROPERTYType.TextBox, });
pulldownlist = new Dictionary<string, string>();
pulldownlist.Add("数字", "数字");
pulldownlist.Add("字母", "字母");
pulldownlist.Add("电缆对序号", "电缆对序号");
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号类型", GroupName = "电芯参数", PropertyValue = "数字", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, });
pulldownlist = new Dictionary<string, string>();
pulldownlist.Add("按电缆编号", "按电缆编号");
pulldownlist.Add("按电缆对编号", "按电缆对编号");
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号规则", GroupName = "电芯参数", PropertyValue = "按电缆对编号", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电芯编号前缀", GroupName = "电芯参数", PropertyValue = "C", ControlTypeName = PROPERTYType.TextBox, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "极性", GroupName = "电芯参数", PropertyValue = "+,-,s", ControlTypeName = PROPERTYType.TextBox, });
//显示属性弹窗
var ReslistPro = ShowPropertyMessage("新建" + ResTagInfosByPixels.tags.FirstOrDefault().TagNumber + "电缆配置", listPropertys);
if (ReslistPro == null || ReslistPro.Count() == 0) return;
ec_Cable ec_Cable = new ec_Cable();
ec_Cable.CableClass = "homerun";//母线
ec_Cable.Cable_Format = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault();
ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
ec_CableSet.CableSetName = ReslistPro.Where(p => p.DisplayText.Equals("电缆对编号前缀")).Select(p => p.PropertyValue).FirstOrDefault() + (i + 1);
ec_CableSet.CableSetSeq = i + 1;
ec_CableSet.Wires = new List<ec_CableSetWire>();
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
string a = ReslistPro.Where(p => p.DisplayText.Equals("电芯编号前缀")).Select(p => p.PropertyValue).FirstOrDefault();//组成线号名的前缀
string Tag = "";//线号名的中间部分
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n - 1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + n.ToString();
}
break;
case "按电缆对编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + j);
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + (j + 1).ToString();
}
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
}
ec_Cable.Sets.Add(ec_CableSet);
}
var httpres = await _iOModuleService.CreateCableByProfile(ec_Cable);
ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID);
}
else
{
listPropertys = new List<propertyModel>();
Dictionary<string, string> pulldownlist;
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对数", GroupName = "基本参数", PropertyValue = "10", ControlTypeName = PROPERTYType.TextBox, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "每电缆对芯数", GroupName = "基本参数", PropertyValue = "2", ControlTypeName = PROPERTYType.TextBox, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电缆对编号前缀", GroupName = "基本参数", PropertyValue = "Set", ControlTypeName = PROPERTYType.TextBox, });
pulldownlist = new Dictionary<string, string>();
pulldownlist.Add("数字", "数字");
pulldownlist.Add("字母", "字母");
pulldownlist.Add("电缆对序号", "电缆对序号");
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号类型", GroupName = "电芯参数", PropertyValue = "数字", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, });
pulldownlist = new Dictionary<string, string>();
pulldownlist.Add("按电缆编号", "按电缆编号");
pulldownlist.Add("按电缆对编号", "按电缆对编号");
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "编号规则", GroupName = "电芯参数", PropertyValue = "按电缆对编号", ControlTypeName = PROPERTYType.ComboBox, Item = pulldownlist, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "电芯编号前缀", GroupName = "电芯参数", PropertyValue = "C", ControlTypeName = PROPERTYType.TextBox, });
listPropertys.Add(new propertyModel() { Id = "1", DisplayText = "极性", GroupName = "电芯参数", PropertyValue = "+,-,s", ControlTypeName = PROPERTYType.TextBox, });
//显示属性弹窗
var ReslistPro = ShowPropertyMessage("新建" + ResTagInfosByPixels.tags.FirstOrDefault().TagNumber + "电缆配置", listPropertys);
if (ReslistPro == null || ReslistPro.Count() == 0) return;
ec_Cable ec_Cable = new ec_Cable();
ec_Cable.CableClass = "conventional";//常规电缆
ec_Cable.EngineerDataID = ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
ec_CableSet.CableSetName = ReslistPro.Where(p => p.DisplayText.Equals("电缆对编号前缀")).Select(p => p.PropertyValue).FirstOrDefault() + (i + 1);
ec_CableSet.CableSetSeq = i + 1;
ec_CableSet.Wires = new List<ec_CableSetWire>();
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
string a = ReslistPro.Where(p => p.DisplayText.Equals("电芯编号前缀")).Select(p => p.PropertyValue).FirstOrDefault();//组成线号名的前缀
string Tag = "";//线号名的中间部分
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号"://所有的电缆对中的电芯一起编号
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n-1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i+1)+"-"+ n.ToString();
}
break;
case "按电缆对编号"://一个电缆对中线号按顺序编号另一个电缆对中线号重新从1开始编号
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + j);
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i+1) + "-" + (j+1).ToString();
}
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
}
ec_Cable.Sets.Add(ec_CableSet);
}
var httpres = await _iOModuleService.CreateCableByProfile(ec_Cable);
ResCableEngID = await _iOModuleService.GetCableByEngID(ResTagInfosByPixels.tags.FirstOrDefault().EngineDataID);
}
}
if (ResCableEngID != null)
{
IntPtr cadHandle = Bricscad.ApplicationServices.Application.MainWindow.Handle;
//打开窗体
var para = new Prism.Services.Dialogs.DialogParameters();
//para.Add(GlobalObject.dialogPar.para1.ToString(), "6e2919e4-28cd-4fb6-9035-10b2ff0e30fb");
para.Add(GlobalObject.dialogPar.info.ToString(), cadHandle);
para.Add(GlobalObject.dialogPar.para1.ToString(), ResCableEngID);
para.Add(GlobalObject.dialogPar.para2.ToString(), ResTagInfosByPixels.tags.FirstOrDefault().TagNumber);
var _dialogService = GlobalObject._prismContainer.Resolve<IDialogService>();
_dialogService.ShowDialog(nameof(DialogSignalPredistribution), para, (RES) =>
{
if (RES.Result == ButtonResult.Yes)
{
}
else if (RES.Result == ButtonResult.No)
{ }
});
}
}
}
catch (System.Exception ex)
{
ed.WriteMessage($"\n错误: {ex.Message}");
}
});
btnCableSinal.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CableSinal.png");
btnCableSinal.Id = "信号预分配";

View File

@ -0,0 +1,9 @@
using Newtonsoft.Json.Linq;
using Prism.Events;
namespace SWS.CAD.Event
{
public class ScrollToItemEvent: PubSubEvent<object>
{
}
}

View File

@ -1,5 +1,6 @@
using IniParser;
using Prism.Ioc;
using SWS.Commons;
using SWS.Model;
using SWS.Service;
using System;
@ -59,7 +60,7 @@ namespace SWS.CAD
if (_dwgType == null)
{
var serv = GlobalObje.container.Resolve<DataItemService>();
var serv = GlobalObject.container.Resolve<DataItemService>();
var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingType.ToString()));
var res2 = res.Result;
return res2;
@ -83,7 +84,7 @@ namespace SWS.CAD
if (_dwgMaterialRange == null)
{
var serv = GlobalObje.container.Resolve<DataItemService>();
var serv = GlobalObject.container.Resolve<DataItemService>();
var res = Task.Run(() => serv.GetDetails(DBConst.Be_MaterialRange.ToString()));
var res2 = res.Result;
return res2;
@ -107,7 +108,7 @@ namespace SWS.CAD
if (_dwgMaterialCensus == null)
{
var serv = GlobalObje.container.Resolve<DataItemService>();
var serv = GlobalObject.container.Resolve<DataItemService>();
var res = Task.Run(() => serv.GetDetails(DBConst.Be_MaterialCensus.ToString()));
var res2 = res.Result;
return res2;
@ -131,7 +132,7 @@ namespace SWS.CAD
if (_dwgStage == null)
{
var serv = GlobalObje.container.Resolve<DataItemService>();
var serv =GlobalObject.container.Resolve<DataItemService>();
var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingStage.ToString()));
var res2 = res.Result;
return res2;
@ -155,7 +156,7 @@ namespace SWS.CAD
if (_dwgSystem == null)
{
var serv = GlobalObje.container.Resolve<DataItemService>();
var serv = GlobalObject.container.Resolve<DataItemService>();
var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingSystem.ToString()));
var res2 = res.Result;
var res3 = DataItemDetailsToTree(res2);
@ -243,11 +244,11 @@ namespace SWS.CAD
para1,
para2
}
public static IUnityContainer container;
public static IContainerExtension _prismContainer;
public static HttpClient client;
public static loginRes userInfo;
public static List<User> Users;
//public static IUnityContainer container;
//public static IContainerExtension _prismContainer;
//public static HttpClient client;
//public static loginRes userInfo;
//public static List<User> Users;
public static bool isConfigIniCreateBySys = true;
//public static string drawingFileId;
@ -321,27 +322,27 @@ namespace SWS.CAD
}
#endregion
#region ID获取用户名称
/// <summary>
/// 根据ID获取用户名称
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static string GetUserNameById(string id)
{
if (string.IsNullOrEmpty(id))
{ return ""; }
var user = Users.FirstOrDefault(a => a.F_UserId == id || a.F_Account == id);
if (user != null)
{ return user.F_RealName; }
else
{
return "";
//user = GlobalObject.Users.FirstOrDefault(a => a.F_Account == id);
//return user != null ? user.F_RealName : "";
}
}
#endregion
//#region 根据ID获取用户名称
///// <summary>
///// 根据ID获取用户名称
///// </summary>
///// <param name="id"></param>
///// <returns></returns>
//public static string GetUserNameById(string id)
//{
// if (string.IsNullOrEmpty(id))
// { return ""; }
// var user = Users.FirstOrDefault(a => a.F_UserId == id || a.F_Account == id);
// if (user != null)
// { return user.F_RealName; }
// else
// {
// return "";
// //user = GlobalObject.Users.FirstOrDefault(a => a.F_Account == id);
// //return user != null ? user.F_RealName : "";
// }
//}
//#endregion
#region

View File

@ -167,6 +167,7 @@
<Compile Include="Event\propertyChangeEvent.cs" />
<Compile Include="Event\IORelationEvent.cs" />
<Compile Include="Event\tagChangeEvent.cs" />
<Compile Include="Event\ScrollToItemEvent.cs" />
<Compile Include="Event\treeNodeChangeEvent.cs" />
<Compile Include="Event\SelectProjectEvent.cs" />
<Compile Include="Helper\Converter\ComboBoxFilterConverter.cs" />
@ -208,6 +209,7 @@
<Compile Include="ViewModels\DialogPreCheckInViewModel.cs" />
<Compile Include="ViewModels\DialogParallelCableViewModel.cs" />
<Compile Include="ViewModels\DialogNewTagNumberViewModel.cs" />
<Compile Include="ViewModels\DialogSignalPredistributionViewModel.cs" />
<Compile Include="ViewModels\DialogTagSelectViewModel.cs" />
<Compile Include="ViewModels\DialogUnitSelectViewModel.cs" />
<Compile Include="ViewModels\Dialog2SelectViewModel.cs" />
@ -315,6 +317,9 @@
<Compile Include="Views\Dialog\DialogNewTagNumber.xaml.cs">
<DependentUpon>DialogNewTagNumber.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Dialog\DialogSignalPredistribution.xaml.cs">
<DependentUpon>DialogSignalPredistribution.xaml</DependentUpon>
</Compile>
<Compile Include="Views\Dialog\DialogTagSelect.xaml.cs">
<DependentUpon>DialogTagSelect.xaml</DependentUpon>
</Compile>
@ -447,6 +452,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Dialog\DialogSignalPredistribution.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Dialog\DialogTagSelect.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@ -5,6 +5,6 @@
<StartProgram>D:\Program Files\KunHeng\KunHengCAD V21 zh_CN\kunhengcad.exe</StartProgram>
</PropertyGroup>
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>

View File

@ -55,6 +55,7 @@ namespace SWS.CAD
GlobalObject._prismContainer.RegisterDialog<DialogPublishRecord, DialogPublishRecordViewModel>();
GlobalObject._prismContainer.RegisterDialog<SWS.WPF.Views.DialogSignalManagement,SWS.WPF.ViewModels.DialogSignalManagementViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogAllOutputSignal, DialogAllOutputSignalViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogAssociatedSignal, DialogAssociatedSignalViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogOperateRecord, DialogOperateRecordViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogPropertyHistory, DialogPropertyHistoryViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogSignalNotice, DialogSignalNoticeViewModel>();
@ -71,6 +72,7 @@ namespace SWS.CAD
GlobalObject._prismContainer.RegisterDialog<DialogChannelMigration, DialogChannelMigrationViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogCableConnection, DialogCableConnectionViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogCableConnection_NewStrip, DialogCableConnection_NewStripViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogSignalPredistribution, DialogSignalPredistributionViewModel>();
}
}
}

View File

@ -70,7 +70,6 @@ namespace SWS.CAD.ViewModels
Application.ShowAlertDialog("本地文件目录不存在。");
return;
}
var data = _configService.parser.ReadFile(_configService.path);
_configService._httpService.Init(address, port);
IsBusy = true;
@ -85,10 +84,14 @@ namespace SWS.CAD.ViewModels
{
address = address.Replace("https://", "").Replace("http://", "");
}
data["Profile"]["Address"] = address;
data["Profile"]["Port"] = port.ToString();
data["Profile"]["Directory"] = _directory;
_configService.parser.WriteFile(_configService.path, data);
//var data = _configService.parser.ReadFile(_configService.path);
//data["Profile"]["Address"] = address;
//data["Profile"]["Port"] = port.ToString();
//data["Profile"]["Directory"] = _directory;
//_configService.parser.WriteFile(_configService.path, data);
_configService.Save("Profile", "strIPAddress", address);
_configService.Save("Profile", "nPort", port.ToString());
_configService.Save("Profile", "strLocalWorkDir", _directory);
GlobalObject.isConfigIniCreateBySys = false;
GlobalObject.SetLocalFileDirectory(_directory);

View File

@ -10,6 +10,7 @@ using System.Windows.Threading;
using Bricscad.ApplicationServices;
using Bricscad.EditorInput;
using OfficeOpenXml;
using OfficeOpenXml.FormulaParsing.Excel.Functions.Information;
using Prism.Events;
using Prism.Ioc;
using Prism.Services.Dialogs;
@ -56,6 +57,8 @@ namespace SWS.CAD.ViewModels
RaisePropertyChanged(nameof(SelectedTreeNode));
UpdateChannelInfos();
var path = FindNodePath(PanelTreels, _SelectedTreeNode);
_eventAggregator.GetEvent<ScrollToItemEvent>().Publish(path);
}
}
@ -279,7 +282,7 @@ namespace SWS.CAD.ViewModels
{
ChannelInfo c = new ChannelInfo();
//电缆位号,电缆对,电缆线号,极性
foreach (var Term in child.Terms)
foreach (var Term in child.Terms.OrderBy(p => p.Term_Seq).ToList())
{
index++;
c.Index.Add(index.ToString());
@ -302,7 +305,8 @@ namespace SWS.CAD.ViewModels
c.Polaritys.Add(new ec_WireTerminal());
}
}
c.Terms.AddRange(child.Terms);
//端子号
c.Terms.AddRange(child.Terms.OrderBy(p => p.Term_Seq).ToList());
//关联信号
c.Signal = child.Signal;
if (child.Signal != null)
@ -333,14 +337,14 @@ namespace SWS.CAD.ViewModels
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
System.Windows.MessageBox.Show(ex.Message, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
}
finally
{
IsBusy = false;
}
}
#endregion
@ -523,6 +527,44 @@ namespace SWS.CAD.ViewModels
}
#endregion
#region
public List<string> FindNodePath(ObservableCollection<TreeModel> nodes, TreeModel targetNode)
{
List<string> path = new List<string>();
FindNodePathRecursive(nodes, targetNode, path);
return path;
}
private bool FindNodePathRecursive(IEnumerable<TreeModel> nodes, TreeModel targetNode, List<string> currentPath)
{
foreach (var node in nodes)
{
currentPath.Add(node.Text);
if (node == targetNode) return true; // 找到目标节点返回True并结束搜索
if (node.ChildNodes.Count > 0 && FindNodePathRecursive(node.ChildNodes, targetNode, currentPath))
return true; // 在子节点中继续搜索并找到目标节点返回True并结束搜索
currentPath.RemoveAt(currentPath.Count - 1); // 回溯,尝试下一个兄弟节点或父节点的其他兄弟节点
}
return false; // 没有找到目标节点返回False
}
#endregion
#region id查找项
private TreeModel FindTreeModelById(IEnumerable<TreeModel> TreeModels, string id)
{
foreach (var Tree in TreeModels)
{
if (Tree.ID == id)
return Tree;
var foundInChildren = FindTreeModelById(Tree.ChildNodes, id);
if (foundInChildren != null)
return foundInChildren;
}
return null;
}
#endregion
#region
public ICommand MouseRightCmd => new DelegateCommand(MouseRight_Click);
@ -602,6 +644,7 @@ namespace SWS.CAD.ViewModels
}
PanelTreels.Clear();
PanelTreels.AddRange(await _iOModuleService.GetPanelTree());
SelectedTreeNode = PanelTreels.FirstOrDefault(p => p.Text.Equals(positionalvalue)).ChildNodes.FirstOrDefault(c => c.ID.Equals(PanelIDValue));
}
else if (RES.Result == ButtonResult.No)
{ }
@ -684,13 +727,14 @@ namespace SWS.CAD.ViewModels
DataItemName = listPro.Where(p => p.DisplayText.Equals("位置名称")).Select(p => p.PropertyValue).FirstOrDefault(),
OrderID = int.Parse(listPro.Where(p => p.DisplayText.Equals("排序号")).Select(p => p.PropertyValue).FirstOrDefault()),
};
var httpres = await _dataItemService.SaveDetailForm(ent);
if (httpres != null)
var httpres = await _dataItemService.SaveDetailForm(ent) as learunHttpRes<ec_dataitemdetail>;
if (httpres.code != 200)
{
System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
System.Windows.MessageBox.Show(httpres.info.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
}
PanelTreels.Clear();
PanelTreels.AddRange(await _iOModuleService.GetPanelTree());
SelectedTreeNode = FindNodeByNodeId(PanelTreels, httpres.data.DataItemID);
}
else if (RES.Result == ButtonResult.No)
{ }
@ -880,13 +924,15 @@ namespace SWS.CAD.ViewModels
}
#endregion
var httpres = await _iOModuleService.CreatePanelStripByProfile(e);
if (httpres != null)
var httpres = await _iOModuleService.CreatePanelStripByProfile(e) as learunHttpRes<ec_PanelStrip>;
if (httpres.code != 200)
{
System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
System.Windows.MessageBox.Show(httpres.info.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
}
PanelTreels.Clear();
PanelTreels.AddRange(await _iOModuleService.GetPanelTree());
SelectedTreeNode = FindTreeModelById(PanelTreels, httpres.data.StripID);
}
else if (RES.Result == ButtonResult.No)
{ }
@ -939,13 +985,14 @@ namespace SWS.CAD.ViewModels
DataItemName = listPro.Where(p => p.DisplayText.Equals("位置名称")).Select(p => p.PropertyValue).FirstOrDefault(),
OrderID = int.Parse(listPro.Where(p => p.DisplayText.Equals("排序号")).Select(p => p.PropertyValue).FirstOrDefault()),
};
var httpres = await _dataItemService.SaveDetailForm(ent);
if (httpres != null)
var httpres = await _dataItemService.SaveDetailForm(ent) as learunHttpRes<ec_dataitemdetail>;
if (httpres.code != 200)
{
System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
System.Windows.MessageBox.Show(httpres.info.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
}
PanelTreels.Clear();
PanelTreels.AddRange(await _iOModuleService.GetPanelTree());
SelectedTreeNode = FindNodeByNodeId(PanelTreels, httpres.info);
}
else if (RES.Result == ButtonResult.No)
{ }
@ -973,6 +1020,7 @@ namespace SWS.CAD.ViewModels
{
if (RES.Result == ButtonResult.Yes)
{
var tempID = SelectedTreeNode.ID;
var listPro = RES.Parameters.GetValue<ObservableCollection<propertyModel>>(GlobalObject.dialogPar.para1.ToString());
ec_PanelStrip ent = new ec_PanelStrip()
@ -984,12 +1032,13 @@ namespace SWS.CAD.ViewModels
StripID = StripIDValue,
};
var httpres = await _iOModuleService.SavePanelStrip(ent);
if (httpres != null)
if (httpres!= null)
{
System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
}
PanelTreels.Clear();
PanelTreels.AddRange(await _iOModuleService.GetPanelTree());
SelectedTreeNode = FindNodeByNodeId(PanelTreels, tempID);
}
else if (RES.Result == ButtonResult.No)
{ }
@ -1016,7 +1065,15 @@ namespace SWS.CAD.ViewModels
MessageBoxResult result = System.Windows.MessageBox.Show($"确定删除[{SelectedTreeNode.Text}]节点以及子节点吗", "KunHengCAD", MessageBoxButton.OKCancel, MessageBoxImage.Question);
if (result == MessageBoxResult.OK)
{
var tempParentId = SelectedTreeNode.parentId;
var httpres = await _iOModuleService.DeletePanelStrip(SelectedTreeNode.ID);
if (httpres!=null)
{
System.Windows.MessageBox.Show(httpres.ToString(), "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
}
PanelTreels.Clear();
PanelTreels.AddRange(await _iOModuleService.GetPanelTree());
SelectedTreeNode = FindTreeModelById(PanelTreels, tempParentId);
}
}
return;
@ -1068,7 +1125,8 @@ namespace SWS.CAD.ViewModels
//获取位号的电缆属性,判断是否设置电缆规格
var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(selectTagNumberOB.TagNumber);
var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(selectTagNumberOB.TagNumber)).FirstOrDefault();
if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
if (string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
//if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
{
System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
@ -1107,6 +1165,7 @@ namespace SWS.CAD.ViewModels
ec_Cable.EngineerDataID = selectTagNumberOB.EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
@ -1116,6 +1175,7 @@ namespace SWS.CAD.ViewModels
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
@ -1124,6 +1184,20 @@ namespace SWS.CAD.ViewModels
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n - 1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + n.ToString();
}
break;
case "按电缆对编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
@ -1134,12 +1208,9 @@ namespace SWS.CAD.ViewModels
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1).ToString();
Tag = (i + 1) + "-" + (j + 1).ToString();
}
break;
case "按电缆对编号":
a = selectTagNumberOB.TagNumber;
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
@ -1176,6 +1247,7 @@ namespace SWS.CAD.ViewModels
ec_Cable.EngineerDataID = selectTagNumberOB.EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
@ -1185,6 +1257,7 @@ namespace SWS.CAD.ViewModels
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
@ -1193,6 +1266,20 @@ namespace SWS.CAD.ViewModels
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n - 1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + n.ToString();
}
break;
case "按电缆对编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
@ -1203,12 +1290,9 @@ namespace SWS.CAD.ViewModels
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1).ToString();
Tag = (i + 1) + "-" + (j + 1).ToString();
}
break;
case "按电缆对编号":
a = selectTagNumberOB.TagNumber;
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
@ -1501,11 +1585,12 @@ namespace SWS.CAD.ViewModels
//获取位号的电缆属性,判断是否设置电缆规格
var TagNumberBys = await _objectTypeService.GetEngineDataListByTags(resTagNumberListByPixels.TagNumber);
var TagNumberBy = TagNumberBys.Where(t => t.TagNumber.Equals(resTagNumberListByPixels.TagNumber)).FirstOrDefault();
if (string.IsNullOrEmpty(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
//if (!CableSpecification.Split(',').ToList().Contains(TagNumberBy.EngineDataProperty.Where(e => e.PropertyName.Equals("电缆规格")).Select(e => e.PropertyValue).FirstOrDefault()))
//{
// System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
{
System.Windows.MessageBox.Show("无法获取电缆对信息,请在电缆\"属性面版“输入电缆”电缆规格”属性\r\n如:“1x2x0.75”", "KunHengCAD", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning); return;
//}
}
//获取电缆的配置,没有则创建新配置
var CableBy = await _iOModuleService.GetCableByEngID(resTagNumberListByPixels?.EngineDataID);
if (CableBy == null)
@ -1539,6 +1624,7 @@ namespace SWS.CAD.ViewModels
ec_Cable.EngineerDataID = resTagNumberListByPixels.EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
@ -1548,6 +1634,7 @@ namespace SWS.CAD.ViewModels
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
@ -1556,6 +1643,20 @@ namespace SWS.CAD.ViewModels
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n - 1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + n.ToString();
}
break;
case "按电缆对编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
@ -1566,12 +1667,9 @@ namespace SWS.CAD.ViewModels
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1).ToString();
Tag = (i + 1) + "-" + (j + 1).ToString();
}
break;
case "按电缆对编号":
a = resTagNumberListByPixels.TagNumber;
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
@ -1608,6 +1706,7 @@ namespace SWS.CAD.ViewModels
ec_Cable.EngineerDataID = resTagNumberListByPixels.EngineDataID;
ec_Cable.Sets = new List<ec_CableSet>();
int CableSetCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("电缆对数")).Select(p => p.PropertyValue).FirstOrDefault(), out CableSetCount) ? CableSetCount : 0;
int n = 0;
for (int i = 0; i < CableSetCount; i++)
{
ec_CableSet ec_CableSet = new ec_CableSet();
@ -1617,6 +1716,7 @@ namespace SWS.CAD.ViewModels
int WireCount = int.TryParse(ReslistPro.Where(p => p.DisplayText.Equals("每电缆对芯数")).Select(p => p.PropertyValue).FirstOrDefault(), out WireCount) ? WireCount : 0;
for (int j = 0; j < WireCount; j++)
{
n++;
ec_CableSetWire ec_CableSetWire = new ec_CableSetWire();
ec_CableSetWire.Polarity = ReslistPro.Where(p => p.DisplayText.Equals("极性")).Select(p => p.PropertyValue).FirstOrDefault().Split(',')[Math.Abs(j % 3)];
ec_CableSetWire.SetLevel = j + 1;
@ -1625,6 +1725,20 @@ namespace SWS.CAD.ViewModels
switch (ReslistPro.Where(p => p.DisplayText.Equals("编号规则")).Select(p => p.PropertyValue).FirstOrDefault())
{
case "按电缆编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = n.ToString();
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("字母"))
{
Tag = Tag + (char)('A' + (n - 1));
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1) + "-" + n.ToString();
}
break;
case "按电缆对编号":
if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("数字"))
{
Tag = (j + 1).ToString();
@ -1635,12 +1749,9 @@ namespace SWS.CAD.ViewModels
}
else if (ReslistPro.Where(p => p.DisplayText.Equals("编号类型")).Select(p => p.PropertyValue).FirstOrDefault().Equals("电缆对序号"))
{
Tag = (i + 1).ToString();
Tag = (i + 1) + "-" + (j + 1).ToString();
}
break;
case "按电缆对编号":
a = resTagNumberListByPixels.TagNumber;
break;
}
ec_CableSetWire.Wire_Tag = a + Tag;
ec_CableSet.Wires.Add(ec_CableSetWire);
@ -2054,7 +2165,7 @@ namespace SWS.CAD.ViewModels
if (result == MessageBoxResult.OK)
{
var httpres = await _iOModuleService.DeletePanelChannel(SelectedChannelInfo.ChannelID);
if (httpres!=null)
if (httpres != null)
{
System.Windows.MessageBox.Show(httpres, "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return;
@ -2530,8 +2641,8 @@ namespace SWS.CAD.ViewModels
ent.Signals = new List<SWS.Model.ec_Wire_Group>();
ent.Signals.Add(SelectedChannelInfo.Signal);
//解除信号
var data = await _wireGroupService.SaveSignals(ent);
if (data != null)
var data = await _wireGroupService.SaveSignals(ent) as learunHttpRes<List<ec_Wire_Group>>;
if (data.code ==200)
{
ChannelInfos.Clear();
UpdateChannelInfos();

View File

@ -0,0 +1,583 @@

using Prism.Events;
using Prism.Ioc;
using Prism.Services.Dialogs;
using SWS.CAD.Event;
using SWS.CAD.ViewModels.myViewModelBase;
using SWS.CAD.Views;
using SWS.CAD.Views.CustomControl;
using SWS.Commons;
using SWS.Model;
using SWS.Service;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using Telerik.Windows.Controls;
using Unity;
namespace SWS.CAD.ViewModels
{
public class DialogSignalPredistributionViewModel : DialogBase, IDialogAware
{
#region
private ObservableCollection<Model.TreeModel> _PanelTreels = new ObservableCollection<Model.TreeModel>();
/// <summary>
/// 页面左侧树形结构数据
/// </summary>
public ObservableCollection<Model.TreeModel> PanelTreels
{
get { return _PanelTreels; }
set { _PanelTreels = value; RaisePropertyChanged(nameof(PanelTreels)); }
}
private Model.TreeModel _SelectedTreeNode;
/// <summary>
/// 当前选中的树形节点
/// </summary>
public Model.TreeModel SelectedTreeNode
{
get { return _SelectedTreeNode; }
set
{
_SelectedTreeNode = value;
RaisePropertyChanged(nameof(SelectedTreeNode));
var path= FindNodePath(PanelTreels, _SelectedTreeNode);
_eventAggregator.GetEvent<ScrollToItemEvent>().Publish(path);
}
}
private ObservableCollection<SignalPredistributionInfo> _SignalPredistributionInfos = new ObservableCollection<SignalPredistributionInfo>();
/// <summary>
/// 表格数据
/// </summary>
public ObservableCollection<SignalPredistributionInfo> SignalPredistributionInfos
{
get { return _SignalPredistributionInfos; }
set
{
_SignalPredistributionInfos = value;
RaisePropertyChanged(nameof(SignalPredistributionInfos));
}
}
private string _SelectedOption1;
/// <summary>
/// 是否通讯母线
/// </summary>
public string SelectedOption1
{
get { return _SelectedOption1; }
set
{
_SelectedOption1 = value;
RaisePropertyChanged(nameof(SelectedOption1));
}
}
private string _SelectedOption2;
/// <summary>
/// 选择的信号类型
/// </summary>
public string SelectedOption2
{
get { return _SelectedOption2; }
set
{
_SelectedOption2 = value;
SignalColumnName = value;
RaisePropertyChanged(nameof(SelectedOption2));
}
}
private string _SignalColumnName;
/// <summary>
/// 信号类型列的列名
/// </summary>
public string SignalColumnName
{
get { return _SignalColumnName; }
set
{
_SignalColumnName = value;
RaisePropertyChanged(nameof(SignalColumnName));
if (value.Equals("Digital"))
{
SignalTypeColumn = new ObservableCollection<string>() { "无公共端接线(断开报警NC)", "无公共端接线(闭合报警NO)", "带公共端接线(断开报警NC)", "带公共端接线(闭合报警NO)" };
}
else if (value.Equals("4-20mA"))
{
SignalTypeColumn = new ObservableCollection<string>() { "无源", "有源" };
}
else if (value.Equals("-10V-10V"))
{
SignalTypeColumn = new ObservableCollection<string>() { "无源", "有源" };
}
else if (value.Equals("PT100"))
{
SignalTypeColumn = new ObservableCollection<string>() { "量程100", "量程150", "量程200", "量程600" };
}
else if (value.Equals("Pulse"))
{
SignalTypeColumn = new ObservableCollection<string>() { "脉冲信号" };
}
}
}
private List<string> _CommunicationFormats = new List<string>() { "RS485", "RS482", "TCP/IP", "MQTT" };
/// <summary>
/// 通讯格式集合
/// </summary>
public List<string> CommunicationFormats
{
get { return _CommunicationFormats; }
set
{
_CommunicationFormats = value;
RaisePropertyChanged(nameof(CommunicationFormats));
}
}
private string _CommunicationFormat = "RS485";
/// <summary>
/// 通讯格式
/// </summary>
public string CommunicationFormat
{
get { return _CommunicationFormat; }
set
{
_CommunicationFormat = value;
RaisePropertyChanged(nameof(CommunicationFormat));
}
}
private ObservableCollection<string> _SignalTypeColumn;
/// <summary>
/// 信号类型列的下拉列表
/// </summary>
public ObservableCollection<string> SignalTypeColumn
{
get { return _SignalTypeColumn; }
set
{
_SignalTypeColumn = value;
RaisePropertyChanged(nameof(SignalTypeColumn));
if (SignalPredistributionInfos != null)
{
foreach (var item in SignalPredistributionInfos)
{
item.SignalType = _SignalTypeColumn.FirstOrDefault();
}
}
}
}
private List<string> _InorOuts = new List<string>() { "输出", "输入" };
/// <summary>
/// 输入/输出列的下拉列表
/// </summary>
public List<string> InorOuts
{
get { return _InorOuts; }
set
{
_InorOuts = value;
RaisePropertyChanged(nameof(InorOuts));
}
}
#endregion
IOModuleService _iOModuleService;
IEventAggregator _eventAggregator;
public DialogSignalPredistributionViewModel()
{
_iOModuleService = GlobalObject.container.Resolve<IOModuleService>();
_eventAggregator = GlobalObject.container.Resolve<IEventAggregator>();
}
public string Title => "";
public event Action<IDialogResult> RequestClose;
public bool CanCloseDialog()
{
return true;
}
public void OnDialogClosed()
{
}
private ec_Cable CableBy;
public async void OnDialogOpened(IDialogParameters parameters)
{
title = $"电缆信号({parameters.GetValue<string>(GlobalObject.dialogPar.para2.ToString())})预分配";
//树形结构数据
PanelTreels.AddRange(await _iOModuleService.GetPanelTree());
//电缆信息
CableBy = parameters.GetValue<ec_Cable>(GlobalObject.dialogPar.para1.ToString());
//是否母线
if (CableBy.CableClass.Equals("homerun"))
{
SelectedOption1 = "是";
}
else if (CableBy.CableClass.Equals("conventional") || CableBy.CableClass.Equals(""))
{
SelectedOption1 = "否";
}
//设置默认信号类型
if (string.IsNullOrEmpty(CableBy.PreAssignIOType))
{
SelectedOption2 = "Digital";
}
else
{
SelectedOption2 = CableBy.PreAssignIOType;
}
//设置表格数据
int index = 0;
foreach (var Set in CableBy.Sets)
{
SignalPredistributionInfo predistributionInfo = new SignalPredistributionInfo();
predistributionInfo.CablePair = Set.CableSetName;
foreach (var Wire in Set.Wires)
{
index++;
predistributionInfo.Index.Add(index.ToString());
predistributionInfo.CableWires.Add(Wire);
predistributionInfo.Polaritys.Add(Wire);
}
if (string.IsNullOrEmpty(Set.PreAssignIOTypeDetail))
{
predistributionInfo.SignalType = SignalTypeColumn.FirstOrDefault();
}
else
{
predistributionInfo.SignalType = Set.PreAssignIOTypeDetail;
}
predistributionInfo.ChineseDescription = Set.PreAssignGroup_Desc;
predistributionInfo.EnglishDescription = Set.PreAssignGroup_Desc_EN;
if (string.IsNullOrEmpty(Set.PreAssignInOrOut))
{
predistributionInfo.InorOut = InorOuts.FirstOrDefault();
}
else
{
predistributionInfo.InorOut = Set.PreAssignInOrOut;
}
predistributionInfo.SensorCode = Set.PreAssignSensorCode;
SignalPredistributionInfos.Add(predistributionInfo);
}
//是否预关联,有则选中节点
foreach (var Panel in PanelTreels)
{
if (!string.IsNullOrEmpty(Panel.ID))
{
if (Panel.ID.Equals(CableBy.PanelID))
{
SelectedTreeNode = Panel;
break;
}
}
foreach (var Child in Panel.ChildNodes)
{
if (!string.IsNullOrEmpty(Child.ID))
{
if (Child.ID.Equals(CableBy.PanelID))
{
SelectedTreeNode = Child;
break;
}
}
}
}
}
public override async void ExecuteOKCommandAsync(object para)
{
//创建SaveCable接口实例
ec_Cable newCable = new ec_Cable();
if (SelectedOption1.Equals("是"))
{
newCable.CableClass = "homerun";
newCable.PreAssignIOType = CommunicationFormat;
}
else
{
newCable.CableClass = "conventional";
newCable.PreAssignIOType = SelectedOption2;
}
newCable.CableID = CableBy.CableID;
newCable.EngineerDataID = CableBy.EngineerDataID;
if (SelectedTreeNode != null)
{
newCable.PanelID = SelectedTreeNode.ID;
}
else
{
MessageBox.Show("请选择系统柜!", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
newCable.UpdateUserID = GlobalObject.userInfo.userId;
newCable.Sets = new List<ec_CableSet>();
foreach (var CableBySet in CableBy.Sets)
{
ec_CableSet newCableSet = new ec_CableSet();
newCableSet.CableSetID = CableBySet.CableSetID;
newCableSet.CableSetName = CableBySet.CableSetName;
newCableSet.CableSetSeq = CableBySet.CableSetSeq;
newCableSet.IsConned = CableBySet.IsConned;
newCableSet.PreAssignGroup_Desc = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).ChineseDescription;
newCableSet.PreAssignGroup_Desc_EN = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).EnglishDescription;
newCableSet.PreAssignIOTypeDetail = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).SignalType;
newCableSet.PreAssignInOrOut = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).InorOut;
newCableSet.PreAssignSensorCode = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).SensorCode;
newCableSet.Wires = new List<ec_CableSetWire>();
foreach (var wire in CableBySet.Wires)
{
ec_CableSetWire newWire = new ec_CableSetWire();
newWire.Polarity = wire.Polarity;
newWire.SetLevel = 0;
newWire.WireID = wire.WireID;
newWire.Wire_Tag = wire.Wire_Tag;
newWire.Wire_Color_ID = wire.Wire_Color_ID;
newWire.PreAssignChannelTermNo = SignalPredistributionInfos.FirstOrDefault(s => s.CablePair.Equals(CableBySet.CableSetName)).CableWires.FirstOrDefault(c => c.Wire_Tag.Equals(wire.Wire_Tag)).PreAssignChannelTermNo;
newCableSet.Wires.Add(newWire);
}
newCable.Sets.Add(newCableSet);
}
var httpres = await _iOModuleService.SaveCable(newCable);
IDialogParameters res = new Prism.Services.Dialogs.DialogParameters();
//res.Add(GlobalObject.dialogPar.info.ToString(), TagNumber);
RequestClose.Invoke(new DialogResult(ButtonResult.Yes, res));
}
public override void ExecuteCloseCommand(object parameter)
{
if (parameter as string == "ClickNo")
{
DialogResult res = new DialogResult(ButtonResult.No);
RequestClose.Invoke(res);
}
else
{
RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
}
this.Dispose();
}
#region
public ICommand ButtonCmd => new DelegateCommand(Button_Click);
/// <summary>
/// 页面左侧按钮
/// </summary>
/// <param name="parameter"></param>
public virtual async void Button_Click(object parameter)
{
#region
if (parameter.ToString().Equals("清除配置"))
{
MessageBoxResult result = MessageBox.Show($"确定删除“{ CableBy.TagNumber}”电缆配置?", "KunHengCAD", MessageBoxButton.OKCancel, MessageBoxImage.Question);
if (result == MessageBoxResult.OK)
{
var httpres = await _iOModuleService.DeleteCableProfile(CableBy.CableID);
if (httpres == null)
{
RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
this.Dispose();
}
}
return;
}
#endregion
#region
if (parameter.ToString().Equals("指定中英文"))
{
//SelectedTreeNode = PanelTreels[2].ChildNodes.LastOrDefault();
return;
}
#endregion
}
#region
public List<string> FindNodePath(ObservableCollection<TreeModel> nodes, TreeModel targetNode)
{
List<string> path = new List<string>();
FindNodePathRecursive(nodes, targetNode, path);
return path;
}
private bool FindNodePathRecursive(IEnumerable<TreeModel> nodes, TreeModel targetNode, List<string> currentPath)
{
foreach (var node in nodes)
{
currentPath.Add(node.Text);
if (node == targetNode) return true; // 找到目标节点返回True并结束搜索
if (node.ChildNodes.Count > 0 && FindNodePathRecursive(node.ChildNodes, targetNode, currentPath))
return true; // 在子节点中继续搜索并找到目标节点返回True并结束搜索
currentPath.RemoveAt(currentPath.Count - 1); // 回溯,尝试下一个兄弟节点或父节点的其他兄弟节点
}
return false; // 没有找到目标节点返回False
}
#endregion
#endregion
}
public class SignalPredistributionInfo : DialogBase
{
#region
private ObservableCollection<string> _Index = new ObservableCollection<string>();
/// <summary>
/// 序号集合
/// </summary>
public ObservableCollection<string> Index
{
get { return _Index; }
set { _Index = value; }
}
private string _CablePair;
/// <summary>
/// 电缆对
/// </summary>
public string CablePair
{
get { return _CablePair; }
set { _CablePair = value; }
}
private ObservableCollection<ec_CableSetWire> _CableWires = new ObservableCollection<ec_CableSetWire>();
/// <summary>
/// 电缆线号
/// </summary>
public ObservableCollection<ec_CableSetWire> CableWires
{
get { return _CableWires; }
set { _CableWires = value; }
}
private ObservableCollection<ec_CableSetWire> _Polaritys = new ObservableCollection<ec_CableSetWire>();
/// <summary>
/// 极性
/// </summary>
public ObservableCollection<ec_CableSetWire> Polaritys
{
get { return _Polaritys; }
set
{
_Polaritys = value;
RaisePropertyChanged(nameof(Polaritys));
}
}
private string _SignalType;
/// <summary>
/// 信号类型
/// </summary>
public string SignalType
{
get { return _SignalType; }
set
{
_SignalType = value;
RaisePropertyChanged(nameof(SignalType));
}
}
private string _ChineseDescription;
/// <summary>
/// 中文描述
/// </summary>
public string ChineseDescription
{
get { return _ChineseDescription; }
set
{
_ChineseDescription = value;
RaisePropertyChanged(nameof(ChineseDescription));
}
}
private string _EnglishDescription;
/// <summary>
/// 英文描述
/// </summary>
public string EnglishDescription
{
get { return _EnglishDescription; }
set
{
_EnglishDescription = value;
RaisePropertyChanged(nameof(EnglishDescription));
}
}
private string _InorOut;
/// <summary>
/// 输入/输出
/// </summary>
public string InorOut
{
get { return _InorOut; }
set
{
_InorOut = value;
RaisePropertyChanged(nameof(InorOut));
}
}
private string _SensorCode;
/// <summary>
/// 传感器编号
/// </summary>
public string SensorCode
{
get { return _SensorCode; }
set
{
_SensorCode = value;
RaisePropertyChanged(nameof(SensorCode));
}
}
private ObservableCollection<ec_PanelStripTerm> _Terms = new ObservableCollection<ec_PanelStripTerm>();
/// <summary>
/// 端子号集合
/// </summary>
public ObservableCollection<ec_PanelStripTerm> Terms
{
get { return _Terms; }
set { _Terms = value; }
}
#endregion
}
}

View File

@ -92,7 +92,7 @@ namespace SWS.CAD.ViewModels
{
sPASSWORD = GlobalObject.userInfo.userPs;
}
curServer = "当前服务器: " + _configService.Read(nameof(ConfigIni.Address)) + ":" + _configService.Read(nameof(ConfigIni.Port));
curServer = "当前服务器: " + _configService.Read("strIPAddress") + ":" + _configService.Read("nPort");
}
public override async void ExecuteOKCommandAsync(object obj)
{

View File

@ -248,7 +248,6 @@
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate1">
<!-- 使用ItemsControl垂直显示多个值 -->
<ItemsControl ItemsSource="{Binding Index}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -265,7 +264,6 @@
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate2">
<!-- 使用ItemsControl垂直显示多个值 -->
<ItemsControl ItemsSource="{Binding Terms}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -283,7 +281,6 @@
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate2">
<!-- 使用ItemsControl垂直显示多个值 -->
<ItemsControl ItemsSource="{Binding Terms}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -501,6 +498,9 @@
ItemContainerStyle="{StaticResource ExpandedTreeViewItemStyle}"
PreviewMouseRightButtonDown="RadTreeView_PreviewMouseRightButtonDown"
Margin="5" telerik:StyleManager.Theme="Office_Blue" AllowDrop="True"
AutoScrollToSelectedItem="True"
IsVirtualizing="True"
telerik:TextSearch.TextPath="Text"
>
<telerik:RadTreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">

View File

@ -1,10 +1,17 @@

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using Prism.Events;
using SWS.CAD.Event;
using SWS.CAD.ViewModels;
using SWS.Commons;
using Telerik.Windows.Controls;
using Unity;
namespace SWS.CAD.Views.Dialog
{
@ -13,14 +20,19 @@ namespace SWS.CAD.Views.Dialog
/// </summary>
public partial class DialogIODistribution : UserControl
{
IEventAggregator _eventAggregator;
public DialogIODistribution()
{
InitializeComponent();
DataContext = new DialogIODistributionViewModel();
_eventAggregator = GlobalObject.container.Resolve<IEventAggregator>();
_eventAggregator.GetEvent<ScrollToItemEvent>().Subscribe(ScrollToSelectedItem, ThreadOption.UIThread, true);
}
private void RadTreeView_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
var treeView = sender as RadTreeView;
var originalSource = e.OriginalSource as DependencyObject;
@ -80,5 +92,13 @@ namespace SWS.CAD.Views.Dialog
return source as T;
}
// 滚动到选中项
private void ScrollToSelectedItem(object path)
{
var pathls = path as List<string>;
var ph = string.Join("\\", pathls);
treeView1.BringPathIntoView(ph);
}
}
}

View File

@ -0,0 +1,471 @@
<UserControl x:Class="SWS.CAD.Views.Dialog.DialogSignalPredistribution"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:prism="http://prismlibrary.com/"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local="clr-namespace:SWS.CAD.Views.Dialog"
xmlns:cvt="clr-namespace:SWS.Commons.Helper.Converter;assembly=SWS.Commons"
xmlns:CustomControl="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
Width="1000" Height="790"
mc:Ignorable="d" >
<prism:Dialog.WindowStyle>
<Style TargetType="Window">
<!--最大化-->
<Setter Property="Width" Value="1000" />
<Setter Property="Height" Value="800" />
<Setter Property="SizeToContent" Value="WidthAndHeight" />
<Setter Property="WindowState" Value="Normal" />
<Setter Property="WindowStyle" Value="None" />
<Setter Property="ResizeMode" Value="NoResize" />
</Style>
</prism:Dialog.WindowStyle>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SWS.WPF;component/Style/CustomStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- 转换器 -->
<cvt:RadioButtonValueConverter x:Key="RadioButtonValueCvt" />
<!-- GroupBox显示隐藏 -->
<Style x:Key="SecondGroupStyle1" TargetType="GroupBox">
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=RadioButton1}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsChecked, ElementName=RadioButton1}" Value="False">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="SecondGroupStyle2" TargetType="GroupBox">
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=RadioButton1}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsChecked, ElementName=RadioButton1}" Value="False">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
<!-- 树结构展开按钮样式 -->
<Style x:Key="ExpanderStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="IsEnabled" Value="True" />
<Setter Property="IsTabStop" Value="True" />
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid>
<Grid x:Name="ButtonOver" Opacity="0" Margin="0,4,0,0"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="16" Height="16">
<Rectangle Stroke="#FF027BA6" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Width="Auto" Height="Auto"
RadiusX="3" RadiusY="3">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF00BCFF" Offset="0" />
<GradientStop Color="#FF027BA6" Offset="1" />
<GradientStop Color="#FF00A5E0" Offset="0.5" />
<GradientStop Color="#FF005674" Offset="0.501" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle x:Name="CollapsedVisualOver"
HorizontalAlignment="Left" VerticalAlignment="Top"
Width="2" Height="8" RadiusX="0" RadiusY="0"
Fill="#FFFFFFFF" Margin="7,4,0,0" />
<Rectangle RadiusX="0" RadiusY="0" Fill="#FFFFFFFF"
HorizontalAlignment="Left" VerticalAlignment="Top"
Width="8" Height="2" Margin="4,7,0,0" />
</Grid>
<Grid x:Name="Button" Margin="0,6,5.5,0" HorizontalAlignment="Right"
VerticalAlignment="Top" Width="10" Height="10">
<Rectangle Stroke="#ffc7defc" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Width="Auto" Height="Auto"
RadiusX="1" RadiusY="1" Fill="#ffc7defc">
</Rectangle>
<Rectangle x:Name="CollapsedVisual" HorizontalAlignment="Left"
VerticalAlignment="Top" Width="2" Height="6" RadiusX="0"
RadiusY="0" Fill="#FF3C6AA3" Margin="4,2,0,0" />
<Rectangle RadiusX="0" RadiusY="0" Fill="#FF3C6AA3"
HorizontalAlignment="Left" Margin="2,3.5,0,0"
VerticalAlignment="Top" Width="6" Height="2" />
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CollapsedVisualOver" Storyboard.TargetProperty="(UIElement.Opacity)" To="0"/>
<DoubleAnimation Storyboard.TargetName="CollapsedVisual" Storyboard.TargetProperty="(UIElement.Opacity)" To="0"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="CollapsedVisualOver" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
<DoubleAnimation Storyboard.TargetName="CollapsedVisual" Storyboard.TargetProperty="(UIElement.Opacity)" To="1"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 树结构节点默认展开样式设置 -->
<Style x:Key="ExpandedTreeViewItemStyle" TargetType="telerik:RadTreeViewItem">
<Setter Property="IsExpanded" Value="True"/>
</Style>
<!-- GridViewCell样式 -->
<Style x:Key="CellTyle1" TargetType="telerik:GridViewCell" >
<Setter Property="Background" Value="#F8F9F1" />
</Style>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate1">
<ItemsControl ItemsSource="{Binding Index}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0">
<TextBlock Text="{Binding}" TextAlignment="Center" Padding="4,2" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate1">
<ItemsControl ItemsSource="{Binding Index}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate2">
<ItemsControl ItemsSource="{Binding CableWires}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBlock Text="{Binding PreAssignChannelTermNo}" TextAlignment="Center" Padding="4,2" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate2">
<ItemsControl ItemsSource="{Binding CableWires}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding PreAssignChannelTermNo}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate3">
<ItemsControl ItemsSource="{Binding CableWires}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0">
<TextBlock Text="{Binding Wire_Tag}" TextAlignment="Center" Padding="4,2" Width="auto"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate3">
<ItemsControl ItemsSource="{Binding CableWires}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Wire_Tag}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<!-- 使用ItemsControl垂直显示多个值 -->
<DataTemplate x:Key="CellTemplate4">
<ItemsControl ItemsSource="{Binding Polaritys}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderBrush="#cccccc" BorderThickness="0,0,0,1" Padding="0">
<TextBlock Text="{Binding Polarity}" TextAlignment="Center" Padding="4,2" />
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
<DataTemplate x:Key="CellEditTemplate4">
<ItemsControl ItemsSource="{Binding Polaritys}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBox Text="{Binding Polarity}" TextAlignment="Center" Padding="4,2" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ResourceDictionary>
</UserControl.Resources>
<telerik:RadBusyIndicator BusyContent="{Binding BusyContent}" IsBusy="{Binding IsBusy}">
<StackPanel Background="#f0f0f0">
<CustomControl:customWindowTitleBar x:Name="titleBar" />
<StackPanel Grid.Row="1" Orientation="Horizontal">
<GroupBox Margin="5,10,5,5"
VerticalAlignment="Bottom"
Header="通讯信号">
<StackPanel Orientation="Horizontal">
<TextBlock Text="是否通讯母线" Margin="5"/>
<RadioButton x:Name="RadioButton1"
Content="是"
GroupName="OptionGroup1"
Margin="5"
IsChecked="{Binding SelectedOption1 ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=是}"/>
<RadioButton x:Name="RadioButton2"
Content="否"
GroupName="OptionGroup1"
Margin="5"
IsChecked="{Binding SelectedOption1 ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=否}"/>
</StackPanel>
</GroupBox>
<GroupBox Margin="5,0,5,5"
VerticalAlignment="Bottom"
Header="信号类型"
Style="{StaticResource SecondGroupStyle1}">
<StackPanel Orientation="Horizontal">
<RadioButton IsChecked="{Binding SelectedOption2 ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=Digital}"
Content="Digital" GroupName="OptionGroup2" Margin="5"/>
<RadioButton IsChecked="{Binding SelectedOption2 ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=4-20mA}"
Content="4-20mA" GroupName="OptionGroup2" Margin="5"/>
<RadioButton IsChecked="{Binding SelectedOption2 ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=-10V-10V}"
Content="-10V-10V" GroupName="OptionGroup2" Margin="5"/>
<RadioButton IsChecked="{Binding SelectedOption2 ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=PT100}"
Content="PT100" GroupName="OptionGroup2" Margin="5"/>
<RadioButton IsChecked="{Binding SelectedOption2 ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=Pulse}"
Content="Pulse" GroupName="OptionGroup2" Margin="5"/>
</StackPanel>
</GroupBox>
<GroupBox Margin="5,0,5,5"
VerticalAlignment="Bottom"
Header="通讯格式"
Style="{StaticResource SecondGroupStyle2}">
<StackPanel Orientation="Horizontal">
<RadioButton IsChecked="{Binding CommunicationFormat ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=RS485}"
Content="RS485" GroupName="OptionGroup3" Margin="5"/>
<RadioButton IsChecked="{Binding CommunicationFormat ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=RS482}"
Content="RS482" GroupName="OptionGroup3" Margin="5"/>
<RadioButton IsChecked="{Binding CommunicationFormat ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=TCP/IP}"
Content="TCP/IP" GroupName="OptionGroup3" Margin="5"/>
<RadioButton IsChecked="{Binding CommunicationFormat ,Converter={StaticResource RadioButtonValueCvt},ConverterParameter=MQTT}"
Content="MQTT" GroupName="OptionGroup3" Margin="5"/>
</StackPanel>
</GroupBox>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2">
<!-- 左侧树形结构 -->
<GroupBox Margin="5,0,5,0"
Height="auto"
Header="选择该电缆预分配系统柜">
<telerik:RadTreeView x:Name="treeView1"
Height="620"
Width="200"
Background="White"
IsLineEnabled="True"
ItemContainerStyle="{StaticResource ExpandedTreeViewItemStyle}"
ExpanderStyle="{StaticResource ExpanderStyle}"
ItemsSource="{Binding PanelTreels}"
SelectedItem="{Binding SelectedTreeNode,Mode=TwoWay}"
telerik:StyleManager.Theme="Office_Blue"
AllowDrop="True"
AutoScrollToSelectedItem="True"
IsVirtualizing="True"
telerik:TextSearch.TextPath="Text"
>
<telerik:RadTreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
<TextBlock Text="{Binding Text}">
</TextBlock>
<HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
<TextBlock Text="{Binding Text}"/>
<HierarchicalDataTemplate.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding PanelTreels}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Text}"/>
<TextBlock Text=" (" />
<TextBlock Text="{Binding NodeExtData.ChannelsSpared}" FontWeight="Bold" />
<TextBlock Text=")" />
</StackPanel>
</HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</telerik:RadTreeView.ItemTemplate>
</telerik:RadTreeView>
</GroupBox>
<GroupBox Margin="5,0,5,0"
Width="770"
Header="电缆配置信息">
<!-- 数据表格 -->
<Grid>
<telerik:RadGridView x:Name="RadGridView1" SelectionMode="Single" Width="auto" Height="630"
AutoGenerateColumns="False" IsFilteringAllowed="False" Background="#a0a0a0"
IsReadOnly="False" RowIndicatorVisibility="Collapsed"
ShowGroupPanel="False" telerik:StyleManager.Theme="Office_Blue"
ItemsSource="{Binding SignalPredistributionInfos}" SelectedItem="{Binding SelectedChannelInfo, Mode=TwoWay}">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="序号" CellTemplate="{StaticResource CellTemplate1}" CellStyle="{StaticResource CellTyle1}" IsReadOnly="True"/>
<telerik:GridViewDataColumn Header="电缆对" DataMemberBinding="{Binding CablePair}"/>
<telerik:GridViewDataColumn Header="电缆线芯" CellTemplate="{StaticResource CellTemplate3}" CellEditTemplate="{StaticResource CellEditTemplate3}"/>
<telerik:GridViewDataColumn Header="极性" CellTemplate="{StaticResource CellTemplate4}" CellEditTemplate="{StaticResource CellEditTemplate4}"/>
<telerik:GridViewComboBoxColumn Header="{Binding SignalColumnName,Mode=TwoWay}"
IsVisible="{Binding IsChecked,ElementName=RadioButton2}"
ItemsSource="{Binding DataContext.SignalTypeColumn, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}"
DataMemberBinding="{Binding SignalType}"
Width="120">
<telerik:GridViewComboBoxColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding SignalType}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding SignalType}"/>
</DataTemplate>
</telerik:GridViewComboBoxColumn.CellTemplate>
</telerik:GridViewComboBoxColumn>
<telerik:GridViewDataColumn Header="中文描述" DataMemberBinding="{Binding ChineseDescription}" Width="120">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ChineseDescription}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding ChineseDescription}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="英文描述" DataMemberBinding="{Binding EnglishDescription}" Width="120">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding EnglishDescription}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding EnglishDescription}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewComboBoxColumn Header="输入/输出"
ItemsSource="{Binding DataContext.InorOuts, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}"
DataMemberBinding="{Binding InorOut}"
Width="60">
</telerik:GridViewComboBoxColumn>
<telerik:GridViewDataColumn Header="传感器编号" DataMemberBinding="{Binding EnglishDescription}" Width="auto">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding SensorCode}"
TextTrimming="CharacterEllipsis"
ToolTip="{Binding SensorCode}"/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn Header="端子号" Width="*" CellTemplate="{StaticResource CellTemplate2}" CellEditTemplate="{StaticResource CellEditTemplate2}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</GroupBox>
</StackPanel>
<Grid>
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Left">
<telerik:RadButton Margin="0,0,20,0"
Width="100"
HorizontalAlignment="Right"
Style="{StaticResource sysBtn4}"
Command="{Binding ButtonCmd}"
CommandParameter="清除配置"
Content="清除配置" />
<telerik:RadButton Margin="0,0,0,0"
Width="100"
HorizontalAlignment="Right"
Style="{StaticResource sysBtn2}"
Command="{Binding ButtonCmd}"
CommandParameter="指定中英文"
Content="指定中英文" />
</StackPanel>
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Right">
<telerik:RadButton Margin="0,0,20,0"
Width="100"
HorizontalAlignment="Right"
Style="{StaticResource sysBtn}"
Command="{Binding OKCommand}"
CommandParameter="确定"
Content="确定" />
<telerik:RadButton Margin="0,0,0,0"
Width="100"
HorizontalAlignment="Right"
Style="{StaticResource sysBtn2}"
Command="{Binding CloseCommand}"
CommandParameter="取消"
Content="取消" />
</StackPanel>
</Grid>
</StackPanel>
</telerik:RadBusyIndicator>
</UserControl>

View File

@ -0,0 +1,49 @@
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;
using System.Windows.Threading;
using Prism.Events;
using SWS.CAD.Event;
using SWS.Commons;
using SWS.Model;
using Telerik.Windows.Controls;
using Unity;
namespace SWS.CAD.Views.Dialog
{
/// <summary>
/// DialogSignalPredistribution.xaml 的交互逻辑
/// </summary>
public partial class DialogSignalPredistribution : UserControl
{
IEventAggregator _eventAggregator;
public DialogSignalPredistribution()
{
InitializeComponent();
_eventAggregator = GlobalObject.container.Resolve<IEventAggregator>();
_eventAggregator.GetEvent<ScrollToItemEvent>().Subscribe(ScrollToSelectedItem, ThreadOption.UIThread, true);
}
// 滚动到选中项
private void ScrollToSelectedItem(object path)
{
var pathls = path as List<string>;
var ph = string.Join("\\", pathls);
treeView1.BringPathIntoView(ph);
}
}
}

View File

@ -1455,10 +1455,9 @@
</Grid>
<ControlTemplate.Triggers>
<!-- 按钮禁用 -->
<!-- 按钮禁用 -->
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="PART_Icon" Property="Fill"
Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
<Setter TargetName="PART_Icon" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />

View File

@ -84,6 +84,7 @@ namespace SWS.Commons
public static List<TreeModel> designTree = new List<TreeModel>();
#endregion
public enum DBConst
{
/// <summary>
@ -154,10 +155,11 @@ namespace SWS.Commons
{
if (string.IsNullOrEmpty(_LocalFileDirectory))
{
string path = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\AppData\Roaming\SWS\Config.ini");
FileIniDataParser parser = new FileIniDataParser();
var data = parser.ReadFile(path);
_LocalFileDirectory = data["Profile"]["Directory"];
//string path = configPath;
//FileIniDataParser parser = new FileIniDataParser();
//var data = parser.ReadFile(path);
//_LocalFileDirectory = data["Profile"]["strLocalWorkDir"];
_LocalFileDirectory = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir");
return _LocalFileDirectory;
}
else

View File

@ -0,0 +1,36 @@
using System;
using System.Globalization;
using System.Windows.Data;
using SWS.Model;
namespace SWS.Commons.Helper.Converter
{
public class RadioButtonValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is string isChecked)
{
if (isChecked.Equals(parameter.ToString()))
{
return true;
}
else
{
return false;
}
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool isChecked)
{
return parameter.ToString();
}
return parameter.ToString();
}
}
}

View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace SWS.Commons
{
public static class IniHelper
{
[DllImport("kernel32", CharSet = CharSet.Unicode)]
private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
[DllImport("kernel32", CharSet = CharSet.Unicode)]
private static extern int GetPrivateProfileString(string section, string key, string def, StringBuilder retVal, int size, string filePath);
/// <summary>
///读取ini文件数据
/// </summary>
/// <param name="Section">段</param>
/// <param name="Key">键名</param>
/// <param name="def">默认值</param>
/// <param name="filePath">文件路径</param>
/// <returns>读出内容</returns>
public static string ReadValueFromIniFile(string Section, string Key, string def=null, string filePath= null)
{
if (def == null)
{ def = ""; }
if (filePath == null)
{
filePath = GlobalObject.configPath;
}
StringBuilder temp = new StringBuilder(4096);
int i = GetPrivateProfileString(Section, Key, def, temp, 4096, filePath);
return temp.ToString();
}
/// <summary>
/// 写入数据到ini文件
/// </summary>
/// <param name="Section">段</param>
/// <param name="Key">键名</param>
/// <param name="Value">键值</param>
/// <param name="filePath">文件路径</param>
public static void WriteValueFromIniFile(string Section, string Key, string Value, string filePath = null)
{
if (filePath == null)
{
filePath = GlobalObject.configPath;
}
WritePrivateProfileString(Section, Key, Value, filePath);
}
}
}

View File

@ -24,6 +24,8 @@ namespace SWS.Commons
string dllPath = codeBase.Replace("file:///", "");
dllPath = Path.GetDirectoryName(dllPath);
logPath = Path.Combine(dllPath, "Logs\\");
if (!Directory.Exists(logPath))
{ Directory.CreateDirectory(logPath); }
var configFile = new FileInfo(Path.Combine(dllPath, "log4net.config"));
log4net.Config.XmlConfigurator.ConfigureAndWatch(configFile);
}

View File

@ -106,10 +106,12 @@
<Compile Include="GlobalObject.cs" />
<Compile Include="Helper\Converter\CollectionToStringConverter.cs" />
<Compile Include="Helper\Converter\TimeSpanToColourValueConverter.cs" />
<Compile Include="Helper\Converter\RadioButtonValueConverter.cs" />
<Compile Include="Helper\Converter\TimeSpanValueConverter.cs" />
<Compile Include="Helper\Converter\RadGridViewRowToBoolConverter.cs" />
<Compile Include="Helper\Converter\ColumnValueConverter.cs" />
<Compile Include="Helper\Converter\StatusToColourConverter.cs" />
<Compile Include="Helper\IniHelper.cs" />
<Compile Include="Helper\FileHelper.cs" />
<Compile Include="Helper\LoggerHelper.cs" />
<Compile Include="Helper\PasswordHelper.cs" />

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
@ -11,6 +12,7 @@ using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using IniParser;
using IniParser.Model;
using Newtonsoft.Json;
using Prism.Ioc;
using SWS.Commons;
@ -41,17 +43,29 @@ namespace SWS.Electrical
{
try
{
var data = configIni.ReadFile(GlobalObject.configPath);
string token = data["LoginInfo"]["LoginToken"];
string loginkey = data["LoginInfo"]["LoginMark"];
string curProjId = data["LoginInfo"]["CurProjId"];
LocalWorkDir= data["Profile"]["strLocalWorkDir"];
string address = data["Profile"]["strIPAddress"];
string port = data["Profile"]["nPort"];
string dbType = data["Profile"]["nConType"];
//var parser = new FileIniDataParser();
//string[] lines = File.ReadAllLines(GlobalObject.configPath);
//IniData data = parser.Parser.Parse(File.ReadAllText(GlobalObject.configPath));
//var data = configIni.ReadFile(GlobalObject.configPath);
//string token = data["LoginInfo"]["LoginToken"];
//string loginkey = data["LoginInfo"]["LoginMark"];
//string curProjId = data["LoginInfo"]["CurProjId"];
//LocalWorkDir= data["Profile"]["strLocalWorkDir"];
//string address = data["Profile"]["strIPAddress"];
//string port = data["Profile"]["nPort"];
//string dbType = data["Profile"]["nConType"];
//string domain= data["Profile"]["strDomainName"];
string token = IniHelper.ReadValueFromIniFile("LoginInfo", "LoginToken");
string loginkey = IniHelper.ReadValueFromIniFile("LoginInfo", "LoginMark");
string curProjId = IniHelper.ReadValueFromIniFile("LoginInfo", "CurProjId");
LocalWorkDir = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir");
string address = IniHelper.ReadValueFromIniFile("Profile", "strIPAddress");
string port = IniHelper.ReadValueFromIniFile("Profile", "nPort");
string dbType = IniHelper.ReadValueFromIniFile("Profile", "nConType");
string domain = IniHelper.ReadValueFromIniFile("Profile", "strDomainName");
if (dbType == "1")
{
string strDomain = data["Profile"]["strDomainName"];
string strDomain = domain;
GlobalObject.client = new HttpClient()
{
BaseAddress = new Uri($"{strDomain}/api/"),

View File

@ -153,6 +153,7 @@
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="配置说明.docx" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SWS.CAD.Base\SWS.CAD.Base.csproj">

View File

@ -63,6 +63,7 @@ namespace SWS.Electrical
GlobalObject._prismContainer.RegisterDialog<DialogSignalPropertyhisAndLogs, DialogSignalPropertyhisAndLogsViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogSignalSelect, DialogSignalSelectViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogAllOutputSignal, DialogAllOutputSignalViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogAssociatedSignal, DialogAssociatedSignalViewModel>();
GlobalObject._prismContainer.RegisterDialog<DialogAutoArrangeLayout, DialogAutoArrangeLayoutViewModel>();
}

View File

@ -130,6 +130,7 @@ namespace SWS.Electrical.ViewModels
if (value != this._selectRange)
{
this._selectRange = value;
RangeChange(value);
RaisePropertyChanged(nameof(selectRange));
}
}
@ -167,6 +168,22 @@ namespace SWS.Electrical.ViewModels
}
}
}
private ObservableCollection<KeyValueModel> _listValue;
/// <summary>
/// 输入值 列表
/// </summary>
public ObservableCollection<KeyValueModel> listValue
{
get { return this._listValue; }
set
{
if (value != this._listValue)
{
this._listValue = value;
RaisePropertyChanged(nameof(listValue));
}
}
}
private string _inputValue = "";
/// <summary>
/// 输入值
@ -195,11 +212,15 @@ namespace SWS.Electrical.ViewModels
EnginedataService _ServiceEnginedata;
ObjectTypeService _ServiceObjectType;
ProjectSettingsService _ServiceProjectSettings;
DataItemService _ServiceDataItem;
List<string> listTagNumberSucc = new List<string>();
private bool isSearch = false;//是否正在查询
private bool isDrawing = false;//是否正在画图
private string dwgName = string.Empty;
private List<string> listLibraryTagName = new List<string>();//元件图纸上的位号属性名称,
private List<KeyValueModel> listDeck=new List<KeyValueModel>();//甲板号值列表
private List<KeyValueModel> listArea = new List<KeyValueModel>();//区域值列表
private List<KeyValueModel> listSystem = new List<KeyValueModel>();//所属系统值列表
public DialogAutoArrangeLayoutViewModel()
{
Command_StartDrawing = new DelegateCommand(onStartDrawing);
@ -215,6 +236,7 @@ namespace SWS.Electrical.ViewModels
_ServiceEnginedata = GlobalObject.container.Resolve<EnginedataService>();
_ServiceObjectType = GlobalObject.container.Resolve<ObjectTypeService>();
_ServiceProjectSettings = GlobalObject.container.Resolve<ProjectSettingsService>();
_ServiceDataItem= GlobalObject.container.Resolve<DataItemService>();
listDrawings = new ObservableCollection<DtoDrawing>();
listBasePoint = new ObservableCollection<DtoAutoPlotLayout>();
listMsg = new ObservableCollection<TextBlock>();
@ -223,7 +245,6 @@ namespace SWS.Electrical.ViewModels
list.Add(new KeyValueModel { Key = "区域", Value = "区域" });
list.Add(new KeyValueModel { Key = "所属系统", Value = "所属系统" });
listRange = new ObservableCollection<KeyValueModel>(list);
selectRange = listRange[0];
listOperator = new ObservableCollection<KeyValueModel>()
{ new KeyValueModel { Key = "等于", Value = "=" }
};
@ -243,7 +264,33 @@ namespace SWS.Electrical.ViewModels
{
}
private List<TreeModel> GetChildNodes(TreeModel treeModel)
{
List<TreeModel> listModel = new List<TreeModel>();
if (treeModel.ChildNodes != null && treeModel.ChildNodes.Any())
{
foreach (var item in treeModel.ChildNodes)
{
if (item.NodeType == "1")
{
listModel.Add(item);
}
else
{
var list = GetChildNodes(item);
if (list.Any())
{
listModel.AddRange(list);
}
}
}
return listModel;
}
else
{
return listModel;
}
}
public async void OnDialogOpened(IDialogParameters parameters)
{
try
@ -259,8 +306,19 @@ namespace SWS.Electrical.ViewModels
if (item.NodeType == "1")
{
listDrawings.Add(new DtoDrawing() { DrawingFileID = item.ID, DrawingFileName = item.Text });
ec_drawing_file dwgFile = JsonConvert.DeserializeObject<ec_drawing_file>(model.NodeExtData.ToString());
}
else
{
if (item.Text == "封面、目录、设计说明" || item.Text == "材料表")
{ continue; }
var list = GetChildNodes(item);
if (list.Any())
{
foreach (var dto in list)
{
listDrawings.Add(new DtoDrawing() { DrawingFileID = dto.ID, DrawingFileName = dto.Text });
}
}
}
}
}
@ -289,14 +347,24 @@ namespace SWS.Electrical.ViewModels
if (item.NodeType == "1")
{
listDrawings.Add(new DtoDrawing() { DrawingFileID = item.ID, DrawingFileName = item.Text });
ec_drawing_file dwgFile = JsonConvert.DeserializeObject<ec_drawing_file>(model.NodeExtData.ToString());
}
else
{
if (item.Text == "封面、目录、设计说明" || item.Text == "材料表")
{ continue; }
var list = GetChildNodes(item);
if (list.Any())
{
foreach (var dto in list)
{
listDrawings.Add(new DtoDrawing() { DrawingFileID = dto.ID, DrawingFileName = dto.Text });
}
}
}
}
}
}
AddMsg($"布置图列表加载完成!");
}
var settingModel = await _ServiceProjectSettings.GetEntity("布置图图例显示位号名称");
if (settingModel == null)
@ -304,16 +372,48 @@ namespace SWS.Electrical.ViewModels
listLibraryTagName.Add("位号");//默认
}
else { listLibraryTagName = settingModel.SettingValue.Split(',').ToList(); }
//区域下拉框对应值列表
var listDetail = await _ServiceDataItem.GetDetails("Area");
if (listDetail != null && listDetail.Any())
{
foreach (var item in listDetail)
{ listArea.Add(new KeyValueModel() { Key=item.DataItemName, Value=item.DataItemName }); }
}
//甲板号下拉框对应值列表
listDetail = await _ServiceDataItem.GetDetails("甲板号");
if (listDetail != null && listDetail.Any())
{
foreach (var item in listDetail)
{ listDeck.Add(new KeyValueModel() { Key = item.DataItemName, Value = item.DataItemName }); }
}
//所属系统下拉框对应值列表
listDetail = await _ServiceDataItem.GetDetails("Be_DrawingSystem");
if (listDetail != null && listDetail.Any())
{
foreach (var item in listDetail)
{ listSystem.Add(new KeyValueModel() { Key = item.DataItemName, Value = item.DataItemName }); }
}
selectRange = listRange[0];
}
catch (Exception ex)
{
MessageBox.Show("DialogOpened异常" + ex.Message);
}
//selectRange = listRange[2];
//inputValue = "声力电话";
}
/// <summary>
/// 下拉值列表绑定
/// </summary>
/// <param name="model"></param>
private void RangeChange(KeyValueModel model)
{
inputValue = "";
if (model.Value == "甲板号")
{ listValue = new ObservableCollection<KeyValueModel>(listDeck); }
else if (model.Value == "区域")
{ listValue = new ObservableCollection<KeyValueModel>(listArea); }
else if (model.Value == "所属系统")
{ listValue = new ObservableCollection<KeyValueModel>(listSystem); }
}
/// <summary>
/// 获取基点信息
/// </summary>

View File

@ -178,13 +178,22 @@
FontSize="16"
ItemsSource="{Binding listOperator}"
SelectedItem="{Binding selectOperator, Mode=TwoWay}" />
<TextBox
<ComboBox
Grid.Column="1"
Width="200"
Height="25"
Margin="5,0,0,0"
DisplayMemberPath="Key"
FontSize="16"
IsEditable="True"
ItemsSource="{Binding listValue}"
Text="{Binding inputValue, Mode=TwoWay}" />
<!--<TextBox
Width="200"
Height="25"
Margin="5,0,0,0"
FontSize="16"
Text="{Binding inputValue}" />
Text="{Binding inputValue}" />-->
</StackPanel>
<StackPanel

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8006F31A06196293D0E58F4239B97FC4F768BCF414C1B4C2472A1C22D26CF0B1"
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "55992553F782D436B236E9D0626B49AE48376927B5906F253898CDC4189B1D22"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -85,7 +85,7 @@ namespace SWS.Electrical.Views {
#line hidden
#line 211 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
#line 220 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid dgTag;

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "8006F31A06196293D0E58F4239B97FC4F768BCF414C1B4C2472A1C22D26CF0B1"
#pragma checksum "..\..\..\Views\DialogAutoArrangeLayout.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "55992553F782D436B236E9D0626B49AE48376927B5906F253898CDC4189B1D22"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -85,7 +85,7 @@ namespace SWS.Electrical.Views {
#line hidden
#line 211 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
#line 220 "..\..\..\Views\DialogAutoArrangeLayout.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid dgTag;

View File

@ -0,0 +1,10 @@
第1步把文件拷贝到D盘文件夹[SWS.Electrical]里面
第2步在坤恒CAD的安装目录里找到文件on_start.lsp ,用记事本打开
第3步把下面一行命令添加到最下面
(command "netload" "D:\\SWS.Electrical\\SWS.Electrical.dll")
PS:存放文件夹路径可以自己定

View File

@ -2,6 +2,7 @@
using SWS.Commons;
using System;
using System.IO;
using static System.Collections.Specialized.BitVector32;
namespace SWS.Service
{
@ -16,13 +17,12 @@ namespace SWS.Service
void SetDefaultConfigValue()
{
if (!File.Exists(path))
{//默认值
{
//默认值
var data = parser.Parser.Parse("");
data["Profile"]["strIPAddress"] = "1.117.161.11";
data["Profile"]["nPort"] = "8080";
string userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
data["Profile"]["strLocalWorkDir"] = $"{userProfilePath}\\AppData\\Roaming\\BricsCAD Electrical";
Directory.CreateDirectory(Path.GetDirectoryName(path));
parser.WriteFile(path, data);
@ -40,17 +40,23 @@ namespace SWS.Service
string address;
int port;
string locDrawingPath;
Read(out address, out port,out locDrawingPath);
Read(out address, out port, out locDrawingPath);
_httpService.Init(address, port);
}
}
public void Read(out string address, out int port, out string directory)
{
var data = parser.ReadFile(path);
address = data["Profile"]["strIPAddress"];
port = int.Parse(data["Profile"]["nPort"]);
directory = data["Profile"]["strLocalWorkDir"];
//var data = parser.ReadFile(path);
//address = data["Profile"]["strIPAddress"];
//port = int.Parse(data["Profile"]["nPort"]);
//directory = data["Profile"]["strLocalWorkDir"];
address = IniHelper.ReadValueFromIniFile("Profile", "strIPAddress");
string portString = IniHelper.ReadValueFromIniFile("Profile", "nPort");
int.TryParse(portString?.Trim(), out port);
//port = int.Parse(IniHelper.ReadValueFromIniFile("Profile", "nPort"));
directory = IniHelper.ReadValueFromIniFile("Profile", "strLocalWorkDir");
}
/// <summary>
/// 查询某个
/// </summary>
@ -58,8 +64,11 @@ namespace SWS.Service
/// <returns></returns>
public string Read(string keyName)
{
var data = parser.ReadFile(path);
return data["Profile"][keyName];
//var data = parser.ReadFile(path);
//return data["Profile"][keyName];
var data = IniHelper.ReadValueFromIniFile("Profile", keyName);
return data;
}
/// <summary>
/// 查询某个
@ -67,14 +76,17 @@ namespace SWS.Service
/// <param name="session">节点</param>
/// <param name="keyName">key名称</param>
/// <returns></returns>
public string Read(string session,string keyName)
public string Read(string session, string keyName)
{
try
{
var data = parser.ReadFile(path);
return data[session][keyName];
{
//var data = parser.ReadFile(path);
//return data[session][keyName];
var data = IniHelper.ReadValueFromIniFile(session, keyName);
return data;
}
catch
catch
{
return null;
}
@ -86,9 +98,10 @@ namespace SWS.Service
/// <param name="value"></param>
public void Save(string keyName, string value)
{
var data = parser.ReadFile(path);
data["Profile"][keyName] = value;
parser.WriteFile(path, data);
//var data = parser.ReadFile(path);
//data["Profile"][keyName] = value;
//parser.WriteFile(path, data);
IniHelper.WriteValueFromIniFile("Profile", keyName, value);
}
/// <summary>
/// 保存某个值
@ -98,9 +111,11 @@ namespace SWS.Service
/// <param name="value">值</param>
public void Save(string session, string keyName, string value)
{
var data = parser.ReadFile(path);
data[session][keyName] = value;
parser.WriteFile(path, data);
//var data = parser.ReadFile(path);
//data[session][keyName] = value;
//parser.WriteFile(path, data);
IniHelper.WriteValueFromIniFile(session, keyName, value);
}
}
}

View File

@ -50,16 +50,16 @@ namespace SWS.Service
public async Task<object> SaveDetailForm(ec_dataitemdetail entity)
{
var res = await this.PostBodyAsync<ec_dataitemdetail, ec_dataitemdetail>($"DataItemApi/SaveDetailForm?ProjectId={GlobalObject.curProject?.ProjectId}", entity);
if (res.code == 200)
{
//return res.info;
return null;
}
else
{
return res.info; // 返回错误信息
}
//if (res.code == 200)
//{
// //return res.info;
// return null;
//}
//else
//{
// return res.info; // 返回错误信息
//}
return res;
}
}
}

View File

@ -139,16 +139,16 @@ namespace SWS.Service
public async Task<object> CreatePanelStripByProfile(ec_PanelStrip entity)
{
var res = await this.PostBodyAsync<ec_PanelStrip, ec_PanelStrip>($"IOModuleApi/CreatePanelStripByProfile?projId={GlobalObject.curProject?.ProjectId}", entity);
if (res.code == 200)
{
//return res.info;
return null;
}
else
{
return res.info; // 返回错误信息
}
//if (res.code == 200)
//{
// //return res.info;
// return null;
//}
//else
//{
// return res.info; // 返回错误信息
//}
return res;
}
public async Task<string> DeletePanel(string PanelID)

View File

@ -126,6 +126,7 @@
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\DialogInputViewModel.cs" />
<Compile Include="ViewModels\DialogSignalManagementVM\DialogAssociatedSignalViewModel.cs" />
<Compile Include="ViewModels\DialogSignalManagementVM\DialogSignalManagementViewModel.cs" />
<Compile Include="ViewModels\DialogSignalManagementVM\DialogAllOutputSignalViewModel.cs" />
<Compile Include="ViewModels\DialogSignalManagementVM\DialogSignalNoticeViewModel.cs" />
@ -137,6 +138,9 @@
<Compile Include="Views\CustomDialogWindow.xaml.cs">
<DependentUpon>CustomDialogWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Views\DialogSignalManagements\DialogAssociatedSignal.xaml.cs">
<DependentUpon>DialogAssociatedSignal.xaml</DependentUpon>
</Compile>
<Compile Include="Views\DialogSignalManagements\DialogAllOutputSignal.xaml.cs">
<DependentUpon>DialogAllOutputSignal.xaml</DependentUpon>
</Compile>
@ -200,6 +204,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\DialogSignalManagements\DialogAssociatedSignal.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\DialogSignalManagements\DialogAllOutputSignal.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -1,10 +1,10 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:CustomControl="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
xmlns:cvt="clr-namespace:SWS.Commons.Helper.Converter;assembly=SWS.Commons"
xmlns:local="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<!-- 系统颜色 -->
@ -579,7 +579,7 @@
</Style>
<!-- 多选搜索 Combox End -->
<!-- 信号状态样式 -->
<!-- 信号状态样式 -->
<Style x:Key="ToDeleteStatusStyle" TargetType="telerik:GridViewRow">
<Setter Property="Foreground" Value="#db9fa9" />
<Setter Property="Background" Value="Transparent" />
@ -595,7 +595,7 @@
<Setter Property="Background" Value="Transparent" />
</Style>
<Style x:Key="ConfirmedStatusStyle" TargetType="telerik:GridViewRow">
<Setter Property="Foreground" Value="DarkGray" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="Transparent" />
</Style>

View File

@ -0,0 +1,267 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Input;
using Prism.Services.Dialogs;
using Prism.Ioc;
using SWS.Commons;
using SWS.Model;
using SWS.Service;
using SWS.WPF.Views;
using Telerik.Windows.Controls;
using Unity;
using DialogParameters = Prism.Services.Dialogs.DialogParameters;
using System.Windows;
namespace SWS.WPF.ViewModels
{
public class DialogAssociatedSignalViewModel : DialogBase, IDialogAware
{
#region
private ObservableCollection<SignalManagementInfo> _MySignals = new ObservableCollection<SignalManagementInfo>();
/// <summary>
/// 表格数据源
/// </summary>
public ObservableCollection<SignalManagementInfo> MySignals
{
get { return _MySignals; }
set { _MySignals = value; RaisePropertyChanged(nameof(MySignals)); }
}
private SignalManagementInfo _SelectedSignal;
/// <summary>
/// 选中行
/// </summary>
public SignalManagementInfo SelectedSignal
{
get { return _SelectedSignal; }
set { _SelectedSignal = value; RaisePropertyChanged(nameof(SelectedSignal)); }
}
private string _Info;
/// <summary>
/// 列表上方文字
/// </summary>
public string Info
{
get { return _Info; }
set { _Info = value; RaisePropertyChanged(nameof(Info)); }
}
private Visibility _IsVisibility = Visibility.Collapsed;
/// <summary>
/// 控制取消关联按钮是否可见
/// </summary>
public Visibility IsVisibility
{
get { return _IsVisibility; }
set
{
_IsVisibility = value;
RaisePropertyChanged(nameof(IsVisibility));
}
}
/// <summary>
/// 信号接口服务
/// </summary>
WireGroupService _wireGroupService;
public DialogSignalNotice SignalNoticeView { get; set; }
#endregion
public DialogAssociatedSignalViewModel()
{
_wireGroupService = GlobalObject.container.Resolve<WireGroupService>();
}
public string Title => "";
public event Action<IDialogResult> RequestClose;
public bool CanCloseDialog()
{
return true;
}
public void OnDialogClosed()
{
}
public async void OnDialogOpened(IDialogParameters parameters)
{
title = parameters.GetValue<string>(GlobalObject.dialogPar.title.ToString());
Info = parameters.GetValue<string>(GlobalObject.dialogPar.info.ToString());
var signals = parameters.GetValue<ObservableCollection<SignalManagementInfo>>(GlobalObject.dialogPar.para1.ToString());
foreach (var item in signals)
{
if (title.Equals("信号选择框"))
{
if (item.type.Equals("信号"))
{
MySignals.Add(item);
}
}
else if (title.Equals("信号关联列表"))
{
MySignals.Add(item);
IsVisibility = Visibility.Visible;
}
}
}
public override void ExecuteOKCommandAsync(object para)
{
IDialogParameters par = new DialogParameters();
if (title.Equals("信号选择框"))
{
if (SelectedSignal == null)
{
MessageBox.Show("请选择一个信号!");
return;
}
}
else if (title.Equals("信号关联列表"))
{
//如何是取消关联,则把取消的列表传回去
par.Add(GlobalObject.dialogPar.para2.ToString(), CancelAssociationls);
}
par.Add(GlobalObject.dialogPar.para1.ToString(), SelectedSignal);
DialogResult result = new DialogResult(ButtonResult.Yes, par);
RequestClose.Invoke(result);
}
public override void ExecuteCloseCommand(object parameter)
{
if (parameter as string == "ClickNo")
{
DialogResult result = new DialogResult(ButtonResult.No);
RequestClose.Invoke(result);
}
else
{
DialogResult result = new DialogResult(ButtonResult.Cancel);
RequestClose.Invoke(result);
}
this.Dispose();
}
//全局的取消关联列表
List<SignalManagementInfo> CancelAssociationls = new List<SignalManagementInfo>();
public ICommand CancelAssociationCmd => new DelegateCommand(CancelAssociation_Click);
/// <summary>
/// 取消关联按钮的点击事件
/// </summary>
/// <param name="parameter"></param>
public virtual void CancelAssociation_Click(object parameter)
{
CancelAssociationls.Add(SelectedSignal);
MySignals.Remove(SelectedSignal);
}
}
public class AssociatedSignalInfo : ViewModelBase
{
#region
private string _Group_Name;
/// <summary>
/// CH.NO
/// </summary>
public string Group_Name
{
get { return _Group_Name; }
set { _Group_Name = value; RaisePropertyChanged(nameof(Group_Name)); }
}
private string _Group_Desc_EN;
/// <summary>
/// 英文描述
/// </summary>
public string Group_Desc_EN
{
get { return _Group_Desc_EN; }
set { _Group_Desc_EN = value; RaisePropertyChanged(nameof(Group_Desc_EN)); }
}
private string _Group_Desc;
/// <summary>
/// 中文描述
/// </summary>
public string Group_Desc
{
get { return _Group_Desc; }
set { _Group_Desc = value; RaisePropertyChanged(nameof(Group_Desc)); }
}
private string _IO_Type;
/// <summary>
/// 信号类型
/// </summary>
public string IO_Type
{
get { return _IO_Type; }
set { _IO_Type = value; RaisePropertyChanged(nameof(IO_Type)); }
}
private string _Alarm_LL;
public string Alarm_LL
{
get { return _Alarm_LL; }
set { _Alarm_LL = value; RaisePropertyChanged(nameof(Alarm_LL)); }
}
private string _Alarm_L;
public string Alarm_L
{
get { return _Alarm_L; }
set { _Alarm_L = value; RaisePropertyChanged(nameof(Alarm_L)); }
}
private string _Alarm_H;
public string Alarm_H
{
get { return _Alarm_H; }
set { _Alarm_H = value; RaisePropertyChanged(nameof(Alarm_H)); }
}
private string _Alarm_HH;
public string Alarm_HH
{
get { return _Alarm_HH; }
set { _Alarm_HH = value; RaisePropertyChanged(nameof(Alarm_HH)); }
}
private string _SENSOR_CODE;
/// <summary>
/// 传感器编号
/// </summary>
public string SENSOR_CODE
{
get { return _SENSOR_CODE; }
set { _SENSOR_CODE = value; RaisePropertyChanged(nameof(SENSOR_CODE)); }
}
#endregion
public AssociatedSignalInfo(ec_Wire_Group ec_Wire_Group)
{
}
}
}

View File

@ -347,11 +347,11 @@ namespace SWS.WPF.ViewModels
}
}
private DateTime _ReviewTime;
private DateTime? _ReviewTime;
/// <summary>
/// 送审时间
/// </summary>
public DateTime ReviewTime
public DateTime? ReviewTime
{
get { return _ReviewTime; }
set { _ReviewTime = value;
@ -359,11 +359,11 @@ namespace SWS.WPF.ViewModels
}
}
private DateTime _ConstructionTime;
private DateTime? _ConstructionTime;
/// <summary>
/// 施工时间
/// </summary>
public DateTime ConstructionTime
public DateTime? ConstructionTime
{
get { return _ConstructionTime; }
set { _ConstructionTime = value;
@ -371,6 +371,33 @@ namespace SWS.WPF.ViewModels
}
}
private Visibility _IsReviewTimeVisibility = Visibility.Visible;
/// <summary>
/// 控制送审时间是否可见
/// </summary>
public Visibility IsReviewTimeVisibility
{
get { return _IsReviewTimeVisibility; }
set
{
_IsReviewTimeVisibility = value;
RaisePropertyChanged(nameof(IsReviewTimeVisibility));
}
}
private Visibility _IsConstructionTimeVisibility = Visibility.Visible;
/// <summary>
/// 控制施工时间是否可见
/// </summary>
public Visibility IsConstructionTimeVisibility
{
get { return _IsConstructionTimeVisibility; }
set
{
_IsConstructionTimeVisibility = value;
RaisePropertyChanged(nameof(IsConstructionTimeVisibility));
}
}
private readonly DispatcherTimer _timer = new DispatcherTimer();
@ -423,6 +450,10 @@ namespace SWS.WPF.ViewModels
//DateTime startTime = DateTime.Now;
//设置信号源
signals = await _wireGroupService.GetSignals(GlobalObject.curProject.ProjectId, false);
if (signals == null)
{
signals = new List<ec_Wire_Group>();
}
//TimeSpan duration = DateTime.Now - startTime;
//System.Windows.MessageBox.Show($"Time taken: {duration.Seconds} milliseconds");
count = signals.Count().ToString();
@ -448,24 +479,33 @@ namespace SWS.WPF.ViewModels
IsAssociated = parameters.GetValue<ec_Wire_Group>(GlobalObject.dialogPar.info.ToString());
//获取送审时间和施工时间
ReviewTime = (DateTime)GlobalObject.curProject.IO_predicted_issue;
ConstructionTime = (DateTime)GlobalObject.curProject.IO_predicted_construct;
ReviewTime = GlobalObject.curProject.IO_predicted_issue;
ConstructionTime = GlobalObject.curProject.IO_predicted_issue;
if (ReviewTime == null) IsReviewTimeVisibility = Visibility.Collapsed;
if (ConstructionTime == null) IsConstructionTimeVisibility = Visibility.Collapsed;
// 获取当前时间
DateTime currentTime = DateTime.Now;
// 初始化倒计时时间
ReviewCountdown.TimeRemaining = (TimeSpan)(ReviewTime - currentTime);
ReviewCountdown.IsActive = true;
ReviewCountdown.TimeRemaining = ReviewTime==null? TimeSpan.Zero:(TimeSpan)(ReviewTime - currentTime);
ReviewCountdown.IsActive = ReviewTime == null ?false: true;
if (ReviewCountdown.TimeRemaining<= TimeSpan.Zero)
{
System.Windows.MessageBox.Show($"送审时间已过期: {ReviewCountdown.TimeRemaining:%d}天 {ReviewCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
}
ConstructionCountdown.TimeRemaining = (TimeSpan)(ConstructionTime - currentTime);
if (GlobalObject.curProject.IO_real_issue == null && GlobalObject.curProject.IO_predicted_issue!=null)
{
System.Windows.MessageBox.Show($"送审时间已过期: {ReviewCountdown.TimeRemaining:%d}天 {ReviewCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
ConstructionCountdown.IsActive = true;
}
}
ConstructionCountdown.TimeRemaining = ConstructionTime==null? TimeSpan.Zero:(TimeSpan)(ConstructionTime - currentTime);
ConstructionCountdown.IsActive = ConstructionTime == null ? false: true;
if (ConstructionCountdown.TimeRemaining <= TimeSpan.Zero)
{
System.Windows.MessageBox.Show($"施工时间已过期: {ConstructionCountdown.TimeRemaining:%d}天 {ConstructionCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
if (GlobalObject.curProject.IO_real_construct == null&& GlobalObject.curProject.IO_predicted_issue!=null)
{
System.Windows.MessageBox.Show($"施工时间已过期: {ConstructionCountdown.TimeRemaining:%d}天 {ConstructionCountdown.TimeRemaining:hh\\:mm\\:ss}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
// 初始化定时器
@ -1338,25 +1378,25 @@ namespace SWS.WPF.ViewModels
para.Add(GlobalObject.dialogPar.title.ToString(), "信号选择框");
para.Add(GlobalObject.dialogPar.info.ToString(), "请选择要关联的信号:");
para.Add(GlobalObject.dialogPar.para1.ToString(), smInfols);
_dialogService.ShowDialog(nameof(DialogSignalSelect), para, (RES) =>
_dialogService.ShowDialog(nameof(DialogAssociatedSignal), para, (RES) =>
{
if (RES.Result == ButtonResult.Yes)
{
var signal = RES.Parameters.GetValue<Signal>(GlobalObject.dialogPar.para1.ToString());
var signal = RES.Parameters.GetValue<SignalManagementInfo>(GlobalObject.dialogPar.para1.ToString());
if (!string.IsNullOrEmpty(SelectedSmInfo.LinkedID))
{
var LinkedIDs = SelectedSmInfo.LinkedID.Split(',').ToList();
LinkedIDs.RemoveAll(item => string.IsNullOrEmpty(item));
if (!LinkedIDs.Contains(signal.SignalId))
if (!LinkedIDs.Contains(signal.Wire_Group_ID))
{
LinkedIDs.Add(signal.SignalId);
LinkedIDs.Add(signal.Wire_Group_ID);
}
SelectedSmInfo.LinkedID = string.Join(",", LinkedIDs);
}
else
{
SelectedSmInfo.LinkedID = signal.SignalId;
SelectedSmInfo.LinkedID = signal.Wire_Group_ID;
}
SelectedSmInfo.IsModified = true;
System.Windows.MessageBox.Show("关联成功", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning);
@ -1389,15 +1429,15 @@ namespace SWS.WPF.ViewModels
para.Add(GlobalObject.dialogPar.title.ToString(), "信号关联列表");
para.Add(GlobalObject.dialogPar.info.ToString(), "下面是信号关联列表");
para.Add(GlobalObject.dialogPar.para1.ToString(), sminfols);
_dialogService.ShowDialog(nameof(DialogSignalSelect), para, (RES) =>
_dialogService.ShowDialog(nameof(DialogAssociatedSignal), para, (RES) =>
{
if (RES.Result == ButtonResult.Yes)
{
var signals = RES.Parameters.GetValue<List<Signal>>(GlobalObject.dialogPar.para2.ToString());
var signals = RES.Parameters.GetValue<List<SignalManagementInfo>>(GlobalObject.dialogPar.para2.ToString());
signals.ForEach(s =>
{
var signalid = s.SignalId;
var signalid = s.Wire_Group_ID;
if (LinkedIDs.Contains(signalid))
{
LinkedIDs.Remove(signalid);

View File

@ -0,0 +1,106 @@
<UserControl x:Class="SWS.WPF.Views.DialogAssociatedSignal"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SWS.WPF.Views"
xmlns:prism="http://prismlibrary.com/"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:cvt="clr-namespace:SWS.Commons.Helper.Converter;assembly=SWS.Commons"
xmlns:CustomControl="clr-namespace:SWS.CustomControl;assembly=SWS.CustomControl"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<prism:Dialog.WindowStyle>
<Style TargetType="Window">
<!--最大化-->
<Setter Property="Width" Value="1000" />
<Setter Property="Height" Value="800" />
<Setter Property="SizeToContent" Value="WidthAndHeight" />
<Setter Property="WindowState" Value="Normal" />
<Setter Property="WindowStyle" Value="None" />
<Setter Property="ResizeMode" Value="NoResize" />
</Style>
</prism:Dialog.WindowStyle>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SWS.WPF;component/Style/CustomStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<telerik:RadBusyIndicator BusyContent="{Binding BusyContent}" IsBusy="{Binding IsBusy}">
<StackPanel>
<CustomControl:customWindowTitleBar x:Name="titleBar" />
<TextBlock Margin="10,0" Text="{Binding Info}" />
<telerik:RadGridView x:Name="RadGridView1" SelectionMode="Single" Width="500" Height="530"
AutoGenerateColumns="False" IsFilteringAllowed="False" Background="#a0a0a0"
IsReadOnly="True" RowIndicatorVisibility="Collapsed"
ShowGroupPanel="False" telerik:StyleManager.Theme="Office_Blue"
ItemsSource="{Binding MySignals}" SelectedItem="{Binding SelectedSignal, Mode=TwoWay}">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Group_Name}"
Header="CH.NO"
IsFilterable="False"/>
<telerik:GridViewDataColumn Width="120"
DataMemberBinding="{Binding Group_Desc_EN}"
Header="英文描述"
IsFilterable="False" />
<telerik:GridViewDataColumn Width="120"
DataMemberBinding="{Binding Group_Desc}"
Header="中文描述"
IsFilterable="False" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding IO_Type}"
Header="信号类型"
IsFilterable="False" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Alarm_LL}"
Header="L.L"
IsFilterable="False" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Alarm_L}"
Header="L"
IsFilterable="False" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Alarm_H}"
Header="H"
IsFilterable="False" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Alarm_HH}"
Header="H.H"
IsFilterable="False" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding SENSOR_CODE}"
Header="CODE"
IsFilterable="False"
Width="*"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<Border Grid.Row="2"
Height="30"
Background="{StaticResource ColorPrimary}">
<DockPanel >
<StackPanel DockPanel.Dock="Left">
<telerik:RadButton Margin="5"
HorizontalAlignment="Left"
Command="{Binding CancelAssociationCmd}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="取消关联"
Visibility="{Binding IsVisibility}"
Style="{StaticResource sysBtn4}" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<telerik:RadButton Margin="5"
Command="{Binding OKCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="确定"
Style="{StaticResource sysBtn}" />
<telerik:RadButton Margin="5"
Command="{Binding CloseCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="取消"
Style="{StaticResource sysBtn2}" />
</StackPanel>
</DockPanel>
</Border>
</StackPanel>
</telerik:RadBusyIndicator>
</UserControl>

View File

@ -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.WPF.Views
{
/// <summary>
/// DialogAssociatedSignal.xaml 的交互逻辑
/// </summary>
public partial class DialogAssociatedSignal : UserControl
{
public DialogAssociatedSignal()
{
InitializeComponent();
}
}
}

View File

@ -224,7 +224,8 @@
Text="{Binding pojectName}" />
<!--送审时间倒计时-->
<Border Background="{Binding ReviewCountdown.TimeRemaining,Converter={StaticResource TimeSpanToColourCvt}}" CornerRadius="6"
Margin="50,1,0,1" Padding="1">
Visibility="{Binding IsReviewTimeVisibility}"
Margin="50,1,0,1" Padding="1">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<TextBlock Text="送审时间"
FontSize="14" Foreground="White"
@ -242,7 +243,8 @@
<!--施工时间倒计时-->
<Border Background="{Binding ConstructionCountdown.TimeRemaining,Converter={StaticResource TimeSpanToColourCvt}}" CornerRadius="6"
Margin="25,1,0,1" Padding="1">
Visibility="{Binding IsConstructionTimeVisibility}"
Margin="25,1,0,1" Padding="1">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="施工时间"
FontSize="14" Foreground="White"

View File

@ -1,111 +0,0 @@
#pragma checksum "..\..\..\Views\DialogInput.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "79ABA349AD65127222E52DC2168828F367F61B79E30D6794AC600F9A9A45AF1D"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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.WPF.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.WPF.Views {
/// <summary>
/// DialogInput
/// </summary>
public partial class DialogInput : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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.WPF;component/views/dialoginput.xaml", System.UriKind.Relative);
#line 1 "..\..\..\Views\DialogInput.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) {
this._contentLoaded = true;
}
}
}

View File

@ -1,192 +0,0 @@
#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7BBBAAC2D30DDCBE426FDE8827BDBF7527EEDC8C0F823DBAF3EBE2D35FF1D1F8"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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.Commons.Helper.Converter;
using SWS.CustomControl;
using SWS.WPF.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.WPF.Views {
/// <summary>
/// DialogSignalManagement
/// </summary>
public partial class DialogSignalManagement : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 213 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal SWS.CustomControl.customWindowTitleBar titleBar;
#line default
#line hidden
#line 232 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtReviewCountdown;
#line default
#line hidden
#line 250 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtConstructionCountdown;
#line default
#line hidden
#line 306 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal SWS.CustomControl.IconButton PopupButton;
#line default
#line hidden
#line 316 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.Popup CustomPopup;
#line default
#line hidden
#line 365 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal SWS.CustomControl.IconButton myButton;
#line default
#line hidden
#line 398 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Telerik.Windows.Controls.RadTreeListView RadGridView1;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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.WPF;component/views/dialogsignalmanagements/dialogsignalmanagement.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.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.txtReviewCountdown = ((System.Windows.Controls.TextBlock)(target));
return;
case 3:
this.txtConstructionCountdown = ((System.Windows.Controls.TextBlock)(target));
return;
case 4:
this.PopupButton = ((SWS.CustomControl.IconButton)(target));
return;
case 5:
this.CustomPopup = ((System.Windows.Controls.Primitives.Popup)(target));
return;
case 6:
this.myButton = ((SWS.CustomControl.IconButton)(target));
return;
case 7:
this.RadGridView1 = ((Telerik.Windows.Controls.RadTreeListView)(target));
return;
}
this._contentLoaded = true;
}
}
}

View File

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "7BBBAAC2D30DDCBE426FDE8827BDBF7527EEDC8C0F823DBAF3EBE2D35FF1D1F8"
#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "D4B655A725F9DA5CEF801330CC2E000E8A952FC6E92D22159739897F8A32A6A6"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -86,7 +86,7 @@ namespace SWS.WPF.Views {
#line hidden
#line 232 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
#line 233 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtReviewCountdown;
@ -94,7 +94,7 @@ namespace SWS.WPF.Views {
#line hidden
#line 250 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
#line 252 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock txtConstructionCountdown;
@ -102,7 +102,7 @@ namespace SWS.WPF.Views {
#line hidden
#line 306 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
#line 308 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal SWS.CustomControl.IconButton PopupButton;
@ -110,7 +110,7 @@ namespace SWS.WPF.Views {
#line hidden
#line 316 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
#line 318 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Primitives.Popup CustomPopup;
@ -118,7 +118,7 @@ namespace SWS.WPF.Views {
#line hidden
#line 365 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
#line 367 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal SWS.CustomControl.IconButton myButton;
@ -126,7 +126,7 @@ namespace SWS.WPF.Views {
#line hidden
#line 398 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
#line 400 "..\..\..\..\Views\DialogSignalManagements\DialogSignalManagement.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Telerik.Windows.Controls.RadTreeListView RadGridView1;

View File

@ -1,120 +0,0 @@
#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalNotice.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "96F2D26AF189BFC9415C3A5E2A7E8B4F6F86E0A3BD2C2F7AAD40D4F0138BF2C9"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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.WPF.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.WPF.Views {
/// <summary>
/// DialogSignalNotice
/// </summary>
public partial class DialogSignalNotice : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 77 "..\..\..\..\Views\DialogSignalManagements\DialogSignalNotice.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Telerik.Windows.Controls.RadGridView RadGridView2;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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.WPF;component/views/dialogsignalmanagements/dialogsignalnotice.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalNotice.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.RadGridView2 = ((Telerik.Windows.Controls.RadGridView)(target));
return;
}
this._contentLoaded = true;
}
}
}

View File

@ -1,132 +0,0 @@
#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "BE60D5C45BFF53C850EE04B85D1AED3A70B5A4F94BFCB1E5612DE8D892E9C533"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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.WPF.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.WPF.Views {
/// <summary>
/// DialogSignalPropertyhisAndLogs
/// </summary>
public partial class DialogSignalPropertyhisAndLogs : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 40 "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Telerik.Windows.Controls.RadGridView RadGridView1;
#line default
#line hidden
#line 89 "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal Telerik.Windows.Controls.RadGridView RadGridView2;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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.WPF;component/views/dialogsignalmanagements/dialogsignalpropertyhisandlogs.x" +
"aml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalPropertyhisAndLogs.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.RadGridView1 = ((Telerik.Windows.Controls.RadGridView)(target));
return;
case 2:
this.RadGridView2 = ((Telerik.Windows.Controls.RadGridView)(target));
return;
}
this._contentLoaded = true;
}
}
}

View File

@ -1,106 +0,0 @@
#pragma checksum "..\..\..\..\Views\DialogSignalManagements\DialogSignalSelect.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "EE32C8B45FE374AABAE5ED09E93D91CDBA87B6F49A5282F213060672367234A0"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
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.WPF.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.WPF.Views {
/// <summary>
/// DialogSignalSelect
/// </summary>
public partial class DialogSignalSelect : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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.WPF;component/views/dialogsignalmanagements/dialogsignalselect.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\DialogSignalManagements\DialogSignalSelect.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) {
this._contentLoaded = true;
}
}
}

View File

@ -1,112 +0,0 @@
#pragma checksum "..\..\..\Views\DialogTest.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6B3B7EEAB6D20917F0C5D3D89D2899E3CB2081B27EC6998F991166F325652220"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using SWS.CustomControl;
using SWS.WPF.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.WPF.Views {
/// <summary>
/// DialogTest
/// </summary>
public partial class DialogTest : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector {
#line 19 "..\..\..\Views\DialogTest.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal SWS.CustomControl.customWindowTitleBar titleBar;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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.WPF;component/views/dialogtest.xaml", System.UriKind.Relative);
#line 1 "..\..\..\Views\DialogTest.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;
}
}
}

View File

@ -1,108 +0,0 @@
#pragma checksum "..\..\..\Views\Project.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "CEE66C3694A40153FDD13BBA62FE1B6DC3D9D33F6B276CA567053423C05A4D66"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using SWS.CustomControl;
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.WPF.Views {
/// <summary>
/// Project
/// </summary>
public partial class Project : System.Windows.Window, System.Windows.Markup.IComponentConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[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.WPF;component/views/project.xaml", System.UriKind.Relative);
#line 1 "..\..\..\Views\Project.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:
#line 13 "..\..\..\Views\Project.xaml"
((SWS.WPF.Views.Project)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}