|
@@ -2,11 +2,13 @@
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Windows;
|
|
|
-
|
|
|
+using System.Windows.Controls;
|
|
|
+using System.Windows.Media;
|
|
|
using CEFSharpWPF;
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
using SAGA.GplotRelationComputerManage;
|
|
|
using SAGA.Models;
|
|
|
+using SAGA.RevitUtils;
|
|
|
using SAGA.RevitUtils.Windows;
|
|
|
|
|
|
namespace SAGA.GplotDrawData.View
|
|
@@ -57,26 +59,37 @@ namespace SAGA.GplotDrawData.View
|
|
|
/// </summary>
|
|
|
private void InitTreeNode()
|
|
|
{
|
|
|
- List<List<MachineRoomDrawRecord>> drawDatas = GetMachineRoomDrawData();
|
|
|
- List<DataNode> treeDataSource = new List<DataNode>();
|
|
|
- foreach (var drawData in drawDatas)
|
|
|
+ try
|
|
|
{
|
|
|
- foreach (var drawRecord in drawData)
|
|
|
+ List<List<MachineRoomDrawRecord>> drawDatas = GetMachineRoomDrawData();
|
|
|
+ List<DataNode> treeDataSource = new List<DataNode>();
|
|
|
+ foreach (var drawData in drawDatas)
|
|
|
{
|
|
|
- if (!drawRecord.NodePaths.Any())
|
|
|
- continue;
|
|
|
- var relationNode = treeDataSource.FirstOrDefault(d => d.EName == drawRecord.RelationName);
|
|
|
- if (relationNode == null)
|
|
|
+ foreach (var drawRecord in drawData)
|
|
|
{
|
|
|
- relationNode= new DataNode(drawRecord.RelationName);
|
|
|
- treeDataSource.Add(relationNode);
|
|
|
+ if (!drawRecord.NodePaths.Any())
|
|
|
+ continue;
|
|
|
+ var relationNode = treeDataSource.FirstOrDefault(d => d.EName == drawRecord.RelationName);
|
|
|
+ if (relationNode == null)
|
|
|
+ {
|
|
|
+ relationNode = new DataNode(drawRecord.RelationName);
|
|
|
+ treeDataSource.Add(relationNode);
|
|
|
+ }
|
|
|
+ var recordNode = new DataNode(drawRecord.FloorName);
|
|
|
+ recordNode.SetData(drawRecord);
|
|
|
+ relationNode.Childrens.Add(recordNode);
|
|
|
}
|
|
|
- var recordNode= new DataNode(drawRecord.FloorName);
|
|
|
- recordNode.SetData(drawRecord);
|
|
|
- relationNode.Childrens.Add(recordNode);
|
|
|
}
|
|
|
+ this.TreeRootNode.ItemsSource = treeDataSource;
|
|
|
+ if (treeDataSource.Count == 0)
|
|
|
+ {
|
|
|
+ this.Content = CommonControlUtils.CreatMaskElement("未发现计算数据");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ MessageShow.Show(ex);
|
|
|
}
|
|
|
- this.TreeRootNode.ItemsSource = treeDataSource;
|
|
|
}
|
|
|
private void Draw(MachineRoomDrawRecord record)
|
|
|
{
|