SineMainPage.axaml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <UserControl
  2. x:Class="ShakerApp.Views.SineMainPage"
  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:oxy="clr-namespace:OxyPlot.Avalonia;assembly=OxyPlot.Avalonia"
  9. xmlns:suki="https://github.com/kikipoulet/SukiUI"
  10. xmlns:view="using:ShakerApp.Views"
  11. xmlns:vm="using:ShakerApp.ViewModels"
  12. d:DesignHeight="450"
  13. d:DesignWidth="800"
  14. x:DataType="vm:SineMainPageViewModel"
  15. DataContext="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}}"
  16. mc:Ignorable="d">
  17. <Grid ColumnDefinitions="220,*">
  18. <ScrollViewer Grid.Column="0">
  19. <StackPanel>
  20. <view:ShakerMiniStatusControl />
  21. <view:OilMinView IsVisible="{Binding Source={x:Static vm:OilSourceStatusViewModel.Instance}, Path=IsEnabled}" />
  22. <Expander ExpandDirection="Down">
  23. <Expander.Header>
  24. <TextBlock
  25. FontSize="24"
  26. FontWeight="Bold"
  27. Text="{DynamicResource TestInfo}" />
  28. </Expander.Header>
  29. <StackPanel Margin="4,0,0,0">
  30. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  31. <TextBlock VerticalAlignment="Center">
  32. <Run Text="{DynamicResource TotalTime}" />
  33. <Run Text=":" />
  34. </TextBlock>
  35. <TextBlock
  36. VerticalAlignment="Center"
  37. FontWeight="Normal"
  38. Text="{Binding TotalTime, Converter={StaticResource TimeToStringConverter}}" />
  39. </StackPanel>
  40. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  41. <TextBlock VerticalAlignment="Center">
  42. <Run Text="{DynamicResource RunTime}" />
  43. <Run Text=":" />
  44. </TextBlock>
  45. <TextBlock
  46. VerticalAlignment="Center"
  47. FontWeight="Normal"
  48. Text="{Binding RunTime, Converter={StaticResource TimeToStringConverter}}" />
  49. </StackPanel>
  50. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  51. <TextBlock VerticalAlignment="Center">
  52. <Run Text="{DynamicResource CurrentFrequency}" />
  53. <Run Text=":" />
  54. </TextBlock>
  55. <TextBlock
  56. VerticalAlignment="Center"
  57. FontWeight="Normal"
  58. Text="{Binding CurrentFrequency, StringFormat='{}{0:F4} Hz'}" />
  59. </StackPanel>
  60. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  61. <TextBlock VerticalAlignment="Center">
  62. <Run Text="{DynamicResource CurrentAcceleration}" />
  63. <Run Text=":" />
  64. </TextBlock>
  65. <TextBlock
  66. VerticalAlignment="Center"
  67. FontWeight="Normal"
  68. Text="{Binding CurrentAcceleration, StringFormat='{}{0:F4} g'}" />
  69. </StackPanel>
  70. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  71. <TextBlock VerticalAlignment="Center">
  72. <Run Text="{DynamicResource SweepCurrentStep}" />
  73. <Run Text=":" />
  74. </TextBlock>
  75. <TextBlock
  76. VerticalAlignment="Center"
  77. FontWeight="Normal"
  78. Text="{local:ResourceBinding SweepStep}" />
  79. </StackPanel>
  80. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  81. <TextBlock VerticalAlignment="Center">
  82. <Run Text="{DynamicResource SweepDirection}" />
  83. <Run Text=":" />
  84. </TextBlock>
  85. <TextBlock
  86. VerticalAlignment="Center"
  87. FontWeight="Normal"
  88. Text="{local:ResourceBinding SweepDirection}" />
  89. </StackPanel>
  90. <StackPanel Height="{StaticResource ItemHeight}" Orientation="Horizontal">
  91. <TextBlock VerticalAlignment="Center">
  92. <Run Text="{DynamicResource SweepIndex}" />
  93. <Run Text=":" />
  94. </TextBlock>
  95. <TextBlock
  96. VerticalAlignment="Center"
  97. FontWeight="Normal"
  98. Text="{Binding SweepIndex}" />
  99. </StackPanel>
  100. </StackPanel>
  101. </Expander>
  102. </StackPanel>
  103. </ScrollViewer>
  104. <oxy:PlotView
  105. Grid.Column="1"
  106. Background="Transparent"
  107. Model="{Binding PlotModel}">
  108. <oxy:PlotView.DefaultTrackerTemplate>
  109. <ControlTemplate>
  110. <oxy:TrackerControl
  111. Background="#6F999999"
  112. BorderBrush="Transparent"
  113. CornerRadius="6"
  114. HorizontalLineVisibility="True"
  115. LineStroke="Gray"
  116. Position="{Binding Position}"
  117. ShowPointer="True"
  118. VerticalLineVisibility="True">
  119. <oxy:TrackerControl.Content>
  120. <StackPanel Margin="6">
  121. <TextBlock Text="{DynamicResource Value}" />
  122. <TextBlock>
  123. <Run Text="{DynamicResource Frequency}" />
  124. <Run Text=":" />
  125. <Run Text="{Binding Item.Frequency, StringFormat='{}{0:F2}Hz'}" />
  126. </TextBlock>
  127. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[0].IsVisible}">
  128. <Run Text="{DynamicResource Acceleration}" />
  129. <Run Text=":" />
  130. <Run Text="{Binding Item.Acceleration, StringFormat='{}{0:F4}g'}" />
  131. </TextBlock>
  132. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[1].IsVisible}">
  133. <Run Text="{DynamicResource TargetAcceleration}" />
  134. <Run Text=":" />
  135. <Run Text="{Binding Item.TargetAcceleration, StringFormat='{}{0:F4}g'}" />
  136. </TextBlock>
  137. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[2].IsVisible}">
  138. <Run Text="{DynamicResource UpStopAcceleration}" />
  139. <Run Text=":" />
  140. <Run Text="{Binding Item.UpStopAcceleration, StringFormat='{}{0:F4}g'}" />
  141. </TextBlock>
  142. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[3].IsVisible}">
  143. <Run Text="{DynamicResource UpWarnAcceleration}" />
  144. <Run Text=":" />
  145. <Run Text="{Binding Item.UpWarnAcceleration, StringFormat='{}{0:F4}g'}" />
  146. </TextBlock>
  147. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[4].IsVisible}">
  148. <Run Text="{DynamicResource DownStopAcceleration}" />
  149. <Run Text=":" />
  150. <Run Text="{Binding Item.DownStopAcceleration, StringFormat='{}{0:F4}g'}" />
  151. </TextBlock>
  152. <TextBlock IsVisible="{Binding Source={x:Static vm:SineMainPageViewModel.Instance}, Path=LineSeries[5].IsVisible}">
  153. <Run Text="{DynamicResource DownWarnAcceleration}" />
  154. <Run Text=":" />
  155. <Run Text="{Binding Item.DownWarnAcceleration, StringFormat='{}{0:F4}g'}" />
  156. </TextBlock>
  157. </StackPanel>
  158. </oxy:TrackerControl.Content>
  159. </oxy:TrackerControl>
  160. </ControlTemplate>
  161. </oxy:PlotView.DefaultTrackerTemplate>
  162. </oxy:PlotView>
  163. </Grid>
  164. </UserControl>