PmIoView.xaml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <UserControl x:Class="VirgoUI.Client.Models.PMs.PmIoView"
  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:cal="http://www.caliburn.org"
  8. xmlns:toolkit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
  9. xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
  10. xmlns:local="clr-namespace:VirgoUI.Client.Models.PMs"
  11. mc:Ignorable="d">
  12. <UserControl.Resources>
  13. <local:DisplayNameConverter x:Key="DisplayConverter" />
  14. </UserControl.Resources>
  15. <Grid ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible">
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="*" />
  18. <ColumnDefinition Width="*" />
  19. <ColumnDefinition Width="*" />
  20. <ColumnDefinition Width="1.2*" />
  21. </Grid.ColumnDefinitions>
  22. <TabControl Grid.Column="0" Margin="5,0,0,0">
  23. <TabItem Header="DI">
  24. <ListView ItemsSource="{Binding Path=DIs}" AlternationCount="2" VerticalAlignment="Top" Name="DIListView">
  25. <ListView.View>
  26. <GridView>
  27. <GridViewColumn Width="30" Header="" DisplayMemberBinding="{Binding Path=Index}" />
  28. <GridViewColumn Width="220" Header="Name">
  29. <GridViewColumn.CellTemplate>
  30. <DataTemplate>
  31. <TextBlock Text="{Binding Name, Converter={StaticResource DisplayConverter}}" FontSize="12px"/>
  32. </DataTemplate>
  33. </GridViewColumn.CellTemplate>
  34. </GridViewColumn>
  35. <!--<GridViewColumn Width="70" Header="Address" DisplayMemberBinding="{Binding Path=Address}" />-->
  36. <GridViewColumn Width="40" Header="Val">
  37. <GridViewColumn.CellTemplate>
  38. <DataTemplate>
  39. <Grid Width="35">
  40. <ctrl:SwitchButton HorizontalAlignment="Center" ON="{Binding Value}" Style="{StaticResource Lamp-Button}"></ctrl:SwitchButton>
  41. </Grid>
  42. </DataTemplate>
  43. </GridViewColumn.CellTemplate>
  44. </GridViewColumn>
  45. </GridView>
  46. </ListView.View>
  47. </ListView>
  48. </TabItem>
  49. </TabControl>
  50. <TabControl Grid.Column="1" Margin="5,0,0,0">
  51. <TabItem Header="DO">
  52. <ListView ItemsSource="{Binding Path=DOs}" AlternationCount="2" VerticalAlignment="Top" Name="DOListView">
  53. <ListView.View>
  54. <GridView>
  55. <GridViewColumn Width="30" Header="" DisplayMemberBinding="{Binding Path=Index}" />
  56. <GridViewColumn Width="200" Header="Name">
  57. <GridViewColumn.CellTemplate>
  58. <DataTemplate>
  59. <TextBlock Text="{Binding Name, Converter={StaticResource DisplayConverter}}" FontSize="12px"/>
  60. </DataTemplate>
  61. </GridViewColumn.CellTemplate>
  62. </GridViewColumn>
  63. <!--<GridViewColumn Width="70" Header="Address" DisplayMemberBinding="{Binding Path=Address}" />-->
  64. <GridViewColumn Width="40" Header="Val">
  65. <GridViewColumn.CellTemplate>
  66. <DataTemplate>
  67. <Grid Width="35">
  68. <ctrl:SwitchButton HorizontalAlignment="Center" ON="{Binding Value}" Style="{StaticResource Lamp-Button}"></ctrl:SwitchButton>
  69. </Grid>
  70. </DataTemplate>
  71. </GridViewColumn.CellTemplate>
  72. </GridViewColumn>
  73. <GridViewColumn Width="40" Header="Set">
  74. <GridViewColumn.CellTemplate>
  75. <DataTemplate>
  76. <Grid Width="35">
  77. <ctrl:SwitchButton ON="{Binding Value}" Style="{StaticResource OperationButton}" HorizontalAlignment="Center">
  78. <i:Interaction.Triggers>
  79. <i:EventTrigger EventName="Click">
  80. <cal:ActionMessage MethodName="SetDO">
  81. <cal:Parameter Value="{Binding }" />
  82. </cal:ActionMessage>
  83. </i:EventTrigger>
  84. </i:Interaction.Triggers>
  85. </ctrl:SwitchButton>
  86. </Grid>
  87. </DataTemplate>
  88. </GridViewColumn.CellTemplate>
  89. </GridViewColumn>
  90. </GridView>
  91. </ListView.View>
  92. </ListView>
  93. </TabItem>
  94. </TabControl>
  95. <TabControl Grid.Column="2" Margin="5,0,0,0">
  96. <TabItem Header="AI">
  97. <ListView ItemsSource="{Binding Path=AIs}" AlternationCount="2" Name="AIListView" VerticalAlignment="Top">
  98. <ListView.View>
  99. <GridView>
  100. <GridViewColumn Width="30" Header="" DisplayMemberBinding="{Binding Path=Index}" />
  101. <GridViewColumn Width="200" Header="Name">
  102. <GridViewColumn.CellTemplate>
  103. <DataTemplate>
  104. <TextBlock Text="{Binding Name, Converter={StaticResource DisplayConverter}}" FontSize="12px"/>
  105. </DataTemplate>
  106. </GridViewColumn.CellTemplate>
  107. </GridViewColumn>
  108. <!--<GridViewColumn Width="70" Header="Address" DisplayMemberBinding="{Binding Path=Address}" />-->
  109. <GridViewColumn Width="80" Header="Value" DisplayMemberBinding="{Binding Path=Value}" />
  110. </GridView>
  111. </ListView.View>
  112. </ListView>
  113. </TabItem>
  114. </TabControl>
  115. <TabControl Grid.Column="3" Margin="5,0,0,0">
  116. <TabItem Header="AO">
  117. <ListView ItemsSource="{Binding Path=AOs}" AlternationCount="2" VerticalAlignment="Top" Name="AOListView">
  118. <ListView.View>
  119. <GridView>
  120. <GridViewColumn Width="30" Header="" DisplayMemberBinding="{Binding Path=Index}" />
  121. <GridViewColumn Width="210" Header="Name">
  122. <GridViewColumn.CellTemplate>
  123. <DataTemplate>
  124. <TextBlock Text="{Binding Name, Converter={StaticResource DisplayConverter}}" FontSize="12px"/>
  125. </DataTemplate>
  126. </GridViewColumn.CellTemplate>
  127. </GridViewColumn>
  128. <!--<GridViewColumn Width="70" Header="Address" DisplayMemberBinding="{Binding Path=Address}" />-->
  129. <GridViewColumn Width="50" Header="Value" DisplayMemberBinding="{Binding Path=Value}" />
  130. <GridViewColumn Width="80" Header="New Value">
  131. <GridViewColumn.CellTemplate>
  132. <DataTemplate>
  133. <toolkit:IntegerUpDown Text="{Binding Path=NewValue}" Width="60" />
  134. </DataTemplate>
  135. </GridViewColumn.CellTemplate>
  136. </GridViewColumn>
  137. <GridViewColumn Width="65" Header="Operation">
  138. <GridViewColumn.CellTemplate>
  139. <DataTemplate>
  140. <Button Content="Set" Height="20" Width="35">
  141. <i:Interaction.Triggers>
  142. <i:EventTrigger EventName="Click">
  143. <cal:ActionMessage MethodName="SetAO">
  144. <cal:Parameter Value="{Binding }" />
  145. </cal:ActionMessage>
  146. </i:EventTrigger>
  147. </i:Interaction.Triggers>
  148. </Button>
  149. </DataTemplate>
  150. </GridViewColumn.CellTemplate>
  151. </GridViewColumn>
  152. </GridView>
  153. </ListView.View>
  154. </ListView>
  155. </TabItem>
  156. </TabControl>
  157. </Grid>
  158. </UserControl>