RFCalibrationView.xaml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <UserControl x:Class="VirgoUI.Client.Models.PMs.RFCalibrationView"
  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:controls="http://OpenSEMI.Ctrlib.com/presentation"
  9. xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
  10. xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
  11. xmlns:converter="clr-namespace:VirgoUI.Client.Models.Converter"
  12. mc:Ignorable="d"
  13. d:DesignHeight="450" d:DesignWidth="1920">
  14. <UserControl.Resources>
  15. <converter:Bool2Not x:Key="Bool2Not"/>
  16. </UserControl.Resources>
  17. <Grid>
  18. <Grid.ColumnDefinitions>
  19. <ColumnDefinition Width="300"/>
  20. <ColumnDefinition Width="900"/>
  21. <ColumnDefinition Width="600"/>
  22. </Grid.ColumnDefinitions>
  23. <DataGrid Grid.Column="0" HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
  24. VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
  25. SelectedItem="{Binding CurrentSelection}"
  26. ItemsSource="{Binding CalibrationItems}" Margin="0,5,0,0" >
  27. <DataGrid.Columns>
  28. <DataGridTemplateColumn Header="Name" Width="280">
  29. <DataGridTemplateColumn.CellTemplate>
  30. <DataTemplate>
  31. <TextBlock Text="{Binding DisplayName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
  32. </TextBlock>
  33. </DataTemplate>
  34. </DataGridTemplateColumn.CellTemplate>
  35. </DataGridTemplateColumn>
  36. </DataGrid.Columns>
  37. </DataGrid>
  38. <Grid Grid.Column="1">
  39. <Grid.RowDefinitions>
  40. <RowDefinition Height="45"/>
  41. <RowDefinition Height="75"/>
  42. <RowDefinition Height="15"/>
  43. <RowDefinition Height="*"/>
  44. <RowDefinition Height="50"/>
  45. </Grid.RowDefinitions>
  46. <Canvas Grid.Row="0">
  47. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,1,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1" Height="40" Width="120">
  48. <TextBlock Text="Calibration Item" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  49. </Border>
  50. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="1" Padding="5,1" Canvas.Left="120" Height="40" Width="250">
  51. <TextBlock Text="{Binding CurrentSelection.DisplayName}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  52. </Border>
  53. <Button Content="Save" Grid.Column="1" Width="70" Height="30" Margin="0" Padding="0" Canvas.Left="385" Canvas.Top="4" IsEnabled="{Binding IsSaveEnable}" >
  54. <i:Interaction.Triggers>
  55. <i:EventTrigger EventName="Click">
  56. <cal:ActionMessage MethodName="Save">
  57. </cal:ActionMessage>
  58. </i:EventTrigger>
  59. </i:Interaction.Triggers>
  60. </Button>
  61. <Button Content="Reload" Grid.Column="1" Width="70" Height="30" Margin="0" Padding="0" Canvas.Left="473" Canvas.Top="4" >
  62. <i:Interaction.Triggers>
  63. <i:EventTrigger EventName="Click">
  64. <cal:ActionMessage MethodName="Reload">
  65. </cal:ActionMessage>
  66. </i:EventTrigger>
  67. </i:Interaction.Triggers>
  68. </Button>
  69. <Button Content="Export" Grid.Column="1" Width="70" Height="30" Padding="0" Canvas.Left="561" Canvas.Top="4" HorizontalAlignment="Left" VerticalAlignment="Center" >
  70. <i:Interaction.Triggers>
  71. <i:EventTrigger EventName="Click">
  72. <cal:ActionMessage MethodName="Export">
  73. </cal:ActionMessage>
  74. </i:EventTrigger>
  75. </i:Interaction.Triggers>
  76. </Button>
  77. <deviceControl:AITRfGenerator DeviceData="{Binding CurrentSelectionRF}" Canvas.Left="662" Canvas.Top="10" HorizontalAlignment="Left" VerticalAlignment="Center" ></deviceControl:AITRfGenerator>
  78. </Canvas>
  79. <Canvas Grid.Row="1">
  80. <Border BorderBrush="{DynamicResource Table_BD}" Background="{DynamicResource Table_BG_Content}" BorderThickness="1,1,1,1" Padding="5,1" >
  81. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5,10">
  82. <Grid>
  83. <Grid.ColumnDefinitions>
  84. <ColumnDefinition Width="140"/>
  85. <ColumnDefinition Width="100"/>
  86. <ColumnDefinition Width="140"/>
  87. <ColumnDefinition Width="100"/>
  88. <ColumnDefinition Width="160"/>
  89. <ColumnDefinition Width="100"/>
  90. </Grid.ColumnDefinitions>
  91. <Grid.RowDefinitions>
  92. <RowDefinition Height="24"/>
  93. <RowDefinition Height="24"/>
  94. </Grid.RowDefinitions>
  95. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Padding="5,1">
  96. <TextBlock Text="RF电源序列号" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  97. </Border>
  98. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="0" Grid.Column="1" Padding="5,1">
  99. <controls:TextBoxEx Text="{Binding Path=GeneratorSerialNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  100. </Border>
  101. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1">
  102. <TextBlock Text="SensorHead序列号" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  103. </Border>
  104. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="1" Padding="5,1">
  105. <controls:TextBoxEx Text="{Binding Path=SensorSerialNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  106. </Border>
  107. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Grid.Column="2" Padding="5,1">
  108. <TextBlock Text="RF Physical Max Power" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  109. </Border>
  110. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="0" Grid.Column="3" Padding="5,1">
  111. <TextBlock Text="{Binding Path=RFPhysicalMaxPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  112. </Border>
  113. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Grid.Column="2" Padding="5,1">
  114. <TextBlock Text="Current RF Max Power" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  115. </Border>
  116. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="3" Padding="5,1">
  117. <TextBlock Text="{Binding Path=CurrentRFMaxPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  118. </Border>
  119. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="0" Grid.Column="4" Padding="5,1">
  120. <TextBlock Text="RF Calibrated Max Power" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  121. </Border>
  122. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="0" Grid.Column="5" Padding="5,1">
  123. <TextBlock Text="{Binding Path=RFCalibratedMaxPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, StringFormat=\{0:F3\}}" VerticalAlignment="Center"/>
  124. </Border>
  125. </Grid>
  126. </StackPanel>
  127. </Border>
  128. </Canvas>
  129. <Canvas Grid.Row="2">
  130. <TextBlock Text="Select All:" Canvas.Left="74" Canvas.Top="0"/>
  131. <CheckBox IsEnabled="{Binding IsSelectedAllEnable,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Left="143" Canvas.Top="3" >
  132. <i:Interaction.Triggers>
  133. <i:EventTrigger EventName="Checked">
  134. <cal:ActionMessage MethodName="SelectedAll">
  135. </cal:ActionMessage>
  136. </i:EventTrigger>
  137. <i:EventTrigger EventName="Unchecked">
  138. <cal:ActionMessage MethodName="UnselectedAll">
  139. </cal:ActionMessage>
  140. </i:EventTrigger>
  141. </i:Interaction.Triggers>
  142. </CheckBox>
  143. </Canvas>
  144. <DataGrid Name="TableData" Grid.Row="3" HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0" Focusable="True"
  145. VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
  146. ItemsSource="{Binding TableData}" SelectedIndex="{Binding TableDataSelectedIndex,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}" Margin="0,5,0,0" >
  147. <DataGrid.Columns >
  148. <DataGridTemplateColumn Header="SetPoint" Width="100">
  149. <DataGridTemplateColumn.CellTemplate>
  150. <DataTemplate>
  151. <controls:TextBoxEx IsEnabled="{Binding SetPointEnable,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Text="{Binding SetPoint,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" MinValue="-999999" MaxValue="999999" EditBoxMode="Decimal" Width="80" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
  152. </controls:TextBoxEx>
  153. </DataTemplate>
  154. </DataGridTemplateColumn.CellTemplate>
  155. </DataGridTemplateColumn>
  156. <DataGridTemplateColumn Header="Selected" Width="70">
  157. <DataGridTemplateColumn.CellTemplate>
  158. <DataTemplate>
  159. <CheckBox IsEnabled="{Binding IsSelectedEnable,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
  160. </CheckBox>
  161. </DataTemplate>
  162. </DataGridTemplateColumn.CellTemplate>
  163. </DataGridTemplateColumn>
  164. <DataGridTemplateColumn Header="Forward Power (UI)" Width="200">
  165. <DataGridTemplateColumn.CellTemplate>
  166. <DataTemplate>
  167. <TextBlock Text="{Binding ForwardPowerUI,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="180" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" >
  168. </TextBlock>
  169. </DataTemplate>
  170. </DataGridTemplateColumn.CellTemplate>
  171. </DataGridTemplateColumn>
  172. <DataGridTemplateColumn Header="Forward Power (Meter)" Width="200">
  173. <DataGridTemplateColumn.CellTemplate>
  174. <DataTemplate>
  175. <controls:TextBoxEx Text="{Binding ForwardPowerMeter,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" MinValue="-999999" MaxValue="999999" EditBoxMode="Decimal" Width="180" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
  176. </controls:TextBoxEx>
  177. </DataTemplate>
  178. </DataGridTemplateColumn.CellTemplate>
  179. </DataGridTemplateColumn>
  180. <DataGridTemplateColumn Header="Reflected Power (Meter)" Width="200">
  181. <DataGridTemplateColumn.CellTemplate>
  182. <DataTemplate>
  183. <controls:TextBoxEx Text="{Binding ReflectedPower,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" MinValue="-999999" MaxValue="999999" EditBoxMode="Decimal" Width="180" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" >
  184. </controls:TextBoxEx>
  185. </DataTemplate>
  186. </DataGridTemplateColumn.CellTemplate>
  187. </DataGridTemplateColumn>
  188. <DataGridTemplateColumn Header="%Difference" Width="100">
  189. <DataGridTemplateColumn.CellTemplate>
  190. <DataTemplate>
  191. <Border Background="{Binding DifferenceBackground,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
  192. <TextBlock Text="{Binding Difference,Mode=OneWay,UpdateSourceTrigger=PropertyChanged, StringFormat=\{0:F3\}}" FontSize="14" Height="25" HorizontalAlignment="Center" TextAlignment="Center"/>
  193. </Border>
  194. </DataTemplate>
  195. </DataGridTemplateColumn.CellTemplate>
  196. </DataGridTemplateColumn>
  197. </DataGrid.Columns>
  198. </DataGrid>
  199. <Canvas Grid.Row="4">
  200. <StackPanel Orientation="Horizontal" IsEnabled="{Binding SystemInManual}">
  201. <Button Content="Start" Width="70" Height="30" Margin="10" Padding="0" Focusable="False">
  202. <i:Interaction.Triggers>
  203. <i:EventTrigger EventName="Click">
  204. <cal:ActionMessage MethodName="Start">
  205. </cal:ActionMessage>
  206. </i:EventTrigger>
  207. </i:Interaction.Triggers>
  208. </Button>
  209. <Button Content="Next" Width="70" Height="30" Margin="10" Padding="0" Focusable="False" IsEnabled="{Binding IsNextEnable}">
  210. <i:Interaction.Triggers>
  211. <i:EventTrigger EventName="Click">
  212. <cal:ActionMessage MethodName="Next">
  213. </cal:ActionMessage>
  214. </i:EventTrigger>
  215. </i:Interaction.Triggers>
  216. </Button>
  217. <Button Content="End" Width="70" Height="30" Margin="10" Padding="0">
  218. <i:Interaction.Triggers>
  219. <i:EventTrigger EventName="Click">
  220. <cal:ActionMessage MethodName="End">
  221. </cal:ActionMessage>
  222. </i:EventTrigger>
  223. </i:Interaction.Triggers>
  224. </Button>
  225. </StackPanel>
  226. </Canvas>
  227. </Grid>
  228. <Grid Grid.Column="2" Grid.Row="0" Margin="5,0,0,0">
  229. <s:SciChartSurface Name="sciChart" RenderableSeries="{Binding RenderableSeries}"
  230. s:ThemeManager.Theme="ExpressionLight"
  231. Padding="0,0,0,0"
  232. DebugWhyDoesntSciChartRender="False" BorderBrush="Gray" Focusable="False" IsTabStop="False">
  233. <!-- Create an X Axis -->
  234. <s:SciChartSurface.XAxis>
  235. <s:NumericAxis DrawMinorTicks="False" AxisTitle="SetPoint"
  236. DrawMinorGridLines="True"
  237. Margin="0,0,0,0"
  238. TitleFontSize="15"
  239. FontSize="20"
  240. MajorDelta="0.1"
  241. MinorDelta="0.1" DrawMajorBands="True" Focusable="False"
  242. BorderThickness="0"
  243. AutoRange="Always" DrawLabels="True" DrawMajorGridLines="True" DrawMajorTicks="False"
  244. Id="DefaultAxisId" TitleFontWeight="Normal" >
  245. <s:NumericAxis.GrowBy>
  246. <s:DoubleRange Min="0.1" Max="0.1"/>
  247. </s:NumericAxis.GrowBy>
  248. </s:NumericAxis>
  249. </s:SciChartSurface.XAxis>
  250. <!-- Create a Y Axis -->
  251. <s:SciChartSurface.YAxis>
  252. <s:NumericAxis DrawMinorTicks="False" AxisTitle="Actual Forward Power"
  253. DrawMinorGridLines="False"
  254. AxisAlignment="Left"
  255. MinWidth="50" MaxWidth="50"
  256. HorizontalAlignment="Center"
  257. CursorTextFormatting="0.######"
  258. Id="DefaultAxisId" MajorDelta="0.1"
  259. MinorDelta="0.1" DrawMajorBands="False" Focusable="False"
  260. BorderThickness="0" AutoRange="Always"
  261. DrawLabels="True" DrawMajorGridLines="True" DrawMajorTicks="False">
  262. <s:NumericAxis.GrowBy>
  263. <s:DoubleRange Min="0.1" Max="0.1"/>
  264. </s:NumericAxis.GrowBy>
  265. </s:NumericAxis>
  266. </s:SciChartSurface.YAxis>
  267. <s:SciChartSurface.ChartModifier>
  268. <s:ModifierGroup >
  269. <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True"
  270. IsXAxisOnly="False"
  271. ZoomExtentsY="True"
  272. IsAnimated="True" ExecuteOn="MouseLeftButton" ReceiveHandledEvents="True" />
  273. <s:CursorModifier IsEnabled="True" ShowTooltipOn="MouseOver" ShowAxisLabels="True"
  274. SourceMode="AllSeries" ShowTooltip="False" />
  275. <s:LegendModifier ShowLegend="True" GetLegendDataFor="AllSeries" x:Name="legendModifier"/>
  276. <s:ZoomExtentsModifier x:Name="zoomExtentsModifier" XyDirection="XYDirection" ExecuteOn="MouseDoubleClick"/>
  277. <s:ZoomPanModifier x:Name="zoomPanModifier" IsEnabled="True" ClipModeX="None" XyDirection="XYDirection" ExecuteOn="MouseRightButton" ZoomExtentsY="False" />
  278. <s:RolloverModifier x:Name="rolloverModifier"
  279. UseInterpolation="False" FontSize="9" IsEnabled="True"
  280. DrawVerticalLine="False" FontFamily="Arial,SimSun"
  281. SnapsToDevicePixels="False"
  282. ShowAxisLabels="False" />
  283. <s:MouseWheelZoomModifier x:Name="mouseWheelZoomModifier" XyDirection="XYDirection"/>
  284. </s:ModifierGroup>
  285. </s:SciChartSurface.ChartModifier>
  286. </s:SciChartSurface>
  287. </Grid>
  288. </Grid>
  289. </UserControl>