RealTimeView.xaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Operations.RealTime.RealtimeView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
  5. xmlns:converter="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Converter"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:micro="clr-namespace:Caliburn.Micro"
  10. xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
  11. xmlns:userControls="clr-namespace:MECF.Framework.UI.Client.ClientBase.UserControls"
  12. d:DesignHeight="450"
  13. d:DesignWidth="1800"
  14. mc:Ignorable="d">
  15. <UserControl.Resources>
  16. <converter:BoolReverseConverter x:Key="boolReverseConverter" />
  17. <converter:BoolVisibilityConverter x:Key="boolVisibilityConverter" />
  18. </UserControl.Resources>
  19. <Grid IsEnabled="{Binding IsPermission}">
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="375" />
  22. <ColumnDefinition Width="Auto" />
  23. <ColumnDefinition />
  24. </Grid.ColumnDefinitions>
  25. <Grid.RowDefinitions>
  26. <RowDefinition />
  27. <RowDefinition Height="200" />
  28. </Grid.RowDefinitions>
  29. <Grid Grid.RowSpan="2" Grid.Column="0">
  30. <Border
  31. Padding="5"
  32. Background="{DynamicResource Tab_BG}"
  33. BorderBrush="{DynamicResource Tab_BD}"
  34. BorderThickness="1"
  35. SnapsToDevicePixels="True">
  36. <Grid>
  37. <userControls:ParameterNodeTreeViewControl
  38. x:Name="tvParameterNodes"
  39. IsEnabled="{Binding IsBusy, Converter={StaticResource boolReverseConverter}}"
  40. TreeRoot="{Binding ParameterNodes}"
  41. PresetGroupsFolderName="RealTimeView"/>
  42. </Grid>
  43. </Border>
  44. </Grid>
  45. <GridSplitter
  46. Grid.Row="0"
  47. Grid.RowSpan="2"
  48. Grid.Column="1"
  49. Width="10"
  50. HorizontalAlignment="Left"
  51. VerticalAlignment="Stretch"
  52. Background="Transparent"
  53. Style="{DynamicResource VerticalGridSplitterStyle}" />
  54. <!-- data chart -->
  55. <Grid
  56. Grid.Row="0"
  57. Grid.Column="2"
  58. Margin="0,0,0,0">
  59. <s:SciChartSurface
  60. Name="sciChart"
  61. Padding="2"
  62. s:ThemeManager.Theme="ExpressionDark"
  63. BorderBrush="Gray"
  64. DebugWhyDoesntSciChartRender="False"
  65. Focusable="False"
  66. IsTabStop="False"
  67. RenderableSeries="{Binding SelectedData}">
  68. <!-- Create an X Axis -->
  69. <s:SciChartSurface.XAxis>
  70. <s:DateTimeAxis
  71. Margin="0,0,0,0"
  72. AutoRange="{Binding ChartAutoRange}"
  73. DrawMinorGridLines="False"
  74. DrawMinorTicks="False"
  75. DrawMajorBands="False"
  76. FontSize="20"
  77. Id="DefaultAxisId"
  78. SubDayTextFormatting="HH:mm:ss"
  79. TextFormatting="HH:mm:ss"
  80. TitleFontSize="15"
  81. TitleFontWeight="Normal" />
  82. </s:SciChartSurface.XAxis>
  83. <!-- Create a Y Axis -->
  84. <s:SciChartSurface.YAxis>
  85. <s:NumericAxis
  86. HorizontalAlignment="Center"
  87. AutoRange="{Binding ChartAutoRange}"
  88. AxisAlignment="Right"
  89. BorderThickness="0"
  90. CursorTextFormatting="0.######"
  91. DrawLabels="True"
  92. DrawMajorBands="False"
  93. DrawMajorGridLines="True"
  94. DrawMajorTicks="False"
  95. DrawMinorGridLines="False"
  96. DrawMinorTicks="False"
  97. Focusable="False"
  98. Id="DefaultAxisId"
  99. MajorDelta="0.001"
  100. MinorDelta="0.001">
  101. <s:NumericAxis.GrowBy>
  102. <s:DoubleRange Max="0.001" Min="0.001" />
  103. </s:NumericAxis.GrowBy>
  104. </s:NumericAxis>
  105. </s:SciChartSurface.YAxis>
  106. <s:SciChartSurface.ChartModifier>
  107. <s:ModifierGroup>
  108. <s:RubberBandXyZoomModifier
  109. x:Name="rubberBandZoomModifier"
  110. ExecuteOn="MouseLeftButton"
  111. IsAnimated="True"
  112. IsXAxisOnly="False"
  113. ReceiveHandledEvents="True"
  114. IsEnabled="{Binding Source={x:Reference Name=EnableZoom},Path=IsChecked}"
  115. ZoomExtentsY="False" />
  116. <s:CursorModifier
  117. IsEnabled="True"
  118. ShowAxisLabels="True"
  119. ShowTooltip="False"
  120. ShowTooltipOn="Never"
  121. SourceMode="AllSeries" />
  122. <s:LegendModifier
  123. x:Name="legendModifier"
  124. GetLegendDataFor="AllSeries"
  125. ShowLegend="False" />
  126. <s:ZoomExtentsModifier
  127. x:Name="zoomExtentsModifier"
  128. ExecuteOn="MouseDoubleClick"
  129. XyDirection="XYDirection" />
  130. <s:ZoomPanModifier
  131. x:Name="zoomPanModifier"
  132. ClipModeX="None"
  133. ExecuteOn="MouseLeftButton"
  134. IsEnabled="{Binding Source={x:Reference Name=EnablePan},Path=IsChecked}"
  135. XyDirection="{Binding Source={x:Reference Name=CbDirection},Path=Text}"
  136. ZoomExtentsY="False" />
  137. <s:RolloverModifier
  138. x:Name="rolloverModifier"
  139. DrawVerticalLine="False"
  140. FontFamily="Arial,SimSun"
  141. FontSize="9"
  142. IsEnabled="True"
  143. ShowAxisLabels="False"
  144. SnapsToDevicePixels="False"
  145. UseInterpolation="False" />
  146. <s:MouseWheelZoomModifier x:Name="mouseWheelZoomModifier" XyDirection="{Binding Source={x:Reference Name=CbDirection},Path=Text}" />
  147. <s:SeriesValueModifier />
  148. </s:ModifierGroup>
  149. </s:SciChartSurface.ChartModifier>
  150. </s:SciChartSurface>
  151. <CheckBox Margin="10" VerticalAlignment="Top" Content="Auto Zoom" HorizontalAlignment="Left"
  152. IsChecked="{Binding EnableAutoZoom, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  153. <userControls:FourArrowButton ArrowColor="{StaticResource Button_BG}" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,50,0" IsEnabled="{Binding Source={x:Reference Name=HoldLine},Path=IsChecked}"/>
  154. </Grid>
  155. <StackPanel
  156. Grid.Row="1"
  157. Grid.Column="2"
  158. Orientation="Vertical" Margin="0,5,0,0" HorizontalAlignment="Left">
  159. <StackPanel Orientation="Horizontal">
  160. <RadioButton x:Name="HoldLine" Width="70" Content="Hold" Margin="2" GroupName="operate" IsChecked="{Binding IsHold, Mode=TwoWay}"/>
  161. <RadioButton x:Name="ReleaseLine" Width="70" Content="Release" Margin="2" GroupName="operate"/>
  162. <RadioButton x:Name="EnablePan" Width="70" Content="Pan" Margin="2" IsChecked="{Binding Source={x:Reference Name=HoldLine},Path=IsChecked,Mode=OneWay}" GroupName="zoomPan"/>
  163. <RadioButton x:Name="EnableZoom" Width="70" Content="Zoom" Margin="2" IsEnabled="{Binding Source={x:Reference Name=HoldLine},Path=IsChecked}" GroupName="zoomPan"/>
  164. <ComboBox x:Name="CbDirection" Width="120" IsEditable="False" SelectedIndex="2">
  165. <ComboBoxItem Content="XDirection"/>
  166. <ComboBoxItem Content="YDirection"/>
  167. <ComboBoxItem Content="XYDirection"/>
  168. </ComboBox>
  169. <Button Content="Zoom In" Width="95" Margin="1,2,0,2" IsEnabled="{Binding Source={x:Reference Name=HoldLine},Path=IsChecked}">
  170. <i:Interaction.Triggers>
  171. <i:EventTrigger EventName="Click">
  172. <micro:ActionMessage MethodName="ZoomInClick">
  173. <micro:Parameter Value="{Binding Source={x:Reference Name=CbDirection},Path=SelectedIndex}"/>
  174. </micro:ActionMessage>
  175. </i:EventTrigger>
  176. </i:Interaction.Triggers>
  177. </Button>
  178. <Button Content="Zoom Out" Width="95" Margin="1,2,0,2" IsEnabled="{Binding Source={x:Reference Name=HoldLine},Path=IsChecked}">
  179. <i:Interaction.Triggers>
  180. <i:EventTrigger EventName="Click">
  181. <micro:ActionMessage MethodName="ZoomOutClick">
  182. <micro:Parameter Value="{Binding Source={x:Reference Name=CbDirection},Path=SelectedIndex}"/>
  183. </micro:ActionMessage>
  184. </i:EventTrigger>
  185. </i:Interaction.Triggers>
  186. </Button>
  187. </StackPanel>
  188. <userControls:DataViewDataGrid
  189. x:Name="dataGrid"
  190. Width="1000"
  191. IsShowStatisticColumn="False"
  192. IsEnabled="{Binding IsBusy, Converter={StaticResource boolReverseConverter}}"
  193. ItemsSource="{Binding Path=SelectedData}">
  194. <i:Interaction.Triggers>
  195. <i:EventTrigger EventName="Deleted">
  196. <micro:ActionMessage MethodName="Deleted">
  197. <micro:Parameter Value="$source" />
  198. <micro:Parameter Value="$eventargs" />
  199. </micro:ActionMessage>
  200. </i:EventTrigger>
  201. <i:EventTrigger EventName="Exporting">
  202. <micro:ActionMessage MethodName="Exporting">
  203. <micro:Parameter Value="$source" />
  204. <micro:Parameter Value="$eventargs" />
  205. </micro:ActionMessage>
  206. </i:EventTrigger>
  207. <i:EventTrigger EventName="Exported">
  208. <micro:ActionMessage MethodName="Exported">
  209. <micro:Parameter Value="$source" />
  210. <micro:Parameter Value="$eventargs" />
  211. </micro:ActionMessage>
  212. </i:EventTrigger>
  213. <i:EventTrigger EventName="ProgressMessageUpdating">
  214. <micro:ActionMessage MethodName="ProgressUpdating">
  215. <micro:Parameter Value="$source" />
  216. <micro:Parameter Value="$eventargs" />
  217. </micro:ActionMessage>
  218. </i:EventTrigger>
  219. </i:Interaction.Triggers>
  220. </userControls:DataViewDataGrid>
  221. <!--<Grid Margin="15,10,0,0">
  222. <Grid.RowDefinitions>
  223. <RowDefinition Height="26" />
  224. <RowDefinition Height="35" />
  225. <RowDefinition Height="35" />
  226. </Grid.RowDefinitions>
  227. <Grid.ColumnDefinitions>
  228. <ColumnDefinition Width="100" />
  229. <ColumnDefinition Width="49" />
  230. <ColumnDefinition Width="61" />
  231. <ColumnDefinition Width="120" />
  232. </Grid.ColumnDefinitions>
  233. <Label
  234. Grid.Row="0"
  235. Grid.ColumnSpan="4"
  236. HorizontalContentAlignment="Center"
  237. VerticalContentAlignment="Center"
  238. Content="Trend Chart Setting"
  239. Style="{DynamicResource Table_TitleStyle}" />
  240. <Border
  241. Grid.Row="1"
  242. Padding="5,1"
  243. Background="{DynamicResource Table_BG_Title}"
  244. BorderBrush="{DynamicResource Table_BD}"
  245. BorderThickness="1,0,1,1">
  246. <TextBlock
  247. VerticalAlignment="Center"
  248. FontFamily="Arial"
  249. FontSize="12"
  250. Foreground="{DynamicResource FG_Black}"
  251. Text="Interval (ms)"
  252. TextWrapping="Wrap" />
  253. </Border>
  254. <Border
  255. Grid.Row="1"
  256. Grid.Column="1"
  257. Grid.ColumnSpan="2"
  258. Padding="5,1"
  259. Background="{Binding AlignerStatusBackground}"
  260. BorderBrush="{DynamicResource Table_BD}"
  261. BorderThickness="0,0,1,1">
  262. <controls:TextBoxEx
  263. Width="100"
  264. Height="25"
  265. EditBoxMode="UnSignInteger"
  266. MaxValue="60000"
  267. MinValue="100"
  268. Text="{Binding TrendInterval, Mode=TwoWay}"
  269. TextSaved="{Binding IntervalSaved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  270. Validation.ErrorTemplate="{x:Null}" />
  271. </Border>
  272. <Border
  273. Grid.Row="1"
  274. Grid.Column="3"
  275. Padding="5,1"
  276. Background="{DynamicResource Table_BG_Content}"
  277. BorderBrush="{DynamicResource Table_BD}"
  278. BorderThickness="0,0,1,1">
  279. <Button
  280. Width="70"
  281. Height="25"
  282. Margin="5,0,0,0"
  283. Content="Set">
  284. <i:Interaction.Triggers>
  285. <i:EventTrigger EventName="Click">
  286. <micro:ActionMessage MethodName="SetInterval" />
  287. </i:EventTrigger>
  288. </i:Interaction.Triggers>
  289. </Button>
  290. </Border>
  291. <Border
  292. Grid.Row="2"
  293. Padding="5,1"
  294. Background="{DynamicResource Table_BG_Title}"
  295. BorderBrush="{DynamicResource Table_BD}"
  296. BorderThickness="1,0,1,1">
  297. <TextBlock
  298. VerticalAlignment="Center"
  299. FontFamily="Arial"
  300. FontSize="12"
  301. Foreground="{DynamicResource FG_Black}"
  302. Text="Time Span (s)"
  303. TextWrapping="Wrap" />
  304. </Border>
  305. <Border
  306. Grid.Row="2"
  307. Grid.Column="1"
  308. Grid.ColumnSpan="2"
  309. Padding="5,1"
  310. Background="{Binding AlignerStatusBackground}"
  311. BorderBrush="{DynamicResource Table_BD}"
  312. BorderThickness="0,0,1,1">
  313. <controls:TextBoxEx
  314. Width="100"
  315. Height="25"
  316. EditBoxMode="UnSignInteger"
  317. MaxValue="3600"
  318. MinValue="1"
  319. Text="{Binding TrendTimeSpan, Mode=TwoWay}"
  320. TextSaved="{Binding TimeSpanSaved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  321. Validation.ErrorTemplate="{x:Null}" />
  322. </Border>
  323. <Border
  324. Grid.Row="2"
  325. Grid.Column="3"
  326. Padding="5,1"
  327. Background="{DynamicResource Table_BG_Content}"
  328. BorderBrush="{DynamicResource Table_BD}"
  329. BorderThickness="0,0,1,1">
  330. <Button
  331. Width="70"
  332. Height="25"
  333. Margin="5,0,0,0"
  334. Content="Set">
  335. <i:Interaction.Triggers>
  336. <i:EventTrigger EventName="Click">
  337. <micro:ActionMessage MethodName="SetTimeSpan" />
  338. </i:EventTrigger>
  339. </i:Interaction.Triggers>
  340. </Button>
  341. </Border>
  342. </Grid>-->
  343. </StackPanel>
  344. <userControls:BusyIndicator
  345. Grid.Row="1" Grid.Column="2"
  346. Width="Auto"
  347. Height="Auto"
  348. HorizontalAlignment="Left"
  349. VerticalAlignment="Center"
  350. BorderBrush="Gray"
  351. BorderThickness="3"
  352. Padding="20 10"
  353. Background="{StaticResource Tab_BG}"
  354. Visibility="{Binding IsBusy, Converter={StaticResource boolVisibilityConverter}}"
  355. Message="{Binding BusyIndicatorContent}" Margin="350,0,0,0">
  356. <i:Interaction.Triggers>
  357. <i:EventTrigger EventName="Canceled">
  358. <micro:ActionMessage MethodName="Cancel" />
  359. </i:EventTrigger>
  360. </i:Interaction.Triggers>
  361. </userControls:BusyIndicator>
  362. </Grid>
  363. </UserControl>