Forráskód Böngészése

Merge branch 'master' of https://git.dev.tencent.com/xuhuo1234/saga

mengxiangge 6 éve
szülő
commit
f35a48cd94

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


+ 2 - 2
MBI/SAGA.GplotRelationComputerManage/SystemRelation/FloorSystemItem.cs

@@ -231,7 +231,7 @@ namespace SAGA.GplotRelationComputerManage
 
         public void ParsePipe(SystemComputerContext context, RelationTypeShell relationSetting, Domain currentDomain)
         {
-            Domain useDomain = currentDomain;//Domain.DomainPiping;
+            Domain useDomain = currentDomain;
             var relationType = relationSetting.RelationItem.Type;
             List<FloorDrawRecord> drawRecords = new List<FloorDrawRecord>();
             List<FloorRelationRecord> relationRecords = new List<FloorRelationRecord>();
@@ -251,7 +251,7 @@ namespace SAGA.GplotRelationComputerManage
                 var useRelation = relationSetting.GetFirstMatchSystem(startNode.Flag);
                 if (useRelation == null)
                     continue;
-                if (useIds.Any(id => id == startNode.Instance.Current.Id.IntegerValue))
+                if (useIds.Contains(startNode.Instance.Current.Id.IntegerValue))
                 {
                     continue;
                 }

+ 59 - 16
MBI/SAGA.MBI/WinView/ModeInfoMaintenance/WinConfigRunParam.xaml

@@ -29,38 +29,81 @@
                     <ColumnDefinition></ColumnDefinition>
                     <ColumnDefinition></ColumnDefinition>
                 </Grid.ColumnDefinitions>
-                <ListView Grid.Column="0"  >
+                <ListView Grid.Column="0"  ItemsSource="{Binding EqNames}"   AlternationCount="2">
                     <ListView.View>
                         <GridView>
-                            <GridViewColumn Header="设备名称" Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=ListView , Mode=FindAncestor}}"></GridViewColumn>
+                            <GridViewColumn Header="设备名称" DisplayMemberBinding="{Binding }"  Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=ListView , Mode=FindAncestor}}"></GridViewColumn>
                         </GridView>
                     </ListView.View>
-                    <ListBox.Items>
-                        <ListBoxItem>设备类1</ListBoxItem>
-                        <ListBoxItem>设备类2</ListBoxItem>
-                    </ListBox.Items>
+                    <ListView.ItemContainerStyle>
+                        <Style TargetType="{x:Type ListBoxItem}">
+                            <Style.Triggers>
+                                <Trigger Property="ItemsControl.AlternationIndex"
+                                         Value="0">
+                                    <Setter Property="Background" Value="White" />
+                                </Trigger>
+                                <Trigger Property="ItemsControl.AlternationIndex"
+                                         Value="1">
+                                    <Setter Property="Background" Value="#FFE6E3DD" />
+                                </Trigger>
+                            
+                                    <Trigger Property="IsSelected" Value="true">
+                                        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
+                                        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
+                                    </Trigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="IsSelected" Value="true"/>
+                                        <Condition Property="Selector.IsSelectionActive" Value="false"/>
+                                    </MultiTrigger.Conditions>
+                                    <Setter Property="Background"  Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
+                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
+                                </MultiTrigger>
+                            </Style.Triggers>
+                        </Style>
+                    </ListView.ItemContainerStyle>
                 </ListView>
 
-                <ListView Grid.Column="1"  >
+                <ListView Grid.Column="1"  ItemsSource="{Binding EqFlags}"   AlternationCount="2">
                     <ListView.View>
                         <GridView>
-                            <GridViewColumn Header="设备标识"  Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=ListView , Mode=FindAncestor}}"></GridViewColumn>
+                            <GridViewColumn Header="设备标识" DisplayMemberBinding="{Binding }"   Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource AncestorType=ListView , Mode=FindAncestor}}" ></GridViewColumn>
                         </GridView>
                     </ListView.View>
-                    <ListBox.Items>
-                        <ListBoxItem>1#</ListBoxItem>
-                        <ListBoxItem>5F-3#</ListBoxItem>
-                    </ListBox.Items>
+                    <ListView.ItemContainerStyle>
+                        <Style TargetType="{x:Type ListBoxItem}">
+                            <Style.Triggers>
+                                <Trigger Property="ItemsControl.AlternationIndex"
+                                         Value="0">
+                                    <Setter Property="Background" Value="White" />
+                                </Trigger>
+                                <Trigger Property="ItemsControl.AlternationIndex"
+                                         Value="1">
+                                    <Setter Property="Background" Value="#FFE6E3DD" />
+                                </Trigger>
+                                <Trigger Property="IsSelected" Value="true">
+                                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
+                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
+                                </Trigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="IsSelected" Value="true"/>
+                                        <Condition Property="Selector.IsSelectionActive" Value="false"/>
+                                    </MultiTrigger.Conditions>
+                                    <Setter Property="Background"  Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
+                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
+                                </MultiTrigger>
+                            </Style.Triggers>
+                        </Style>
+                    </ListView.ItemContainerStyle>
                 </ListView>
             </Grid>
         </GroupBox>
         <Canvas Grid.Row="2">
             <Button Width="178" Height="24" Content="确定" IsDefault="True"
-                Command="{Binding Path=Commands.Save}"
-                CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}" Canvas.Left="77" Canvas.Top="18"></Button>
+                Click="Button_Ensure" Canvas.Left="77" Canvas.Top="18"></Button>
             <Button Width="100" Height="24" Content="取消" IsDefault="True" Background="White"
-                    Command="{Binding Path=Commands.Save}"
-                    CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}" Canvas.Left="298" Canvas.Top="18"></Button>
+                    Click="Button_Cancel" Canvas.Left="298" Canvas.Top="18"></Button>
         </Canvas>
     </Grid>
 </Window>

+ 90 - 0
MBI/SAGA.MBI/WinView/ModeInfoMaintenance/WinConfigRunParam.xaml.cs

@@ -1,5 +1,7 @@
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -29,6 +31,8 @@ namespace SAGA.MBI.WinView.ModeInfoMaintenance
         public WinConfigRunParam(MEquipment equipment):this()
         {
             m_MEquipment = equipment;
+            InitData();
+            this.DataContext = this;
         }
 
         public void UpdateWPG(object obj)
@@ -37,5 +41,91 @@ namespace SAGA.MBI.WinView.ModeInfoMaintenance
             var item = m_MEquipment.CompositeItem;
            
         }
+        #region 属性相关
+
+        private void InitData()
+        {
+            EqNames = new ObservableCollection<string>();
+            EqNames.Add("卧式风盘");
+            EqNames.Add("新风机组");
+            EqNames.Add("潜污泵");
+            EqNames.Add("空调吊柜");
+            EqNames.Add("空调吊柜-B");
+            EqNames.Add("CO2传感器"); 
+            EqFlags = new ObservableCollection<string>();
+            EqFlags.Add("F4-E-001");
+            EqFlags.Add("F4-E-003");
+            EqFlags.Add("F4-W-002");
+            EqFlags.Add("F3-E-043");
+            EqFlags.Add("F3-W-005");
+            EqFlags.Add("B1-0345");
+            EqFlags.Add("B1-W-043");
+
+        }
+        private ObservableCollection<string> m_EqNames;
+        /// <summary>
+        /// 设备名称
+        /// </summary>
+        public ObservableCollection<string> EqNames
+        {
+            get { return this.m_EqNames; }
+            set
+            {
+                this.m_EqNames = value;
+                RaiseChanged(nameof(this.EqNames));
+            }
+        }
+
+        private ObservableCollection<string> m_EqFlags;
+        /// <summary>
+        /// 设备标志
+        /// </summary>
+        public ObservableCollection<string> EqFlags
+        {
+            get { return this.m_EqFlags; }
+            set
+            {
+                this.m_EqFlags = value;
+                RaiseChanged(nameof(this.EqFlags));
+            }
+        }
+        #endregion
+
+        #region 事件相关
+        private void Button_Cancel(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
+
+        private void Button_Ensure(object sender, RoutedEventArgs e)
+        {
+            //this.Close();
+        } 
+        #endregion
     }
+
+    #region 通知信息
+    public partial class WinConfigRunParam : INotifyPropertyChanged
+    {
+        public event PropertyChangedEventHandler PropertyChanged;
+        /// <summary>
+        /// 提交变更
+        /// </summary>
+        /// <param name="propertyName">变更属性名称</param>
+        protected void RaiseChanged(String propertyName = "")
+        {
+            if (PropertyChanged != null)
+            {
+
+                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+            }
+        }
+
+        //protected void SetPropertyValue<T>(ref T old, T value, [CallerMemberName] string propertyName = "")
+        //{
+        //    old = value;
+        //    RaiseChanged(propertyName);
+        //}
+    } 
+    #endregion
 }