Monitor.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <UserControl x:Class="HistoryView.Views.Regions.Monitor"
  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:local="clr-namespace:HistoryView.Views.Regions"
  7. mc:Ignorable="d"
  8. xmlns:prism="http://prismlibrary.com/"
  9. xmlns:controls="clr-namespace:HistoryView.Controls"
  10. xmlns:convert="clr-namespace:HistoryView.Converters"
  11. xmlns:resource="clr-namespace:HistoryView.Resources"
  12. prism:ViewModelLocator.AutoWireViewModel="True"
  13. d:DesignHeight="450" d:DesignWidth="800">
  14. <UserControl.Resources>
  15. <convert:Mini8StatusToBrush x:Key="Mini8Brush"/>
  16. <convert:Mini8StatusToBrushMulti x:Key="Mini8Multi"/>
  17. </UserControl.Resources>
  18. <Border Background="{StaticResource BackgroundDarkColor}">
  19. <Border.Effect>
  20. <DropShadowEffect BlurRadius="20" Color="Black" Opacity="0.6" ShadowDepth="5"/>
  21. </Border.Effect>
  22. <Border Margin="4" Background="{StaticResource BackgroundColor}">
  23. <Grid Margin="0,2,0,0">
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="auto"/>
  26. <RowDefinition />
  27. </Grid.RowDefinitions>
  28. <Expander x:Name="Filter" Panel.ZIndex="1" Margin="16,0" Background="{StaticResource BackgroundColor}" FlowDirection="LeftToRight" Style="{StaticResource ExpanderStyle1}">
  29. <Expander.Header>
  30. <Border Background="{StaticResource LightThemeColor}" Margin="4,0" CornerRadius="4" >
  31. <TextBlock FontSize="14" FontWeight="Bold" Margin="6,2" Text="{DynamicResource DisplaySetting}"/>
  32. </Border>
  33. </Expander.Header>
  34. <Border BorderBrush="{StaticResource DarkBorderColor}" BorderThickness="1">
  35. <Grid Margin="8" >
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="*"/>
  38. <ColumnDefinition Width="8"/>
  39. <ColumnDefinition Width="auto" MinWidth="160"/>
  40. <ColumnDefinition Width="8"/>
  41. <ColumnDefinition Width="auto" MinWidth="160"/>
  42. </Grid.ColumnDefinitions>
  43. <Grid.RowDefinitions>
  44. <RowDefinition Height="auto"/>
  45. <RowDefinition Height="4"/>
  46. <RowDefinition Height="auto"/>
  47. <RowDefinition Height="4"/>
  48. </Grid.RowDefinitions>
  49. <TextBlock FontSize="14" FontWeight="Bold" Margin="4" Text="{DynamicResource Mini8Select}"/>
  50. <Border Grid.Row="2" BorderBrush="{StaticResource DarkBorderColor}" BorderThickness="1" >
  51. <ItemsControl ItemsSource="{Binding Mini8DisplayStatus}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="8">
  52. <ItemsControl.ItemTemplate>
  53. <DataTemplate>
  54. <CheckBox Style="{StaticResource ThemeCheckBox}" Margin="2" IsChecked="{Binding Value.IsDisplay}"
  55. Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.DisplayCommand}"
  56. CommandParameter="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center">
  57. <TextBlock Text="{Binding Key.Name}" />
  58. <CheckBox.Background>
  59. <MultiBinding Converter="{StaticResource Mini8Multi}" ConverterParameter="Bright">
  60. <Binding Path="Key.Status"/>
  61. <Binding Path="Key.IsConnected"/>
  62. </MultiBinding>
  63. </CheckBox.Background>
  64. </CheckBox>
  65. </DataTemplate>
  66. </ItemsControl.ItemTemplate>
  67. <ItemsControl.ItemsPanel>
  68. <ItemsPanelTemplate>
  69. <UniformGrid Rows="2"/>
  70. </ItemsPanelTemplate>
  71. </ItemsControl.ItemsPanel>
  72. </ItemsControl>
  73. </Border>
  74. <TextBlock Grid.Row="0" Grid.Column="2" FontSize="14" FontWeight="Bold" Margin="4" Text="{DynamicResource DisplayMode}"/>
  75. <Border Grid.Row="2" Grid.Column="2" BorderBrush="{StaticResource DarkBorderColor}" BorderThickness="1">
  76. <Grid Margin="8" VerticalAlignment="Center">
  77. <Grid.RowDefinitions>
  78. <RowDefinition Height="auto"/>
  79. <RowDefinition Height="8"/>
  80. <RowDefinition Height="auto"/>
  81. <RowDefinition Height="8"/>
  82. <RowDefinition Height="auto"/>
  83. </Grid.RowDefinitions>
  84. <Button Grid.Row="0" Height="28" Style="{StaticResource FunctionButton}" Command="{Binding DisplayAllCommand}" CommandParameter="All" Content="{DynamicResource DisplayModeAll}"/>
  85. <Button Grid.Row="2" Height="28" Style="{StaticResource FunctionButton}" Command="{Binding DisplayAllCommand}" CommandParameter="Enable" Content="{DynamicResource DisplayModeEnable}"/>
  86. <Button Grid.Row="4" Height="28" Style="{StaticResource FunctionButton}" Command="{Binding DisplayAllCommand}" CommandParameter="Alarm" Content="{DynamicResource DisplayModeError}"/>
  87. </Grid>
  88. </Border>
  89. <TextBlock Grid.Column="4" Grid.Row="0" FontSize="14" FontWeight="Bold" Margin="4" Text="{DynamicResource DisplayChannelMode}"/>
  90. <Border Grid.Column="4" Grid.Row="2" BorderBrush="{StaticResource DarkBorderColor}" BorderThickness="1">
  91. <Grid Margin="8" VerticalAlignment="Center">
  92. <Grid.RowDefinitions>
  93. <RowDefinition Height="auto"/>
  94. <RowDefinition Height="8"/>
  95. <RowDefinition Height="auto"/>
  96. <RowDefinition Height="8"/>
  97. <RowDefinition Height="auto"/>
  98. </Grid.RowDefinitions>
  99. <Button Grid.Row="0" Height="28" Style="{StaticResource FunctionButton}" Command="{Binding ChannelDisplayCommand}" CommandParameter="1" Content="{DynamicResource DisplayChannelModeSingle}"/>
  100. <Button Grid.Row="2" Height="28" Style="{StaticResource FunctionButton}" Command="{Binding ChannelDisplayCommand}" CommandParameter="2" Content="{DynamicResource DisplayChannelDouble}"/>
  101. <Button Grid.Row="4" Height="28" Style="{StaticResource FunctionButton}" Command="{Binding ChannelDisplayCommand}" CommandParameter="4" Content="{DynamicResource DisplayChannelQuad}"/>
  102. </Grid>
  103. </Border>
  104. </Grid>
  105. </Border>
  106. </Expander>
  107. <Border Background="{StaticResource BackgroundColor}" GotFocus="Filter_LostFocus" Margin="0,24,0,0" Grid.Row="0" Grid.RowSpan="3">
  108. <resource:TouchableScrollViewer VerticalScrollBarVisibility="Hidden">
  109. <ItemsControl ItemsSource="{Binding DisplayMini8}">
  110. <ItemsControl.ItemTemplate>
  111. <DataTemplate>
  112. <controls:StatusPlot DataSource="{Binding Key}" Channels="{Binding Value}" Margin="4,4"
  113. Rows="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.Rows}"
  114. EditChannel="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.EditChannelCommand}"
  115. TraceLogCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.TraceLogCommand}"
  116. MultiTraceCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.ViewMultiTraceCommand}"
  117. Reconnect="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.ReconnectCommand}"
  118. MultiSelectCommand="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.MultiSelectCommand}"
  119. User="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:Monitor}, Path=DataContext.User}"
  120. ReconnectParameter="{Binding Key}"/>
  121. </DataTemplate>
  122. </ItemsControl.ItemTemplate>
  123. <ItemsControl.ItemsPanel>
  124. <ItemsPanelTemplate>
  125. <WrapPanel VerticalAlignment="Top" HorizontalAlignment="Center"/>
  126. </ItemsPanelTemplate>
  127. </ItemsControl.ItemsPanel>
  128. </ItemsControl>
  129. </resource:TouchableScrollViewer>
  130. </Border>
  131. </Grid>
  132. </Border>
  133. </Border>
  134. </UserControl>