Browse Source

xls:修改水系统拓扑计算名称

xulisong 6 years ago
parent
commit
afac3109ed

BIN
MBI/MBIResource/Config/物理世界关系定义列表-2019-1.xlsx


+ 9 - 9
MBI/Menu/SAGABIM.xml

@@ -486,12 +486,12 @@
     <!--冷凍水供水-->
     <Button ButtonStyles="Large">
       <ButtonName>SAGA.GplotManage.ChillWaterLoopComputerSupplyGraph</ButtonName>
-      <ButtonText>水系统</ButtonText>
+      <ButtonText>水系统-平面</ButtonText>
       <ImageName>10、空间管理</ImageName>
       <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
       <ClassName>SAGA.GplotManage.ChillWaterLoopComputerSupplyGraph</ClassName>
-      <ToolTip>冷冻水-供水</ToolTip>
-      <LongDescription>冷冻水-供水</LongDescription>
+      <ToolTip>水系统平面</ToolTip>
+      <LongDescription>水系统平面</LongDescription>
       <ToolTipImage></ToolTipImage>
       <MenuTab>SJJC_W</MenuTab>
       <Modules>SJJC</Modules>
@@ -513,24 +513,24 @@
     <!--冷凍水立管-->
     <Button ButtonStyles="Large">
       <ButtonName>SAGA.GplotManage.ChillWaterLoopComputerVGraph</ButtonName>
-      <ButtonText>冷冻水-立管</ButtonText>
+      <ButtonText>水系统-立面</ButtonText>
       <ImageName>10、空间管理</ImageName>
       <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
       <ClassName>SAGA.GplotManage.ChillWaterLoopComputerVGraph</ClassName>
-      <ToolTip>冷冻水-立管</ToolTip>
-      <LongDescription>冷冻水-立管</LongDescription>
+      <ToolTip>水系统立面</ToolTip>
+      <LongDescription>水系统立面</LongDescription>
       <ToolTipImage></ToolTipImage>
       <MenuTab>SJJC_W</MenuTab>
       <Modules>SJJC</Modules>
     </Button>
     <Button ButtonStyles="Large">
       <ButtonName>SAGA.GplotManage.ChillWaterLoopRoom</ButtonName>
-      <ButtonText>冷站</ButtonText>
+      <ButtonText>机房</ButtonText>
       <ImageName>10、空间管理</ImageName>
       <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
       <ClassName>SAGA.GplotManage.ChillWaterLoopRoom</ClassName>
-      <ToolTip>冷站</ToolTip>
-      <LongDescription>冷站</LongDescription>
+      <ToolTip>机房拓扑图</ToolTip>
+      <LongDescription>机房拓扑图</LongDescription>
       <ToolTipImage></ToolTipImage>
       <MenuTab>SJJC_W</MenuTab>
       <Modules>SJJC</Modules>

+ 30 - 0
MBI/SAGA.GplotDrawData/CommonControlUtils.cs

@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:CommonControlUtils
+ * 作者:xulisong
+ * 创建时间: 2019/4/11 11:16:28
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+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.Media;
+
+namespace SAGA.GplotDrawData
+{
+    public class CommonControlUtils
+    {
+        public static UIElement CreatMaskElement(string message)
+        {
+            Grid grid = new Grid();
+            grid.Background = Brushes.Gray;
+            grid.Opacity = 0.8;
+            grid.Children.Add(new TextBlock() { Text = message??"空", FontSize = 30, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center });
+            return grid;
+        }
+    }
+}

+ 1 - 0
MBI/SAGA.GplotDrawData/SAGA.GplotDrawData.csproj

@@ -76,6 +76,7 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="CommonControlUtils.cs" />
     <Compile Include="Common\WebGplotSettings.cs" />
     <Compile Include="DBView\EquipmentGraphView.cs" />
     <Compile Include="DBView\FloorSystemGraphView.cs" />

+ 28 - 15
MBI/SAGA.GplotDrawData/View/WinMachineRoom.xaml.cs

@@ -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)
         {

+ 5 - 0
MBI/SAGA.GplotDrawData/View/WinSystem.xaml.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Windows;
 using CEFSharpWPF;
+using SAGA.DotNetUtils;
 using SAGA.GplotRelationComputerManage;
 using SAGA.Models;
 using SAGA.RevitUtils.Windows;
@@ -43,6 +44,10 @@ namespace SAGA.GplotDrawData.View
                 InitFloorData();
             }
             RootNode_OnSelectedItemChanged(null, null);
+            if (rootNode.ItemsSource==null|| !rootNode.ItemsSource.OfType<DataNode>().Any())
+            {
+                this.Content = CommonControlUtils.CreatMaskElement("未发现计算数据");
+            }
         }
 
         private void RootNode_OnSelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)