DataView.xaml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <UserControl x:Class="Virgo_DUI.Client.Models.History.DataHistory.DataView"
  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:ctrl="http://OpenSEMI.Ctrlib.com/presentation"
  9. xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
  10. xmlns:visuals="http://schemas.abtsoftware.co.uk/scichart"
  11. xmlns:control="clr-namespace:Aitex.Core.UI.Control;assembly=MECF.Framework.UI.Core"
  12. xmlns:converters="clr-namespace:Aitex.Core.UI.Converters;assembly=MECF.Framework.UI.Core"
  13. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
  14. mc:Ignorable="d"
  15. d:DesignHeight="450" d:DesignWidth="1800">
  16. <UserControl.Resources>
  17. <converters:LineColorConverter x:Key="colorConverter"/>
  18. </UserControl.Resources>
  19. <Grid>
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="400" ></ColumnDefinition>
  22. <ColumnDefinition Width="Auto" />
  23. <ColumnDefinition ></ColumnDefinition>
  24. </Grid.ColumnDefinitions>
  25. <Grid.RowDefinitions>
  26. <RowDefinition ></RowDefinition>
  27. <RowDefinition Height="200" ></RowDefinition>
  28. </Grid.RowDefinitions>
  29. <Grid Grid.Column="0" Grid.RowSpan="2">
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="80"/>
  32. <RowDefinition Height="0"/>
  33. <RowDefinition />
  34. </Grid.RowDefinitions>
  35. <Border Grid.Row="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
  36. <StackPanel Orientation="Horizontal">
  37. <StackPanel Margin="0,5" Width="290">
  38. <StackPanel Orientation="Horizontal">
  39. <TextBlock Text="Start Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  40. <xctk:DateTimePicker Format="Custom" FontSize="14"
  41. FormatString="yyyy/MM/dd HH:mm:ss"
  42. TimeFormat="Custom"
  43. AutoCloseCalendar="True"
  44. TimeFormatString="HH:mm:ss"
  45. Grid.Row="0" VerticalAlignment="Top"
  46. Value="{Binding Path=StartDateTime, Mode=TwoWay}" Height="30" Width="172" />
  47. </StackPanel>
  48. <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
  49. <TextBlock Text="End Time" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center"/>
  50. <xctk:DateTimePicker Format="Custom" FontSize="14"
  51. FormatString="yyyy/MM/dd HH:mm:ss"
  52. TimeFormat="Custom"
  53. AutoCloseCalendar="True"
  54. TimeFormatString="HH:mm:ss"
  55. Grid.Row="0" VerticalAlignment="Top"
  56. Value="{Binding Path=EndDateTime, Mode=TwoWay}" Height="30" Width="172" />
  57. </StackPanel>
  58. <!--<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
  59. <TextBlock Text="Module" Width="70" FontFamily="Arial" FontSize="14" VerticalAlignment="Center" TextAlignment="Left"/>
  60. <xctk:CheckComboBox x:Name="tbModule" ItemsSource="{Binding SourceModule}" Width="172"
  61. FontFamily="Arial" FontSize="14" Height="25"
  62. HorizontalAlignment="Center"
  63. VerticalAlignment="Center"
  64. SelectedValue="{Binding SelectedValueModule}" >
  65. </xctk:CheckComboBox>
  66. </StackPanel>-->
  67. </StackPanel>
  68. <Button Content="Query" Margin="0,0,5,0" HorizontalAlignment="Right" Width="80" Height="60">
  69. <i:Interaction.Triggers>
  70. <i:EventTrigger EventName="Click">
  71. <cal:ActionMessage MethodName="Query"/>
  72. </i:EventTrigger>
  73. </i:Interaction.Triggers>
  74. </Button>
  75. </StackPanel>
  76. </Border>
  77. <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10">
  78. <Button Content="Preset Selection" Margin="60,0,5,0" Width="100" Height="30">
  79. <i:Interaction.Triggers>
  80. <i:EventTrigger EventName="Click">
  81. <cal:ActionMessage MethodName="Preset"/>
  82. </i:EventTrigger>
  83. </i:Interaction.Triggers>
  84. </Button>
  85. <Button Content="Clear Selection" Width="100">
  86. <i:Interaction.Triggers>
  87. <i:EventTrigger EventName="Click">
  88. <cal:ActionMessage MethodName="Clear"/>
  89. </i:EventTrigger>
  90. </i:Interaction.Triggers>
  91. </Button>
  92. </StackPanel>
  93. <Border Grid.Row="2" BorderBrush="{DynamicResource Tab_BD}" BorderThickness="1" SnapsToDevicePixels="True" Background="{DynamicResource Tab_BG}" Padding="12">
  94. <TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ParameterNodes}">
  95. <!--<i:Interaction.Triggers>
  96. <i:EventTrigger EventName="TreeView.SelectedItemChanged">
  97. <cal:ActionMessage MethodName="OnTreeSelectedChanged">
  98. <cal:Parameter Value="{Binding ElementName=ParameterTreeView,Path=SelectedItem}"></cal:Parameter>
  99. </cal:ActionMessage>
  100. </i:EventTrigger>
  101. </i:Interaction.Triggers>-->
  102. <TreeView.ItemTemplate>
  103. <HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
  104. <StackPanel Orientation="Horizontal">
  105. <CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
  106. <i:Interaction.Triggers>
  107. <i:EventTrigger EventName="Click">
  108. <cal:ActionMessage MethodName="ParameterCheck">
  109. <cal:Parameter Value="{Binding }"/>
  110. </cal:ActionMessage>
  111. </i:EventTrigger>
  112. </i:Interaction.Triggers>
  113. </CheckBox>
  114. <TextBlock Text="{Binding Name}" />
  115. </StackPanel>
  116. </HierarchicalDataTemplate>
  117. </TreeView.ItemTemplate>
  118. </TreeView>
  119. </Border>
  120. </Grid>
  121. <GridSplitter Grid.Row="0" Grid.RowSpan="2" Grid.Column="1" Background="LightBlue"
  122. HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="5" Margin="0,0,2,0">
  123. </GridSplitter>
  124. <!--data chart-->
  125. <Grid Grid.Column="2" Grid.Row="0" Margin="5,0,0,0">
  126. <s:SciChartSurface Name="sciChart" RenderableSeries="{Binding SelectedData}"
  127. s:ThemeManager.Theme="ExpressionLight"
  128. Padding="0,0,0,0"
  129. DebugWhyDoesntSciChartRender="False" BorderBrush="Gray" Focusable="False" IsTabStop="False">
  130. <!-- Create an X Axis -->
  131. <s:SciChartSurface.XAxis>
  132. <s:DateTimeAxis DrawMinorTicks="False"
  133. DrawMinorGridLines="False"
  134. Margin="0,0,0,0"
  135. SubDayTextFormatting="HH:mm:ss"
  136. TitleFontSize="15"
  137. FontSize="20"
  138. AutoRange="{Binding ChartAutoRange}"
  139. VisibleRange="{Binding VisibleRangeTime}"
  140. TextFormatting="HH:mm:ss"
  141. Id="DefaultAxisId" TitleFontWeight="Normal" />
  142. </s:SciChartSurface.XAxis>
  143. <!-- Create a Y Axis -->
  144. <s:SciChartSurface.YAxis>
  145. <s:NumericAxis DrawMinorTicks="False"
  146. DrawMinorGridLines="False"
  147. AxisAlignment="Right"
  148. MinWidth="35" MaxWidth="35"
  149. HorizontalAlignment="Center"
  150. VisibleRange="{Binding VisibleRangeValue}"
  151. Id="DefaultAxisId" MajorDelta="0.1"
  152. MinorDelta="0.1" DrawMajorBands="False" Focusable="False"
  153. BorderThickness="0" AutoRange="{Binding ChartAutoRange}"
  154. DrawLabels="True" DrawMajorGridLines="True" DrawMajorTicks="False">
  155. <s:NumericAxis.GrowBy>
  156. <s:DoubleRange Min="0.1" Max="0.1"/>
  157. </s:NumericAxis.GrowBy>
  158. </s:NumericAxis>
  159. </s:SciChartSurface.YAxis>
  160. <s:SciChartSurface.ChartModifier>
  161. <s:ModifierGroup >
  162. <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True"
  163. IsXAxisOnly="False"
  164. ZoomExtentsY="True"
  165. IsAnimated="True" ExecuteOn="MouseLeftButton" ReceiveHandledEvents="True" />
  166. <s:CursorModifier IsEnabled="True" ShowTooltipOn="MouseOver" ShowAxisLabels="True"
  167. SourceMode="AllSeries" ShowTooltip="False" />
  168. <s:LegendModifier ShowLegend="False" GetLegendDataFor="AllSeries" x:Name="legendModifier"/>
  169. <s:ZoomExtentsModifier x:Name="zoomExtentsModifier" XyDirection="XYDirection" ExecuteOn="MouseDoubleClick"/>
  170. <s:ZoomPanModifier x:Name="zoomPanModifier" IsEnabled="True" ClipModeX="None" XyDirection="XYDirection" ExecuteOn="MouseRightButton" ZoomExtentsY="False" />
  171. <s:RolloverModifier x:Name="rolloverModifier"
  172. UseInterpolation="False" FontSize="9" IsEnabled="True"
  173. DrawVerticalLine="False" FontFamily="Arial,SimSun"
  174. SnapsToDevicePixels="False"
  175. ShowAxisLabels="False" />
  176. <s:MouseWheelZoomModifier x:Name="mouseWheelZoomModifier" XyDirection="XYDirection"/>
  177. </s:ModifierGroup>
  178. </s:SciChartSurface.ChartModifier>
  179. </s:SciChartSurface>
  180. </Grid>
  181. <DataGrid Grid.Column="2" Grid.Row="1" Margin="5,10,0,0"
  182. AlternationCount="2" ColumnHeaderHeight="30"
  183. ItemsSource="{Binding SelectedData}" AutoGenerateColumns="False"
  184. CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="12">
  185. <DataGrid.Columns>
  186. <DataGridTemplateColumn>
  187. <DataGridTemplateColumn.HeaderTemplate >
  188. <DataTemplate>
  189. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  190. <!--<CheckBox Foreground="{DynamicResource FG_White}" VerticalAlignment="Center">
  191. <i:Interaction.Triggers>
  192. <i:EventTrigger EventName="Click">
  193. <cal:ActionMessage MethodName="VisibleCheckAll">
  194. </cal:ActionMessage>
  195. </i:EventTrigger>
  196. </i:Interaction.Triggers>
  197. </CheckBox>-->
  198. <TextBlock Text="Visible" FontFamily="Arial" FontSize="12" VerticalAlignment="Bottom" Margin="3,0,0,0"/>
  199. </StackPanel>
  200. </DataTemplate>
  201. </DataGridTemplateColumn.HeaderTemplate>
  202. <DataGridTemplateColumn.CellTemplate>
  203. <DataTemplate>
  204. <CheckBox IsChecked="{Binding IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
  205. <!--<i:Interaction.Triggers>
  206. <i:EventTrigger EventName="Click">
  207. <cal:ActionMessage MethodName="VisibleCheck">
  208. <cal:Parameter Value="{Binding }"/>
  209. </cal:ActionMessage>
  210. </i:EventTrigger>
  211. </i:Interaction.Triggers>-->
  212. </CheckBox>
  213. </DataTemplate>
  214. </DataGridTemplateColumn.CellTemplate>
  215. </DataGridTemplateColumn>
  216. <DataGridTemplateColumn Header="Name" MinWidth="100">
  217. <DataGridTemplateColumn.CellTemplate>
  218. <DataTemplate>
  219. <TextBlock Text="{Binding DataName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
  220. </DataTemplate>
  221. </DataGridTemplateColumn.CellTemplate>
  222. </DataGridTemplateColumn>
  223. <DataGridTemplateColumn Header="Color" MinWidth="100" >
  224. <DataGridTemplateColumn.CellTemplate>
  225. <DataTemplate>
  226. <Button Style="{DynamicResource Color_Button}" HorizontalAlignment="Stretch" Background="{Binding Stroke, Converter={StaticResource colorConverter}}" Width="50">
  227. <i:Interaction.Triggers>
  228. <i:EventTrigger EventName="Click">
  229. <cal:ActionMessage MethodName="SelectColor">
  230. <cal:Parameter Value="{Binding}" ></cal:Parameter>
  231. </cal:ActionMessage>
  232. </i:EventTrigger>
  233. </i:Interaction.Triggers>
  234. </Button>
  235. </DataTemplate>
  236. </DataGridTemplateColumn.CellTemplate>
  237. </DataGridTemplateColumn>
  238. <DataGridTemplateColumn Header="Factor" MinWidth="100">
  239. <DataGridTemplateColumn.CellTemplate>
  240. <DataTemplate>
  241. <ctrl:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataFactor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" />
  242. <!--<i:Interaction.Triggers>
  243. <i:EventTrigger EventName="LostFocus">
  244. <cal:ActionMessage MethodName="FactorLostFocus">
  245. <cal:Parameter Value="{Binding}" />
  246. </cal:ActionMessage>
  247. </i:EventTrigger>
  248. <i:EventTrigger EventName="KeyDown">
  249. <cal:ActionMessage MethodName="FactorKeyDown">
  250. <cal:Parameter Value="$eventargs" />
  251. <cal:Parameter Value="{Binding}" />
  252. </cal:ActionMessage>
  253. </i:EventTrigger>
  254. </i:Interaction.Triggers>-->
  255. </DataTemplate>
  256. </DataGridTemplateColumn.CellTemplate>
  257. </DataGridTemplateColumn>
  258. <DataGridTemplateColumn Header="Offset" MinWidth="100">
  259. <DataGridTemplateColumn.CellTemplate>
  260. <DataTemplate>
  261. <ctrl:TextBoxEx AllowBackgroundChange="False" Text="{Binding DataOffset, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
  262. <!--<i:Interaction.Triggers>
  263. <i:EventTrigger EventName="LostFocus">
  264. <cal:ActionMessage MethodName="OffsetLostFocus">
  265. <cal:Parameter Value="{Binding}" />
  266. </cal:ActionMessage>
  267. </i:EventTrigger>
  268. <i:EventTrigger EventName="KeyDown">
  269. <cal:ActionMessage MethodName="OffsetKeyDown">
  270. <cal:Parameter Value="$eventargs" />
  271. <cal:Parameter Value="{Binding}" />
  272. </cal:ActionMessage>
  273. </i:EventTrigger>
  274. </i:Interaction.Triggers>-->
  275. </ctrl:TextBoxEx>
  276. </DataTemplate>
  277. </DataGridTemplateColumn.CellTemplate>
  278. </DataGridTemplateColumn>
  279. <DataGridTemplateColumn Header="Width" MinWidth="60">
  280. <DataGridTemplateColumn.CellTemplate>
  281. <DataTemplate>
  282. <ctrl:TextBoxEx AllowBackgroundChange="False" Text="{Binding LineThickness, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="80" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
  283. <!--<i:Interaction.Triggers>
  284. <i:EventTrigger EventName="LostFocus">
  285. <cal:ActionMessage MethodName="WidthLostFocus">
  286. <cal:Parameter Value="{Binding}" />
  287. </cal:ActionMessage>
  288. </i:EventTrigger>
  289. <i:EventTrigger EventName="KeyDown">
  290. <cal:ActionMessage MethodName="WidthKeyDown">
  291. <cal:Parameter Value="$eventargs" />
  292. <cal:Parameter Value="{Binding}" />
  293. </cal:ActionMessage>
  294. </i:EventTrigger>
  295. </i:Interaction.Triggers>-->
  296. </ctrl:TextBoxEx>
  297. </DataTemplate>
  298. </DataGridTemplateColumn.CellTemplate>
  299. </DataGridTemplateColumn>
  300. <DataGridTemplateColumn Width="80">
  301. <DataGridTemplateColumn.HeaderTemplate >
  302. <DataTemplate>
  303. <Button Content="Export All" Width="65" Height="22">
  304. <i:Interaction.Triggers>
  305. <i:EventTrigger EventName="Click">
  306. <cal:ActionMessage MethodName="ExportAll">
  307. </cal:ActionMessage>
  308. </i:EventTrigger>
  309. </i:Interaction.Triggers>
  310. </Button>
  311. </DataTemplate>
  312. </DataGridTemplateColumn.HeaderTemplate>
  313. <DataGridTemplateColumn.CellTemplate>
  314. <DataTemplate>
  315. <Button Content="Export" Width="65" Height="22">
  316. <i:Interaction.Triggers>
  317. <i:EventTrigger EventName="Click">
  318. <cal:ActionMessage MethodName="Export">
  319. <cal:Parameter Value="{Binding }"/>
  320. </cal:ActionMessage>
  321. </i:EventTrigger>
  322. </i:Interaction.Triggers>
  323. </Button>
  324. </DataTemplate>
  325. </DataGridTemplateColumn.CellTemplate>
  326. </DataGridTemplateColumn>
  327. <DataGridTemplateColumn Width="80">
  328. <DataGridTemplateColumn.HeaderTemplate >
  329. <DataTemplate>
  330. <Button Content="Delete All" Width="65" Height="22">
  331. <i:Interaction.Triggers>
  332. <i:EventTrigger EventName="Click">
  333. <cal:ActionMessage MethodName="DeleteAll">
  334. </cal:ActionMessage>
  335. </i:EventTrigger>
  336. </i:Interaction.Triggers>
  337. </Button>
  338. </DataTemplate>
  339. </DataGridTemplateColumn.HeaderTemplate>
  340. <DataGridTemplateColumn.CellTemplate>
  341. <DataTemplate>
  342. <Button Content="Delete" Width="65" Height="22">
  343. <i:Interaction.Triggers>
  344. <i:EventTrigger EventName="Click">
  345. <cal:ActionMessage MethodName="Delete">
  346. <cal:Parameter Value="{Binding }"/>
  347. </cal:ActionMessage>
  348. </i:EventTrigger>
  349. </i:Interaction.Triggers>
  350. </Button>
  351. </DataTemplate>
  352. </DataGridTemplateColumn.CellTemplate>
  353. </DataGridTemplateColumn>
  354. </DataGrid.Columns>
  355. </DataGrid>
  356. </Grid>
  357. </UserControl>