RandomConfigView.axaml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. <UserControl
  2. x:Class="ShakerApp.Views.RandomConfigView"
  3. xmlns="https://github.com/avaloniaui"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="using:ShakerApp"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:model="using:Shaker.Models"
  9. xmlns:oxy="http://oxyplot.org/avalonia"
  10. xmlns:suki="https://github.com/kikipoulet/SukiUI"
  11. xmlns:view="using:ShakerApp.Views"
  12. xmlns:vm="using:ShakerApp.ViewModels"
  13. d:DesignHeight="450"
  14. d:DesignWidth="800"
  15. x:DataType="vm:RandomConfigViewModel"
  16. DataContext="{Binding Source={x:Static vm:RandomConfigViewModel.Instance}}"
  17. mc:Ignorable="d">
  18. <Grid RowDefinitions="1.2*,*">
  19. <Grid ColumnDefinitions="*,*,*">
  20. <oxy:PlotView
  21. Background="Transparent"
  22. DefaultTrackerTemplate="{StaticResource DefaultTrackerTemplate}"
  23. Model="{Binding AccelerationModel}" />
  24. <Button
  25. Margin="0,0,16,56"
  26. HorizontalAlignment="Right"
  27. VerticalAlignment="Bottom"
  28. Classes="Basic"
  29. Cursor="Hand">
  30. <Interaction.Behaviors>
  31. <EventTriggerBehavior EventName="Click">
  32. <InvokeCommandAction Command="{Binding Source={x:Static vm:PlotConfigViewModel.Instance}, Path=PlotConfigCommand}" CommandParameter="{Binding DisplacementModel}" />
  33. </EventTriggerBehavior>
  34. </Interaction.Behaviors>
  35. <PathIcon Background="Transparent" Data="{StaticResource SettingGeometry}">
  36. <PathIcon.Styles>
  37. <Style Selector="PathIcon:pointerover">
  38. <Setter Property="Foreground" Value="Black" />
  39. </Style>
  40. <Style Selector="PathIcon">
  41. <Setter Property="Foreground" Value="#AAAAAAAA" />
  42. </Style>
  43. </PathIcon.Styles>
  44. </PathIcon>
  45. </Button>
  46. <oxy:PlotView
  47. Grid.Column="1"
  48. Background="Transparent"
  49. DefaultTrackerTemplate="{StaticResource DefaultTrackerTemplate}"
  50. Model="{Binding VelocityModel}" />
  51. <Button
  52. Grid.Column="1"
  53. Margin="0,0,16,56"
  54. HorizontalAlignment="Right"
  55. VerticalAlignment="Bottom"
  56. Classes="Basic"
  57. Cursor="Hand">
  58. <Interaction.Behaviors>
  59. <EventTriggerBehavior EventName="Click">
  60. <InvokeCommandAction Command="{Binding Source={x:Static vm:PlotConfigViewModel.Instance}, Path=PlotConfigCommand}" CommandParameter="{Binding VelocityModel}" />
  61. </EventTriggerBehavior>
  62. </Interaction.Behaviors>
  63. <PathIcon Background="Transparent" Data="{StaticResource SettingGeometry}">
  64. <PathIcon.Styles>
  65. <Style Selector="PathIcon:pointerover">
  66. <Setter Property="Foreground" Value="Black" />
  67. </Style>
  68. <Style Selector="PathIcon">
  69. <Setter Property="Foreground" Value="#AAAAAAAA" />
  70. </Style>
  71. </PathIcon.Styles>
  72. </PathIcon>
  73. </Button>
  74. <oxy:PlotView
  75. Grid.Column="2"
  76. Background="Transparent"
  77. DefaultTrackerTemplate="{StaticResource DefaultTrackerTemplate}"
  78. Model="{Binding DisplacementModel}" />
  79. <Button
  80. Grid.Column="2"
  81. Margin="0,0,16,56"
  82. HorizontalAlignment="Right"
  83. VerticalAlignment="Bottom"
  84. Classes="Basic"
  85. Cursor="Hand">
  86. <Interaction.Behaviors>
  87. <EventTriggerBehavior EventName="Click">
  88. <InvokeCommandAction Command="{Binding Source={x:Static vm:PlotConfigViewModel.Instance}, Path=PlotConfigCommand}" CommandParameter="{Binding DisplacementModel}" />
  89. </EventTriggerBehavior>
  90. </Interaction.Behaviors>
  91. <PathIcon Background="Transparent" Data="{StaticResource SettingGeometry}">
  92. <PathIcon.Styles>
  93. <Style Selector="PathIcon:pointerover">
  94. <Setter Property="Foreground" Value="Black" />
  95. </Style>
  96. <Style Selector="PathIcon">
  97. <Setter Property="Foreground" Value="#AAAAAAAA" />
  98. </Style>
  99. </PathIcon.Styles>
  100. </PathIcon>
  101. </Button>
  102. </Grid>
  103. <TabControl Grid.Row="1">
  104. <TabItem Header="{DynamicResource SpectrumItems}">
  105. <Grid
  106. Width="860"
  107. Margin="4,0,0,0"
  108. HorizontalAlignment="Left">
  109. <Grid.RowDefinitions>
  110. <RowDefinition Height="auto" />
  111. <RowDefinition Height="*" />
  112. <RowDefinition Height="auto" />
  113. </Grid.RowDefinitions>
  114. <UniformGrid
  115. Grid.Row="0"
  116. Width="860"
  117. HorizontalAlignment="Left"
  118. VerticalAlignment="Center"
  119. Rows="1">
  120. <StackPanel>
  121. <TextBlock Text="{DynamicResource UpFrequency}" />
  122. <ComboBox
  123. Width="120"
  124. HorizontalAlignment="Left"
  125. VerticalAlignment="Center"
  126. DisplayMemberBinding="{Binding Key}"
  127. ItemsSource="{Binding MaxFrequency, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
  128. SelectedValue="{Binding Path=MaxFrequency}"
  129. SelectedValueBinding="{Binding Value}" />
  130. </StackPanel>
  131. <StackPanel>
  132. <TextBlock Text="{DynamicResource DownFrequency}" />
  133. <NumericUpDown
  134. Width="120"
  135. Margin="0,4,0,0"
  136. HorizontalAlignment="Left"
  137. VerticalAlignment="Center"
  138. Minimum="1"
  139. Value="{Binding MinFrequency}" />
  140. </StackPanel>
  141. <StackPanel>
  142. <TextBlock Text="{DynamicResource SpectrumLines}" />
  143. <ComboBox
  144. Width="120"
  145. HorizontalAlignment="Left"
  146. VerticalAlignment="Center"
  147. DisplayMemberBinding="{Binding Key}"
  148. ItemsSource="{Binding SpectrumLines, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
  149. SelectedValue="{Binding Path=SpectrumLines}"
  150. SelectedValueBinding="{Binding Value}" />
  151. </StackPanel>
  152. <StackPanel>
  153. <TextBlock Text="Sigma" />
  154. <NumericUpDown
  155. Width="120"
  156. Margin="0,4,0,0"
  157. HorizontalAlignment="Left"
  158. VerticalAlignment="Center"
  159. Minimum="1"
  160. Value="{Binding Sigma}" />
  161. </StackPanel>
  162. </UniformGrid>
  163. <Grid Grid.Row="1" ColumnDefinitions="auto,*">
  164. <StackPanel
  165. Grid.Column="1"
  166. Margin="12,0,0,0"
  167. IsEnabled="{Binding CanResetRMS}"
  168. Orientation="Horizontal">
  169. <StackPanel>
  170. <TextBlock>
  171. <Run Text="{DynamicResource RMSValue}" />
  172. <Run Text="(g)" />
  173. </TextBlock>
  174. <NumericUpDown Width="120" Value="{Binding ResetRMS}" />
  175. </StackPanel>
  176. <Button
  177. Height="36"
  178. Margin="10,20,0,0"
  179. VerticalAlignment="Top"
  180. Command="{Binding ResetRMSCommand}"
  181. Content="{DynamicResource ResetRMS}" />
  182. </StackPanel>
  183. <StackPanel Grid.Column="0" Width="860">
  184. <Grid
  185. Height="{StaticResource ItemHeight}"
  186. Background="LightGray"
  187. ColumnDefinitions="40,0.8*,0.8*,1.5*,0.8*,0.8*,0.8*,0.8*">
  188. <TextBlock
  189. HorizontalAlignment="Center"
  190. VerticalAlignment="Center"
  191. Text="{DynamicResource ServoValveIndex}" />
  192. <TextBlock
  193. Grid.Column="1"
  194. HorizontalAlignment="Center"
  195. VerticalAlignment="Center">
  196. <Run Text="{DynamicResource Frequency}" />
  197. <Run Text="(Hz)" />
  198. </TextBlock>
  199. <TextBlock
  200. Grid.Column="2"
  201. HorizontalAlignment="Center"
  202. VerticalAlignment="Center"
  203. Text="{DynamicResource SweepValueType}" />
  204. <TextBlock
  205. Grid.Column="3"
  206. HorizontalAlignment="Center"
  207. VerticalAlignment="Center"
  208. Text="{DynamicResource Value}" />
  209. <TextBlock
  210. Grid.Column="4"
  211. HorizontalAlignment="Center"
  212. VerticalAlignment="Center">
  213. <Run Text="{DynamicResource UpStopAcceleration}" />
  214. <Run Text="(dB)" />
  215. </TextBlock>
  216. <TextBlock
  217. Grid.Column="5"
  218. HorizontalAlignment="Center"
  219. VerticalAlignment="Center">
  220. <Run Text="{DynamicResource UpWarnAcceleration}" />
  221. <Run Text="(dB)" />
  222. </TextBlock>
  223. <TextBlock
  224. Grid.Column="6"
  225. HorizontalAlignment="Center"
  226. VerticalAlignment="Center">
  227. <Run Text="{DynamicResource DownStopAcceleration}" />
  228. <Run Text="(dB)" />
  229. </TextBlock>
  230. <TextBlock
  231. Grid.Column="7"
  232. HorizontalAlignment="Center"
  233. VerticalAlignment="Center">
  234. <Run Text="{DynamicResource DownWarnAcceleration}" />
  235. <Run Text="(dB)" />
  236. </TextBlock>
  237. </Grid>
  238. <ScrollViewer Height="{Binding $parent[StackPanel].Bounds.Height, Converter={StaticResource SubtractionConverter}, ConverterParameter={StaticResource ItemHeight}}">
  239. <ItemsControl ItemsSource="{Binding SpectrumItems}">
  240. <ItemsControl.ItemTemplate>
  241. <DataTemplate>
  242. <Grid
  243. Height="{StaticResource ItemHeight}"
  244. Margin="0,4,0,4"
  245. ColumnDefinitions="40,0.8*,0.8*,1.5*,0.8*,0.8*,0.8*,0.8*">
  246. <TextBlock
  247. HorizontalAlignment="Center"
  248. VerticalAlignment="Center"
  249. Text="{Binding Index}" />
  250. <NumericUpDown Grid.Column="1" Value="{Binding Value.Frequency}" />
  251. <ComboBox
  252. Grid.Column="2"
  253. ItemsSource="{Binding Value.ValueType, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
  254. SelectedValue="{Binding Path=Value.ValueType}"
  255. SelectedValueBinding="{Binding Value}">
  256. <ComboBox.ItemTemplate>
  257. <DataTemplate>
  258. <TextBlock Text="{local:ResourceBinding Key}" />
  259. </DataTemplate>
  260. </ComboBox.ItemTemplate>
  261. </ComboBox>
  262. <StackPanel Grid.Column="3" Orientation="Horizontal">
  263. <NumericUpDown Width="140" Value="{Binding Value.Value}" />
  264. <TextBlock
  265. Margin="4,0,0,0"
  266. HorizontalAlignment="Center"
  267. VerticalAlignment="Center"
  268. Classes.Slope="{Binding Value.ValueType, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static model:RandomValueType.Slope}}">
  269. <TextBlock.Styles>
  270. <Style Selector="TextBlock">
  271. <Setter Property="IsVisible" Value="True" />
  272. <Setter Property="Text" Value="g&#0178;/Hz" />
  273. </Style>
  274. <Style Selector="TextBlock.Slope">
  275. <Setter Property="IsVisible" Value="False" />
  276. <Setter Property="Text" Value="" />
  277. </Style>
  278. </TextBlock.Styles>
  279. </TextBlock>
  280. </StackPanel>
  281. <NumericUpDown
  282. Grid.Column="4"
  283. Margin="4,0,4,0"
  284. Value="{Binding Value.UpStop}" />
  285. <NumericUpDown
  286. Grid.Column="5"
  287. Margin="4,0,4,0"
  288. Value="{Binding Value.UpWarn}" />
  289. <NumericUpDown
  290. Grid.Column="6"
  291. Margin="4,0,4,0"
  292. Value="{Binding Value.DownStop}" />
  293. <NumericUpDown
  294. Grid.Column="7"
  295. Margin="4,0,4,0"
  296. Value="{Binding Value.DownWarn}" />
  297. </Grid>
  298. </DataTemplate>
  299. </ItemsControl.ItemTemplate>
  300. </ItemsControl>
  301. </ScrollViewer>
  302. </StackPanel>
  303. </Grid>
  304. <StackPanel
  305. Grid.Row="2"
  306. HorizontalAlignment="Center"
  307. VerticalAlignment="Center"
  308. Orientation="Horizontal">
  309. <Button Command="{Binding AddCommand}" Content="{DynamicResource AddItem}" />
  310. <Button
  311. Margin="120,0,0,0"
  312. Command="{Binding DeleteCommand}"
  313. Content="{DynamicResource DelLastItem}" />
  314. <Button
  315. Margin="120,0,0,0"
  316. Command="{Binding RefreshCommand}"
  317. Content="{DynamicResource RefreshItem}" />
  318. </StackPanel>
  319. </Grid>
  320. </TabItem>
  321. <TabItem Header="{DynamicResource Channel}" IsVisible="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=AccelerationSensorCount, Converter={StaticResource GreaterThanEqualConverter}, ConverterParameter='2'}">
  322. <StackPanel Margin="10,0,0,0">
  323. <StackPanel Orientation="Horizontal">
  324. <TextBlock VerticalAlignment="Center" Text="{DynamicResource SynthesisType}" />
  325. <ComboBox
  326. ItemsSource="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=SynthesisType, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
  327. SelectedValue="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=SynthesisType}"
  328. SelectedValueBinding="{Binding Path=Value}">
  329. <ComboBox.ItemTemplate>
  330. <DataTemplate>
  331. <TextBlock Text="{local:ResourceBinding Key}" />
  332. </DataTemplate>
  333. </ComboBox.ItemTemplate>
  334. </ComboBox>
  335. </StackPanel>
  336. <suki:GlassCard IsEnabled="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=SynthesisType, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static model:AccelerationSynthesisType.Synthesis}}">
  337. <suki:GroupBox Header="{DynamicResource Weight}">
  338. <ItemsControl ItemsSource="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=Accelerations}">
  339. <ItemsControl.ItemTemplate>
  340. <DataTemplate>
  341. <Grid RowDefinitions="auto,auto,auto">
  342. <TextBlock
  343. Height="{StaticResource ItemHeight}"
  344. HorizontalAlignment="Center"
  345. VerticalAlignment="Center">
  346. <Run Text="{DynamicResource Acceleration}" />
  347. <Run Text="{Binding Index}" />
  348. </TextBlock>
  349. <NumericUpDown
  350. Grid.Row="1"
  351. Height="{StaticResource ItemHeight}"
  352. Margin="10,0,0,0"
  353. VerticalContentAlignment="Center"
  354. Maximum="1"
  355. Minimum="0"
  356. Value="{Binding Value.Weight}" />
  357. <TextBlock
  358. Grid.Row="2"
  359. Height="{StaticResource ItemHeight}"
  360. HorizontalAlignment="Center"
  361. VerticalAlignment="Center">
  362. <Run Text="{DynamicResource Sensitivity}" />
  363. <Run Text="{Binding Value.Sensitivity}" />
  364. <Run Text="mV/g" />
  365. </TextBlock>
  366. </Grid>
  367. </DataTemplate>
  368. </ItemsControl.ItemTemplate>
  369. <ItemsControl.ItemsPanel>
  370. <ItemsPanelTemplate>
  371. <StackPanel Orientation="Horizontal" />
  372. </ItemsPanelTemplate>
  373. </ItemsControl.ItemsPanel>
  374. </ItemsControl>
  375. </suki:GroupBox>
  376. </suki:GlassCard>
  377. </StackPanel>
  378. </TabItem>
  379. <TabItem Header="{DynamicResource SweepLimit}">
  380. <StackPanel
  381. Width="660"
  382. HorizontalAlignment="Left"
  383. VerticalAlignment="Top">
  384. <Grid
  385. Height="{StaticResource ItemHeight}"
  386. Background="LightGray"
  387. ColumnDefinitions="*,*,*,*">
  388. <TextBlock
  389. HorizontalAlignment="Center"
  390. VerticalAlignment="Center"
  391. Text="{DynamicResource Item}" />
  392. <TextBlock
  393. Grid.Column="1"
  394. HorizontalAlignment="Center"
  395. VerticalAlignment="Center"
  396. Text="{DynamicResource Ampt}" />
  397. <TextBlock
  398. Grid.Column="2"
  399. HorizontalAlignment="Center"
  400. VerticalAlignment="Center"
  401. Text="{DynamicResource SweepLimit}" />
  402. <TextBlock
  403. Grid.Column="3"
  404. HorizontalAlignment="Center"
  405. VerticalAlignment="Center">
  406. <Run Text="{DynamicResource Load}" />
  407. <Run Text="(%)" />
  408. </TextBlock>
  409. </Grid>
  410. <Grid RowDefinitions="auto,auto,auto,auto">
  411. <Grid Height="{StaticResource ItemHeight}" ColumnDefinitions="*,*,*,*">
  412. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
  413. <Run Text="{DynamicResource Acceleration}" />
  414. <Run Text="(g)" />
  415. </TextBlock>
  416. <TextBlock
  417. Grid.Column="1"
  418. HorizontalAlignment="Center"
  419. VerticalAlignment="Center"
  420. Text="{Binding MaxAcceleration}" />
  421. <TextBlock
  422. Grid.Column="2"
  423. HorizontalAlignment="Center"
  424. VerticalAlignment="Center"
  425. Text="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=MaxAcceleration}" />
  426. <TextBlock
  427. Grid.Column="3"
  428. HorizontalAlignment="Center"
  429. VerticalAlignment="Center"
  430. Classes.Loaded="{Binding AccelerationOverLimit}"
  431. Text="{Binding AccelerationLoad}">
  432. <TextBlock.Styles>
  433. <Style Selector="TextBlock">
  434. <Setter Property="Foreground" Value="Green" />
  435. </Style>
  436. <Style Selector="TextBlock.Loaded">
  437. <Setter Property="Foreground" Value="Red" />
  438. </Style>
  439. </TextBlock.Styles>
  440. </TextBlock>
  441. </Grid>
  442. <Grid
  443. Grid.Row="1"
  444. Height="{StaticResource ItemHeight}"
  445. ColumnDefinitions="*,*,*,*">
  446. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
  447. <Run Text="{DynamicResource Velocity}" />
  448. <Run Text="(m/s)" />
  449. </TextBlock>
  450. <TextBlock
  451. Grid.Column="1"
  452. HorizontalAlignment="Center"
  453. VerticalAlignment="Center"
  454. Text="{Binding MaxVelocity}" />
  455. <TextBlock
  456. Grid.Column="2"
  457. HorizontalAlignment="Center"
  458. VerticalAlignment="Center"
  459. Text="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=MaxVelocity}" />
  460. <TextBlock
  461. Grid.Column="3"
  462. HorizontalAlignment="Center"
  463. VerticalAlignment="Center"
  464. Classes.Loaded="{Binding VelocityOverLimit}"
  465. Text="{Binding VelocityLoad}">
  466. <TextBlock.Styles>
  467. <Style Selector="TextBlock">
  468. <Setter Property="Foreground" Value="Green" />
  469. </Style>
  470. <Style Selector="TextBlock.Loaded">
  471. <Setter Property="Foreground" Value="Red" />
  472. </Style>
  473. </TextBlock.Styles>
  474. </TextBlock>
  475. </Grid>
  476. <Grid
  477. Grid.Row="2"
  478. Height="{StaticResource ItemHeight}"
  479. ColumnDefinitions="*,*,*,*">
  480. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">
  481. <Run Text="{DynamicResource Displacement}" />
  482. <Run Text="(mm)" />
  483. </TextBlock>
  484. <TextBlock
  485. Grid.Column="1"
  486. HorizontalAlignment="Center"
  487. VerticalAlignment="Center"
  488. Text="{Binding MaxDisplacement}" />
  489. <TextBlock
  490. Grid.Column="2"
  491. HorizontalAlignment="Center"
  492. VerticalAlignment="Center"
  493. Text="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=MaxDisplacement}" />
  494. <TextBlock
  495. Grid.Column="3"
  496. HorizontalAlignment="Center"
  497. VerticalAlignment="Center"
  498. Classes.Loaded="{Binding DisplacementOverLimit}"
  499. Text="{Binding DisplacementLoad}">
  500. <TextBlock.Styles>
  501. <Style Selector="TextBlock">
  502. <Setter Property="Foreground" Value="Green" />
  503. </Style>
  504. <Style Selector="TextBlock.Loaded">
  505. <Setter Property="Foreground" Value="Red" />
  506. </Style>
  507. </TextBlock.Styles>
  508. </TextBlock>
  509. </Grid>
  510. </Grid>
  511. </StackPanel>
  512. </TabItem>
  513. <TabItem Header="{DynamicResource IdentifyConfig}">
  514. <UniformGrid VerticalAlignment="Top" Columns="4">
  515. <StackPanel Margin="10,4,0,0">
  516. <TextBlock VerticalAlignment="Center">
  517. <Run Text="{DynamicResource StartDisplacement}" />
  518. <Run Text="(mm)" />
  519. </TextBlock>
  520. <NumericUpDown
  521. Height="{StaticResource ItemHeight}"
  522. VerticalAlignment="Center"
  523. Maximum="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=MaxDisplacement, Converter={StaticResource MultiConverter}, ConverterParameter='0.5'}"
  524. Minimum="0.001"
  525. Value="{Binding Identify.StartDisplacement}" />
  526. </StackPanel>
  527. <StackPanel Margin="10,4,0,0">
  528. <TextBlock VerticalAlignment="Center">
  529. <Run Text="{DynamicResource UpLevel}" />
  530. <Run Text="(%)" />
  531. </TextBlock>
  532. <NumericUpDown
  533. Height="{StaticResource ItemHeight}"
  534. VerticalAlignment="Center"
  535. Increment="0.1"
  536. Maximum="100"
  537. Minimum="1"
  538. Value="{Binding Identify.UpLevel}" />
  539. </StackPanel>
  540. <StackPanel Margin="10,4,0,0">
  541. <TextBlock VerticalAlignment="Center">
  542. <Run Text="{DynamicResource EndLevel}" />
  543. <Run Text="(dB)" />
  544. </TextBlock>
  545. <NumericUpDown
  546. Height="{StaticResource ItemHeight}"
  547. VerticalAlignment="Center"
  548. Increment="0.1"
  549. Maximum="20"
  550. Minimum="-20"
  551. Value="{Binding Identify.EndLevel}" />
  552. </StackPanel>
  553. <StackPanel Margin="10,4,0,0">
  554. <TextBlock VerticalAlignment="Center">
  555. <Run Text="{DynamicResource MaxIdentifyDisplacement}" />
  556. <Run Text="(mm)" />
  557. </TextBlock>
  558. <NumericUpDown
  559. Height="{StaticResource ItemHeight}"
  560. VerticalAlignment="Center"
  561. Increment="0.1"
  562. Maximum="{Binding Source={x:Static vm:ShakerConfigViewModel.Instance}, Path=MaxDisplacement}"
  563. Minimum="{Binding Identify.StartDisplacement}"
  564. Value="{Binding Identify.MaxDisplacement}" />
  565. </StackPanel>
  566. <StackPanel Margin="10,4,0,0">
  567. <TextBlock VerticalAlignment="Center">
  568. <Run Text="{DynamicResource IdentifyFrameCount}" />
  569. </TextBlock>
  570. <NumericUpDown
  571. Height="{StaticResource ItemHeight}"
  572. VerticalAlignment="Center"
  573. Increment="1"
  574. Maximum="20"
  575. Minimum="8"
  576. Value="{Binding Identify.IdentifyFrameCount}" />
  577. </StackPanel>
  578. </UniformGrid>
  579. </TabItem>
  580. <TabItem Header="{DynamicResource SweepSchedule}">
  581. <Grid
  582. Width="500"
  583. Margin="4,0,0,0"
  584. HorizontalAlignment="Left">
  585. <Grid.RowDefinitions>
  586. <RowDefinition Height="auto" />
  587. <RowDefinition Height="*" />
  588. <RowDefinition Height="auto" />
  589. </Grid.RowDefinitions>
  590. <UniformGrid
  591. Grid.Row="0"
  592. Width="500"
  593. HorizontalAlignment="Left"
  594. VerticalAlignment="Center"
  595. Rows="1">
  596. <StackPanel>
  597. <TextBlock Text="{DynamicResource StopLins}" />
  598. <NumericUpDown
  599. Width="120"
  600. Margin="0,4,0,0"
  601. HorizontalAlignment="Left"
  602. VerticalAlignment="Center"
  603. Minimum="1"
  604. Value="{Binding StopLins}" />
  605. </StackPanel>
  606. <StackPanel>
  607. <TextBlock Text="{DynamicResource WarnLines}" />
  608. <NumericUpDown
  609. Width="120"
  610. Margin="0,4,0,0"
  611. HorizontalAlignment="Left"
  612. VerticalAlignment="Center"
  613. Minimum="1"
  614. Value="{Binding WarnLines}" />
  615. </StackPanel>
  616. <StackPanel>
  617. <TextBlock>
  618. <Run Text="{DynamicResource StopRMS}" />
  619. <Run Text="(dB)" />
  620. </TextBlock>
  621. <NumericUpDown
  622. Width="120"
  623. Margin="0,4,0,0"
  624. HorizontalAlignment="Left"
  625. VerticalAlignment="Center"
  626. Minimum="1"
  627. Value="{Binding StopRMS}" />
  628. </StackPanel>
  629. </UniformGrid>
  630. <StackPanel Grid.Row="1">
  631. <Grid
  632. Height="{StaticResource ItemHeight}"
  633. Margin="0,4,0,4"
  634. Background="LightGray"
  635. ColumnDefinitions="40,120,*">
  636. <TextBlock
  637. HorizontalAlignment="Center"
  638. VerticalAlignment="Center"
  639. Text="{DynamicResource ServoValveIndex}" />
  640. <TextBlock
  641. Grid.Column="1"
  642. HorizontalAlignment="Center"
  643. VerticalAlignment="Center">
  644. <Run Text="{DynamicResource RandomLevel}" />
  645. <Run Text="(dB)" />
  646. </TextBlock>
  647. <TextBlock
  648. Grid.Column="2"
  649. HorizontalAlignment="Center"
  650. VerticalAlignment="Center"
  651. Text="{DynamicResource Time}" />
  652. </Grid>
  653. <ScrollViewer Height="{Binding $parent[StackPanel].Bounds.Height, Converter={StaticResource SubtractionConverter}, ConverterParameter={StaticResource ItemHeight}}">
  654. <ItemsControl ItemsSource="{Binding PlanItems}">
  655. <ItemsControl.ItemTemplate>
  656. <DataTemplate>
  657. <Grid
  658. Height="{StaticResource ItemHeight}"
  659. Margin="0,4,0,4"
  660. ColumnDefinitions="40,120,*">
  661. <TextBlock
  662. HorizontalAlignment="Center"
  663. VerticalAlignment="Center"
  664. Text="{Binding Index}" />
  665. <NumericUpDown Grid.Column="1" Value="{Binding Value.Level}" />
  666. <view:TimeControl
  667. Grid.Column="2"
  668. Margin="10,0,10,0"
  669. Time="{Binding Value.Time}" />
  670. </Grid>
  671. </DataTemplate>
  672. </ItemsControl.ItemTemplate>
  673. </ItemsControl>
  674. </ScrollViewer>
  675. </StackPanel>
  676. <StackPanel
  677. Grid.Row="2"
  678. HorizontalAlignment="Center"
  679. VerticalAlignment="Center"
  680. Orientation="Horizontal">
  681. <Button Command="{Binding AddPlanCommand}" Content="{DynamicResource AddItem}" />
  682. <Button
  683. Margin="120,0,0,0"
  684. Command="{Binding DeletePlanCommand}"
  685. Content="{DynamicResource DelLastItem}" />
  686. <Button
  687. Margin="120,0,0,0"
  688. Command="{Binding RefreshPlanCommand}"
  689. Content="{DynamicResource RefreshItem}" />
  690. </StackPanel>
  691. </Grid>
  692. </TabItem>
  693. </TabControl>
  694. </Grid>
  695. </UserControl>