SimulatorIOPM2View.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <UserControl x:Class="EfemDualSimulator.Views.SimulatorIOPM2View"
  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:control="clr-namespace:MECF.Framework.UI.Core.Control;assembly=MECF.Framework.UI.Core"
  7. xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
  8. xmlns:toolkit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
  9. xmlns:views="clr-namespace:EfemDualSimulator.Views"
  10. mc:Ignorable="d"
  11. d:DesignHeight="450" d:DesignWidth="1900">
  12. <UserControl.Resources>
  13. <views:BoolBackgroundConverter x:Key="BoolBackgroundConverter"/>
  14. <SolidColorBrush x:Key="DataGrid_Cell_BD" Color="Gray"/>
  15. <Style x:Key="Lamp-Button" TargetType="{x:Type views:IoButton}">
  16. <Setter Property="Width" Value="16"/>
  17. <Setter Property="Height" Value="16"/>
  18. <Setter Property="Template">
  19. <Setter.Value>
  20. <ControlTemplate TargetType="{x:Type views:IoButton}">
  21. <Grid>
  22. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" Content=""/>
  23. <Ellipse Stroke="Gray" StrokeThickness="2"
  24. Fill="DarkGray" />
  25. <Ellipse x:Name="Highlight" Stroke="Gray" StrokeThickness="2"
  26. Fill="Lime" />
  27. </Grid>
  28. <ControlTemplate.Triggers>
  29. <Trigger Property="IsChecked" Value="True">
  30. <Setter Property="Visibility" TargetName="Highlight" Value="Visible"/>
  31. </Trigger>
  32. <Trigger Property="IsChecked" Value="False">
  33. <Setter Property="Visibility" TargetName="Highlight" Value="Collapsed"/>
  34. </Trigger>
  35. <Trigger Property="IsMouseOver" Value="False">
  36. <Setter Property="Opacity" TargetName="Highlight" Value="1"/>
  37. </Trigger>
  38. </ControlTemplate.Triggers>
  39. </ControlTemplate>
  40. </Setter.Value>
  41. </Setter>
  42. </Style>
  43. </UserControl.Resources>
  44. <Grid ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible" >
  45. <Grid.ColumnDefinitions>
  46. <ColumnDefinition Width="480"/>
  47. <ColumnDefinition Width="480"/>
  48. <ColumnDefinition Width="500"/>
  49. <ColumnDefinition Width="480"/>
  50. </Grid.ColumnDefinitions>
  51. <TabControl Grid.Column="0" Margin="20,0,0,0" >
  52. <TabItem Header="DI">
  53. <ListView ItemsSource="{Binding Path=DIs}"
  54. Grid.Column="2"
  55. AlternationCount="2"
  56. VerticalAlignment="Top"
  57. FontSize="12"
  58. Name="DIListView">
  59. <ListView.View>
  60. <GridView>
  61. <GridViewColumn Width="30"
  62. Header="Index"
  63. DisplayMemberBinding="{Binding Path=Index}" />
  64. <GridViewColumn Width="250"
  65. Header="Name"
  66. DisplayMemberBinding="{Binding Path=Name}" />
  67. <GridViewColumn Width="70"
  68. Header="Address"
  69. DisplayMemberBinding="{Binding Path=Address}" />
  70. <GridViewColumn Width="50" Header="Status">
  71. <GridViewColumn.CellTemplate>
  72. <DataTemplate>
  73. <Grid Width="35">
  74. <views:IoButton HorizontalAlignment="Center"
  75. ON="{Binding Path=BoolValue}" Style="{StaticResource Lamp-Button}" IsChecked="{Binding BoolValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  76. >
  77. </views:IoButton>
  78. </Grid>
  79. </DataTemplate>
  80. </GridViewColumn.CellTemplate>
  81. </GridViewColumn>
  82. <GridViewColumn Width="50" Header="Hold">
  83. <GridViewColumn.CellTemplate>
  84. <DataTemplate>
  85. <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
  86. </DataTemplate>
  87. </GridViewColumn.CellTemplate>
  88. </GridViewColumn>
  89. </GridView>
  90. </ListView.View>
  91. </ListView>
  92. </TabItem>
  93. </TabControl>
  94. <TabControl Grid.Column="1" Margin="20,0,0,0">
  95. <TabItem Header="DO">
  96. <ListView ItemsSource="{Binding Path=DOs}"
  97. Grid.Column="3"
  98. AlternationCount="2"
  99. VerticalAlignment="Top"
  100. FontSize="12"
  101. Name="DOListView">
  102. <ListView.View>
  103. <GridView>
  104. <GridViewColumn Width="30"
  105. Header="Index"
  106. DisplayMemberBinding="{Binding Path=Index}" />
  107. <GridViewColumn Width="250"
  108. Header="Name"
  109. DisplayMemberBinding="{Binding Path=Name}" />
  110. <GridViewColumn Width="70"
  111. Header="Address"
  112. DisplayMemberBinding="{Binding Path=Address}" />
  113. <GridViewColumn Width="50" Header="Status">
  114. <GridViewColumn.CellTemplate>
  115. <DataTemplate >
  116. <Grid Width="35">
  117. <views:IoButton HorizontalAlignment="Center"
  118. ON="{Binding Path=BoolValue}" Style="{StaticResource Lamp-Button}" IsChecked="{Binding BoolValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
  119. </views:IoButton>
  120. </Grid>
  121. </DataTemplate>
  122. </GridViewColumn.CellTemplate>
  123. </GridViewColumn>
  124. <GridViewColumn Width="50" Header="Hold">
  125. <GridViewColumn.CellTemplate>
  126. <DataTemplate>
  127. <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
  128. </DataTemplate>
  129. </GridViewColumn.CellTemplate>
  130. </GridViewColumn>
  131. </GridView>
  132. </ListView.View>
  133. </ListView>
  134. </TabItem>
  135. </TabControl>
  136. <TabControl Grid.Column="2" Margin="15,0,0,0">
  137. <TabItem Header="AI">
  138. <ListView ItemsSource="{Binding Path=AIs}"
  139. AlternationCount="2"
  140. Name="AIListView"
  141. FontSize="12"
  142. VerticalAlignment="Top" >
  143. <ListView.View>
  144. <GridView>
  145. <GridViewColumn Width="30"
  146. Header="Index"
  147. DisplayMemberBinding="{Binding Path=Index}" />
  148. <GridViewColumn Width="210"
  149. Header="Name"
  150. DisplayMemberBinding="{Binding Path=Name}" />
  151. <GridViewColumn Width="70"
  152. Header="Address"
  153. DisplayMemberBinding="{Binding Path=Address}" />
  154. <GridViewColumn Width="80" Header="Value">
  155. <GridViewColumn.CellTemplate>
  156. <DataTemplate >
  157. <TextBox Text="{Binding Path=FloatValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Padding="0" Margin="0" Width="60" Height="20"/>
  158. </DataTemplate>
  159. </GridViewColumn.CellTemplate>
  160. </GridViewColumn>
  161. <GridViewColumn Width="50" Header="Hold">
  162. <GridViewColumn.CellTemplate>
  163. <DataTemplate>
  164. <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
  165. </DataTemplate>
  166. </GridViewColumn.CellTemplate>
  167. </GridViewColumn>
  168. </GridView>
  169. </ListView.View>
  170. </ListView>
  171. </TabItem>
  172. </TabControl>
  173. <TabControl Grid.Column="3" Margin="20,0,0,0">
  174. <TabItem Header="AO">
  175. <ListView ItemsSource="{Binding Path=AOs}"
  176. Grid.Column="1"
  177. AlternationCount="2"
  178. FontSize="12"
  179. VerticalAlignment="Top"
  180. Name="AOListView">
  181. <ListView.View>
  182. <GridView>
  183. <GridViewColumn Width="30"
  184. Header="Index"
  185. DisplayMemberBinding="{Binding Path=Index}" />
  186. <GridViewColumn Width="210"
  187. Header="Name"
  188. DisplayMemberBinding="{Binding Path=Name}" />
  189. <GridViewColumn Width="70"
  190. Header="Address"
  191. DisplayMemberBinding="{Binding Path=Address}" />
  192. <GridViewColumn Width="80" Header="Value">
  193. <GridViewColumn.CellTemplate>
  194. <DataTemplate >
  195. <TextBox Text="{Binding Path=FloatValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Padding="0" Margin="0" Height="20" Width="60"/>
  196. </DataTemplate>
  197. </GridViewColumn.CellTemplate>
  198. </GridViewColumn>
  199. <GridViewColumn Width="50" Header="Hold">
  200. <GridViewColumn.CellTemplate>
  201. <DataTemplate>
  202. <CheckBox x:Name="ckHold" IsChecked="{Binding Path=HoldValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="25" Height="25" ></CheckBox>
  203. </DataTemplate>
  204. </GridViewColumn.CellTemplate>
  205. </GridViewColumn>
  206. </GridView>
  207. </ListView.View>
  208. </ListView>
  209. </TabItem>
  210. </TabControl>
  211. </Grid>
  212. </UserControl>