RealTimeView.xaml 23 KB

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