SweepConfigView.axaml 39 KB

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