RandomMainPage.axaml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <UserControl
  2. x:Class="ShakerApp.Views.RandomMainPage"
  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:models="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:RandomMainPageViewModel"
  16. DataContext="{Binding Source={x:Static vm:RandomMainPageViewModel.Instance}}"
  17. mc:Ignorable="d">
  18. <Grid ColumnDefinitions="220,*">
  19. <ScrollViewer Grid.Column="0">
  20. <StackPanel>
  21. <view:ShakerMiniStatusControl />
  22. <view:OilMinView IsVisible="{Binding Source={x:Static vm:OilSourceStatusViewModel.Instance}, Path=IsEnabled}" />
  23. <Expander ExpandDirection="Down" IsExpanded="True">
  24. <Expander.Header>
  25. <TextBlock
  26. FontSize="24"
  27. FontWeight="Bold"
  28. Text="{DynamicResource TestInfo}" />
  29. </Expander.Header>
  30. <StackPanel Margin="4,0,0,0">
  31. <StackPanel>
  32. <TextBlock>
  33. <Run Text="{DynamicResource RandomTestStep}" />
  34. <Run Text=":" />
  35. </TextBlock>
  36. <TextBlock Text="{local:ResourceBinding RandomTestStepKey}" />
  37. </StackPanel>
  38. <StackPanel>
  39. <TextBlock>
  40. <Run Text="{DynamicResource CurrentIdentifyDisplacement}" />
  41. <Run Text=":" />
  42. </TextBlock>
  43. <TextBlock Text="{Binding CurrentIdentifyDisplacement, StringFormat='{}{0:F4}mm'}" />
  44. </StackPanel>
  45. <StackPanel>
  46. <TextBlock>
  47. <Run Text="{DynamicResource CurrentIdentifyRms}" />
  48. <Run Text=":" />
  49. </TextBlock>
  50. <TextBlock Text="{Binding TimeDomainRMS, StringFormat='{}{0:F4}g'}" />
  51. </StackPanel>
  52. <StackPanel>
  53. <TextBlock>
  54. <Run Text="{DynamicResource IdentifyIndex}" />
  55. <Run Text=":" />
  56. </TextBlock>
  57. <TextBlock Text="{Binding IdentifyIndex}" />
  58. </StackPanel>
  59. <StackPanel IsVisible="{Binding RandomTestStep, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static models:RandomTestStep.Test}}">
  60. <TextBlock>
  61. <Run Text="{DynamicResource CurrentTestLevel}" />
  62. <Run Text=":" />
  63. </TextBlock>
  64. <TextBlock Text="{Binding CurrentTestLevel, StringFormat='{}{0:F1}dB'}" />
  65. </StackPanel>
  66. <StackPanel IsVisible="{Binding RandomTestStep, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static models:RandomTestStep.Test}}">
  67. <TextBlock>
  68. <Run Text="{DynamicResource CurrentTestTime}" />
  69. <Run Text=":" />
  70. </TextBlock>
  71. <TextBlock Text="{Binding CurrentTestTime, Converter={StaticResource TimeToStringConverter}}" />
  72. </StackPanel>
  73. <StackPanel IsVisible="{Binding RandomTestStep, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static models:RandomTestStep.Test}}">
  74. <TextBlock>
  75. <Run Text="{DynamicResource CurrentLevelTestMaxTime}" />
  76. <Run Text=":" />
  77. </TextBlock>
  78. <TextBlock Text="{Binding CurrentLevelTestMaxTime, Converter={StaticResource TimeToStringConverter}}" />
  79. </StackPanel>
  80. </StackPanel>
  81. </Expander>
  82. </StackPanel>
  83. </ScrollViewer>
  84. <oxy:PlotView
  85. Grid.Column="1"
  86. Background="Transparent"
  87. Model="{Binding PlotModel}">
  88. <oxy:PlotView.DefaultTrackerTemplate>
  89. <ControlTemplate>
  90. <oxy:TrackerControl
  91. Background="#6F999999"
  92. BorderBrush="Transparent"
  93. CornerRadius="6"
  94. Position="{Binding Position}"
  95. ShowPointer="True">
  96. <oxy:TrackerControl.Content>
  97. <StackPanel Margin="6">
  98. <TextBlock Text="{DynamicResource Value}" />
  99. <TextBlock>
  100. <Run Text="{DynamicResource Frequency}" />
  101. <Run Text=":" />
  102. <Run Text="{Binding Item.Frequency, StringFormat='{}{0:F2}Hz'}" />
  103. </TextBlock>
  104. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[0].IsVisible}">
  105. <Run Text="{DynamicResource Acceleration}" />
  106. <Run Text=":" />
  107. <Run Text="{Binding Item.Acceleration, StringFormat='{}{0:F4}g'}" />
  108. </TextBlock>
  109. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[1].IsVisible}">
  110. <Run Text="{DynamicResource TargetAcceleration}" />
  111. <Run Text=":" />
  112. <Run Text="{Binding Item.TargetAcceleration, StringFormat='{}{0:F4}'}" />
  113. <Run Text="{StaticResource RandomValueUnit}" />
  114. </TextBlock>
  115. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[2].IsVisible}">
  116. <Run Text="{DynamicResource UpStopAcceleration}" />
  117. <Run Text=":" />
  118. <Run Text="{Binding Item.UpStopAcceleration, StringFormat='{}{0:F4}g'}" />
  119. </TextBlock>
  120. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[3].IsVisible}">
  121. <Run Text="{DynamicResource UpWarnAcceleration}" />
  122. <Run Text=":" />
  123. <Run Text="{Binding Item.UpWarnAcceleration, StringFormat='{}{0:F4}'}" />
  124. <Run Text="{StaticResource RandomValueUnit}" />
  125. </TextBlock>
  126. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[4].IsVisible}">
  127. <Run Text="{DynamicResource DownStopAcceleration}" />
  128. <Run Text=":" />
  129. <Run Text="{Binding Item.DownStopAcceleration, StringFormat='{}{0:F4}'}" />
  130. <Run Text="{StaticResource RandomValueUnit}" />
  131. </TextBlock>
  132. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[5].IsVisible}">
  133. <Run Text="{DynamicResource DownWarnAcceleration}" />
  134. <Run Text=":" />
  135. <Run Text="{Binding Item.DownWarnAcceleration, StringFormat='{}{0:F4}'}" />
  136. <Run Text="{StaticResource RandomValueUnit}" />
  137. </TextBlock>
  138. </StackPanel>
  139. </oxy:TrackerControl.Content>
  140. </oxy:TrackerControl>
  141. </ControlTemplate>
  142. </oxy:PlotView.DefaultTrackerTemplate>
  143. </oxy:PlotView>
  144. </Grid>
  145. </UserControl>