DataHistoryView.xaml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <UserControl x:Class="Venus_MainPages.Views.DataHistoryView"
  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:Venus_MainPages.Views"
  7. mc:Ignorable="d"
  8. xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
  9. xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
  10. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  11. xmlns:prism="http://prismlibrary.com/"
  12. prism:ViewModelLocator.AutoWireViewModel="True"
  13. xmlns:ctrls="clr-namespace:Venus_Themes.UserControls;assembly=Venus_Themes"
  14. d:DesignHeight="450" d:DesignWidth="800" x:Name="dataHistoryView">
  15. <i:Interaction.Triggers>
  16. <i:EventTrigger EventName="Loaded">
  17. <i:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=dataHistoryView}"/>
  18. </i:EventTrigger>
  19. <i:EventTrigger EventName="Unloaded">
  20. <i:InvokeCommandAction Command="{Binding UnLoadCommand}"/>
  21. </i:EventTrigger>
  22. </i:Interaction.Triggers>
  23. <Grid>
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="auto"/>
  26. <ColumnDefinition />
  27. </Grid.ColumnDefinitions>
  28. <Expander ExpandDirection="Left">
  29. <StackPanel>
  30. <StackPanel>
  31. <TextBlock Text="Start Time:" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" Margin="5,0,0,0"/>
  32. <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="250" Height="40" HorizontalAlignment="Left">
  33. <wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
  34. </wfi:WindowsFormsHost>
  35. <TextBlock Text="End Time:" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" Margin="5,0,0,0"/>
  36. <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="250" Height="22" HorizontalAlignment="Left">
  37. <wf:DateTimePicker x:Name="wfTimeTo" Value="2013-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
  38. </wfi:WindowsFormsHost>
  39. <StackPanel Orientation="Horizontal">
  40. <Button x:Name="searchButton" Content="Search" Command="{Binding StartCommand}" Width="80" Height="20" HorizontalAlignment="Left" Margin="5,10,0,0" IsEnabled="{Binding ElementName=TimeDataCheckBox,Path=IsChecked,Converter={StaticResource BoolToBool}}"/>
  41. <Button Content="Clear" Command="{Binding ClearCommand}" Width="80" Height="20" HorizontalAlignment="Left" Margin="5,10,0,0"/>
  42. <Button Content="Export" Command="{Binding ExportCommand}" Width="80" Height="20" Margin="5,10,0,0"/>
  43. </StackPanel>
  44. </StackPanel>
  45. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content}" Padding="5,1" Margin="0 8 0 0">
  46. <TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ParameterNodes}" Canvas.Top="100" Height="450" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling">
  47. <TreeView.ItemTemplate>
  48. <HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
  49. <StackPanel Orientation="Horizontal">
  50. <CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
  51. <i:Interaction.Triggers>
  52. <i:EventTrigger EventName="Click">
  53. <i:InvokeCommandAction Command="{Binding DataContext.ParameterCheckCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeView}}" CommandParameter="{Binding }"/>
  54. </i:EventTrigger>
  55. </i:Interaction.Triggers>
  56. </CheckBox>
  57. <TextBlock Text="{Binding Name}" />
  58. </StackPanel>
  59. </HierarchicalDataTemplate>
  60. </TreeView.ItemTemplate>
  61. </TreeView>
  62. </Border>
  63. <ListBox ItemsSource="{Binding KeyDataObservableCollection}" Margin="2,0,0,0" FontSize="20" Height="200" VerticalAlignment="Bottom">
  64. <ListBox.ItemTemplate>
  65. <DataTemplate>
  66. <StackPanel Orientation="Horizontal">
  67. <TextBlock Text="{Binding Key}" Width="430"/>
  68. <Button Width="42" FontSize="11" Height="20" Background="{Binding Color,UpdateSourceTrigger=PropertyChanged}" Click="OnChangeLineColor" Tag="{Binding UniqueId}"/>
  69. </StackPanel>
  70. </DataTemplate>
  71. </ListBox.ItemTemplate>
  72. </ListBox>
  73. </StackPanel>
  74. </Expander>
  75. <Grid Grid.Column="1">
  76. <Grid.RowDefinitions>
  77. <RowDefinition Height="60"/>
  78. <RowDefinition/>
  79. </Grid.RowDefinitions>
  80. <!--<Border BorderThickness="1" BorderBrush="Black" Margin="50,5,20,5">-->
  81. <StackPanel Orientation="Horizontal">
  82. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="100,25,0,0" Content="AutoX Zoom" x:Name="AutoXCheckBox"/>
  83. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="100,25,0,0" Content="AutoY Zoom" x:Name="AutoYCheckBox"/>
  84. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="100,25,0,0" Content="Show Step" IsChecked="{Binding IsShowStep}"/>
  85. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="10,45,0,0" Content="PMA" IsChecked="{Binding IsPMAChecked}" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  86. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="10,45,0,0" Content="PMB" IsChecked="{Binding IsPMBChecked}" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  87. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="10,45,0,0" Content="PMC" IsChecked="{Binding IsPMCChecked}" Visibility="{Binding PMCIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  88. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="10,45,0,0" Content="PMD" IsChecked="{Binding IsPMDChecked}" Visibility="{Binding PMDIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  89. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="4,-4,0,0" Margin="100,25,0,0" Content="Real-time Data" x:Name="TimeDataCheckBox">
  90. <i:Interaction.Triggers>
  91. <i:EventTrigger EventName="Checked">
  92. <i:InvokeCommandAction Command="{Binding StartRealTimeCommand}" CommandParameter="{Binding ElementName=TimeDataCheckBox}"/>
  93. </i:EventTrigger>
  94. <i:EventTrigger EventName="Unchecked">
  95. <i:InvokeCommandAction Command="{Binding StopRealTimeCommand}"/>
  96. </i:EventTrigger>
  97. </i:Interaction.Triggers>
  98. </CheckBox>
  99. </StackPanel>
  100. <!--</Border>-->
  101. <ctrls:DrawGraphicsControl x:Name="MyDrawGraphicsControl" Grid.Row="1" IsHorizontalNavigationEnabled="{Binding ElementName=AutoXCheckBox,Path=IsChecked}" IsVerticalNavigationEnabled="{Binding ElementName=AutoYCheckBox,Path=IsChecked}" WavePlotOriginX="{Binding ElementName=MinXTextBox,Path=Text}" WavePlotOriginWidth="{Binding ElementName=MaxXTextBox,Path=Text}" WavePlotOriginY="{Binding ElementName=MinYTextBox,Path=Text}" WavePlotOriginHeight="{Binding ElementName=MaxYTextBox,Path=Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" IsHorizontalDateTimeAxis="True" Background="{DynamicResource DataGrid_BG_First}" Margin="5"/>
  102. </Grid>
  103. </Grid>
  104. </UserControl>