IO1View.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Maitenances.IO1.IO1View"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  7. xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
  8. xmlns:micro="clr-namespace:Caliburn.Micro"
  9. xmlns:c="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter"
  10. xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
  11. mc:Ignorable="d" >
  12. <UserControl.Resources>
  13. <c:DisplayNameConverter x:Key="DisplayConverter" />
  14. <DataTemplate x:Key="DOTemplate">
  15. <Grid Margin="5,-1,0,0" Height="23">
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="50"></ColumnDefinition>
  18. <ColumnDefinition Width="200"></ColumnDefinition>
  19. <ColumnDefinition Width="50"></ColumnDefinition>
  20. <ColumnDefinition Width="45"></ColumnDefinition>
  21. <ColumnDefinition Width="45"></ColumnDefinition>
  22. </Grid.ColumnDefinitions>
  23. <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
  24. <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  25. </Border>
  26. <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  27. <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  28. </Border>
  29. <Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  30. <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  31. </Border>
  32. <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  33. <controls:SwitchButton ON="{Binding Value}" Style="{StaticResource Lamp-Button}" HorizontalAlignment="Center" />
  34. </Border>
  35. <Border Grid.Column="4" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  36. <controls:SwitchButton ON="{Binding Value}" Style="{StaticResource OperationButton}" HorizontalAlignment="Center">
  37. <i:Interaction.Triggers>
  38. <i:EventTrigger EventName="Click">
  39. <micro:ActionMessage MethodName="SetDO">
  40. <micro:Parameter Value="{Binding }" />
  41. </micro:ActionMessage>
  42. </i:EventTrigger>
  43. </i:Interaction.Triggers>
  44. </controls:SwitchButton>
  45. </Border>
  46. </Grid>
  47. </DataTemplate>
  48. <DataTemplate x:Key="DITemplate">
  49. <Grid Margin="5,-1,0,0" Height="23">
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="50"></ColumnDefinition>
  52. <ColumnDefinition Width="200"></ColumnDefinition>
  53. <ColumnDefinition Width="50"></ColumnDefinition>
  54. <ColumnDefinition Width="45"></ColumnDefinition>
  55. </Grid.ColumnDefinitions>
  56. <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
  57. <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  58. </Border>
  59. <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  60. <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  61. </Border>
  62. <Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  63. <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  64. </Border>
  65. <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  66. <controls:SwitchButton ON="{Binding Value}" Style="{StaticResource Lamp-Button}" HorizontalAlignment="Center" />
  67. </Border>
  68. </Grid>
  69. </DataTemplate>
  70. <DataTemplate x:Key="AOTemplate">
  71. <Grid Margin="5,-1,0,0" Height="23">
  72. <Grid.ColumnDefinitions>
  73. <ColumnDefinition Width="30"></ColumnDefinition>
  74. <ColumnDefinition Width="200"></ColumnDefinition>
  75. <ColumnDefinition Width="auto"></ColumnDefinition>
  76. <ColumnDefinition Width="45"></ColumnDefinition>
  77. <ColumnDefinition Width="60"></ColumnDefinition>
  78. <ColumnDefinition Width="60"></ColumnDefinition>
  79. </Grid.ColumnDefinitions>
  80. <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
  81. <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  82. </Border>
  83. <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  84. <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  85. </Border>
  86. <!--<Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  87. <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  88. </Border>-->
  89. <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  90. <TextBlock Text= "{Binding Path=Value}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  91. </Border>
  92. <Border Grid.Column="4" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  93. <toolkit:IntegerUpDown Text="{Binding Path=NewValue}"/>
  94. </Border>
  95. <Border Grid.Column="5" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  96. <Button Content="Set" FontSize="12" Height="22">
  97. <i:Interaction.Triggers>
  98. <i:EventTrigger EventName="Click">
  99. <micro:ActionMessage MethodName="SetAO">
  100. <micro:Parameter Value="{Binding }" />
  101. </micro:ActionMessage>
  102. </i:EventTrigger>
  103. </i:Interaction.Triggers>
  104. </Button>
  105. </Border>
  106. </Grid>
  107. </DataTemplate>
  108. <DataTemplate x:Key="AITemplate">
  109. <Grid Margin="5,-1,0,0" Height="23">
  110. <Grid.ColumnDefinitions>
  111. <ColumnDefinition Width="30"></ColumnDefinition>
  112. <ColumnDefinition Width="200"></ColumnDefinition>
  113. <ColumnDefinition Width="auto"></ColumnDefinition>
  114. <ColumnDefinition Width="45"></ColumnDefinition>
  115. </Grid.ColumnDefinitions>
  116. <Border BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="1" Padding="5,1">
  117. <TextBlock Text= "{Binding Path=Index}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  118. </Border>
  119. <Border Grid.Column="1" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  120. <TextBlock Text= "{Binding Path=DisplayName, Converter={StaticResource DisplayConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  121. </Border>
  122. <!--<Border Grid.Column="2" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  123. <TextBlock Text= "{Binding Path=Address}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  124. </Border>-->
  125. <Border Grid.Column="3" BorderBrush="{DynamicResource DataGrid_Cell_BD}" BorderThickness="0,1,1,1" Padding="5,1">
  126. <TextBlock Text= "{Binding Path=Value}" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
  127. </Border>
  128. </Grid>
  129. </DataTemplate>
  130. </UserControl.Resources>
  131. <Grid HorizontalAlignment="Stretch">
  132. <TabControl HorizontalContentAlignment="Stretch">
  133. <TabItem Header="DI" Visibility="{Binding DIVisibility}">
  134. <ListBox ItemsSource="{Binding DIs}"
  135. ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}"
  136. AlternationCount="2" ItemTemplate="{StaticResource DITemplate}"
  137. ScrollViewer.VerticalScrollBarVisibility="Disabled"
  138. Width="{Binding DIWidth}"
  139. BorderThickness="0" Margin="5,0" HorizontalAlignment="Left" IsEnabled="{Binding IsPermission}">
  140. <ListBox.ItemsPanel>
  141. <ItemsPanelTemplate>
  142. <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
  143. </ItemsPanelTemplate>
  144. </ListBox.ItemsPanel>
  145. </ListBox>
  146. </TabItem>
  147. <TabItem Header="DO" Visibility="{Binding DOVisibility}">
  148. <ListBox ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}" ItemsSource="{Binding DOs}" AlternationCount="2" ItemTemplate="{StaticResource DOTemplate}" IsEnabled="{Binding IsPermission}"
  149. ScrollViewer.VerticalScrollBarVisibility="Disabled" BorderThickness="0" Margin="5,0" HorizontalAlignment="Left">
  150. <ListBox.ItemsPanel>
  151. <ItemsPanelTemplate>
  152. <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
  153. </ItemsPanelTemplate>
  154. </ListBox.ItemsPanel>
  155. </ListBox>
  156. </TabItem>
  157. <TabItem Header="AI" Visibility="{Binding AIVisibility}">
  158. <ListBox ItemsSource="{Binding AIs}"
  159. ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}"
  160. AlternationCount="2" ItemTemplate="{StaticResource AITemplate}"
  161. ScrollViewer.VerticalScrollBarVisibility="Disabled"
  162. Width="{Binding AIWidth}"
  163. BorderThickness="0" Margin="5,0" HorizontalAlignment="Left" IsEnabled="{Binding IsPermission}">
  164. <ListBox.ItemsPanel>
  165. <ItemsPanelTemplate>
  166. <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
  167. </ItemsPanelTemplate>
  168. </ListBox.ItemsPanel>
  169. </ListBox>
  170. </TabItem>
  171. <TabItem Header="AO" Visibility="{Binding AOVisibility}">
  172. <ListBox ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}" ItemsSource="{Binding AOs}" AlternationCount="2" ItemTemplate="{StaticResource AOTemplate}" IsEnabled="{Binding IsPermission}"
  173. ScrollViewer.VerticalScrollBarVisibility="Disabled" BorderThickness="0" Margin="5,0" HorizontalAlignment="Left">
  174. <ListBox.ItemsPanel>
  175. <ItemsPanelTemplate>
  176. <WrapPanel IsItemsHost="True" Orientation="Vertical" Margin="1,1,0,0"/>
  177. </ItemsPanelTemplate>
  178. </ListBox.ItemsPanel>
  179. </ListBox>
  180. </TabItem>
  181. </TabControl>
  182. </Grid>
  183. </UserControl>