PartialPressureView.xaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <UserControl x:Class="Venus_MainPages.Views.PartialPressureView"
  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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
  7. xmlns:local="clr-namespace:Venus_MainPages.Views"
  8. xmlns:prism="http://prismlibrary.com/"
  9. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  10. prism:ViewModelLocator.AutoWireViewModel="True"
  11. xmlns:unity="clr-namespace:Venus_MainPages.Unity"
  12. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  13. xmlns:customControls="clr-namespace:Venus_Themes.CustomControls;assembly=Venus_Themes"
  14. mc:Ignorable="d"
  15. d:DesignHeight="450" d:DesignWidth="800">
  16. <i:Interaction.Triggers>
  17. <i:EventTrigger EventName="Loaded">
  18. <i:InvokeCommandAction Command="{Binding LoadCommand}"/>
  19. </i:EventTrigger>
  20. </i:Interaction.Triggers>
  21. <UserControl.Resources>
  22. <sys:String x:Key="Module">PMA</sys:String>
  23. </UserControl.Resources>
  24. <Grid>
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="*"/>
  27. <ColumnDefinition Width="2*" />
  28. <ColumnDefinition Width="6*"/>
  29. </Grid.ColumnDefinitions>
  30. <Canvas>
  31. <TextBlock Text="Flow Time:" Canvas.Left="10" Canvas.Top="120" FontSize="15"/>
  32. <TextBox FontSize="15" Canvas.Left="92" Canvas.Top="120" Width="80" Text="{Binding GasTime,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0,0,0,1" Background="Transparent" BorderBrush="Black" HorizontalContentAlignment="Center"/>
  33. <TextBlock FontSize="15" Canvas.Left="176" Canvas.Top="120" Text="(s)"/>
  34. <TextBlock Text="Gas Name:" Canvas.Left="10" Canvas.Top="160" FontSize="15"/>
  35. <TextBlock Text="{Binding GasName}" Canvas.Left="90" Canvas.Top="160" FontSize="15"/>
  36. <RadioButton Content="Gas1" Canvas.Left="20" Canvas.Top="200" FontSize="15" IsChecked="True">
  37. <i:Interaction.Triggers>
  38. <i:EventTrigger EventName="Checked">
  39. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  40. CommandParameter="1"/>
  41. </i:EventTrigger>
  42. </i:Interaction.Triggers>
  43. </RadioButton>
  44. <RadioButton Content="Gas2" Canvas.Left="20" Canvas.Top="240" FontSize="15">
  45. <i:Interaction.Triggers>
  46. <i:EventTrigger EventName="Checked">
  47. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  48. CommandParameter="2"/>
  49. </i:EventTrigger>
  50. </i:Interaction.Triggers>
  51. </RadioButton>
  52. <RadioButton Content="Gas3" Canvas.Left="20" Canvas.Top="280" FontSize="15">
  53. <i:Interaction.Triggers>
  54. <i:EventTrigger EventName="Checked">
  55. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  56. CommandParameter="3"/>
  57. </i:EventTrigger>
  58. </i:Interaction.Triggers>
  59. </RadioButton>
  60. <RadioButton Content="Gas4" Canvas.Left="20" Canvas.Top="320" FontSize="15">
  61. <i:Interaction.Triggers>
  62. <i:EventTrigger EventName="Checked">
  63. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  64. CommandParameter="4"/>
  65. </i:EventTrigger>
  66. </i:Interaction.Triggers>
  67. </RadioButton>
  68. <RadioButton Content="Gas5" Canvas.Left="20" Canvas.Top="360" FontSize="15">
  69. <i:Interaction.Triggers>
  70. <i:EventTrigger EventName="Checked">
  71. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  72. CommandParameter="5"/>
  73. </i:EventTrigger>
  74. </i:Interaction.Triggers>
  75. </RadioButton>
  76. <RadioButton Content="Gas6" Canvas.Left="20" Canvas.Top="400" FontSize="15">
  77. <i:Interaction.Triggers>
  78. <i:EventTrigger EventName="Checked">
  79. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  80. CommandParameter="6"/>
  81. </i:EventTrigger>
  82. </i:Interaction.Triggers>
  83. </RadioButton>
  84. <RadioButton Content="Gas7" Canvas.Left="20" Canvas.Top="440" FontSize="15" >
  85. <i:Interaction.Triggers>
  86. <i:EventTrigger EventName="Checked">
  87. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  88. CommandParameter="7"/>
  89. </i:EventTrigger>
  90. </i:Interaction.Triggers>
  91. </RadioButton>
  92. <RadioButton Content="Gas8" Canvas.Left="20" Canvas.Top="480" FontSize="15">
  93. <i:Interaction.Triggers>
  94. <i:EventTrigger EventName="Checked">
  95. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  96. CommandParameter="8"/>
  97. </i:EventTrigger>
  98. </i:Interaction.Triggers>
  99. </RadioButton>
  100. <RadioButton Content="Gas9" Canvas.Left="20" Canvas.Top="520" FontSize="15" Visibility="{Binding MFC9IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
  101. <i:Interaction.Triggers>
  102. <i:EventTrigger EventName="Checked">
  103. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  104. CommandParameter="9"/>
  105. </i:EventTrigger>
  106. </i:Interaction.Triggers>
  107. </RadioButton>
  108. <RadioButton Content="Gas10" Canvas.Left="20" Canvas.Top="560" FontSize="15" Visibility="{Binding MFC10IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
  109. <i:Interaction.Triggers>
  110. <i:EventTrigger EventName="Checked">
  111. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  112. CommandParameter="10"/>
  113. </i:EventTrigger>
  114. </i:Interaction.Triggers>
  115. </RadioButton>
  116. <RadioButton Content="Gas11" Canvas.Left="20" Canvas.Top="600" FontSize="15" Visibility="{Binding MFC11IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
  117. <i:Interaction.Triggers>
  118. <i:EventTrigger EventName="Checked">
  119. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  120. CommandParameter="11"/>
  121. </i:EventTrigger>
  122. </i:Interaction.Triggers>
  123. </RadioButton>
  124. <RadioButton Content="Gas12" Canvas.Left="20" Canvas.Top="640" FontSize="15" Visibility="{Binding MFC12IsEnable,Converter={StaticResource bool2VisibilityConverter}}">
  125. <i:Interaction.Triggers>
  126. <i:EventTrigger EventName="Checked">
  127. <i:InvokeCommandAction Command="{Binding SelectGasCommand}"
  128. CommandParameter="12"/>
  129. </i:EventTrigger>
  130. </i:Interaction.Triggers>
  131. </RadioButton>
  132. <customControls:PathButton Content="Start" Canvas.Left="10" Canvas.Top="700" Width="90" Height="25" Command="{Binding StartCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
  133. <customControls:PathButton Content="Abort" Canvas.Left="110" Canvas.Top="700" Width="90" Height="25" Command="{Binding AbortCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
  134. </Canvas>
  135. <Canvas Grid.Column="1">
  136. <TextBlock Text="Test Result:" FontSize="15" FontWeight="Bold" Canvas.Left="10" Canvas.Top="160"/>
  137. <Grid Canvas.Left="10" Canvas.Top="200" Height="440" unity:GridOptions.ShowBorder="True" unity:GridOptions.LineBrush="#D8DEE5" Width="400" Background="WhiteSmoke">
  138. <Grid.ColumnDefinitions>
  139. <ColumnDefinition/>
  140. <ColumnDefinition Width="2*"/>
  141. <ColumnDefinition/>
  142. <ColumnDefinition Width="2*"/>
  143. </Grid.ColumnDefinitions>
  144. <Grid.RowDefinitions>
  145. <RowDefinition Height="33.846"/>
  146. <RowDefinition/>
  147. <RowDefinition Height="33.846"/>
  148. <RowDefinition/>
  149. <RowDefinition/>
  150. <RowDefinition/>
  151. <RowDefinition/>
  152. <RowDefinition/>
  153. <RowDefinition/>
  154. <RowDefinition/>
  155. <RowDefinition/>
  156. <RowDefinition/>
  157. <RowDefinition/>
  158. </Grid.RowDefinitions>
  159. <TextBlock Text="Current" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  160. <TextBlock Text="Reference" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  161. <TextBlock Text="Flow" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  162. <TextBlock Text="Pressure" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  163. <TextBlock Text="Flow" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  164. <TextBlock Text="Pressure" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  165. <TextBlock Text="{Binding Path=GasFlows[0], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  166. <TextBlock Text="{Binding Path=GasFlows[1], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  167. <TextBlock Text="{Binding Path=GasFlows[2], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  168. <TextBlock Text="{Binding Path=GasFlows[3], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="5" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  169. <TextBlock Text="{Binding Path=GasFlows[4], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="6" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  170. <TextBlock Text="{Binding Path=GasFlows[5], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="7" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  171. <TextBlock Text="{Binding Path=GasFlows[6], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  172. <TextBlock Text="{Binding Path=GasFlows[7], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="9" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  173. <TextBlock Text="{Binding Path=GasFlows[8], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="10" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  174. <TextBlock Text="{Binding Path=GasFlows[9], Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Grid.Row="11" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  175. <TextBlock Text="{Binding CurrentLineSeries[0]}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  176. <TextBlock Text="{Binding CurrentLineSeries[1]}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  177. <TextBlock Text="{Binding CurrentLineSeries[2]}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  178. <TextBlock Text="{Binding CurrentLineSeries[3]}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  179. <TextBlock Text="{Binding CurrentLineSeries[4]}" Grid.Row="6" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  180. <TextBlock Text="{Binding CurrentLineSeries[5]}" Grid.Row="7" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  181. <TextBlock Text="{Binding CurrentLineSeries[6]}" Grid.Row="8" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  182. <TextBlock Text="{Binding CurrentLineSeries[7]}" Grid.Row="9" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  183. <TextBlock Text="{Binding CurrentLineSeries[8]}" Grid.Row="10" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  184. <TextBlock Text="{Binding CurrentLineSeries[9]}" Grid.Row="11" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  185. <TextBlock Text="{Binding ReferenceFlow[0], Mode=TwoWay}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  186. <TextBlock Text="{Binding ReferenceFlow[1], Mode=TwoWay}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  187. <TextBlock Text="{Binding ReferenceFlow[2], Mode=TwoWay}" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  188. <TextBlock Text="{Binding ReferenceFlow[3], Mode=TwoWay}" Grid.Row="5" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  189. <TextBlock Text="{Binding ReferenceFlow[4], Mode=TwoWay}" Grid.Row="6" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  190. <TextBlock Text="{Binding ReferenceFlow[5], Mode=TwoWay}" Grid.Row="7" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  191. <TextBlock Text="{Binding ReferenceFlow[6], Mode=TwoWay}" Grid.Row="8" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  192. <TextBlock Text="{Binding ReferenceFlow[7], Mode=TwoWay}" Grid.Row="9" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  193. <TextBlock Text="{Binding ReferenceFlow[8], Mode=TwoWay}" Grid.Row="10" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  194. <TextBlock Text="{Binding ReferenceFlow[9], Mode=TwoWay}" Grid.Row="11" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  195. <TextBlock Text="{Binding ReferenceLineSeries[0]}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  196. <TextBlock Text="{Binding ReferenceLineSeries[1]}" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  197. <TextBlock Text="{Binding ReferenceLineSeries[2]}" Grid.Row="4" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  198. <TextBlock Text="{Binding ReferenceLineSeries[3]}" Grid.Row="5" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  199. <TextBlock Text="{Binding ReferenceLineSeries[4]}" Grid.Row="6" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  200. <TextBlock Text="{Binding ReferenceLineSeries[5]}" Grid.Row="7" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  201. <TextBlock Text="{Binding ReferenceLineSeries[6]}" Grid.Row="8" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  202. <TextBlock Text="{Binding ReferenceLineSeries[7]}" Grid.Row="9" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  203. <TextBlock Text="{Binding ReferenceLineSeries[8]}" Grid.Row="10" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  204. <TextBlock Text="{Binding ReferenceLineSeries[9]}" Grid.Row="11" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  205. </Grid>
  206. <customControls:PathButton Content="Save" Canvas.Left="10" Canvas.Top="700" Width="100" Height="26" Command="{Binding SaveCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
  207. <customControls:PathButton Content="Compare" Canvas.Left="310" Canvas.Top="700" Width="100" Height="26" Command="{Binding LoadReferenceCommand}" IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>
  208. </Canvas>
  209. <Grid Grid.Column="2">
  210. <lvc:CartesianChart LegendLocation="Right" Hoverable="True" DataTooltip="{x:Null}" Grid.Row="1" Height="700" >
  211. <lvc:CartesianChart.Series>
  212. <lvc:LineSeries Title="Current" Width="1" Values="{Binding CurrentLineSeries}" Fill="Transparent" LineSmoothness="0" PointGeometry="{x:Null}" />
  213. <lvc:LineSeries Title="Reference" Width="1" Values="{Binding ReferenceLineSeries}" Fill="Transparent" LineSmoothness="0" PointGeometry="{x:Null}"/>
  214. </lvc:CartesianChart.Series>
  215. <lvc:CartesianChart.AxisX>
  216. <lvc:Axis Title="SetPoint(%)" Labels="10%,20%,30%,40%,50%,60%,70%,80%,90%,100%" FontSize="15" Foreground="Black">
  217. <lvc:Axis.Separator>
  218. <lvc:Separator Step="1"/>
  219. </lvc:Axis.Separator>
  220. </lvc:Axis>
  221. </lvc:CartesianChart.AxisX>
  222. <lvc:CartesianChart.AxisY>
  223. <lvc:Axis Title="{Binding PressureType, StringFormat=Pressure({0})}" FontSize="15" Foreground="Black">
  224. </lvc:Axis>
  225. </lvc:CartesianChart.AxisY>
  226. </lvc:CartesianChart>
  227. </Grid>
  228. </Grid>
  229. </UserControl>