ShakerPageView.xaml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <UserControl
  2. x:Class="ShakerManger.View.ShakerPageView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:hc="https://handyorg.github.io/handycontrol"
  7. xmlns:local="clr-namespace:ShakerManger.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:model="clr-namespace:Shaker.Model;assembly=Shaker"
  10. xmlns:vm="clr-namespace:ShakerManger.ViewModel"
  11. d:DataContext="{d:DesignInstance {x:Type vm:MainWindowViewModel}}"
  12. d:DesignHeight="450"
  13. d:DesignWidth="800"
  14. DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data}"
  15. mc:Ignorable="d">
  16. <UserControl.Style>
  17. <Style TargetType="UserControl">
  18. <Style.Triggers>
  19. <DataTrigger Binding="{Binding Source={StaticResource Login}, Path=Data.UserType}" Value="{x:Static model:UserType.SystemAdministrator}">
  20. <Setter Property="IsEnabled" Value="True" />
  21. </DataTrigger>
  22. <DataTrigger Binding="{Binding Source={StaticResource Login}, Path=Data.UserType}" Value="{x:Static model:UserType.ClientUser}">
  23. <Setter Property="IsEnabled" Value="False" />
  24. </DataTrigger>
  25. <DataTrigger Binding="{Binding Source={StaticResource Login}, Path=Data.UserType}" Value="{x:Static model:UserType.SystemUser}">
  26. <Setter Property="IsEnabled" Value="False" />
  27. </DataTrigger>
  28. </Style.Triggers>
  29. </Style>
  30. </UserControl.Style>
  31. <Grid>
  32. <Grid.RowDefinitions>
  33. <RowDefinition Height="80" />
  34. <RowDefinition Height="auto" />
  35. <RowDefinition />
  36. </Grid.RowDefinitions>
  37. <Border Background="{StaticResource SystemItemsSelectBackColor}">
  38. <TextBlock Grid.Row="0" Margin="10">
  39. <Run
  40. FontFamily="Arial Black"
  41. FontSize="22"
  42. Foreground="{StaticResource MainBrush}"
  43. Text="振动台配置说明" />
  44. <LineBreak />
  45. <LineBreak />
  46. <Run
  47. FontSize="16"
  48. Foreground="{StaticResource MainBrush}"
  49. Text="当前振动台配置参数设置成功后需要重启下位机软件方可生效" />
  50. </TextBlock>
  51. </Border>
  52. <StackPanel
  53. x:Name="first"
  54. Grid.Row="1"
  55. Height="66"
  56. HorizontalAlignment="Center"
  57. VerticalAlignment="Center"
  58. Orientation="Horizontal">
  59. <TextBlock
  60. Width="94"
  61. HorizontalAlignment="Right"
  62. VerticalAlignment="Center"
  63. FontSize="16"
  64. Text="振动台:" />
  65. <ComboBox
  66. Width="720"
  67. Height="34"
  68. Margin="10,0,0,0"
  69. Background="Transparent"
  70. DisplayMemberPath="Description"
  71. FontSize="16"
  72. ItemsSource="{Binding Shakers.Shakers}"
  73. SelectedValue="{Binding SystemConfig.ShakerPage.CurrentShaker}"
  74. Style="{StaticResource ComboBoxStyle1}"
  75. TabIndex="0" />
  76. </StackPanel>
  77. <UniformGrid
  78. Grid.Row="2"
  79. Margin="0,20,0,0"
  80. HorizontalAlignment="Center"
  81. VerticalAlignment="Top"
  82. d:DataContext="{d:DesignInstance {x:Type vm:ShakerControlViewModel}}"
  83. Columns="1">
  84. <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
  85. <TextBlock
  86. Width="94"
  87. HorizontalAlignment="Right"
  88. VerticalAlignment="Center"
  89. FontSize="16">
  90. <Run Foreground="Red" Text="*" />
  91. <Run Text="振动台别名:" />
  92. </TextBlock>
  93. <TextBox
  94. Width="720"
  95. Height="34"
  96. Margin="10,0,0,0"
  97. Background="Transparent"
  98. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  99. FontSize="16"
  100. TabIndex="1"
  101. Text="{Binding SystemConfig.ShakerPage.CurrentShaker.Description}" />
  102. </StackPanel>
  103. <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
  104. <TextBlock
  105. Width="94"
  106. HorizontalAlignment="Right"
  107. VerticalAlignment="Center"
  108. FontSize="16">
  109. <Run Foreground="Red" Text="*" />
  110. <Run Text="功放IP地址:" />
  111. </TextBlock>
  112. <TextBox
  113. Width="720"
  114. Height="34"
  115. Margin="10,0,0,0"
  116. Background="Transparent"
  117. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  118. FontSize="16"
  119. InputScope="Digits"
  120. TabIndex="1"
  121. Text="{Binding SystemConfig.ShakerPage.CurrentShaker.IPAddress}" />
  122. </StackPanel>
  123. <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
  124. <TextBlock
  125. Width="94"
  126. HorizontalAlignment="Right"
  127. VerticalAlignment="Center"
  128. FontSize="16">
  129. <Run Foreground="Red" Text="*" />
  130. <Run Text="功放端口:" />
  131. </TextBlock>
  132. <hc:NumericUpDown
  133. Width="120"
  134. Height="34"
  135. Margin="10,0,0,0"
  136. Background="Transparent"
  137. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  138. FontSize="16"
  139. Maximum="65535"
  140. Minimum="1"
  141. TabIndex="2"
  142. Value="{Binding SystemConfig.ShakerPage.CurrentShaker.Port, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  143. </StackPanel>
  144. <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
  145. <TextBlock
  146. Width="94"
  147. HorizontalAlignment="Right"
  148. VerticalAlignment="Center"
  149. FontSize="16">
  150. <Run Foreground="Red" Text="*" />
  151. <Run Text="客户端ID:" />
  152. </TextBlock>
  153. <TextBox
  154. Width="720"
  155. Height="34"
  156. Margin="10,0,0,0"
  157. Background="Transparent"
  158. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  159. FontSize="16"
  160. TabIndex="1"
  161. Text="{Binding SystemConfig.ShakerPage.CurrentShaker.ClientID}" />
  162. </StackPanel>
  163. <StackPanel Height="{Binding ElementName=first, Path=Height}" Orientation="Horizontal">
  164. <TextBlock
  165. Width="94"
  166. HorizontalAlignment="Right"
  167. VerticalAlignment="Center"
  168. FontSize="16">
  169. <Run Foreground="Red" Text="*" />
  170. <Run Text="SlaveID:" />
  171. </TextBlock>
  172. <hc:NumericUpDown
  173. Width="120"
  174. Height="34"
  175. Margin="10,0,0,0"
  176. Background="Transparent"
  177. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  178. FontSize="16"
  179. Maximum="254"
  180. Minimum="1"
  181. TabIndex="3"
  182. Value="{Binding SystemConfig.ShakerPage.CurrentShaker.SlaveID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  183. </StackPanel>
  184. <UniformGrid Rows="1">
  185. <Button
  186. Width="144"
  187. Height="34"
  188. hc:IconElement.Geometry="{StaticResource SaveGeometry}"
  189. hc:IconElement.Height="20"
  190. hc:IconElement.Width="20"
  191. Command="{Binding SystemConfig.ShakerPage.SaveCommand}"
  192. Content="保存配置"
  193. FontSize="16"
  194. Style="{StaticResource HasIconButton}"
  195. TabIndex="4" />
  196. </UniformGrid>
  197. </UniformGrid>
  198. </Grid>
  199. </UserControl>