IO3View.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Maitenances.IO3.IO3View"
  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:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
  8. xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
  9. xmlns:micro="clr-namespace:Caliburn.Micro"
  10. xmlns:c="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter"
  11. mc:Ignorable="d">
  12. <UserControl.Resources>
  13. <c:DisplayNameConverter x:Key="DisplayConverter" />
  14. </UserControl.Resources>
  15. <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  16. <Grid HorizontalAlignment="Left">
  17. <Grid.ColumnDefinitions>
  18. <ColumnDefinition Width="Auto"></ColumnDefinition>
  19. <ColumnDefinition Width="Auto"></ColumnDefinition>
  20. <ColumnDefinition Width="Auto"></ColumnDefinition>
  21. <ColumnDefinition Width="Auto"></ColumnDefinition>
  22. </Grid.ColumnDefinitions>
  23. <TabControl Grid.Column="0" Margin="20,0,0,0" Visibility="{Binding DIVisibility}">
  24. <TabItem Header="DI">
  25. <ListView ItemsSource="{Binding Path=DIs}" IsEnabled="{Binding IsPermission}"
  26. Grid.Column="2" MaxHeight="730"
  27. AlternationCount="2"
  28. VerticalAlignment="Top"
  29. Name="DIListView">
  30. <ListView.View>
  31. <GridView>
  32. <GridViewColumn Width="50"
  33. Header="Index"
  34. DisplayMemberBinding="{Binding Path=Index}" />
  35. <GridViewColumn Width="200" Header="Name">
  36. <GridViewColumn.CellTemplate>
  37. <DataTemplate>
  38. <TextBlock Text="{Binding Path=DisplayName}" />
  39. </DataTemplate>
  40. </GridViewColumn.CellTemplate>
  41. </GridViewColumn>
  42. <GridViewColumn Width="0"
  43. Header="Address"
  44. DisplayMemberBinding="{Binding Path=Address}" />
  45. <GridViewColumn Width="50" Header="Status">
  46. <GridViewColumn.CellTemplate>
  47. <DataTemplate>
  48. <Grid Width="35">
  49. <controls:SwitchButton HorizontalAlignment="Center"
  50. ON="{Binding Value}"
  51. Style="{StaticResource Lamp-Button}">
  52. </controls:SwitchButton>
  53. </Grid>
  54. </DataTemplate>
  55. </GridViewColumn.CellTemplate>
  56. </GridViewColumn>
  57. </GridView>
  58. </ListView.View>
  59. </ListView>
  60. </TabItem>
  61. </TabControl>
  62. <TabControl Grid.Column="1" Margin="10,0,0,0" Visibility="{Binding DOVisibility}">
  63. <TabItem Header="DO">
  64. <ListView ItemsSource="{Binding Path=DOs}" IsEnabled="{Binding IsPermission}"
  65. Grid.Column="3" MaxHeight="730"
  66. AlternationCount="2"
  67. VerticalAlignment="Top"
  68. Name="DOListView">
  69. <ListView.View>
  70. <GridView>
  71. <GridViewColumn Width="50"
  72. Header="Index"
  73. DisplayMemberBinding="{Binding Path=Index}" />
  74. <GridViewColumn Width="200" Header="Name">
  75. <GridViewColumn.CellTemplate>
  76. <DataTemplate>
  77. <TextBlock Text="{Binding DisplayName, Converter={StaticResource DisplayConverter}}" />
  78. </DataTemplate>
  79. </GridViewColumn.CellTemplate>
  80. </GridViewColumn>
  81. <GridViewColumn Width="0"
  82. Header="Address"
  83. DisplayMemberBinding="{Binding Path=Address}" />
  84. <GridViewColumn Width="50" Header="Status">
  85. <GridViewColumn.CellTemplate>
  86. <DataTemplate >
  87. <Grid Width="35">
  88. <controls:SwitchButton HorizontalAlignment="Center"
  89. ON="{Binding Value}"
  90. Style="{StaticResource Lamp-Button}">
  91. </controls:SwitchButton>
  92. </Grid>
  93. </DataTemplate>
  94. </GridViewColumn.CellTemplate>
  95. </GridViewColumn>
  96. <GridViewColumn Width="75" Header="Operation">
  97. <GridViewColumn.CellTemplate>
  98. <DataTemplate >
  99. <Grid Width="45">
  100. <controls:SwitchButton ON="{Binding Value}" Style="{StaticResource OperationButton}" HorizontalAlignment="Center">
  101. <i:Interaction.Triggers>
  102. <i:EventTrigger EventName="Click">
  103. <micro:ActionMessage MethodName="SetDO">
  104. <micro:Parameter Value="{Binding }" />
  105. </micro:ActionMessage>
  106. </i:EventTrigger>
  107. </i:Interaction.Triggers>
  108. </controls:SwitchButton>
  109. </Grid>
  110. </DataTemplate>
  111. </GridViewColumn.CellTemplate>
  112. </GridViewColumn>
  113. </GridView>
  114. </ListView.View>
  115. </ListView>
  116. </TabItem>
  117. </TabControl>
  118. <TabControl Grid.Column="2" Margin="10,0,0,0" Visibility="{Binding AIVisibility}">
  119. <TabItem Header="AI">
  120. <ListView ItemsSource="{Binding Path=AIs}" IsEnabled="{Binding IsPermission}"
  121. AlternationCount="2" MaxHeight="730"
  122. Name="AIListView"
  123. VerticalAlignment="Top" >
  124. <ListView.View>
  125. <GridView>
  126. <GridViewColumn Width="50"
  127. Header="Index"
  128. DisplayMemberBinding="{Binding Path=Index}" />
  129. <GridViewColumn Width="200" Header="Name">
  130. <GridViewColumn.CellTemplate>
  131. <DataTemplate>
  132. <TextBlock Text="{Binding DisplayName, Converter={StaticResource DisplayConverter}}" />
  133. </DataTemplate>
  134. </GridViewColumn.CellTemplate>
  135. </GridViewColumn>
  136. <GridViewColumn Width="0"
  137. Header="Address"
  138. DisplayMemberBinding="{Binding Path=Address}" />
  139. <GridViewColumn Width="90"
  140. Header="Value"
  141. DisplayMemberBinding="{Binding Path=Value, StringFormat={}{0:F2}}" />
  142. </GridView>
  143. </ListView.View>
  144. </ListView>
  145. </TabItem>
  146. </TabControl>
  147. <TabControl Grid.Column="3" Margin="10,0,0,0" Visibility="{Binding AOVisibility}">
  148. <TabItem Header="AO">
  149. <ListView ItemsSource="{Binding Path=AOs}" IsEnabled="{Binding IsPermission}"
  150. Grid.Column="1" MaxHeight="730"
  151. AlternationCount="2"
  152. VerticalAlignment="Top"
  153. Name="AOListView">
  154. <ListView.View>
  155. <GridView>
  156. <GridViewColumn Width="50"
  157. Header="Index"
  158. DisplayMemberBinding="{Binding Path=Index}" />
  159. <GridViewColumn Width="200" Header="Name">
  160. <GridViewColumn.CellTemplate>
  161. <DataTemplate>
  162. <TextBlock Text="{Binding DisplayName, Converter={StaticResource DisplayConverter}}" />
  163. </DataTemplate>
  164. </GridViewColumn.CellTemplate>
  165. </GridViewColumn>
  166. <GridViewColumn Width="0"
  167. Header="Address"
  168. DisplayMemberBinding="{Binding Path=Address}" />
  169. <GridViewColumn Width="90"
  170. Header="Value"
  171. DisplayMemberBinding="{Binding Path=Value, StringFormat={}{0:F2}}" />
  172. <GridViewColumn Width="100" Header="New Value">
  173. <GridViewColumn.CellTemplate>
  174. <DataTemplate >
  175. <controls:TextBoxEx Text="{Binding Path=NewValue}" Width="90"/>
  176. </DataTemplate>
  177. </GridViewColumn.CellTemplate>
  178. </GridViewColumn>
  179. <GridViewColumn Width="75" Header="Operation">
  180. <GridViewColumn.CellTemplate>
  181. <DataTemplate >
  182. <Button Content="Set" FontSize="12" Height="22" Width="45">
  183. <i:Interaction.Triggers>
  184. <i:EventTrigger EventName="Click">
  185. <micro:ActionMessage MethodName="SetAO">
  186. <micro:Parameter Value="{Binding }" />
  187. </micro:ActionMessage>
  188. </i:EventTrigger>
  189. </i:Interaction.Triggers>
  190. </Button>
  191. </DataTemplate>
  192. </GridViewColumn.CellTemplate>
  193. </GridViewColumn>
  194. </GridView>
  195. </ListView.View>
  196. </ListView>
  197. </TabItem>
  198. </TabControl>
  199. </Grid>
  200. </ScrollViewer>
  201. </UserControl>